/* ==========================================================================
   IFE WEBMAIL - TEMA INSTITUCIONAL DARK-TECH
   Paleta: negro/azulado IFE + rojo institucional + blanco.
   Override centralizado que se carga despues de styles.css.
   Todo se aplica bajo html.dark-mode (forzado en layout.html).
   ========================================================================== */

:root {
	/* Fondos institucionales */
	--ife-black:   #0b0f19;
	--ife-black-2: #0f172a;
	--ife-panel:   #1e293b;

	/* Rojo institucional de acento */
	--ife-red:     #c1121f;
	--ife-red-2:   #e11d48;
	--ife-red-soft: rgba(193, 18, 31, 0.18);
	--ife-red-glow: rgba(193, 18, 31, 0.35);

	/* Textos y bordes */
	--ife-white:   #ffffff;
	--ife-text:    #e2e8f0;
	--ife-muted:   #94a3b8;
	--ife-link:    #f87171;
	--ife-border:  rgba(255, 255, 255, 0.08);

	/* Geometria */
	--ife-radius:  12px;
	--ife-shadow:  0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   1. BASE
   ========================================================================== */

html.dark-mode body {
	background-color: var(--ife-black) !important;
	color: var(--ife-text) !important;
}

html.dark-mode #layout {
	background-color: var(--ife-black) !important;
}

html.dark-mode a {
	color: var(--ife-link);
}

html.dark-mode ::-webkit-scrollbar-thumb {
	background-color: #334155 !important;
}

html.dark-mode ::-webkit-scrollbar-track {
	background-color: var(--ife-black-2) !important;
}

/* ==========================================================================
   2. RAIL DE TAREAS (#layout-menu / #taskmenu)
   ========================================================================== */

html.dark-mode #layout-menu {
	background-color: var(--ife-black-2) !important;
	border-right: 1px solid var(--ife-border) !important;
}

html.dark-mode #taskmenu a {
	color: var(--ife-muted) !important;
}

html.dark-mode #taskmenu a:hover,
html.dark-mode #taskmenu a:focus {
	color: var(--ife-white) !important;
	background-color: rgba(255, 255, 255, 0.05) !important;
}

html.dark-mode #taskmenu a.selected {
	color: var(--ife-white) !important;
	background: linear-gradient(90deg, var(--ife-red-soft) 0%, transparent 100%) !important;
	box-shadow: inset 3px 0 0 0 var(--ife-red);
}

html.dark-mode #taskmenu .action-buttons a {
	color: var(--ife-white) !important;
	background: linear-gradient(135deg, var(--ife-red) 0%, var(--ife-red-2) 100%) !important;
	box-shadow: 0 4px 14px var(--ife-red-glow) !important;
}

html.dark-mode #taskmenu .action-buttons a:hover {
	background: linear-gradient(135deg, var(--ife-red-2) 0%, var(--ife-red) 100%) !important;
}

/* ==========================================================================
   3. COLUMNAS (sidebar / lista / contenido)
   ========================================================================== */

html.dark-mode #layout-sidebar {
	background-color: var(--ife-black-2) !important;
	border-right: 1px solid var(--ife-border) !important;
}

html.dark-mode #layout-list {
	background-color: var(--ife-black) !important;
	border-right: 1px solid var(--ife-border) !important;
}

html.dark-mode #layout-content {
	background-color: var(--ife-black) !important;
	position: relative !important;
}

html.dark-mode #layout > div > .header {
	background-color: var(--ife-black-2) !important;
	border-bottom: 1px solid var(--ife-border) !important;
	color: var(--ife-text) !important;
}

html.dark-mode #layout > div > .footer {
	background-color: var(--ife-black-2) !important;
	border-top: 1px solid var(--ife-border) !important;
	color: var(--ife-muted) !important;
}

html.dark-mode #layout > div > .header .header-title {
	color: var(--ife-white) !important;
}

html.dark-mode #layout > div > .header a.button,
html.dark-mode #layout > div > .footer a.button {
	color: var(--ife-muted) !important;
}

html.dark-mode #layout > div > .header a.button:not(.disabled):hover,
html.dark-mode #layout > div > .header a.button:not(.disabled):focus {
	color: var(--ife-white) !important;
	background-color: rgba(255, 255, 255, 0.06) !important;
}

/* ==========================================================================
   4. LISTAS (carpetas, mensajes, contactos)
   ========================================================================== */

