/* ============================================================================
 *  Comunicación Segura (CTGE) — app.css
 *  Enfoque: MOBILE-FIRST. Emula un equipo de radio profesional, limpio y moderno.
 *  Paleta:  #1061CC (Azul principal) · #1889C1 (Azul secundario)
 *           #333333 (Texto)         · #F9F9F9 (Fondo claro)
 * ==========================================================================*/

:root {
	--sc-azul:        #1061CC;
	--sc-azul-2:      #1889C1;
	--sc-gris:        #333333;
	--sc-bg:          #F9F9F9;
	--sc-blanco:      #ffffff;
	--sc-borde:       #e2e6ee;
	--sc-ok:          #1faa59;
	--sc-alerta:      #e63946;
	--sc-ambar:       #f4a300;

	--sc-radio:       14px;
	--sc-topbar-h:    60px;
	--sc-sidebar-w:   240px;
	--sc-sidebar-wc:  64px;   /* ancho colapsado */
	--sc-sombra:      0 6px 20px rgba(16, 97, 204, .12);
	--sc-trans:       .25s ease;

	--sc-text:        var(--sc-gris);
	--sc-panel:       var(--sc-blanco);
	--sc-page:        var(--sc-bg);
}

/* ---- MODO NOCTURNO: buen contraste, evitando gris sobre oscuro ---- */
@media (prefers-color-scheme: dark) {
	:root {
		--sc-bg:     #0d1b2a;
		--sc-page:   #0d1b2a;
		--sc-panel:  #16263b;
		--sc-borde:  #2a3d57;
		--sc-text:   #eaf1fb;   /* texto claro, NO gris, sobre fondo oscuro */
		--sc-gris:   #eaf1fb;
		--sc-sombra: 0 6px 22px rgba(0, 0, 0, .45);
	}
}

* { box-sizing: border-box; }

/* ============================================================================
 *  LIENZO A PANTALLA COMPLETA (app mode)
 *  Esta hoja solo se carga en la página de la app, por lo que estos resets no
 *  afectan al resto del sitio. Elimina cabecera/pie/ancho del tema.
 * ==========================================================================*/
html { height: 100%; margin-top: 0 !important; }
body.sc-app-canvas {
	margin: 0 !important;
	padding: 0 !important;
	min-height: 100vh;
	min-height: 100dvh;
	background: var(--sc-page);
}
body.sc-app-canvas #wpadminbar { display: none !important; }
body.sc-app-canvas .sc-auth-wrap,
body.sc-app-canvas .sc-shell { width: 100%; max-width: none; }

/* Reset acotado al contenedor del plugin para no romper el tema de WP. */
.sc-auth-wrap, .sc-shell {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--sc-text);
	-webkit-font-smoothing: antialiased;
}

/* ============================================================================
 *  LOGIN + 2FA
 * ==========================================================================*/
.sc-auth-wrap {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: linear-gradient(160deg, var(--sc-azul) 0%, var(--sc-azul-2) 100%);
}

.sc-auth-card {
	width: 100%;
	max-width: 420px;
	background: var(--sc-panel);
	border-radius: 20px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
	padding: 32px 26px;
	overflow: hidden;
}

.sc-panel { display: none; }
.sc-panel--active { display: block; animation: scFade .35s ease; }
@keyframes scFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sc-auth-logo { display: block; max-width: 160px; height: auto; margin: 0 auto 18px; }

.sc-auth-title {
	font-size: 19px; line-height: 1.3; text-align: center;
	color: var(--sc-azul); margin: 0 0 4px; font-weight: 700;
}
.sc-auth-title--sm { font-size: 18px; }
.sc-auth-subtitle { text-align: center; margin: 0 0 22px; font-size: 14px; opacity: .8; }

.sc-form { display: flex; flex-direction: column; gap: 14px; }
.sc-field { display: flex; flex-direction: column; gap: 6px; }
.sc-field__label { font-size: 13px; font-weight: 600; }

.sc-field input,
.sc-select,
.sc-search__input {
	width: 100%;
	padding: 13px 14px;
	border: 1.5px solid var(--sc-borde);
	border-radius: 10px;
	font-size: 16px;                 /* 16px evita zoom en iOS */
	background: var(--sc-panel);
	color: var(--sc-text);
	transition: border-color var(--sc-trans);
}
.sc-field input:focus,
.sc-select:focus,
.sc-search__input:focus {
	outline: none;
	border-color: var(--sc-azul);
	box-shadow: 0 0 0 3px rgba(16, 97, 204, .15);
}

