/* Casher Helpdesk — Copyright (c) Casher Group. Todos los derechos reservados. */
/* Roboto (Google Fonts, licencia Apache 2.0) alojada localmente: no se cargan recursos externos */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/roboto-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/roboto-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("/static/fonts/roboto-700.woff2") format("woff2"); }
:root {
  color-scheme: light;
  --bg: #f6f6f7; --surface: #ffffff; --surface-2: #f3f3f5; --hover: #f0f0f3; --line: #e5e5e9; --line-2: #d4d4da;
  --text: #111116; --text-2: #3b3b44; --muted: #6c6c76; --faint: #9a9aa3;
  --brand: #000066; --brand-2: #1c1c85; --brand-ink: #ffffff; --brand-tint: #ececf6; --link: #22329a;
  --good: #146c43; --good-bg: #e8f3ec; --warn: #8a5a00; --warn-bg: #fbf1dc; --bad: #b3261e; --bad-bg: #fbeae8; --info: #1f4fb8; --info-bg: #e9eef9;
  --serious: #b4470f; --neutral-bg: #efeff2;
  --series-1: #2a78d6; --series-2: #1baf7a;
  --radius: 6px; --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --shadow-pop: 0 10px 30px rgba(17,17,22,.12), 0 1px 3px rgba(17,17,22,.08);
  --logo-filter: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0e11; --surface: #16161a; --surface-2: #1c1c21; --hover: #222228; --line: #2a2a31; --line-2: #3a3a43;
    --text: #f2f2f4; --text-2: #cfcfd6; --muted: #9a9aa5; --faint: #6c6c76;
    --brand: #7f9cff; --brand-2: #9db3ff; --brand-ink: #0b0b1e; --brand-tint: #1b2040; --link: #9db3ff;
    --good: #5fd39a; --good-bg: #10261b; --warn: #f0b84a; --warn-bg: #2a2110; --bad: #ff8a80; --bad-bg: #2e1514; --info: #8fb0ff; --info-bg: #17203a;
    --serious: #ffa36b; --neutral-bg: #24242a;
    --series-1: #3987e5; --series-2: #199e70;
    --shadow-pop: 0 10px 30px rgba(0,0,0,.5);
    --logo-filter: invert(1);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e11; --surface: #16161a; --surface-2: #1c1c21; --hover: #222228; --line: #2a2a31; --line-2: #3a3a43;
  --text: #f2f2f4; --text-2: #cfcfd6; --muted: #9a9aa5; --faint: #6c6c76;
  --brand: #7f9cff; --brand-2: #9db3ff; --brand-ink: #0b0b1e; --brand-tint: #1b2040; --link: #9db3ff;
  --good: #5fd39a; --good-bg: #10261b; --warn: #f0b84a; --warn-bg: #2a2110; --bad: #ff8a80; --bad-bg: #2e1514; --info: #8fb0ff; --info-bg: #17203a;
  --serious: #ffa36b; --neutral-bg: #24242a;
  --series-1: #3987e5; --series-2: #199e70;
  --shadow-pop: 0 10px 30px rgba(0,0,0,.5);
  --logo-filter: invert(1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; color: var(--text); }
h1 { font-size: 21px; font-weight: 500; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 500; }
h3 { font-size: 13.5px; font-weight: 500; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.logo { display: block; height: 22px; width: auto; filter: var(--logo-filter); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Estructura ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px 18px 16px; border-bottom: 1px solid var(--line); text-align: center; }
.side-brand .logo { height: 24px; }
.side-brand span { font-size: 10.5px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; line-height: 1.2; }
.nav { padding: 8px 10px 12px; overflow-y: auto; flex: 1; }
.nav-sec { font-size: 11px; font-weight: 600; color: var(--faint); padding: 14px 8px 4px; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius); color: var(--text-2); font-size: 13.5px; position: relative; }
.nav a svg { color: var(--muted); }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a.active { background: var(--brand-tint); color: var(--text); font-weight: 600; }
.nav a.active svg { color: var(--brand); }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a .count.alert { color: var(--bad); font-weight: 600; }
.nav a .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.side-user { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.side-user .who { flex: 1; min-width: 0; }
.side-user .who a { color: var(--text); font-weight: 600; font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { font-size: 11px; color: var(--faint); padding: 0 12px 10px; line-height: 1.4; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.content { padding: 24px; width: 100%; max-width: 1400px; margin: 0 auto; min-width: 0; flex: 1; }
.page-foot { padding: 14px 24px; font-size: 11.5px; color: var(--faint); border-top: 1px solid var(--line); display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 220px; }
.page-head p { margin-top: 4px; color: var(--muted); }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumb a { color: var(--muted); }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 480px; }
.search input { width: 100%; padding-left: 32px; background: var(--surface-2); border-color: transparent; }
.search input:focus { background: var(--surface); }
.search > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 6px; max-height: 420px; overflow: auto; z-index: 40; }
.pop .grp { font-size: 11px; color: var(--faint); padding: 8px 8px 4px; font-weight: 600; }
.pop a { display: block; padding: 6px 8px; border-radius: 5px; color: var(--text); }
.pop a:hover { background: var(--hover); text-decoration: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

/* ---------- Controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.rel { position: relative; }
.badge-n { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
input, select, textarea { font: 14px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 10px; outline: none; width: 100%; }
input, select { height: 34px; }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; accent-color: var(--brand); }
textarea { padding: 8px 10px; resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nw { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13.5px; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 12.5px; cursor: pointer; }
.days label:has(input:checked) { background: var(--brand-tint); border-color: var(--brand); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 4px; margin: 0 0 14px; }
legend { font-size: 12.5px; font-weight: 600; padding: 0 6px; color: var(--text-2); }

/* ---------- Superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 48px; }
.card-h .grow { flex: 1; }
.card-b { padding: 16px; }
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mb { margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; }
.stat { padding: 14px 18px; border-right: 1px solid var(--line); display: block; color: inherit; min-width: 0; }
.stat:last-child { border-right: none; }
a.stat:hover { background: var(--hover); text-decoration: none; }
.stat .l { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font-size: 24px; font-weight: 500; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v.bad { color: var(--bad); }
.stat .s { font-size: 12px; color: var(--muted); }

/* ---------- Etiquetas de estado ---------- */
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 20px; }
.st-nuevo { color: var(--info); background: var(--info-bg); }
.st-abierto { color: var(--info); background: var(--info-bg); }
.st-en_progreso { color: var(--warn); background: var(--warn-bg); }
.st-en_espera { color: var(--muted); background: var(--neutral-bg); }
.st-resuelto { color: var(--good); background: var(--good-bg); }
.st-cerrado { color: var(--muted); background: var(--neutral-bg); }
.b-good { color: var(--good); background: var(--good-bg); } .b-bad { color: var(--bad); background: var(--bad-bg); } .b-warn { color: var(--warn); background: var(--warn-bg); } .b-neutral { color: var(--muted); background: var(--neutral-bg); } .b-info { color: var(--info); background: var(--info-bg); }
.pr { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; color: var(--text-2); }
.pr i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.pr-urgente i { background: var(--bad); } .pr-alta i { background: var(--serious); } .pr-media i { background: #c99a1a; } .pr-baja i { background: var(--faint); }
.pr-urgente { color: var(--bad); font-weight: 600; }
.sla { font-size: 12.5px; white-space: nowrap; }
.sla-vencido, .sla-incumplido { color: var(--bad); font-weight: 600; } .sla-por_vencer { color: var(--serious); font-weight: 600; } .sla-en_plazo, .sla-cumplido { color: var(--good); }
.tag { display: inline-block; padding: 0 7px; border-radius: 4px; background: var(--neutral-bg); font-size: 11.5px; color: var(--text-2); margin: 0 4px 4px 0; line-height: 20px; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: 4px; line-height: 18px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 11px; color: #fff; flex: none; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }

/* ---------- Tablas ---------- */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: none; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--hover); }
table.t .r { text-align: right; font-variant-numeric: tabular-nums; }
.t-wrap { overflow-x: auto; }
.subj { font-weight: 600; color: var(--text); }
.subj small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 1px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 10px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--brand); }
.empty { padding: 44px 16px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.toolbar select, .toolbar input { width: auto; min-width: 140px; height: 30px; font-size: 13px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--brand-tint); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bulkbar select { width: auto; height: 30px; }

/* ---------- Gráficos ---------- */
.chart { width: 100%; display: block; }
.chart text { fill: var(--muted); font: 11px var(--font); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.hbar { display: grid; grid-template-columns: minmax(90px, 170px) 1fr 52px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.hbar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .track { height: 8px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.meter div { height: 100%; background: var(--brand); border-radius: 0 3px 3px 0; }
.meter.over div { background: var(--bad); }
.tooltip { position: fixed; pointer-events: none; z-index: 100; background: #111116; color: #f2f2f4; padding: 6px 9px; border-radius: 5px; font-size: 12px; line-height: 1.45; white-space: pre; box-shadow: var(--shadow-pop); }

/* ---------- Ticket ---------- */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 16px; align-items: start; }
.thread { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.msg { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: none; }
.msg.internal { background: var(--warn-bg); }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; }
.msg-head b { font-weight: 600; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.att { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 6px 0 0; font-size: 12.5px; color: var(--text); background: var(--surface); }
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-top: 16px; }
.composer .ctabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 6px; }
.composer .ctabs button { background: none; border: none; padding: 10px 10px; font: 500 13px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.composer .ctabs button.active { color: var(--text); border-bottom-color: var(--brand); }
.composer .ctabs button.active.note { border-bottom-color: var(--warn); }
.composer textarea { border: none; border-radius: 0; min-height: 120px; box-shadow: none !important; }
.composer.note textarea { background: var(--warn-bg); }
.composer .cfoot { display: flex; gap: 8px; align-items: center; padding: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.composer .cfoot select { width: auto; height: 30px; font-size: 13px; }
.props .prop { margin-bottom: 12px; }
.props .prop label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.props select, .props input { height: 32px; font-size: 13px; }
.kv { display: grid; grid-template-columns: 112px 1fr; gap: 6px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 5px 0 5px 14px; border-left: 2px solid var(--line); position: relative; font-size: 12.5px; }
.notice { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; display: flex; gap: 8px; align-items: flex-start; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.info { background: var(--info-bg); color: var(--info); }
.notice svg { margin-top: 2px; }

/* ---------- Chat ---------- */
.chat { display: grid; grid-template-columns: 210px minmax(0, 1fr); height: calc(100vh - 56px - 48px - 46px); min-height: 440px; }
.chat-list { border-right: 1px solid var(--line); padding: 10px; overflow-y: auto; }
.chat-list a { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-radius: var(--radius); color: var(--text-2); }
.chat-list a.active { background: var(--brand-tint); color: var(--text); font-weight: 600; }
.chat-list a:hover { background: var(--hover); text-decoration: none; }
.chat-list a .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cmsg { display: flex; gap: 10px; padding: 5px 0; }
.cmsg .who { font-weight: 600; margin-right: 6px; }
.cmsg .txt { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.cmsg.cont { padding-top: 0; }
.cmsg.cont .avatar { visibility: hidden; height: 0; }
.chat-day { text-align: center; font-size: 11.5px; color: var(--faint); margin: 10px 0; }
.chat-input { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.chat-input textarea { min-height: 38px; height: 38px; }
.mention { color: var(--link); font-weight: 600; }

/* ---------- Capas ---------- */
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); z-index: 50; }
.dropdown .dh { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dropdown .list { max-height: 420px; overflow-y: auto; }
.notif { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.notif:hover { background: var(--hover); text-decoration: none; }
.notif.unread { border-left: 3px solid var(--brand); padding-left: 11px; }
.notif b { display: block; font-weight: 600; font-size: 13px; }
.notif span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-bg { position: fixed; inset: 0; background: rgba(10,10,14,.45); display: grid; place-items: center; z-index: 80; padding: 16px; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
.modal.wide { max-width: 780px; }
.modal-h { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h2 { flex: 1; }
.modal-b { padding: 18px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 120; }
.toast { background: #111116; color: #f2f2f4; padding: 10px 14px; border-radius: 6px; box-shadow: var(--shadow-pop); font-size: 13px; max-width: 360px; }
.toast.err { background: var(--bad); color: #fff; }

/* ---------- Contenido ---------- */
.kb-item { display: block; padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.kb-item:last-child { border-bottom: none; }
.kb-item:hover { background: var(--hover); text-decoration: none; }
.kb-item p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.article { white-space: pre-wrap; line-height: 1.7; color: var(--text-2); font-size: 15px; max-width: 760px; }
.stars { display: flex; gap: 6px; }
.stars button { background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; width: 40px; height: 36px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.stars button.on { color: var(--brand-ink); border-color: var(--brand); background: var(--brand); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; font-family: var(--mono); font-size: 14px; background: var(--surface-2); border-radius: 6px; padding: 14px 18px; margin: 12px 0; }
.qr { width: 200px; height: 200px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.plan-card { display: flex; flex-direction: column; }
.plan-card .price { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.plan-card ul { padding-left: 18px; margin: 8px 0 0; color: var(--text-2); font-size: 13px; }
.plan-card li { margin-bottom: 3px; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: #000066; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; overflow: hidden; text-align: center; }
.auth-side { background: radial-gradient(90% 70% at 50% 42%, #14209a 0%, #000066 48%, #00003a 100%); }
.auth-side #authNet { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: .75; }
.auth-side::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 45% at 50% 45%, rgba(0,0,60,.55) 0%, rgba(0,0,60,0) 70%); }
.auth-side .center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; }
.logo-stage { position: relative; display: grid; place-items: center; margin-bottom: 30px; }
.logo-stage .logo { height: 46px; width: auto; filter: invert(1); }
.auth-mobile-logo.logo { width: auto; margin-left: auto; margin-right: auto; }
.auth-side h2 { color: #fff; font-size: clamp(15px, 1.55vw, 23px); font-weight: 500; line-height: 1.3; white-space: nowrap; letter-spacing: -.005em; }
.auth-side p { color: rgba(255,255,255,.72); margin-top: 12px; max-width: 420px; line-height: 1.6; }
.auth-side .copy { color: rgba(255,255,255,.5); padding: 0; position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; z-index: 1; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 48px; background: var(--surface); }
.auth-box { width: 100%; max-width: 380px; margin: 0 auto; }
.auth-box h1 { font-size: 22px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 22px; }
.auth-box .btn.primary { width: 100%; height: 40px; }
.err-box { background: var(--bad-bg); color: var(--bad); border-radius: 6px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.ok-box { background: var(--good-bg); color: var(--good); border-radius: 6px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; height: 48px; }
.auth-mobile-logo { display: none; margin-bottom: 28px; }

/* ---------- Portal ---------- */
.portal-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.portal-top .inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 20px; }
.portal-top nav { display: flex; gap: 2px; }
.portal-top nav a { padding: 6px 10px; border-radius: var(--radius); color: var(--text-2); white-space: nowrap; }
.portal-top nav a.active { color: var(--text); font-weight: 600; background: var(--brand-tint); }
.portal-top nav a:hover { background: var(--hover); text-decoration: none; }
.portal-main { max-width: 1080px; margin: 0 auto; padding: 28px 20px; width: 100%; }
.portal-foot { max-width: 1080px; margin: 0 auto; padding: 20px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.welcome { padding: 28px; margin-bottom: 16px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.welcome h1 { font-size: 24px; }
.welcome p { color: var(--muted); margin-top: 6px; }

/* ---------- Carga inicial (marca Casher) ---------- */
.boot { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; transition: opacity .4s ease, visibility .4s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.boot .logo { height: 26px; animation: breathe 2.2s ease-in-out infinite; }
.boot .loader { width: 76px; height: 76px; }
.boot .loader .core { inset: 19px; }
.loader { position: relative; width: 56px; height: 56px; }
.loader svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.loader .track { fill: none; stroke: var(--line); stroke-width: 3; }
.loader .arc { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 38 113; transform-origin: 50% 50%; animation: spin 1s cubic-bezier(.55,.15,.45,.85) infinite; }
.loader .arc2 { stroke: var(--series-1); stroke-dasharray: 14 137; animation-duration: 1.6s; animation-direction: reverse; opacity: .7; }
.loader .core { position: absolute; inset: 15px; display: grid; place-items: center; animation: pulse 1.6s ease-in-out infinite; }
.loader .core img { width: 100%; height: 100%; object-fit: contain; filter: var(--logo-filter); }
.boot-text { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.86); } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.page-loader { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 80px 16px; color: var(--muted); font-size: 13px; }
.page-loader .loader { width: 40px; height: 40px; }
.page-loader .loader .core { inset: 11px; }

/* ---------- Cabecera animada del Resumen (red de conexiones de fondo) ---------- */
.hero-band { position: relative; overflow: hidden; border-radius: 10px; margin-bottom: 16px; min-height: 168px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #1a2a9c 0%, #000066 45%, #00003d 100%); }
.hero-band canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-band::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,40,.55) 0%, rgba(0,0,40,.15) 55%, rgba(0,0,40,0) 100%); }
.hero-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 24px; padding: 26px 28px; flex-wrap: wrap; min-height: 168px; }
.hero-content .grow { min-width: 240px; }
.hero-content h1 { color: #fff; font-size: 24px; font-weight: 500; letter-spacing: -.01em; }
.hero-content p { color: rgba(255,255,255,.72); margin-top: 6px; }
.hero-content .live { color: rgba(255,255,255,.85); font-size: 12.5px; margin-bottom: 8px; }
.hero-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-kpi { min-width: 128px; padding: 12px 16px; border-radius: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; text-decoration: none !important; transition: background .2s ease; }
a.hero-kpi:hover { background: rgba(255,255,255,.14); }
.hero-kpi .l { font-size: 12px; color: rgba(255,255,255,.7); }
.hero-kpi .v { font-size: 26px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-kpi .v.alert { color: #ffb4ab; }

/* ---------- Barra de progreso superior ---------- */
#nprog { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 150; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--brand), var(--series-1)); box-shadow: 0 0 10px color-mix(in srgb, var(--series-1) 60%, transparent);
  transition: width .3s ease, opacity .35s ease; }
#nprog.on { opacity: 1; }

/* ---------- Animaciones de entrada ---------- */
.enter .rise { animation: rise .55s cubic-bezier(.2,.75,.2,1) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.enter .hbar .fill, .enter .meter div { animation: grow 1s cubic-bezier(.2,.75,.2,1) both; animation-delay: .3s; transform-origin: left center; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.enter .chart .line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.5s cubic-bezier(.4,.1,.2,1) .25s forwards; }
.enter .chart .grid-l { animation: fade .6s ease both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.live { display: inline-flex; align-items: center; gap: 7px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); position: relative; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: .6; } to { transform: scale(2.8); opacity: 0; } }
.stat, .card { transition: border-color .2s ease, box-shadow .2s ease; }
a.stat:hover, .card.hoverable:hover { box-shadow: 0 4px 14px rgba(17,17,22,.06); }
.auth-box { animation: rise .6s cubic-bezier(.2,.75,.2,1) both; }
.auth-side .center > * { animation: rise .7s cubic-bezier(.2,.75,.2,1) both; }
.auth-side .center > *:nth-child(2) { animation-delay: .12s; }
.auth-side .center > *:nth-child(3) { animation-delay: .22s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .enter .chart .line { stroke-dasharray: none; stroke-dashoffset: 0; }
}

@media print {
  .sidebar, .topbar, .noprint { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card { break-inside: avoid; }
}
@media (max-width: 1100px) {
  .ticket-layout, .g-21 { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .content { padding: 16px; }
  .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .chat { grid-template-columns: minmax(0, 1fr); height: auto; }
  .chat-list { border-right: none; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; }
  .chat-msgs { max-height: 60vh; }
  .hide-sm { display: none !important; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-main { padding: 32px 20px; }
  .auth-mobile-logo { display: block; }
  .welcome { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .portal-top .inner { gap: 8px; padding: 0 12px; }
  .portal-top nav a { padding: 6px 7px; font-size: 13px; }
  .stat { border-right: none; border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 96px 1fr; }
  .portal-top .logo { height: 18px; }
}