html.dark-mode .listing tbody td,
html.dark-mode .listing li {
	border-bottom-color: var(--ife-border) !important;
}

html.dark-mode .listing tbody td,
html.dark-mode .listing tbody td a,
html.dark-mode .listing li a {
	color: var(--ife-text) !important;
}

html.dark-mode .listing li.selected,
html.dark-mode .listing tr.selected td {
	background-color: var(--ife-red-soft) !important;
	color: var(--ife-white) !important;
	box-shadow: inset 3px 0 0 0 var(--ife-red);
}

html.dark-mode .listing li > a:not(.disabled):hover,
html.dark-mode .listing tbody tr:not(.selected):hover td {
	background-color: rgba(255, 255, 255, 0.04) !important;
}

html.dark-mode span.secondary {
	color: var(--ife-muted) !important;
}

html.dark-mode .listing-info {
	color: var(--ife-muted) !important;
}

/* Carpetas */
html.dark-mode #mailboxlist li.selected > a {
	background: linear-gradient(90deg, var(--ife-red) 0%, var(--ife-red-2) 100%) !important;
	color: var(--ife-white) !important;
	border-radius: 8px !important;
	font-weight: 600 !important;
}

html.dark-mode .folderlist .unreadcount {
	background: var(--ife-red) !important;
	color: var(--ife-white) !important;
}

/* Lista de mensajes */
html.dark-mode .messagelist td.subject span.date,
html.dark-mode .messagelist td.subject span.size,
html.dark-mode .messagelist td.subject span.fromto {
	color: var(--ife-muted) !important;
}

html.dark-mode .messagelist tr.unread td.subject span.subject {
	color: var(--ife-white) !important;
	font-weight: 700;
}

html.dark-mode .messagelist tr.flagged td,
html.dark-mode .messagelist tr.flagged td.subject span.subject a {
	color: var(--ife-red-2) !important;
}

html.dark-mode .messagelist td.subject span.msgicon.status.unread:before {
	color: var(--ife-red) !important;
}

/* ==========================================================================
   5. BUSCADOR Y PAGINACION
   ========================================================================== */

html.dark-mode .searchbar {
	background-color: var(--ife-black-2) !important;
	border-bottom: 1px solid var(--ife-border) !important;
}

html.dark-mode .searchbar input {
	color: var(--ife-text) !important;
}

html.dark-mode .searchbar input::placeholder {
	color: var(--ife-muted) !important;
}

html.dark-mode .searchbar a {
	color: var(--ife-muted) !important;
}

html.dark-mode .menu.pagenav,
html.dark-mode .pagenav.pagenav-list {
	background-color: var(--ife-black-2) !important;
	border-color: var(--ife-border) !important;
}

html.dark-mode .menu.pagenav a {
	color: var(--ife-muted) !important;
}