.sc-btn {
	border: none; cursor: pointer; border-radius: 10px;
	padding: 14px 18px; font-size: 16px; font-weight: 700;
	transition: transform .08s ease, filter var(--sc-trans);
}
.sc-btn:active { transform: scale(.98); }
.sc-btn--primary { background: var(--sc-azul); color: #fff; }
.sc-btn--primary:hover { filter: brightness(1.06); }
.sc-btn[disabled] { opacity: .55; cursor: not-allowed; }

.sc-link {
	display: inline-block; text-align: center; margin-top: 6px;
	color: var(--sc-azul-2); text-decoration: none; font-size: 14px; cursor: pointer;
	background: none; border: none;
}
.sc-link:hover { text-decoration: underline; }
.sc-link--btn { width: 100%; }

.sc-form__msg { font-size: 14px; min-height: 18px; text-align: center; color: var(--sc-alerta); }
.sc-form__msg.is-ok { color: var(--sc-ok); }

/* ---- 6 celdas OTP ---- */
.sc-otp { display: flex; gap: 8px; justify-content: center; margin: 22px 0 10px; }
.sc-otp__cell {
	width: 46px; height: 56px; text-align: center;
	font-size: 26px; font-weight: 700;
	border: 1.5px solid var(--sc-borde); border-radius: 10px;
	background: var(--sc-panel); color: var(--sc-text);
}
.sc-otp__cell:focus {
	outline: none; border-color: var(--sc-azul);
	box-shadow: 0 0 0 3px rgba(16, 97, 204, .18);
}

.sc-2fa-meta { text-align: center; margin-bottom: 10px; }
.sc-timer {
	display: inline-block; font-variant-numeric: tabular-nums;
	font-size: 15px; font-weight: 700; color: var(--sc-azul-2);
	background: rgba(24, 137, 193, .12); padding: 3px 10px; border-radius: 20px;
}
.sc-timer.is-expired { color: var(--sc-alerta); background: rgba(230, 57, 70, .12); }
.sc-2fa-hint { font-size: 13px; opacity: .85; margin: 8px 0 0; }

/* ============================================================================
 *  SHELL (barra superior + menú lateral + contenido)
 * ==========================================================================*/
.sc-shell {
	min-height: 100vh; min-height: 100dvh;
	background: var(--sc-page);
	display: flex; flex-direction: column;
}

/* ---- Barra superior estática ---- */
.sc-topbar {
	position: sticky; top: 0; z-index: 50;
	height: var(--sc-topbar-h);
	display: flex; align-items: center; justify-content: space-between;
	padding: 0 14px;
	background: var(--sc-panel);
	border-bottom: 1px solid var(--sc-borde);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
.sc-topbar__left { display: flex; align-items: center; gap: 10px; }
.sc-topbar__logo { height: 34px; width: auto; }
.sc-topbar__hamb {
	background: none; border: none; font-size: 22px; cursor: pointer;
	color: var(--sc-azul); display: none;
}

.sc-profile { display: flex; align-items: center; gap: 10px; position: relative; cursor: pointer; }
.sc-profile__avatar {
	width: 38px; height: 38px; border-radius: 50%;
	background: var(--sc-azul); color: #fff;
	display: grid; place-items: center; font-weight: 700;
}
.sc-profile__info { display: flex; flex-direction: column; line-height: 1.1; }
.sc-profile__name { font-weight: 700; font-size: 14px; }
.sc-profile__role { font-size: 12px; opacity: .75; }
.sc-profile__menu {
	position: absolute; right: 0; top: 110%;
	background: var(--sc-panel); border: 1px solid var(--sc-borde);
	border-radius: 10px; box-shadow: var(--sc-sombra);
	padding: 6px; min-width: 160px; display: none;
}
.sc-profile__menu.is-open { display: block; }
.sc-profile__menu a { display: block; padding: 9px 12px; color: var(--sc-text); text-decoration: none; border-radius: 8px; }
.sc-profile__menu a:hover { background: rgba(16, 97, 204, .08); }

/* ---- Cuerpo: sidebar + contenido ---- */
.sc-body { display: flex; flex: 1; min-height: 0; }

/* ---- Menú lateral flotante azul ---- */
.sc-sidebar {
	position: relative;
	width: var(--sc-sidebar-w);
	flex: 0 0 var(--sc-sidebar-w);
	background: var(--sc-azul);
	color: #fff;
	transition: width var(--sc-trans), flex-basis var(--sc-trans);
	padding-top: 14px;
}
/* Botón de colapsar: en el borde derecho del menú, círculo con ◄ / ► */
.sc-sidebar__toggle {
	position: absolute; top: 14px; right: -14px; z-index: 5;
	width: 28px; height: 28px; border-radius: 50%;
	background: var(--sc-panel); color: var(--sc-azul);
	border: 1px solid var(--sc-borde); cursor: pointer;
	display: grid; place-items: center; box-shadow: var(--sc-sombra);
}
.sc-sidebar__chev { font-size: 13px; line-height: 1; transition: transform var(--sc-trans); }

.sc-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.sc-nav__item {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 14px; border-radius: 10px;
	color: #eaf1fb; text-decoration: none; white-space: nowrap;
	transition: background var(--sc-trans);
}
.sc-nav__item:hover,
.sc-nav__item.is-active { background: rgba(255, 255, 255, .16); color: #fff; }
.sc-nav__icon { font-size: 18px; width: 22px; text-align: center; flex: 0 0 22px; }
.sc-nav__label { font-size: 14px; font-weight: 600; }

/* Estado COLAPSADO: solo íconos; el chevron apunta ► */
.sc-shell.is-collapsed .sc-sidebar { width: var(--sc-sidebar-wc); flex-basis: var(--sc-sidebar-wc); }
.sc-shell.is-collapsed .sc-nav__label { display: none; }
.sc-shell.is-collapsed .sc-nav__item { justify-content: center; }
.sc-shell.is-collapsed .sc-sidebar__chev { transform: scaleX(-1); }

/* ---- Contenido: ocupa el 100% restante ---- */
.sc-content { flex: 1; min-width: 0; padding: 18px; overflow-y: auto; }

/* Vistas conmutables */
.sc-view { display: none; }
.sc-view--active { display: block; }

.sc-view__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sc-view__title { font-size: 20px; margin: 0; color: var(--sc-azul); }

.sc-noaccess { padding: 40px; text-align: center; color: var(--sc-alerta); font-weight: 600; }

/* ============================================================================
 *  ESTADOS / INDICADORES
 * ==========================================================================*/
.sc-status, .sc-channel__status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.sc-status__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--sc-ok); box-shadow: 0 0 0 0 rgba(31,170,89,.5); }
[data-state="idle"]   .sc-status__dot { background: var(--sc-ok); }
[data-state="rx"]     .sc-status__dot { background: var(--sc-azul-2); animation: scPulse 1s infinite; }
[data-state="tx"]     .sc-status__dot { background: var(--sc-alerta); animation: scPulse .8s infinite; }
@keyframes scPulse { 0% { box-shadow: 0 0 0 0 rgba(24,137,193,.6); } 70% { box-shadow: 0 0 0 9px rgba(24,137,193,0); } 100% { box-shadow: 0 0 0 0 rgba(24,137,193,0); } }

/* ============================================================================
 *  CONDUCTOR — PTT gigante
 * ==========================================================================*/
.sc-view--conductor { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.sc-conductor__head { text-align: center; }
.sc-conductor__label { display: block; font-size: 13px; opacity: .7; }
.sc-conductor__canal { display: block; font-size: 26px; font-weight: 800; color: var(--sc-azul); margin: 2px 0 8px; }

.sc-ptt-zone { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 10px 0; }
.sc-ptt {
	position: relative;
	width: min(72vw, 260px); height: min(72vw, 260px);
	border-radius: 50%;
	border: none; cursor: pointer;
	background: radial-gradient(circle at 50% 35%, var(--sc-azul-2), var(--sc-azul));
	color: #fff; box-shadow: 0 14px 34px rgba(16, 97, 204, .45);
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
	user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
	touch-action: none;              /* evita gestos del navegador al pulsar */
	transition: transform .1s ease, box-shadow .2s ease;
}
.sc-ptt__icon { font-size: 56px; }
.sc-ptt__text { font-size: 15px; font-weight: 800; letter-spacing: .5px; line-height: 1.2; text-align: center; }
.sc-ptt__ring {
	position: absolute; inset: -6px; border-radius: 50%;
	border: 4px solid rgba(255,255,255,.0);
}
/* Mientras transmite */
.sc-ptt.is-active { transform: scale(.96); background: radial-gradient(circle at 50% 35%, #ff6b6b, var(--sc-alerta)); }
.sc-ptt.is-active .sc-ptt__ring { animation: scRing 1s infinite; border-color: rgba(255,255,255,.55); }
@keyframes scRing { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.18); opacity: 0; } }
.sc-ptt-hint { font-size: 13px; opacity: .75; text-align: center; max-width: 320px; }

/* ============================================================================
 *  CONSOLA — matriz de canales
 * ==========================================================================*/
.sc-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.sc-channel {
	background: var(--sc-panel); border: 1px solid var(--sc-borde);
	border-radius: var(--sc-radio); padding: 14px; box-shadow: var(--sc-sombra);
}
.sc-channel[data-tipo="principal"] { border-left: 5px solid var(--sc-azul); }
.sc-channel[data-tipo="eas"]       { border-left: 5px solid var(--sc-azul-2); }
.sc-channel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sc-channel__name { font-weight: 700; font-size: 16px; }
.sc-channel__status { margin-bottom: 10px; }
.sc-channel__who { opacity: .8; }

/* Switch de escucha */
.sc-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.sc-switch input { opacity: 0; width: 0; height: 0; }
.sc-switch__slider { position: absolute; inset: 0; background: #b9c2d0; border-radius: 24px; transition: var(--sc-trans); cursor: pointer; }
.sc-switch__slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: var(--sc-trans); }
.sc-switch input:checked + .sc-switch__slider { background: var(--sc-ok); }
.sc-switch input:checked + .sc-switch__slider::before { transform: translateX(20px); }

.sc-ptt--mini { width: 100%; height: 56px; border-radius: 12px; flex-direction: row; gap: 8px; box-shadow: none; }
.sc-ptt--mini .sc-ptt__icon { font-size: 22px; }
.sc-ptt--mini .sc-ptt__text { font-size: 14px; }

.sc-base-switch { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sc-base-switch .sc-select { width: auto; }

/* ============================================================================
 *  FEED DE TEXTO + BÚSQUEDA
 * ==========================================================================*/
.sc-feed { margin-top: 12px; }
.sc-feed__title { font-size: 14px; margin: 0 0 8px; opacity: .8; }
.sc-feed--mini { max-height: 150px; overflow-y: auto; }
.sc-feed__list, .sc-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-msg {
	background: var(--sc-panel); border: 1px solid var(--sc-borde);
	border-radius: 10px; padding: 9px 12px; font-size: 14px;
}
.sc-msg__meta { display: flex; gap: 8px; font-size: 12px; opacity: .7; margin-bottom: 3px; }
.sc-msg__autor { font-weight: 700; opacity: 1; }
.sc-msg__texto { line-height: 1.35; }

.sc-search { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.sc-search__input { flex: 1 1 240px; }
.sc-results .sc-msg { box-shadow: var(--sc-sombra); }

/* ============================================================================
 *  RESPONSIVE
 * ==========================================================================*/

/* Escritorio: 2-3 columnas en la matriz */
@media (min-width: 980px) {
	.sc-grid { grid-template-columns: repeat(3, 1fr); }
}
/* Tablet */
@media (min-width: 600px) and (max-width: 979px) {
	.sc-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Móvil (≤ 768px): el menú se vuelve cajón superpuesto */
@media (max-width: 768px) {
	.sc-topbar__hamb { display: inline-block; }

	.sc-sidebar {
		position: fixed; top: var(--sc-topbar-h); left: 0; bottom: 0; z-index: 60;
		width: var(--sc-sidebar-w); flex-basis: var(--sc-sidebar-w);
		transform: translateX(-105%);
		box-shadow: 6px 0 24px rgba(0,0,0,.3);
	}
	/* En móvil "abierto" = visible; el toggle ◄/► se oculta a favor del ☰ */
	.sc-shell.is-mobile-open .sc-sidebar { transform: translateX(0); }
	.sc-sidebar__toggle { display: none; }
	.sc-shell.is-collapsed .sc-sidebar { width: var(--sc-sidebar-w); flex-basis: var(--sc-sidebar-w); }
	.sc-shell.is-collapsed .sc-nav__label { display: inline; }

	/* Fondo oscuro al abrir el cajón */
	.sc-shell.is-mobile-open .sc-content::before {
		content: ""; position: fixed; inset: var(--sc-topbar-h) 0 0 0; z-index: 55;
		background: rgba(0,0,0,.45);
	}

	.sc-content { padding: 14px; }
	.sc-profile__info { display: none; }   /* ahorra espacio en 9:16 */
	.sc-view__title { font-size: 18px; }
}

/* Móvil muy estrecho 9:16: el PTT no debe tapar el feed */
@media (max-width: 420px) {
	.sc-ptt { width: 64vw; height: 64vw; }
	.sc-ptt__icon { font-size: 46px; }
	.sc-auth-card { padding: 26px 18px; }
	.sc-otp__cell { width: 13vw; max-width: 46px; height: 52px; font-size: 22px; }
}

/* Soporte de notch (PWA standalone) */
@supports (padding: max(0px)) {
	.sc-topbar { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
}

/* ============================================================================
 *  PANEL DEL MASTER ADMIN — componentes adicionales
 * ==========================================================================*/

/* ---- Modo nocturno manual (toggle): reusa las mismas variables del dark ---- */
.sc-dark {
	--sc-bg:     #0d1b2a;
	--sc-page:   #0d1b2a;
	--sc-panel:  #16263b;
	--sc-borde:  #2a3d57;
	--sc-text:   #eaf1fb;
	--sc-gris:   #eaf1fb;
	--sc-sombra: 0 6px 22px rgba(0, 0, 0, .45);
	background: var(--sc-page);
	color: var(--sc-text);
}

/* ---- Botones tipo "pill" en la barra superior (Avisos / Chat / Consignas) ---- */
.sc-topbar__actions { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; }
.sc-pill {
	position: relative;
	display: inline-flex; align-items: center; gap: 6px;
	padding: 8px 16px; border-radius: 22px;
	border: 1.5px solid var(--sc-azul); background: transparent;
	color: var(--sc-azul); font-weight: 600; font-size: 14px; cursor: pointer;
	white-space: nowrap; transition: background var(--sc-trans), color var(--sc-trans);
}
.sc-pill:hover { background: rgba(16, 97, 204, .08); }
.sc-dark .sc-pill { color: #8fc0ff; border-color: #2f6fd0; }

.sc-badge {
	min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px;
	background: var(--sc-alerta); color: #fff; font-size: 11px; font-weight: 700;
	display: inline-flex; align-items: center; justify-content: center;
}
.sc-pill .sc-badge { position: absolute; top: -7px; right: -6px; }

/* ---- Avatar con foto + menú de perfil ---- */
.sc-profile__avatar { overflow: hidden; }
.sc-profile__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sc-profile__email { font-size: 12px; opacity: .75; }
.sc-profile__opt {
	display: block; width: 100%; text-align: left; background: none; border: none;
	padding: 10px 14px; color: var(--sc-text); cursor: pointer; font-size: 14px; border-radius: 8px;
	text-decoration: none;
}
.sc-profile__opt:hover { background: rgba(16, 97, 204, .08); }
.sc-profile__menu { min-width: 190px; }

/* ============================================================================
 *  PANELES LATERALES (Chat / Avisos / Consignas)
 * ==========================================================================*/
.sc-panel-veil { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 70; }
.sc-side-panel {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
	width: min(420px, 92vw);
	background: var(--sc-panel); color: var(--sc-text);
	box-shadow: -8px 0 30px rgba(0,0,0,.25);
	display: flex; flex-direction: column;
	transform: translateX(100%); transition: transform var(--sc-trans);
}
.sc-side-panel.is-open { transform: translateX(0); }
.sc-side-panel__head {
	display: flex; align-items: center; justify-content: space-between;
	background: var(--sc-azul); color: #fff; padding: 16px 18px; font-size: 17px; font-weight: 700;
}
.sc-side-panel__close { background: none; border: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.sc-empty { padding: 22px; text-align: center; opacity: .7; }
.sc-avisos, .sc-consignas { padding: 14px; overflow-y: auto; }

/* ---- Chat: lista de usuarios ---- */
.sc-chat__users { overflow-y: auto; flex: 1; }
.sc-chat-user {
	display: flex; align-items: center; gap: 12px; width: 100%;
	padding: 12px 16px; background: none; border: none; border-bottom: 1px solid var(--sc-borde);
	cursor: pointer; text-align: left; color: var(--sc-text);
}
.sc-chat-user:hover { background: rgba(16, 97, 204, .06); }
.sc-chat-user__av {
	position: relative; width: 42px; height: 42px; border-radius: 50%;
	background: var(--sc-azul-2); color: #fff; display: grid; place-items: center;
	font-weight: 700; overflow: hidden; flex: 0 0 42px;
}
.sc-chat-user__av img { width: 100%; height: 100%; object-fit: cover; }
.sc-dot {
	position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px;
	border-radius: 50%; background: #b9c2d0; border: 2px solid var(--sc-panel);
}
.sc-dot.is-on { background: var(--sc-ok); }
.sc-chat-user__info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sc-chat-user__name { font-weight: 700; font-size: 14px; }
.sc-chat-user__st { font-size: 12px; opacity: .7; }

/* ---- Chat: conversación ---- */
.sc-chat__conv { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sc-chat__conv-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--sc-borde); }
.sc-chat__back { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--sc-azul); }
.sc-chat__conv-name { font-weight: 700; }
.sc-chat__msgs { list-style: none; margin: 0; padding: 14px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.sc-chat-bubble {
	max-width: 80%; padding: 9px 12px; border-radius: 14px;
	background: #eef2f8; color: #222; align-self: flex-start; font-size: 14px; word-wrap: break-word;
}
.sc-chat-bubble.is-mine { align-self: flex-end; background: var(--sc-azul); color: #fff; }
.sc-dark .sc-chat-bubble { background: #22344c; color: var(--sc-text); }
.sc-chat-adj { max-width: 100%; border-radius: 10px; display: block; }
.sc-chat-doc { color: inherit; text-decoration: underline; display: inline-block; }
.sc-chat__compose { display: flex; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--sc-borde); }
.sc-chat__attach { cursor: pointer; font-size: 20px; }
.sc-chat__input { flex: 1; padding: 10px 12px; border: 1.5px solid var(--sc-borde); border-radius: 20px; font-size: 15px; background: var(--sc-panel); color: var(--sc-text); }
.sc-chat__send { background: var(--sc-azul); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.sc-chat__file-hint { padding: 6px 14px; font-size: 12px; opacity: .8; }

/* ============================================================================
 *  PERFIL / FIRMA — formularios en tarjeta
 * ==========================================================================*/
.sc-card { background: var(--sc-panel); border: 1px solid var(--sc-borde); border-radius: var(--sc-radio); padding: 22px; box-shadow: var(--sc-sombra); }
.sc-muted { opacity: .75; font-size: 14px; line-height: 1.5; }
.sc-hint-blue { color: var(--sc-azul-2); font-size: 13px; margin: 4px 0 14px; }

.sc-perfil-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.sc-perfil-avatar { width: 70px; height: 70px; border-radius: 50%; background: var(--sc-azul); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 700; overflow: hidden; }
.sc-perfil-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sc-file-btn { display: inline-block; margin-top: 8px; padding: 7px 14px; border: 1.5px solid var(--sc-azul); border-radius: 8px; color: var(--sc-azul); cursor: pointer; font-size: 13px; font-weight: 600; }

.sc-grid-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; margin-bottom: 18px; }
.sc-tel { display: flex; gap: 6px; }
.sc-tel .sc-select { flex: 0 0 auto; width: auto; }
.sc-tel input { flex: 1; padding: 13px 14px; border: 1.5px solid var(--sc-borde); border-radius: 10px; font-size: 16px; background: var(--sc-panel); color: var(--sc-text); }

.sc-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin: 6px 0 16px; opacity: .9; }
.sc-check input { margin-top: 3px; }
.sc-chip { display: inline-block; padding: 4px 12px; border-radius: 20px; background: rgba(16,97,204,.1); color: var(--sc-azul); font-size: 13px; font-weight: 600; }
.sc-chip--ok { background: rgba(31,170,89,.14); color: var(--sc-ok); }
.sc-firma-estado { margin: 10px 0 18px; }
.sc-firma-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sc-btn--ghost { background: transparent; border: 1.5px solid var(--sc-azul); color: var(--sc-azul); }
.sc-btn--ghost-danger { background: transparent; border: 1.5px solid var(--sc-alerta); color: var(--sc-alerta); }

/* ============================================================================
 *  PANEL ADMIN — pestañas, placeholders y tabla de logs
 * ==========================================================================*/
.sc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sc-tab {
	padding: 8px 16px; border-radius: 8px; border: 1px solid var(--sc-borde);
	background: var(--sc-panel); color: var(--sc-text); cursor: pointer; font-size: 14px; font-weight: 600;
}
.sc-tab.is-active { background: var(--sc-azul); color: #fff; border-color: var(--sc-azul); }
.sc-placeholder { text-align: center; padding: 40px 20px; }
.sc-placeholder h3 { color: var(--sc-azul); margin: 0 0 8px; }

.sc-logs-filtros { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 16px 0; }
.sc-field--inline { flex-direction: column; gap: 4px; }
.sc-input-date { padding: 10px 12px; border: 1.5px solid var(--sc-borde); border-radius: 8px; font-size: 14px; background: var(--sc-panel); color: var(--sc-text); }
.sc-logs-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.sc-table-wrap { overflow-x: auto; margin-top: 12px; }
.sc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sc-table th, .sc-table td { border: 1px solid var(--sc-borde); padding: 8px 10px; text-align: left; vertical-align: top; }
.sc-table th { background: var(--sc-azul); color: #fff; position: sticky; top: 0; }
.sc-table tr:nth-child(even) td { background: rgba(16,97,204,.04); }
.sc-dark .sc-table tr:nth-child(even) td { background: rgba(255,255,255,.03); }

/* ---- Chat: secciones, grupos y autor ---- */
.sc-chat-sect {
	padding: 10px 16px 4px; font-size: 12px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .4px; opacity: .6;
}
.sc-chat-user__av--grp { background: var(--sc-azul); font-size: 12px; letter-spacing: .5px; }
.sc-chat-bubble__autor { display: block; font-size: 11px; font-weight: 700; color: var(--sc-azul-2); margin-bottom: 2px; }
.sc-chat-bubble.is-mine .sc-chat-bubble__autor { color: #d6e6ff; }

/* ---- Config: Correos e IA ---- */
.sc-config-form { display: flex; flex-direction: column; gap: 16px; }
.sc-fieldset { border: 1px solid var(--sc-borde); border-radius: 10px; padding: 14px 16px; }
.sc-fieldset legend { padding: 0 8px; font-weight: 700; color: var(--sc-azul); }
.sc-textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--sc-borde); border-radius: 10px; font-size: 15px; background: var(--sc-panel); color: var(--sc-text); resize: vertical; }

/* ---- Matriz de Permisos del menú ---- */
.sc-permisos-table th, .sc-permisos-table td { text-align: center; }
.sc-permisos-table td:first-child, .sc-permisos-table th:first-child { text-align: left; }
.sc-permisos-table input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }

/* ============================================================================
 *  INFORMES (Caso Relevante)
 * ==========================================================================*/
.sc-inf-listhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sc-inf-rowacts { display: flex; gap: 10px; }
.sc-inf-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.sc-inf-block { border-top: 1px solid var(--sc-borde); padding-top: 14px; margin-top: 16px; }
.sc-inf-block h4 { margin: 0 0 6px; color: var(--sc-azul); font-size: 15px; }
.sc-inf-insumos { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.sc-inf-insumos li { font-size: 14px; }
.sc-inf-anexos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.sc-anexo { border: 1px solid var(--sc-borde); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.sc-anexo img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; }
.sc-anexo-desc { padding: 7px 9px; border: 1.5px solid var(--sc-borde); border-radius: 8px; font-size: 13px; background: var(--sc-panel); color: var(--sc-text); }
.sc-inf-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.sc-btn--ia { background: linear-gradient(135deg, var(--sc-azul-2), var(--sc-azul)); color: #fff; }
.sc-btn--ia:hover { filter: brightness(1.08); }

/* ---- Responsive del panel ---- */
@media (max-width: 768px) {
	.sc-topbar__actions { gap: 6px; }
	.sc-pill { padding: 7px 11px; font-size: 12px; }
	.sc-grid-fields { grid-template-columns: 1fr; }
	.sc-side-panel { width: 100vw; }
	.sc-inf-anexos { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 600px) {
	/* En móvil 9:16, los botones de acción pasan a una fila desplazable */
	.sc-topbar__actions { overflow-x: auto; justify-content: flex-start; }
}
