/* ============ Mesa de Ayuda UNCA — estilos ============ */

/* ---------- Paleta institucional UNCA (fija) ---------- */
:root {
  --brand: #326AB7;      /* azul UNCA */
  --brand-700: #24508F;
  --brand-900: #16345F;  /* azul marino */
  --brand-50: #EBF2FB;
  --brand-100: #D6E4F6;
  --side: #0F2747;       /* menú lateral */
  --accent: #F2A900;     /* dorado */
  --accent-50: #FFF6DE;
}
:root {
  --bg: #F2F5FA;
  --card: #FFFFFF;
  --text: #172033;
  --text-2: #4A5468;
  --muted: #667085;
  --line: #E4E8EF;
  --ok: #157347;  --ok-50: #E4F4EA;
  --warn: #9A5B00; --warn-50: #FDF1DC;
  --danger: #B42318; --danger-50: #FDECEA;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 24px 8px; text-align: center; }
:focus-visible { outline: 3px solid var(--brand-100); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn-primary, .btn-outline, .btn-cta, .btn-ghost, .btn-logout {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border-radius: 10px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand-100); }
.btn-outline:hover { background: var(--brand-50); }
.btn-cta { background: var(--accent); color: #1B1405; min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.btn-cta:hover { filter: brightness(1.05); }
.btn-cta.small { min-height: 46px; font-size: 15px; box-shadow: none; }
.btn-ghost { color: var(--brand); background: var(--brand-50); }
.btn-ghost:hover { background: var(--brand-100); }
.btn-logout { color: var(--text-2); border-color: var(--line); background: #fff; padding: 0 14px; }
.btn-logout:hover { color: var(--danger); border-color: #F3C9C4; background: var(--danger-50); }

/* ---------- Estructura: menú lateral + contenido ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 264px; flex-shrink: 0; background: linear-gradient(180deg, var(--brand-900), var(--side)); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px; }
.side-brand { display: block; background: #fff; border-radius: 12px; padding: 12px 14px; text-decoration: none; }
.side-brand img { width: 100%; height: auto; display: block; }
.side-brand strong { color: var(--brand-900); font-size: 22px; }
.side-app { margin: 12px 6px 18px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9FB6D8; text-align: center; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 10px; color: #D5E1F2; text-decoration: none; font-weight: 600; font-size: 15px; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side-sec { margin: 18px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7F98BE; }
.side-user { display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.12); padding: 14px 6px 0; margin-top: 12px; }
.side-user .avatar-ini { background: rgba(255,255,255,.14); color: #fff; }
.side-user-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.side-user-txt strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-txt small { font-size: 12px; color: #9FB6D8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 68px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.topbar-logo { display: none; text-decoration: none; color: var(--brand-900); font-size: 20px; }
.topbar-logo img { height: 28px; width: auto; display: block; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar-ini { width: 38px; height: 38px; border-radius: 19px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.user-txt { display: flex; flex-direction: column; line-height: 1.2; }
.user-txt strong { font-size: 14px; text-transform: uppercase; }
.user-txt small { font-size: 12px; color: var(--muted); }
.bottomnav { display: none; }

.content { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }
.content.narrow { max-width: 900px; }
.content.wide { max-width: 1440px; display: flex; flex-direction: column; gap: 18px; }
.content.wide .card { margin-bottom: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.content.wide .page-head { margin-bottom: 4px; }
.page-head h1 { margin: 0; font-size: 28px; color: var(--brand-900); }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* tarjetas de indicadores */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.content.wide .kpis { margin-bottom: 0; }
.kpi { position: relative; overflow: hidden; border-radius: 16px; padding: 18px 22px; color: #fff; min-height: 116px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 10px 24px -10px rgba(16,24,40,.45); }
.kpi span { font-size: 14px; font-weight: 600; opacity: .92; position: relative; }
.kpi strong { font-size: 40px; line-height: 1.1; position: relative; }
.kpi-bg { position: absolute; right: -8px; bottom: -14px; width: 96px; height: 96px; opacity: .2; }
.g-blue { background: linear-gradient(135deg, #4A86D6, #24508F); }
.g-orange { background: linear-gradient(135deg, #F7A21B, #E2640E); }
.g-green { background: linear-gradient(135deg, #2BB673, #10804F); }
.g-navy { background: linear-gradient(135deg, #1E3A66, #0B1D38); }
.g-red { background: linear-gradient(135deg, #EF5350, #B42318); }

/* tarjeta del asistente IA */
.ai-card { display: flex; align-items: center; gap: 18px; padding: 18px 22px; margin-bottom: 22px; border-radius: 16px; text-decoration: none; color: var(--text); background: linear-gradient(100deg, #FFF8E6, #EBF2FB 60%); border: 1px solid #F1DFAE; }
.ai-card:hover { border-color: var(--accent); }
.ai-ico { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--accent), #E08A00); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.ai-ico svg { width: 26px; height: 26px; }
.ai-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ai-txt strong { font-size: 17px; color: var(--brand-900); }
.ai-txt span { color: var(--text-2); font-size: 14px; }
.ai-go { font-weight: 700; color: var(--brand); white-space: nowrap; }

/* tabla de datos */
.card.table-card { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; }
.card-head h2 { margin: 0; font-size: 19px; color: var(--brand-900); }
.card-head h2 small { color: var(--muted); font-weight: 500; font-size: 14px; }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable thead th { background: linear-gradient(90deg, var(--brand-900), var(--brand-700)); color: #fff; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 13px 16px; white-space: nowrap; }
.dtable td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.dtable tbody tr { cursor: pointer; }
.dtable tbody tr:hover td { background: var(--brand-50); }
.dtable tr[hidden] { display: none; }
.dtable td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.dtable .c-id { font-weight: 700; color: var(--brand-700); white-space: nowrap; }
.dtable .c-main a { color: var(--text); font-weight: 600; text-decoration: none; }
.dtable .c-main a:hover { color: var(--brand); text-decoration: underline; }
.dtable .cat { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.dtable .cat svg { color: var(--brand); flex-shrink: 0; }
.dtable .flag { display: inline-block; margin: 6px 6px 0 0; }
.unread { display: inline-block; margin-top: 6px; background: var(--accent-50); color: #7A5600; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.seg { display: inline-flex; background: #E9EDF3; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; min-height: 38px; padding: 0 14px; border-radius: 8px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.empty-state { text-align: center; color: var(--muted); padding: 44px 20px 52px; border-top: 1px solid var(--line); }
.empty-state svg { color: #A9B6CA; }
.empty-state p { margin: 10px 0 0; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-nuevo { background: var(--brand-50); color: var(--brand-700); }
.st-en_atencion { background: var(--warn-50); color: var(--warn); }
.st-resuelto { background: var(--ok-50); color: var(--ok); }
.st-cerrado { background: #EEF0F3; color: var(--muted); }

/* barra de avance */
.steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.steps li::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before { background: var(--brand); }
.steps .dot { width: 15px; height: 15px; border-radius: 8px; background: #fff; border: 3px solid var(--line); position: relative; z-index: 1; }
.steps li.done .dot { background: var(--brand); border-color: var(--brand); }
.steps li.current .dot { box-shadow: 0 0 0 4px var(--brand-100); }
.steps li.done { color: var(--text-2); font-weight: 600; }

/* detalle del ticket (usuario) */
.back-link { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; font-weight: 600; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 16px; }
.card h2 { margin: 0 0 14px; font-size: 18px; }
.tk-head h1 { margin: 12px 0 16px; font-size: 24px; line-height: 1.25; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 20px 0 0; }
.facts div { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 4px 0 0; font-weight: 600; }
.facts small { color: var(--muted); font-weight: 400; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.ev { position: relative; background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.ev::before { content: ""; position: absolute; left: -26px; top: 14px; width: 12px; height: 12px; border-radius: 6px; background: #fff; border: 3px solid var(--line); }
.ev-me::before { border-color: var(--brand); }
.ev-tech { background: var(--ok-50); }
.ev-tech::before { border-color: var(--ok); }
.ev-sys { background: var(--brand-50); }
.ev-sys::before { border-color: var(--accent); }
.ev-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ev-head span { color: var(--muted); }
.ev p { margin: 4px 0 0; white-space: pre-wrap; }
.ev-img { max-width: 260px; width: 100%; border-radius: 10px; margin-top: 8px; display: block; }
.ev audio { margin-top: 8px; max-width: 100%; }
.tk-reply { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.tk-reply textarea { border: 1px solid #CBD3E0; border-radius: 12px; padding: 12px 14px; resize: vertical; min-height: 64px; }
.tk-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: linear-gradient(140deg, var(--side), var(--brand)); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.login-side h2 { margin: 0; font-size: 36px; line-height: 1.15; max-width: 520px; }
.login-kicker { font-size: 13px !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); opacity: 1 !important; }
.login-side p { margin: 0; opacity: .9; font-size: 17px; max-width: 480px; }
.login-feats { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.login-feats li { display: flex; gap: 12px; align-items: center; font-size: 15px; }
.login-feats span { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; flex-shrink: 0; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: #fff; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card img { max-width: 280px; width: 100%; height: auto; margin: 0 auto 26px; display: block; }
.login-card h1 { margin: 0 0 6px; font-size: 26px; }
.login-sub { color: var(--muted); margin: 0 0 26px; }
.login-error { background: var(--danger-50); color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; border: 1px solid #CBD3E0; border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 700; background: #fff; box-shadow: var(--shadow); }
.btn-google:hover { background: #F8FAFC; border-color: var(--brand-100); }
.login-note { color: var(--muted); font-size: 13px; margin: 16px 0 0; }

/* ---------- Ventana flotante de reporte ---------- */
.chat-launch { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 28px; background: var(--brand); color: #fff; font-size: 15px; cursor: pointer; box-shadow: 0 12px 28px -8px rgba(22,52,95,.6); }
.chat-launch:hover { background: var(--brand-700); }
.chat-launch svg { width: 24px; height: 24px; }
.chat-launch b { color: var(--accent); }
.chat-launch[hidden] { display: none; }

.chatw { position: fixed; right: 24px; bottom: 24px; z-index: 50; width: 410px; height: min(700px, calc(100vh - 48px)); display: flex; flex-direction: column; background: #F4F7FB; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px -12px rgba(15,39,71,.45), 0 0 0 1px rgba(15,39,71,.06); opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right; transition: opacity .2s, transform .2s; }
.chatw.open { opacity: 1; transform: none; }
.chatw[hidden] { display: none; }
.cw-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; background: linear-gradient(120deg, var(--brand-900), var(--brand)); color: #fff; }
.cw-avatar { width: 44px; height: 44px; border-radius: 22px; background: #fff; color: var(--brand); display: grid; place-items: center; flex-shrink: 0; position: relative; }
.cw-avatar::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 6px; background: #3DD68C; border: 2px solid var(--brand-900); }
.cw-title { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.cw-title strong { font-size: 16px; }
.cw-title span { font-size: 13px; opacity: .85; }
.cw-close { width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.cw-close:hover { background: rgba(255,255,255,.14); }

.messages { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 85%; padding: 9px 13px; border-radius: 4px 16px 16px 16px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.06); word-wrap: break-word; font-size: 14.5px; animation: pop .18s ease-out; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-radius: 16px 4px 16px 16px; }
.bubble.tech { background: var(--ok-50); }
.bubble .who { display: block; font-size: 12px; font-weight: 700; color: var(--ok); margin-bottom: 2px; }
.bubble .time { display: block; font-size: 11px; opacity: .55; text-align: right; margin-top: 2px; }
.bubble img { display: block; max-width: 220px; width: 100%; border-radius: 10px; cursor: zoom-in; }
.bubble audio { width: 230px; max-width: 100%; height: 40px; }
.typing { align-self: flex-start; background: #fff; padding: 12px 14px; border-radius: 4px 16px 16px 16px; display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 4px; background: #A9B6CA; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.typing.err { color: var(--danger); font-size: 13px; }
@keyframes blink { 50% { opacity: .25; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

.quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 14px 10px; }
.quick:empty { display: none; }
.chip { min-height: 40px; padding: 0 15px; border-radius: 20px; border: 1.5px solid var(--brand); background: #fff; color: var(--brand); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.chip:hover { background: var(--brand-50); }
.chip.solid { background: var(--brand); color: #fff; }

/* tarjeta de revisión */
.review { align-self: stretch; background: #fff; border-radius: 16px; border: 1.5px solid var(--brand-100); box-shadow: 0 8px 20px -10px rgba(22,52,95,.35); overflow: hidden; animation: pop .25s ease-out; margin-top: 4px; }
.rv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--brand-50); }
.rv-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.rv-head strong { display: block; font-size: 15px; color: var(--brand-900); }
.rv-head small { color: var(--muted); font-size: 12px; }
.rv-alert { margin: 0; padding: 8px 14px; background: var(--danger-50); color: var(--danger); font-size: 13px; }
.rv-row { display: grid; grid-template-columns: 78px 1fr auto; gap: 8px; align-items: start; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.rv-l { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.rv-v p { margin: 0; }
.rv-v small { display: block; color: var(--muted); font-size: 12px; }
.rv-chip { display: inline-block; background: var(--brand-50); color: var(--brand-700); font-weight: 600; font-size: 13px; padding: 2px 10px; border-radius: 12px; }
.rv-link { border: 0; background: none; color: var(--brand); font-weight: 700; font-size: 13px; cursor: pointer; padding: 2px 4px; min-height: 28px; }
.rv-link:hover { text-decoration: underline; }
.rv-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rv-files img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.rv-aud { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; background: var(--bg); padding: 4px 8px; border-radius: 8px; }
.rv-add { height: 52px; padding: 0 10px; border: 1.5px dashed #B9C6D9; border-radius: 8px; background: none; color: var(--brand); font-weight: 700; font-size: 12px; cursor: pointer; }
.rv-add:hover { border-color: var(--brand); background: var(--brand-50); }
.rv-editing { grid-column: 2 / -1; }
.rv-editing textarea { width: 100%; border: 1.5px solid var(--brand); border-radius: 10px; padding: 8px 10px; resize: vertical; font-size: 14px; }
.rv-edit-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.rv-save { border: 0; background: var(--brand); color: #fff; font-weight: 700; border-radius: 8px; padding: 0 14px; min-height: 34px; cursor: pointer; }
.rv-actions { display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.rv-cancel { flex: 0 0 auto; min-height: 46px; padding: 0 16px; border: 1px solid var(--line); background: #fff; border-radius: 12px; color: var(--text-2); font-weight: 600; cursor: pointer; }
.rv-send { flex: 1; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #2BB673, #10804F); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 6px 14px -6px rgba(16,128,79,.7); }
.rv-send:hover { filter: brightness(1.05); }
.rv-send:disabled { opacity: .7; }

/* adjuntos por enviar */
.pending { display: flex; gap: 8px; padding: 8px 14px; flex-wrap: wrap; align-items: center; background: #fff; border-top: 1px solid var(--line); }
.pending-hint { width: 100%; margin: 0; font-size: 12px; color: var(--muted); }
.pending .pitem { position: relative; }
.pending img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; display: block; }
.pending .paud { display: flex; align-items: center; gap: 6px; background: var(--brand-50); border-radius: 12px; padding: 4px 8px; }
.pending .paud audio { height: 36px; width: 200px; }
.pending .paud span { font-size: 12px; color: var(--muted); }
.pending .pitem > button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 11px; border: 0; background: var(--text); color: #fff; cursor: pointer; font-size: 11px; }

/* barra de grabación */
.recbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--danger-50); color: var(--danger); font-size: 14px; font-weight: 600; }
.recbar[hidden] { display: none; }
.recdot { width: 10px; height: 10px; border-radius: 5px; background: var(--danger); animation: blink 1s infinite; }
.rec-time { font-variant-numeric: tabular-nums; margin-right: auto; }
.rec-btn { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid #F3C9C4; background: #fff; color: var(--text-2); font-weight: 600; cursor: pointer; }
.rec-btn.solid { background: var(--danger); border-color: var(--danger); color: #fff; }

/* herramientas y caja de texto */
.cw-tools { display: flex; gap: 8px; padding: 10px 12px 0; background: #fff; border-top: 1px solid var(--line); }
.cw-tools[hidden] { display: none; }
.tool { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--brand-100); background: var(--brand-50); color: var(--brand-700); font-weight: 600; font-size: 13px; cursor: pointer; }
.tool:hover { background: var(--brand-100); }
.tool[hidden] { display: none; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; background: #fff; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.recbar:not([hidden]) + .cw-tools + .composer { border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-width: 0; resize: none; max-height: 120px; min-height: 44px; border: 1px solid #D5DBE5; border-radius: 22px; padding: 11px 16px; background: #F7F9FC; color: var(--text); line-height: 1.3; }
.composer textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; }
.send-btn { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 22px; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; }
.send-btn:disabled { opacity: .5; }

.viewer { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
.viewer::backdrop { background: rgba(0,0,0,.8); }
.viewer img { max-width: 96vw; max-height: 90vh; display: block; border-radius: 8px; }
.viewer button { position: fixed; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: #fff; font-size: 18px; cursor: pointer; }

/* etiquetas de área */
.area-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.a-blue { background: #E6EFFB; color: #24508F; } .dot.a-blue { background: #326AB7; }
.a-teal { background: #DFF5F2; color: #0B6B60; } .dot.a-teal { background: #13A493; }
.a-purple { background: #EFE9FB; color: #5B34A8; } .dot.a-purple { background: #7C4DDB; }
.a-orange { background: #FFF0DD; color: #A2550A; } .dot.a-orange { background: #F08C1A; }
.a-pink { background: #FCE7F1; color: #A3215E; } .dot.a-pink { background: #DB3D84; }
.dot.a-all { background: var(--brand-900); }
.area-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.area-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); }
.area-tabs a:hover { border-color: var(--brand-100); }
.area-tabs a[aria-current="page"] { border-color: var(--brand); color: var(--brand-900); box-shadow: 0 0 0 3px var(--brand-100); }
.area-tabs b { background: var(--bg); border-radius: 10px; padding: 0 8px; font-size: 12px; color: var(--text-2); }
.area-tabs .dot { width: 10px; height: 10px; border-radius: 5px; }
.auto-note { color: var(--muted); font-size: 12px; }

/* ---------- Panel del técnico ---------- */
.panel-main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.panel-main .card { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--card); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.card .stats .stat { background: var(--bg); box-shadow: none; }
.stat span { font-size: 13px; color: var(--muted); }
.stat strong { font-size: 28px; }
.stat .danger { color: var(--danger); }
.stat .ok { color: var(--ok); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.toolbar h1 { margin: 0; font-size: 20px; flex: 1; }
.toolbar label { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.c-prio { width: 1%; }
.tabs a { text-decoration: none; padding: 8px 14px; border-radius: 18px; border: 1px solid var(--line); color: var(--text-2); font-size: 14px; font-weight: 600; }
.tabs a[aria-current="page"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.search { display: flex; gap: 6px; flex-wrap: wrap; }
input, select, textarea { border: 1px solid #CBD3E0; border-radius: 8px; padding: 9px 11px; background: #fff; color: var(--text); min-height: 40px; }
.search input { width: 280px; max-width: 100%; }
.btn { min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid #CBD3E0; background: #fff; color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-700); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-row { display: flex; align-items: center; gap: 14px; padding: 14px 8px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; flex-wrap: wrap; border-radius: 8px; }
.ticket-row:hover { background: var(--brand-50); }
.t-main { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.t-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.prio { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; min-width: 72px; text-align: center; }
.prio-urgente { background: var(--danger); color: #fff; }
.prio-alta { background: var(--danger-50); color: var(--danger); }
.prio-media { background: var(--warn-50); color: var(--warn); }
.prio-baja { background: #EEF0F3; color: var(--muted); }
.flag { font-size: 12px; font-weight: 700; color: var(--danger); border: 1px solid var(--danger); border-radius: 10px; padding: 2px 8px; }
.flag.msg { color: var(--brand-700); border-color: var(--brand); background: var(--brand-50); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; }
.detail .card:first-child { grid-column: 1 / -1; }
.detail h1 { font-size: 22px; margin: 4px 0 8px; }
.detail h3 { font-size: 13px; margin: 16px 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert { background: var(--danger-50); color: var(--danger); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.alert.soft { background: var(--warn-50); color: var(--warn); }
.ficha { display: grid; gap: 10px; }
.ficha label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ficha .btn { justify-self: start; }
.desc { white-space: pre-wrap; margin: 0; }
.convo { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.cmsg { padding: 8px 12px; border-radius: 10px; background: var(--bg); max-width: 92%; }
.cmsg p { margin: 2px 0 0; white-space: pre-wrap; }
.cmsg.from-user { align-self: flex-end; background: var(--brand-50); }
.cmsg.from-tech { background: var(--ok-50); }
.cwho { font-size: 12px; font-weight: 700; color: var(--muted); }
.thumb { max-width: 220px; border-radius: 8px; margin-top: 6px; display: block; }
.reply { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.reply textarea { flex: 1; }
.table-wrap { overflow-x: auto; }
.table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
.table input:not([type=checkbox]) { width: 180px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid2 .card { margin: 0; }
.grid2 h2 { font-size: 16px; margin: 0 0 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 36px; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.bar-n { text-align: right; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .side { display: none; }
  .topbar { padding: 0 14px; height: 60px; }
  .topbar-logo { display: block; }
  .user-txt { display: none; }
  .btn-logout span { display: none; }
  .btn-logout { padding: 0; width: 44px; }
  .content { padding: 18px 14px 100px; }
  .page-head h1 { font-size: 24px; }
  .page-head .btn-primary, .page-head .btn-outline { display: none; }
  .kpis { gap: 12px; margin-bottom: 16px; }
  .kpi { min-height: 96px; padding: 14px 16px; }
  .kpi strong { font-size: 32px; }
  .kpi-bg { width: 72px; height: 72px; }
  .ai-card { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .ai-go { width: 100%; }
  /* tabla -> tarjetas */
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; width: 100%; }
  .dtable tr { border-top: 1px solid var(--line); padding: 12px 16px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
  .dtable tr[hidden] { display: none; }
  .dtable td { border: 0; padding: 0; }
  .dtable td.c-main { grid-column: 1 / -1; font-size: 15px; }
  .dtable td[data-l] { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .dtable td[data-l]::before { content: attr(data-l); font-size: 12px; color: var(--muted); font-weight: 600; min-width: 84px; }
  .dtable td[data-l] small { display: inline; }
  .dtable td.c-prio { width: auto; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--line); padding: 6px 8px max(6px, env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; min-height: 48px; justify-content: center; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; border-radius: 10px; }
  .bottomnav a[aria-current="page"] { color: var(--brand); }
  .bottomnav .bn-main { color: #2A1F00; background: var(--accent); }
  /* ventana de reporte a pantalla completa en el celular */
  .chatw { inset: 0; width: auto; height: 100dvh; border-radius: 0; transform: translateY(30px); }
  .cw-head { padding-top: max(14px, env(safe-area-inset-top)); }
  body.chat-open { overflow: hidden; }
  .chat-launch { display: none; }
  .panel-main { padding: 14px 10px 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .icon-btn.recording { animation: none; }
}
.avatar-ini.has-pic { background: none; overflow: hidden; }
.avatar-ini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.messages > * { flex-shrink: 0; }

/* ---------- Registrar ticket (técnicos) ---------- */
.head-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.flag.reg { color: #5B34A8; border-color: #C9B6F0; background: #F4EFFD; }
.reg-form { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.reg-card h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; color: var(--brand-900); margin: 0 0 14px; }
.reg-n { width: 28px; height: 28px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; }
.reg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.reg-grid label, .reg-block { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.reg-block { margin-bottom: 14px; }
.reg-grid small, .reg-block small { font-weight: 400; color: var(--muted); font-size: 12px; }
.reg-wide { grid-column: 1 / -1; }
.reg-form input:not([type=radio]):not([type=checkbox]), .reg-form select, .reg-form textarea { width: 100%; min-height: 44px; border-radius: 10px; }
.reg-canal { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reg-canal legend { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; padding: 0; }
.pill input, .sede-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; }
.pill input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.pill input:focus-visible + span, .sede-opt input:focus-visible + span { outline: 3px solid var(--brand-100); }
.reg-sedes { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sede-opt span { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; height: 100%; }
.sede-opt small { color: var(--muted); font-size: 12px; }
.sede-opt input:checked + span { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.reg-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.reg-actions .check { margin-right: auto; display: flex; align-items: center; gap: 8px; font-weight: 600; min-height: 44px; }
.reg-actions .check input { width: 20px; height: 20px; min-height: 0; }
@media (max-width: 900px) {
  .reg-grid, .reg-sedes { grid-template-columns: 1fr 1fr; }
  .head-btns { width: 100%; }
}
@media (max-width: 900px) { .page-head .head-btns .btn-primary { display: inline-flex; } }

/* =================== v1.4 =================== */
/* mensajes */
.toast { display: flex; align-items: center; gap: 12px; margin: 16px 28px 0; padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; animation: pop .2s ease-out; }
.toast.inline { margin: 0 0 16px; }
.toast button { margin-left: auto; border: 0; background: none; cursor: pointer; font-size: 14px; color: inherit; width: 32px; height: 32px; }
.toast-ok { background: var(--ok-50); color: var(--ok); border: 1px solid #BFE3CD; }
.toast-error { background: var(--danger-50); color: var(--danger); border: 1px solid #F3C9C4; }

/* avisos */
.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin-bottom: 14px; border: 1px solid; }
.aviso p { margin: 2px 0 0; }
.aviso small { margin-left: auto; color: var(--muted); white-space: nowrap; font-size: 12px; }
.aviso-ico { font-size: 22px; line-height: 1; }
.aviso-falla { background: #FFF4E5; border-color: #F7C98B; color: #6B3B00; }
.aviso-mantenimiento { background: #EEF2FF; border-color: #C7D2FE; color: #2B3A8C; }
.aviso-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-900); }
.aviso-row { align-items: center; margin: 0 0 10px; }
.aviso-row small { display: block; margin: 4px 0 0; white-space: normal; }
.aviso-row form { margin-left: auto; }
.aviso-strip { display: block; padding: 10px 16px; border-radius: 12px; background: #FFF4E5; border: 1px solid #F7C98B; color: #6B3B00; font-weight: 600; text-decoration: none; font-size: 14px; }
.cw-avisos { background: #FFF4E5; border-bottom: 1px solid #F7C98B; padding: 8px 14px; font-size: 13px; color: #6B3B00; display: flex; flex-direction: column; gap: 4px; }
.cw-avisos[hidden] { display: none; }

/* semáforo */
.sem-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px 3px 8px; border-radius: 12px; white-space: nowrap; }
.sem-chip i, .sem { width: 9px; height: 9px; border-radius: 5px; display: inline-block; }
.s-ok { background: var(--ok-50); color: var(--ok); } .s-ok i, .sem.ok { background: #22A06B; }
.s-warn { background: #FFF4E5; color: #9A5B00; } .s-warn i, .sem.warn { background: #F59F00; }
.s-late { background: var(--danger-50); color: var(--danger); } .s-late i, .sem.late { background: #E5484D; animation: blink 1.4s infinite; }
.s-done_ok { background: #EEF0F3; color: var(--muted); } .s-done_ok i { background: #22A06B; }
.s-done_late { background: #EEF0F3; color: var(--muted); } .s-done_late i { background: #E5484D; }
a.kpi { text-decoration: none; }
a.kpi:hover { filter: brightness(1.05); }

/* configuración */
.cfg { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.cfg-tabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 88px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
.cfg-tabs a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 10px; text-decoration: none; color: var(--text-2); font-weight: 600; }
.cfg-tabs a:hover { background: var(--bg); }
.cfg-tabs a[aria-current="page"] { background: var(--brand-50); color: var(--brand-900); box-shadow: inset 3px 0 0 var(--brand); }
.cfg-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cfg-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.blk { margin: 0; padding: 22px; }
.blk-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.blk-head h2 { margin: 0; font-size: 17px; color: var(--brand-900); }
.blk-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.blk-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.bi-blue { background: var(--brand-50); } .bi-teal { background: #DFF5F2; } .bi-purple { background: #EFE9FB; }
.bi-orange { background: #FFF0DD; } .bi-red { background: var(--danger-50); } .bi-green { background: var(--ok-50); }
.bi-navy { background: #E3E9F3; } .bi-gray { background: #EEF0F3; }
.blk-form { display: flex; flex-direction: column; gap: 12px; }
.blk-form label, .add-row label, .row2 label, .row3 label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.blk-form small, .add-row small { font-weight: 400; color: var(--muted); font-size: 12px; }
.blk input:not([type=checkbox]):not([type=radio]), .blk select, .blk textarea { width: 100%; min-height: 44px; border-radius: 10px; }
.blk-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.blk-actions.left { justify-content: flex-start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.add-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.add-row .grow { flex: 1 1 260px; }
.add-row > button, .add-row > .btn-primary { min-height: 44px; }
.sub-h { font-size: 14px; margin: 10px 0 0; color: var(--brand-900); }
.state { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.st-on { background: var(--ok-50); color: var(--ok); }
.st-off { background: #FFF4E5; color: #9A5B00; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.link-btn { display: inline-flex; margin-top: 14px; font-weight: 700; text-decoration: none; min-height: 44px; align-items: center; }
.guide { background: var(--bg); border-radius: 12px; padding: 4px 16px; margin-bottom: 14px; font-size: 14px; }
.guide summary { cursor: pointer; font-weight: 700; color: var(--brand); min-height: 40px; display: flex; align-items: center; }
.guide ol { margin: 4px 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.guide code { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; word-break: break-all; }

/* interruptores */
.sw-row { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.sw-txt { display: flex; flex-direction: column; gap: 2px; }
.sw-txt strong { color: var(--text); font-size: 15px; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; display: inline-block; }
.switch.sm { width: 42px; height: 24px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; min-height: 0 !important; }
.slider { position: absolute; inset: 0; background: #CBD3E0; border-radius: 14px; transition: background .2s; }
.slider::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch.sm .slider::after { width: 18px; height: 18px; }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch.sm input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 3px solid var(--brand-100); }

/* listas de grupos / destinatarios */
.glist, .dlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.glist li, .dlist li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.glist li:first-child, .dlist li:first-child { border-top: 0; }
.g-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g-main small { color: var(--muted); font-size: 12px; }
.g-tipo select, .d-opts select { min-height: 38px !important; width: auto !important; }
.d-opts { display: flex; align-items: center; gap: 12px; }
.x-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.x-btn:hover { color: var(--danger); border-color: #F3C9C4; background: var(--danger-50); }
.gg { margin-top: 14px; }
.gg summary { cursor: pointer; font-weight: 700; color: var(--brand); min-height: 40px; display: flex; align-items: center; }
.gg-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.gg-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); }
.gg-list li:first-child { border-top: 0; }
.gg-list span:first-child { display: flex; flex-direction: column; }
.gg-list small { color: var(--muted); font-size: 12px; }
.tag-ok { color: var(--ok); font-weight: 700; font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sub h3 { margin: 0; font-size: 15px; color: var(--brand-900); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.chipf { display: contents; }
.echip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border-radius: 16px; background: var(--brand-50); color: var(--brand-900); font-size: 13px; font-weight: 600; }
.echip button { width: 26px; height: 26px; border-radius: 13px; border: 0; background: rgba(0,0,0,.06); cursor: pointer; font-size: 11px; color: inherit; }
.echip button:hover { background: var(--danger); color: #fff; }
.chip-ok { background: var(--ok-50); color: var(--ok); }
.chip-no { background: var(--danger-50); color: var(--danger); }
.bulk { display: flex; gap: 8px; align-items: flex-end; }
.bulk textarea { flex: 1; min-height: 44px !important; resize: vertical; }
.steps-h { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.steps-h div { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border-radius: 12px; padding: 12px; font-size: 14px; }
.steps-h > div > b { width: 26px; height: 26px; border-radius: 13px; background: var(--brand); color: #fff; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; }
.found { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.found-row { display: flex; align-items: center; gap: 10px; flex-direction: row !important; }
.found-row input[type=checkbox] { width: 20px; height: 20px; }
.found-row input:not([type=checkbox]) { max-width: 280px; }
.found-row small { color: var(--muted); }
.sla-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sla-card { border-radius: 14px; padding: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.sla-card > span:first-child { font-weight: 800; font-size: 15px; }
.sla-card small { color: var(--muted); font-weight: 400; }
.sla-in { display: flex; align-items: center; gap: 8px; }
.sla-in input { font-size: 22px; font-weight: 800; text-align: center; }
.p-urg { background: #FDECEA; border-color: #F3C9C4; } .p-urg > span:first-child { color: var(--danger); }
.p-alta { background: #FFF4E5; border-color: #F7C98B; } .p-alta > span:first-child { color: #9A5B00; }
.p-med { background: #FFFBE6; border-color: #F1DFAE; } .p-med > span:first-child { color: #7A5600; }
.p-baja { background: #EEF0F3; } .p-baja > span:first-child { color: var(--muted); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* perfiles */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.role-card { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.role-card > span { font-size: 24px; }
.role-card div { flex: 1; display: flex; flex-direction: column; }
.role-card small { color: var(--muted); font-size: 12.5px; }
.role-card > b { font-size: 26px; color: var(--brand-900); }
.r-admin { border-left: 4px solid var(--accent); } .r-tech { border-left: 4px solid var(--brand); } .r-user { border-left: 4px solid #A9B6CA; }
.rbadge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; background: var(--accent-50); color: #7A5600; }
.rsel { font-weight: 700; min-height: 38px; }
.rs-admin { background: var(--accent-50); color: #7A5600; }
.rs-tech { background: var(--brand-50); color: var(--brand-700); }
.utable input:not([type=checkbox]), .utable select { min-height: 38px; width: 100%; min-width: 120px; }
.utable .in-name { font-weight: 600; min-width: 180px; }
.utable td { vertical-align: middle; }
.utable tr[hidden] { display: none; }
.card-head .search input { min-width: 260px; }

@media (max-width: 1100px) {
  .cfg { grid-template-columns: 1fr; }
  .cfg-tabs { position: static; flex-direction: row; overflow-x: auto; }
  .cfg-tabs a { white-space: nowrap; }
  .sla-grid { grid-template-columns: repeat(2, 1fr); }
  .cfg-cols, .roles { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .row2, .row3, .two, .steps-h { grid-template-columns: 1fr; }
  .toast { margin: 12px 14px 0; }
  .d-opts { flex-wrap: wrap; }
  .glist li, .dlist li { flex-wrap: wrap; }
}

/* informes POI y cierre técnico */
.poi-blk { margin-bottom: 16px; }
.poi-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.poi-form label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.poi-btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.poi-btn { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 14px 18px; border-radius: 14px; border: 1.5px solid var(--brand-100); background: var(--brand-50); cursor: pointer; color: var(--brand-900); }
.poi-btn:hover { border-color: var(--brand); background: #fff; box-shadow: var(--shadow-lg); }
.poi-btn span { grid-row: 1 / 3; font-size: 28px; }
.poi-btn b { font-size: 16px; }
.poi-btn small { color: var(--muted); }
.cierre { border: 1.5px solid var(--brand-100); }
.cierre-form .tareas { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cierre-form .tareas legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; padding: 0; }
.cierre-form .btn.primary { justify-self: stretch; min-height: 46px; justify-content: center; }
@media (max-width: 720px) { .poi-form, .poi-btns { grid-template-columns: 1fr; } }