html.dark-mode .menu.pagenav a:not(.disabled):hover {
	color: var(--ife-white) !important;
	background-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-mode .menu.pagenav .pagenav-text {
	color: var(--ife-muted) !important;
}

/* ==========================================================================
   6. BOTONES
   ========================================================================== */

html.dark-mode .btn-primary,
html.dark-mode button.btn-primary {
	background: linear-gradient(135deg, var(--ife-red) 0%, var(--ife-red-2) 100%) !important;
	border: none !important;
	color: var(--ife-white) !important;
	box-shadow: 0 4px 14px var(--ife-red-glow) !important;
}

html.dark-mode .btn-primary:hover,
html.dark-mode button.btn-primary:hover {
	background: linear-gradient(135deg, var(--ife-red-2) 0%, var(--ife-red) 100%) !important;
}

html.dark-mode .btn-secondary {
	background-color: var(--ife-panel) !important;
	border-color: var(--ife-border) !important;
	color: var(--ife-text) !important;
}

html.dark-mode .btn-link {
	color: var(--ife-link) !important;
}

html.dark-mode .floating-action-buttons a.button {
	background: linear-gradient(135deg, var(--ife-red) 0%, var(--ife-red-2) 100%) !important;
	color: var(--ife-white) !important;
	box-shadow: 0 0 5px 5px var(--ife-red-glow) !important;
}

/* ==========================================================================
   7. FORMULARIOS
   ========================================================================== */

html.dark-mode .form-control {
	background-color: var(--ife-black-2) !important;
	border: 1px solid var(--ife-border) !important;
	color: var(--ife-text) !important;
	border-radius: 8px !important;
}

html.dark-mode .form-control:focus {
	border-color: var(--ife-red) !important;
	box-shadow: 0 0 0 3px var(--ife-red-soft) !important;
}

html.dark-mode .form-control::placeholder {
	color: var(--ife-muted) !important;
}

html.dark-mode .input-group-text {
	background-color: var(--ife-panel) !important;
	border-color: var(--ife-border) !important;
	color: var(--ife-text) !important;
}

html.dark-mode .custom-select,
html.dark-mode select.form-control {
	background-color: var(--ife-black-2) !important;
	color: var(--ife-text) !important;
	border-color: var(--ife-border) !important;
}

html.dark-mode .custom-control-input:checked ~ .custom-control-label::before {
	background-color: var(--ife-red) !important;
	border-color: var(--ife-red) !important;
}

html.dark-mode .custom-checkbox .custom-control-input:focus ~ .custom-control-label::before {
	box-shadow: 0 0 0 3px var(--ife-red-soft) !important;
}

/* ==========================================================================
   8. MENUS CONTEXTUALES Y DIALOGOS
   ========================================================================== */

html.dark-mode .popupmenu,
html.dark-mode .popover,
html.dark-mode .ui-menu {
	background-color: var(--ife-panel) !important;
	border: 1px solid var(--ife-border) !important;
	color: var(--ife-text) !important;
	box-shadow: var(--ife-shadow) !important;
}

html.dark-mode .popupmenu {
	border-radius: var(--ife-radius) !important;
}

html.dark-mode .menu a:not(.disabled):hover,
html.dark-mode .popupmenu .listing li > a:not(.disabled):hover,
html.dark-mode .listing.iconized li a:not(.disabled):hover {
	background-color: var(--ife-red) !important;
	color: var(--ife-white) !important;
}

html.dark-mode .popupmenu .listing li.selected {
	background-color: var(--ife-red) !important;
	color: var(--ife-white) !important;
}

html.dark-mode .ui-dialog .ui-dialog-titlebar {
	background-color: var(--ife-panel) !important;
	border-color: var(--ife-border) !important;
	color: var(--ife-white) !important;
}

html.dark-mode .ui-dialog .ui-dialog-content {
	background-color: var(--ife-black-2) !important;
	color: var(--ife-text) !important;
}

/* ==========================================================================
   9. CUOTA / OTROS
   ========================================================================== */

html.dark-mode .quota-widget {
	color: var(--ife-muted) !important;
}

html.dark-mode .quota-widget .bar {
	background-color: var(--ife-black) !important;
	border-color: var(--ife-border) !important;
}

html.dark-mode .quota-widget .value {
	background-color: var(--ife-red) !important;
}

html.dark-mode .iframe-loader {
	background-color: rgba(11, 15, 25, 0.92) !important;
}

html.dark-mode .iframe-loader .spinner-border {
	color: var(--ife-red) !important;
	border-color: currentColor rgba(255, 255, 255, 0.15) currentColor currentColor !important;
}

/* ==========================================================================
   10. LAYOUT TIPO GMAIL (tarea Correo)
   - Riel lateral vertical + carpetas fijas + lista a pantalla completa.
   - Al abrir un mensaje, el contenido reemplaza la lista (con boton Volver).
   La clase .ife-has-list la agrega ife-ui.js cuando existe #layout-list;
   .ife-reading se alterna segun el iframe de contenido (vacio o no).
   ========================================================================== */

@media screen and (min-width: 769px) {

	/* Carpetas: ancho fijo y siempre visibles */
	html.dark-mode body.task-mail #layout.ife-has-list > #layout-sidebar {
		display: flex !important;
		flex: 0 0 250px !important;
		max-width: 250px !important;
		min-width: 200px !important;
	}

	/* Lista de mensajes: ocupa todo el ancho restante */
	html.dark-mode body.task-mail #layout.ife-has-list > #layout-list {
		display: flex !important;
		flex: 1 1 auto !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
		border-right: 0 !important;
	}

	/* Sin mensaje abierto: ocultar el panel de contenido */
	html.dark-mode body.task-mail #layout.ife-has-list:not(.ife-reading) > #layout-content {
		display: none !important;
	}

	/* Con mensaje abierto: el contenido reemplaza a la lista */
	html.dark-mode body.task-mail #layout.ife-has-list.ife-reading > #layout-list {
		display: none !important;
	}

	html.dark-mode body.task-mail #layout.ife-has-list.ife-reading > #layout-content {
		display: flex !important;
		flex: 1 1 auto !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
	}

	/* Boton "Volver a la lista" visible durante la lectura */
	html.dark-mode body.task-mail #layout.ife-has-list.ife-reading > #layout-content > .header > a.back-list-button {
		display: inline-flex !important;
		align-items: center !important;
	}

	html.dark-mode body.task-mail #layout.ife-has-list.ife-reading > #layout-content > .header {
		border-bottom: 1px solid var(--ife-border) !important;
	}
}

