/* ===========================================================================
   Centro de Soporte · Dato Estratégico
   Navy #0d2b4e · cian #00d4ff · Outfit (títulos) + Inter + JetBrains Mono
   Diseño: Figma "Centro de Soporte" (19-oct-2026)
   =========================================================================== */
:root {
  --navy: #0d2b4e;
  --navy-2: #12365f;
  --ink: #0f1b2d;
  --ink-2: #23344a;
  --ink-3: #33465e;
  --muted: #5b6b82;
  --soft: #8a9aae;
  --faint: #b5c2d0;
  --line: #dce4ec;
  --line-2: #edf1f5;
  --input: #cfd9e4;
  --bg: #f4f7fa;
  --bg-2: #f7f9fb;
  --surface: #ffffff;
  --cyan: #00d4ff;
  --cyan-d: #00b8db;
  --cyan-soft: #e3f5fb;
  --cyan-ink: #0a6e9a;
  --link: #0a7ea4;
  --ok: #16794a;
  --ok-soft: #e3f6ec;
  --warn: #b45309;
  --warn-ink: #9a6700;
  --warn-soft: #fbf3db;
  --violet: #6d28d9;
  --violet-soft: #f1ecfd;
  --danger: #d92d20;
  --danger-soft: #fff4f3;
  --note: #fff8e6;
  --note-line: #f3dfa6;

  --f-display: "Outfit", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r: 12px;
  --r-sm: 8px;
  --shadow-pop: 0 12px 32px -8px rgba(13, 43, 78, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
button { font: inherit; }
.mono { font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: 0; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cyan-d); outline-offset: 2px; }

/* ----------------------------------------------------------------------------
   Layout del panel (equipo de soporte)
   ------------------------------------------------------------------------- */
.panel { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--navy) 248px, var(--bg) 248px); }
.side {
  background: var(--navy);
  color: #fff;
  padding: 28px 20px 24px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { padding-left: 8px; display: grid; gap: 12px; }
.side-brand img { width: 168px; height: auto; }
.side-kicker { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #7fe7ff; }
.side-nav { margin-top: 32px; display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: #b9c8da; font-size: 14px; text-decoration: none;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.side-nav a .l { display: flex; align-items: center; gap: 10px; }
.side-nav a .l::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.2); }
.side-nav a .n { font-size: 12px; font-weight: 500; color: #7c90aa; }
.side-nav a .n.hot { color: var(--navy); background: var(--cyan); border-radius: 999px; padding: 1px 7px; font-weight: 600; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav a.on { background: rgba(255,255,255,.08); color: #fff; font-weight: 600; }
.side-nav a.on .l::before { background: var(--cyan); }
.side-nav a.on .n { color: #7fe7ff; }
.side-me {
  display: flex; align-items: center; gap: 10px;
  padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12);
}
.side-me .who { min-width: 0; }
.side-me .who a, .side-me .who button { color: #7c90aa; font-size: 12px; background: none; border: 0; padding: 0; cursor: pointer; }
.side-me .who a:hover, .side-me .who button:hover { color: #fff; text-decoration: underline; }
.side-me .name { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { padding: 36px 44px 56px; min-width: 0; }
.main-inner { max-width: 1280px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.portal-main { grid-template-columns: minmax(0, 1fr); }

/* ----------------------------------------------------------------------------
   Layout del portal (usuarios de los clientes)
   ------------------------------------------------------------------------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.topbar .brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.topbar .brand img { width: 140px; height: auto; }
.topbar .brand .sep { width: 1px; height: 32px; background: var(--line); }
.topbar .brand span { font-size: 14px; font-weight: 600; color: var(--navy); }
.topnav { display: flex; align-items: center; gap: 24px; }
.topnav > a { font-size: 14px; font-weight: 500; color: var(--muted); }
.topnav > a.on { color: var(--navy); font-weight: 600; }
.topnav > a:hover { color: var(--navy); text-decoration: none; }
.me { display: flex; align-items: center; gap: 10px; }
.me .who { display: grid; line-height: 1.25; }
.me .who b { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.me .who small { font-size: 12px; color: var(--soft); }
.me form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font-size: 13px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.portal-main { max-width: 1040px; margin: 0 auto; padding: 40px 24px 64px; display: grid; gap: 24px; }

/* ----------------------------------------------------------------------------
   Piezas comunes
   ------------------------------------------------------------------------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.head .eyebrow { font-size: 13px; font-weight: 500; color: var(--soft); margin-bottom: 4px; }
.title { font-family: var(--f-display); font-weight: 500; font-size: 34px; letter-spacing: -.02em; color: var(--navy); }
.title-sm { font-family: var(--f-display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; color: var(--navy); }
.lead { font-size: 15px; color: var(--muted); margin-top: 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--faint); }
.crumbs a { font-weight: 500; }
.crumbs .mono { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--input); font-weight: 500; }
.btn-ghost:hover { border-color: var(--soft); }
.btn-ok { background: var(--surface); color: var(--ok); border-color: var(--ok); }
.btn-ok:hover { background: var(--ok-soft); }
.btn-lg { padding: 13px 20px; font-size: 15px; border-radius: 10px; }
.btn-sm { padding: 6px 10px; font-size: 12px; font-weight: 500; }
.btn-block { width: 100%; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.pad { padding: 20px; }
.pad-lg { padding: 24px; }
.label-up { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--line-2); color: var(--ink-3);
  font-size: 12px; font-weight: 600;
}
.avatar.cyan { background: var(--cyan); color: var(--navy); }
.avatar.soft { background: var(--cyan-soft); color: var(--cyan-ink); }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }

.flashes { display: grid; gap: 8px; }
.flash {
  padding: 12px 16px; border-radius: var(--r-sm); font-size: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  display: flex; gap: 10px; align-items: flex-start;
}
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--cyan-d); }
.flash-success { border-color: #b7e4ca; background: #f3fbf6; }
.flash-success::before { background: var(--ok); }
.flash-error { border-color: #f5c2bd; background: var(--danger-soft); }
.flash-error::before { background: var(--danger); }
.flash-warning { border-color: var(--note-line); background: var(--note); }
.flash-warning::before { background: var(--warn); }

/* KPIs en una sola franja */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.kpi { padding: 20px 24px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .num { font-family: var(--f-display); font-size: 40px; line-height: 46px; color: var(--navy); }
.kpi .num.danger { color: var(--danger); }
.kpi .num.ok { color: var(--ok); }
.kpi .lbl { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.kpi .sub { font-size: 12px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub a { color: inherit; }

/* Filtros */
.filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: #e6ecf2; flex-wrap: wrap; }
.seg a {
  display: inline-flex; gap: 8px; align-items: center;
  padding: 8px 14px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none;
}
.seg a span { font-size: 12px; color: var(--soft); }
.seg a.on { background: var(--surface); color: var(--navy); font-weight: 600; box-shadow: 0 1px 2px rgba(13,43,78,.08); }
.seg a:hover:not(.on) { color: var(--navy); }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-form input[type=search] { width: 260px; }
.filter-form select { width: auto; min-width: 170px; max-width: 240px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills a {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); text-decoration: none;
}
.pills a.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Formularios */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel],
select, textarea {
  width: 100%;
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--input); border-radius: var(--r-sm);
  padding: 10px 12px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a9aae' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--soft); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan-d); box-shadow: 0 0 0 3px rgba(0, 184, 219, .15); }
.field { display: grid; gap: 0; }
.fields { display: grid; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.help { font-size: 12px; color: var(--soft); margin-top: 6px; }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger); font-size: 12px; font-weight: 500; }

/* Opciones tipo chip (radio) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips > div { display: contents; }
.chips label { margin: 0; }
.chips input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.chips label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--input); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink-3); cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.chips label:hover { border-color: var(--soft); }
.chips label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.chips label:has(input:focus-visible) { outline: 2px solid var(--cyan-d); outline-offset: 2px; }

/* Radios en lista */
.radios > div { display: grid; gap: 8px; }
.radios label { display: flex; gap: 10px; align-items: center; margin: 0; font-weight: 400; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.radios input[type=radio] { accent-color: var(--navy); width: 16px; height: 16px; margin: 0; }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: #f0fafd; margin: 0; font-weight: 400; font-size: 13px; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--navy); width: 16px; height: 16px; margin: 0; }

/* Zona para subir capturas */
.drop { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.drop .thumb {
  width: 84px; height: 84px; border-radius: 10px; overflow: hidden; position: relative;
  background: var(--line-2); border: 1px solid var(--line);
}
.drop .thumb img { width: 100%; height: 100%; object-fit: cover; }
.drop .thumb .fname {
  position: absolute; inset: auto 0 0 0; padding: 3px 5px;
  font-size: 9px; color: #fff; background: rgba(13,43,78,.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drop .thumb.file { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); padding: 6px; text-align: center; word-break: break-all; }
.drop .add {
  width: 84px; height: 84px; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1.5px dashed var(--cyan-d); border-radius: 10px; background: #f0fafd;
  color: var(--link); font-size: 11px; font-weight: 500; cursor: pointer;
}
.drop .add b { font-size: 22px; font-weight: 400; line-height: 1; }
.drop .add:hover { background: var(--cyan-soft); }
.drop input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop.over .add { background: var(--cyan-soft); border-style: solid; }

/* Estado y prioridad */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 500;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.est-abierto { background: var(--cyan-soft); color: var(--cyan-ink); }
.est-proceso { background: var(--warn-soft); color: var(--warn-ink); }
.est-esperando { background: var(--violet-soft); color: var(--violet); }
.est-resuelto { background: var(--ok-soft); color: var(--ok); }
.est-cerrado { background: var(--line-2); color: var(--muted); }
.prio { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.prio .bars { display: inline-flex; align-items: flex-end; gap: 2px; }
.prio .bars i { display: block; width: 3px; border-radius: 1px; background: #d5dee8; }
.prio .bars i:nth-child(1) { height: 6px; } .prio .bars i:nth-child(2) { height: 8px; }
.prio .bars i:nth-child(3) { height: 10px; } .prio .bars i:nth-child(4) { height: 12px; }
.prio-baja { color: var(--soft); } .prio-media { color: var(--muted); }
.prio-alta { color: var(--warn); } .prio-urgente { color: var(--danger); font-weight: 600; }
.prio .bars i.on { background: currentColor; }
.cli { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); min-width: 0; }
.cli i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.cli span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cli-tag i { width: 8px; height: 8px; border-radius: 2px; }
.rol { display: inline-flex; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.rol.resp { background: var(--cyan-soft); color: var(--cyan-ink); }
.rol.team { background: var(--navy); color: #fff; }
.rol.off { background: #fdecec; color: #b42318; }

/* Tablas */
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; padding: 12px 16px; background: var(--bg-2);
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--soft);
  border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 24px; }
.tbl tbody tr { transition: background .12s var(--ease); }
.tbl tbody tr.clic { cursor: pointer; }
.tbl tbody tr.clic:hover { background: #f8fbfd; }
.tbl tbody tr.urg { background: var(--danger-soft); }
.tbl tbody tr.off td { opacity: .55; }
.tbl .num-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tbl .num-cell .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tbl .num-cell .dot.on { background: var(--cyan-d); }
.tbl .s1 { font-weight: 500; color: var(--ink); font-size: 14px; }
.tbl .s1 a { color: inherit; }
.tbl .s1.new { font-weight: 600; }
.tbl .s2 { font-size: 12px; color: var(--soft); margin-top: 2px; }
.tbl .t-muted { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tbl .person { display: flex; align-items: center; gap: 12px; }
.tbl .row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.tbl .row-actions form { margin: 0; }
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; white-space: nowrap; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--soft); border-bottom: 1.5px solid var(--soft); transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.menu[open] summary { border-color: var(--soft); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 15; width: 260px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop);
  padding: 6px; display: grid; gap: 2px;
}
.menu-pop button {
  display: grid; gap: 1px; text-align: left; width: 100%;
  background: none; border: 0; border-radius: 6px; padding: 8px 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.menu-pop button small { font-size: 12px; font-weight: 400; color: var(--soft); }
.menu-pop button:hover { background: var(--bg); }
.menu-pop button.danger { color: var(--danger); }
.tbl-wrap { overflow: visible; }
.tbl thead th:first-child { border-top-left-radius: var(--r); }
.tbl thead th:last-child { border-top-right-radius: var(--r); }
.tbl-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 24px; font-size: 12px; color: var(--soft); border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.tbl-foot .new-key { color: #00a3c4; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty .title-sm { margin-bottom: 6px; }

/* Línea de seguimiento (nodos, como el logo) */
.track { display: grid; grid-template-columns: repeat(4, 1fr); }
.track .st { display: grid; gap: 8px; min-width: 0; }
.track .rail { display: flex; align-items: center; }
.track .node { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--input); background: var(--surface); flex: none; }
.track .bar { height: 2px; flex: 1; background: var(--line); }
.track .st:last-child .bar { visibility: hidden; }
.track .nm { font-size: 12px; color: #a3b1c2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.track .st.done .node { background: var(--cyan-d); border-color: var(--cyan-d); }
.track .st.done .bar { background: var(--cyan-d); }
.track .st.done .nm { color: var(--muted); }
.track .st.cur .node { box-shadow: 0 0 0 4px rgba(0, 184, 219, .18); }
.track .st.cur .nm { color: var(--navy); font-weight: 600; }
.track .st.cur .bar { background: var(--line); }
.track.fin .st .node { background: var(--ok); border-color: var(--ok); }
.track.fin .st .bar { background: var(--ok); }
.track.fin .st.cur .nm { color: var(--ok); }
.track.fin .st.cur .node { box-shadow: 0 0 0 4px rgba(22, 121, 74, .15); }
.track.big .node { width: 14px; height: 14px; }
.track.big .nm { font-size: 13px; }

/* Tarjetas de solicitud (portal) */
.tcards { display: grid; gap: 14px; }
.tcard {
  display: grid; gap: 16px;
  padding: 20px 24px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  color: inherit; text-decoration: none;
  transition: border-color .15s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.tcard:hover { text-decoration: none; border-color: var(--input); box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.tcard.news { border: 1.5px solid var(--cyan-d); }
.tcard .r1 { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.tcard .asunto { font-size: 17px; font-weight: 600; color: var(--ink); margin-top: 4px; }
.tcard .info { font-size: 13px; color: var(--soft); margin-top: 2px; }
.tcard .quote { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 12px; }
.newtag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--cyan-soft); color: var(--cyan-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.newtag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan-d); }

/* Detalle */
.meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.meta .sep { color: var(--faint); }
.det-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.thread { display: grid; gap: 16px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 14px; }
.msg.team { border-left: 3px solid var(--cyan-d); }
.msg.interna { background: var(--note); border-color: var(--note-line); }
.msg .mh { display: flex; align-items: center; gap: 10px; }
.msg .mh .who b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.msg .mh .who small { font-size: 12px; color: var(--soft); }
.msg .body { font-size: 14px; color: var(--ink-2); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.adjs { display: flex; flex-wrap: wrap; gap: 12px; }
.adj-img { display: grid; gap: 6px; width: 220px; text-decoration: none; }
.adj-img .frame { height: 140px; border-radius: var(--r-sm); border: 1px solid var(--input); overflow: hidden; background: var(--bg-2); }
.adj-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.adj-img:hover img { transform: scale(1.03); }
.adj-img small, .adj-file small { font-size: 11px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adj-file { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--input); border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); }
.adj-file:hover { border-color: var(--soft); text-decoration: none; }

.composer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 20px 18px; display: grid; gap: 12px; }
.composer.nota { background: var(--note); border-color: var(--note-line); }
.ctabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line-2); }
.ctabs button { background: none; border: 0; padding: 4px 0 10px; font-size: 13px; font-weight: 500; color: var(--soft); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ctabs button.on { color: var(--navy); font-weight: 600; border-bottom-color: var(--navy); }
.composer.nota .ctabs button.on { color: var(--warn); border-bottom-color: var(--warn); }
.cfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cfoot .attach { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; color: var(--link); cursor: pointer; }
.cfoot .attach input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cfoot .files { font-size: 12px; color: var(--muted); }
.closed-note { text-align: center; color: var(--muted); }

.side-col { display: grid; gap: 16px; }
.side-col .card { padding: 18px 20px; display: grid; gap: 14px; }
.sfield { display: grid; gap: 6px; }
.sfield form { margin: 0; }
.kv { display: grid; gap: 10px; }
.kv div { display: grid; gap: 1px; }
.kv span { font-size: 12px; color: var(--soft); }
.kv b { font-size: 13px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.others { display: grid; gap: 10px; }
.others a { display: grid; gap: 1px; color: var(--ink-2); font-size: 13px; }
.others a:hover { text-decoration: none; color: var(--navy); }
.others .mono { font-size: 11px; color: var(--muted); }

/* Cliente */
.client-head { display: flex; align-items: center; gap: 20px; padding: 20px 24px; flex-wrap: wrap; }
.mono-box { width: 64px; height: 64px; border-radius: 12px; background: var(--cyan-soft); color: var(--cyan-ink); display: flex; align-items: center; justify-content: center; font-family: var(--f-display); font-size: 24px; font-weight: 500; flex: none; }
.mono-box.sm { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
.client-head .t { flex: 1; min-width: 220px; }
.client-head .stats { display: flex; gap: 28px; }
.client-head .stats div { display: grid; }
.client-head .stats b { font-family: var(--f-display); font-weight: 400; font-size: 28px; color: var(--navy); line-height: 1.2; }
.client-head .stats span { font-size: 12px; color: var(--soft); }
.utabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); }
.utabs a { padding-bottom: 10px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.utabs a span { font-size: 13px; color: var(--soft); margin-left: 4px; }
.utabs a.on { color: var(--navy); font-weight: 600; border-bottom-color: var(--cyan-d); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.two .tbl td, .two .tbl th { padding-left: 12px; padding-right: 12px; }
.two .tbl .s2 { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acceso { background: var(--surface); border: 1.5px solid var(--cyan-d); border-radius: var(--r); padding: 22px; display: grid; gap: 16px; box-shadow: var(--shadow-pop); position: sticky; top: 24px; }
.acceso .ph p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.note-foot { font-size: 12px; color: var(--soft); padding: 12px 20px; border-top: 1px solid var(--line-2); }

/* ----------------------------------------------------------------------------
   Ingreso y contraseña
   ------------------------------------------------------------------------- */
.auth { display: grid; grid-template-columns: minmax(0, 760fr) minmax(0, 680fr); min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden;
  background: var(--navy); color: #fff;
  padding: 64px 80px 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.auth-brand .net { position: absolute; right: -150px; top: 40px; width: 380px; height: 640px; pointer-events: none; }
.auth-brand .net line { stroke: var(--cyan); stroke-opacity: .22; stroke-width: 1.5; }
.auth-brand .net circle { fill: var(--cyan); fill-opacity: .55; }
.auth-brand .net circle.g { fill: #3ecf8e; fill-opacity: .9; }
.auth-brand .top { position: relative; display: grid; gap: 72px; }
.auth-brand .logo { width: 200px; height: auto; }
.auth-brand .kick { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #7fe7ff; }
.auth-brand .kick::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.auth-brand h1 { font-family: var(--f-display); font-weight: 300; font-size: 50px; line-height: 1.16; letter-spacing: -.03em; margin: 24px 0; max-width: 560px; }
.auth-brand .tag { font-size: 17px; line-height: 1.65; color: #b9c8da; max-width: 500px; }
.steps { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 600px; }
.steps div { display: grid; gap: 4px; padding-right: 16px; }
.steps .rail { display: flex; align-items: center; margin-bottom: 8px; }
.steps .rail i { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); flex: none; }
.steps .rail b { flex: 1; height: 1.5px; background: rgba(255,255,255,.25); }
.steps div:last-child .rail i { background: #3ecf8e; }
.steps div:last-child .rail b { visibility: hidden; }
.steps strong { font-size: 15px; font-weight: 600; }
.steps span { font-size: 13px; color: #8fa3bc; }
.auth-form { background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 56px; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 420px; display: grid; gap: 26px; }
.auth-box h2 { font-family: var(--f-display); font-weight: 500; font-size: 36px; letter-spacing: -.02em; color: var(--navy); }
.auth-box .sub { font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.auth-box input[type=text], .auth-box input[type=email], .auth-box input[type=password] { padding: 13px 16px; font-size: 15px; border-radius: 10px; }
.auth-box .forgot { font-size: 13px; font-weight: 500; }
.auth-box .note { padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: #6b7a8f; line-height: 1.6; }
.auth-foot { font-size: 12px; color: #94a3b5; text-align: center; }
.auth-mobile-logo { display: none; }

/* ----------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .det-grid, .two { grid-template-columns: minmax(0, 1fr); }
  .acceso { position: static; }
  .auth-brand { padding: 48px 48px 40px; }
  .auth-brand h1 { font-size: 40px; }
}
@media (max-width: 960px) {
  .panel { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .side > div:first-child { min-width: 0; }
  .seg { display: flex; }
  .head .actions { width: 100%; }
  .head .actions .btn { flex: 1; }
  .side { position: sticky; height: auto; padding: 12px 16px; flex-direction: row; align-items: center; gap: 12px; z-index: 30; }
  .side > div:first-child { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
  .side-brand { padding: 0; }
  .side-brand img { width: 112px; }
  .side-kicker { display: none; }
  .side-nav { margin: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
  .side-nav a { padding: 8px 10px; white-space: nowrap; gap: 6px; }
  .side-nav a .l::before { display: none; }
  .side-me { border: 0; padding: 0; }
  .side-me .who { display: none; }
  .main { padding: 24px 16px 48px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: block; }
  .auth-mobile-logo img { width: 160px; }
}
@media (max-width: 720px) {
  .title { font-size: 28px; }
  .head { align-items: flex-start; }
  .filter-form, .filter-form input[type=search] { width: 100%; }
  .filter-form select { flex: 1; }
  .field-row { grid-template-columns: 1fr; }
  .topbar-in { padding: 12px 16px; }
  .topbar .brand img { width: 112px; }
  .topbar .brand .sep, .topbar .brand span, .topnav > a.hide-sm, .me .who { display: none; }
  .portal-main { padding: 24px 16px 48px; }
  .tcard { padding: 16px; }
  .tcard .r1 { flex-direction: column; gap: 8px; }
  .track .nm { font-size: 11px; white-space: normal; }
  .client-head .stats { width: 100%; justify-content: space-between; }
  /* Tablas en tarjetas */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
  .tbl td { padding: 0 !important; border: 0; width: auto; }
  .tbl td:first-child, .tbl td[data-l="Solicitud"], .tbl td:has(.person) { width: 100%; }
  .two .tbl .s2 { max-width: none; }
  .tbl .row-actions { justify-content: flex-start; }
  .adj-img { width: calc(50% - 6px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