/* ==========================================================================
   11. VISTA DE MENSAJE Y COMPOSE
   ========================================================================== */

html.dark-mode .frame-content {
	color: var(--ife-text);
}

html.dark-mode #message-header .subject {
	color: var(--ife-white) !important;
}

html.dark-mode #message-header .header-headers .header-title {
	color: var(--ife-muted) !important;
}

html.dark-mode #message-header .header-links a {
	color: var(--ife-link) !important;
}

html.dark-mode .message-partheaders {
	background-color: var(--ife-panel) !important;
	border-color: var(--ife-border) !important;
}

html.dark-mode .message-part,
html.dark-mode .message-htmlpart {
	border-color: var(--ife-border) !important;
}

html.dark-mode .attachmentslist {
	background-color: var(--ife-black-2) !important;
	border-color: var(--ife-border) !important;
}

html.dark-mode .message-part blockquote,
html.dark-mode .message-htmlpart blockquote {
	background-color: rgba(255, 255, 255, 0.04) !important;
	border-color: var(--ife-border) !important;
}

html.dark-mode #compose-attachments .file-upload {
	color: var(--ife-text);
}

html.dark-mode .formbuttons {
	background: transparent !important;
}

/* ==========================================================================
   12. RIEL GMAIL MODERNO (#layout-menu)
   - Riel vertical angosto, botones solo-icono (estilo Gmail) con tooltip.
   - "Redactar" como FAB circular rojo anclado al fondo.
   El logo y "Cerrar sesion" viven en la barra superior (#ife-topbar, seccion 13).
   Solo aplica en escritorio/tablet (>= 481px). En movil no se toca.
   ========================================================================== */

@media screen and (min-width: 481px) {

	html.dark-mode #layout-menu {
		position: relative !important;
		display: flex !important;
		flex-direction: column !important;
		flex: 0 0 68px !important;
		width: 68px !important;
		min-width: 68px !important;
		max-width: 68px !important;
		padding: 0 !important;
		background-color: var(--ife-black-2) !important;
		border-right: 1px solid var(--ife-border) !important;
		box-shadow: 6px 0 20px rgba(0, 0, 0, 0.35) !important;
		overflow: visible !important;
		user-select: none !important;
		-webkit-tap-highlight-color: transparent !important;
	}

	/* En escritorio el logo ya no va en el riel */
	html.dark-mode #layout-menu .popover-header {
		display: none !important;
	}

	/* Contenedor de tareas en columna */
	html.dark-mode #taskmenu {
		display: flex !important;
		flex-direction: column !important;
		align-items: stretch !important;
		flex: 1 1 auto !important;
		height: auto !important;
		padding: 10px 0 12px !important;
		background: transparent !important;
	}

	/* Botones del riel: solo icono, cuadrados redondeados */
	html.dark-mode #taskmenu > a,
	html.dark-mode #taskmenu .action-buttons > a {
		position: relative !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		float: none !important;
		width: 46px !important;
		height: 46px !important;
		min-width: 0 !important;
		max-width: none !important;
		margin: 4px auto !important;
		padding: 0 !important;
		font-size: 1.3rem !important;
		line-height: 1 !important;
		color: var(--ife-muted) !important;
		background: transparent !important;
		border: 0 !important;
		border-radius: 12px !important;
		transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease !important;
	}

	html.dark-mode #taskmenu > a:before,
	html.dark-mode #taskmenu .action-buttons > a:before {
		float: none !important;
		width: auto !important;
		height: auto !important;
		margin: 0 !important;
		line-height: 1 !important;
		font-size: 1.3rem !important;
	}

	/* Texto de los botones: oculto pero accesible */
	html.dark-mode #taskmenu > a > .inner,
	html.dark-mode #taskmenu .action-buttons > a > .inner {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0 0 0 0) !important;
		white-space: nowrap !important;
		border: 0 !important;
		font-size: 0 !important;
	}

	html.dark-mode #taskmenu > a:hover,
	html.dark-mode #taskmenu .action-buttons > a:hover {
		color: var(--ife-white) !important;
		background-color: rgba(255, 255, 255, 0.06) !important;
	}

	/* Activo: pastilla roja suave + barra al borde izquierdo del riel */
	html.dark-mode #taskmenu > a.selected {
		color: var(--ife-white) !important;
		background: var(--ife-red-soft) !important;
		box-shadow: inset 3px 0 0 0 var(--ife-red) !important;
	}

	/* "Redactar": FAB circular rojo anclado al fondo del riel */
	html.dark-mode #taskmenu .action-buttons {
		position: absolute !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 80px !important;
		display: flex !important;
		flex-direction: column !important;
		align-items: center !important;
		margin-top: 0 !important;
		padding: 0 !important;
	}

	html.dark-mode #taskmenu .action-buttons > a {
		width: 54px !important;
		height: 54px !important;
		border-radius: 50% !important;
		color: var(--ife-white) !important;
		background: linear-gradient(135deg, var(--ife-red) 0%, var(--ife-red-2) 100%) !important;
		border: 2px solid rgba(255, 255, 255, 0.12) !important;
		box-shadow: 0 8px 22px var(--ife-red-glow) !important;
	}

	html.dark-mode #taskmenu .action-buttons > a:before {
		font-size: 1.5rem !important;
	}

	html.dark-mode #taskmenu .action-buttons > a:hover {
		transform: translateY(-2px) scale(1.06) !important;
		background: linear-gradient(135deg, var(--ife-red-2) 0%, var(--ife-red) 100%) !important;
		box-shadow: 0 12px 28px var(--ife-red-glow) !important;
	}

	/* Tooltip propio de los botones solo-icono (usa data-label) */
	html.dark-mode #taskmenu a[data-label]:after {
		content: attr(data-label) !important;
		position: absolute !important;
		top: 50% !important;
		left: calc(100% + 14px) !important;
		transform: translateY(-50%) scale(0.96) !important;
		transform-origin: left center !important;
		padding: 6px 10px !important;
		background-color: var(--ife-panel) !important;
		color: var(--ife-white) !important;
		border: 1px solid var(--ife-border) !important;
		border-radius: 8px !important;
		box-shadow: var(--ife-shadow) !important;
		font-size: 0.82rem !important;
		font-weight: 600 !important;
		line-height: 1 !important;
		white-space: nowrap !important;
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
		z-index: 50 !important;
		transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease !important;
	}

	html.dark-mode #taskmenu a[data-label]:hover:after,
	html.dark-mode #taskmenu a[data-label]:focus-visible:after {
		opacity: 1 !important;
		visibility: visible !important;
		transform: translateY(-50%) scale(1) !important;
		transition-delay: 0.35s !important;
	}
}

/* Entre 481 y 768px el core ya muestra su propio boton flotante (ui.js),
   asi que ocultamos el "Redactar" del riel para no duplicar el FAB. */
@media screen and (min-width: 481px) and (max-width: 768px) {
	html.dark-mode #taskmenu .action-buttons {
		display: none !important;
	}
}

/* ==========================================================================
   13. BARRA SUPERIOR INSTITUCIONAL (#ife-topbar)
   - Logo institucional a la izquierda.
   - "Correo" + "Acerca de" + "Cerrar sesion" (boton grande) a la derecha.
   La barra vive EN EL FLUJO (no fixed): <body> es una columna flex y #layout
   ocupa el resto. Asi el riel nunca queda tapado por la barra.
   Solo se renderiza fuera de login/print/iframes (clase ife-shell en <body>).
   ========================================================================== */

html.dark-mode body.ife-shell {
	display: flex !important;
	flex-direction: column !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
}

html.dark-mode body.ife-shell #layout {
	flex: 1 1 0 !important;
	height: auto !important;
	min-height: 0 !important;
	overflow: hidden !important;
}

html.dark-mode #ife-topbar {
	position: relative !important;
	flex: 0 0 62px !important;
	height: 62px !important;
	width: 100% !important;
	z-index: 1000 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	padding: 0 18px !important;
	background-color: var(--ife-black-2) !important;
	border-bottom: 1px solid var(--ife-border) !important;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

html.dark-mode #ife-topbar .ife-topbar-brand {
	display: flex !important;
	align-items: center !important;
	height: 100% !important;
}

html.dark-mode #ife-topbar .ife-topbar-brand img {
	display: block !important;
	max-height: 50px !important;
	width: auto !important;
	filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
}

html.dark-mode #ife-topbar .ife-topbar-actions {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
}

html.dark-mode #ife-topbar .ife-topbtn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	height: 40px !important;
	padding: 0 16px !important;
	margin: 0 !important;
	border: 1px solid transparent !important;
	border-radius: 10px !important;
	background: transparent !important;
	color: var(--ife-text) !important;
	font-size: 0.9rem !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	text-decoration: none !important;
	cursor: pointer !important;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease !important;
}

html.dark-mode #ife-topbar .ife-topbtn > .inner {
	display: inline !important;
	position: static !important;
	width: auto !important;
	height: auto !important;
	overflow: visible !important;
	clip: auto !important;
	margin: 0 !important;
	font-size: 0.9rem !important;
	white-space: nowrap !important;
}

html.dark-mode #ife-topbar .ife-topbtn:before {
	float: none !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	font-family: Icons !important;
	font-style: normal !important;
	font-weight: 900 !important;
	font-size: 1rem !important;
	line-height: 1 !important;
	text-align: center !important;
}

html.dark-mode #ife-topbar .ife-topbtn-about:before {
	content: "\f128" !important;
}

html.dark-mode #ife-topbar .ife-topbtn-about:hover {
	color: var(--ife-white) !important;
	background-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-mode #ife-topbar .ife-topbtn-logout:before {
	content: "\f011" !important;
	font-size: 1.05rem !important;
}

/* "Cerrar sesion": boton grande, oscuro con borde rojo */
html.dark-mode #ife-topbar .ife-topbtn-logout {
	height: 44px !important;
	padding: 0 20px !important;
	color: var(--ife-white) !important;
	background-color: rgba(193, 18, 31, 0.08) !important;
	border-color: var(--ife-red) !important;
}

html.dark-mode #ife-topbar .ife-topbtn-logout:hover {
	color: var(--ife-white) !important;
	background: linear-gradient(135deg, var(--ife-red) 0%, var(--ife-red-2) 100%) !important;
	border-color: var(--ife-red-2) !important;
	box-shadow: 0 8px 22px var(--ife-red-glow) !important;
}

/* En pantallas chicas la barra se achica y los botones van solo con icono */
@media screen and (max-width: 480px) {
	html.dark-mode #ife-topbar {
		flex: 0 0 52px !important;
		height: 52px !important;
		padding: 0 10px !important;
	}

	html.dark-mode #ife-topbar .ife-topbar-brand img {
		max-height: 40px !important;
	}

	html.dark-mode #ife-topbar .ife-topbtn {
		height: 38px !important;
		padding: 0 11px !important;
	}

	html.dark-mode #ife-topbar .ife-topbtn-logout {
		height: 38px !important;
		padding: 0 11px !important;
	}

	html.dark-mode #ife-topbar .ife-topbtn > .inner {
		display: none !important;
	}
}

/* ==========================================================================
   14. BOTON "VOLVER A LA LISTA" (vista de lectura)
   ========================================================================== */

html.dark-mode body.task-mail #layout.ife-has-list.ife-reading > #layout-content > .header > a.back-list-button {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	position: static !important;
	height: 34px !important;
	padding: 0 14px !important;
	margin: 0 12px 0 0 !important;
	border: 1px solid var(--ife-border) !important;
	border-radius: 999px !important;
	background-color: var(--ife-black-2) !important;
	color: var(--ife-text) !important;
	font-size: 0.85rem !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	text-decoration: none !important;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease !important;
}

html.dark-mode body.task-mail #layout.ife-has-list.ife-reading > #layout-content > .header > a.back-list-button:before {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	font-size: 0.95rem !important;
}

html.dark-mode body.task-mail #layout.ife-has-list.ife-reading > #layout-content > .header > a.back-list-button:hover {
	background-color: var(--ife-red) !important;
	border-color: var(--ife-red) !important;
	color: var(--ife-white) !important;
}

/* ==========================================================================
   15. ESTADOS DESHABILITADOS
   Botones que dependen de una seleccion previa: que se note que no se puede.
   ========================================================================== */

html.dark-mode #layout > div > .header a.button.disabled,
html.dark-mode #messagelist-header .toolbar a.disabled,
html.dark-mode .menu a.disabled {
	cursor: not-allowed !important;
}

html.dark-mode #layout > div > .header a.button.disabled,
html.dark-mode #messagelist-header .toolbar a.disabled {
	opacity: 0.35 !important;
}
