/* Portal de Auditoría GVN — mockup
   Layout: barra superior verde corporativa, menú lateral fijo, contenido en paneles.
   Colores tomados de las vistas de referencia (verde GVN + dorado). */
:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-2: #f6f8f5;
  --line: #dfe5df;
  --line-2: #eaeeea;
  --fg: #16231c;
  --muted: #5d6c63;
  --soft: #8a978f;

  --brand: #143f2d;
  --brand-2: #1d5a40;
  --brand-ink: #ffffff;
  --gold: #b8892c;
  --gold-2: #d9ae55;
  --gold-soft: #f8efd9;

  --ok: #1d7a4a;      --ok-soft: #e3f3ea;
  --warn: #b26b0f;    --warn-soft: #fdf1dc;
  --bad: #b42318;     --bad-soft: #fde8e6;
  --info: #2457a6;    --info-soft: #e5eefb;
  --violet: #5b48b8;  --violet-soft: #eeebfb;
  --neutral-soft: #eef1ee;

  --f-display: "Barlow Semi Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", Consolas, monospace;

  --r: 10px;
  --r-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 50, 35, .06), 0 4px 14px rgba(20, 50, 35, .05);
  --shadow-lg: 0 18px 50px rgba(10, 30, 20, .22);
  --side-w: 248px;
  --top-h: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: .005em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num, td.n, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: .86em; }
[hidden] { display: none !important; }

/* ───────── Top bar ───────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.topbar-in {
  height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark svg { width: 40px; height: 24px; fill: var(--gold-2); stroke: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font: 700 24px/1 var(--f-display); letter-spacing: .04em; }
.brand-text small { font-size: 11px; opacity: .8; margin-top: 2px; }
.topbar-sep { width: 1px; height: 28px; background: rgba(255,255,255,.28); }
.topbar-title { font: 600 18px var(--f-display); letter-spacing: .02em; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sel-wrap select {
  appearance: none; background: rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 7px;
  padding: 6px 30px 6px 12px; font-weight: 600; min-width: 92px;
}
.sel-wrap select option { color: var(--fg); }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; border: 0; background: transparent; color: inherit; transition: background .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }
.badge-count {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--brand);
}
.badge-count.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }
.menu-toggle { display: none; }
.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: inherit; padding: 4px 6px; border-radius: 10px; }
.user-btn:hover { background: rgba(255,255,255,.1); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--brand); font-weight: 700; font-size: 13px;
}
.user-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.user-txt b { font-size: 14px; }
.user-txt small { font-size: 11.5px; opacity: .8; }
.chev { width: 16px; height: 16px; }
.user-pop, .notif-pop {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); color: var(--fg);
  border-radius: var(--r); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  min-width: 290px; padding: 8px; animation: pop .22s var(--ease); z-index: 60;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.pop-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 10px; }
.user-pop button {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 8px; padding: 9px 10px;
}
.user-pop button small { color: var(--muted); }
.user-pop button:hover, .user-pop button.on { background: var(--gold-soft); }
.notif-pop { width: 360px; max-width: calc(100vw - 32px); padding: 0; }
.notif-pop header { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.notif-pop header b { font-family: var(--f-display); font-size: 17px; }
.notif-list { max-height: 360px; overflow: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .15s; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.notif-item small { color: var(--muted); display: block; }

/* ───────── Shell ───────── */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 12px; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--soft); padding: 14px 12px 6px; font-weight: 600; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  color: var(--fg); text-decoration: none; font-weight: 500; transition: background .2s, color .2s;
}
.nav-item svg { color: var(--muted); transition: color .2s, transform .25s var(--ease); }
.nav-item:hover { background: var(--surface-2); }
.nav-item:hover svg { transform: translateX(2px); }
.nav-item.active { background: var(--gold-soft); font-weight: 600; }
.nav-item.active svg { color: var(--gold); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--gold); animation: grow-y .3s var(--ease);
}
@keyframes grow-y { from { transform: scaleY(0); } }
.nav-item .pill { margin-left: auto; }
.nav-foot { margin-top: auto; padding: 14px 12px 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); }
.nav-foot b { color: var(--fg); display: block; }

.main { padding: 26px max(16px, env(safe-area-inset-right, 0px)) 48px 28px; min-width: 0; outline: none; }
.view { animation: view-in .38s var(--ease); max-width: 1320px; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

/* ───────── Page header ───────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--brand-2); text-decoration: underline; }
.page-head h1 { font-size: 32px; font-weight: 700; color: var(--brand); }
.page-head .sub { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f1c1bc; }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-2); }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ───────── Cards / stats ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-h h3 { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-h h3 svg { color: var(--gold); }
.card-h .hint { color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 18px; }

.stat {
  position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s; text-align: left;
}
button.stat:hover, a.stat:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,50,35,.1); }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat .ico svg { width: 22px; height: 22px; }
.stat .lbl { font-weight: 600; font-size: 14px; }
.stat .val { font: 700 34px/1.05 var(--f-display); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .desc { font-size: 12.5px; color: var(--muted); }
.stat::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--tone, var(--line)); transform-origin: left; animation: grow-x .7s .1s var(--ease) both; }
@keyframes grow-x { from { transform: scaleX(0); } }
.t-ok { --tone: var(--ok); }  .t-ok .ico { background: var(--ok-soft); color: var(--ok); }
.t-warn { --tone: var(--gold); } .t-warn .ico { background: var(--warn-soft); color: var(--warn); }
.t-bad { --tone: var(--bad); }  .t-bad .ico { background: var(--bad-soft); color: var(--bad); } .t-bad .lbl { color: var(--bad); }
.t-info { --tone: var(--info); } .t-info .ico { background: var(--info-soft); color: var(--info); }
.t-violet { --tone: var(--violet); } .t-violet .ico { background: var(--violet-soft); color: var(--violet); }
.t-gold { --tone: var(--gold); } .t-gold .ico { background: var(--gold-soft); color: var(--gold); }
.t-neutral .ico { background: var(--neutral-soft); color: var(--muted); }

/* ───────── Tabs ───────── */
.tabs {
  display: flex; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overflow-x: auto;
  margin-bottom: 16px; scrollbar-width: thin;
}
.tab {
  flex: 1 0 auto; padding: 10px 18px; border: 0; background: transparent; font-weight: 500; color: var(--fg);
  border-right: 1px solid var(--line-2); transition: background .2s, color .2s; white-space: nowrap;
}
.tab:last-child { border-right: 0; }
.tab:hover { background: var(--surface-2); }
.tab.on { background: var(--gold); color: #fff; font-weight: 600; }
.tab .pill { margin-left: 6px; }
.tabs-line { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs-line .tab { flex: none; padding: 10px 2px; border: 0; position: relative; background: transparent; color: var(--muted); }
.tabs-line .tab.on { background: transparent; color: var(--brand); }
.tabs-line .tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--gold); border-radius: 3px 3px 0 0; animation: grow-x .3s var(--ease); }

/* ───────── Tables ───────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); background: var(--surface-2);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: none;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #f8f4ea; }
tbody tr.sel { background: var(--gold-soft); }
td.n, th.n { text-align: right; }
td.c, th.c { text-align: center; }
.rows-in tbody tr { animation: row-in .4s var(--ease) both; }
@keyframes row-in { from { opacity: 0; transform: translateX(-6px); } }
.code { font-family: var(--f-mono); font-weight: 500; font-size: 13px; color: var(--brand); white-space: nowrap; }
.tfoot td { font-weight: 700; background: var(--surface-2); }
.cell-sub { display: block; font-size: 12px; color: var(--muted); }

/* ───────── Pills ───────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; background: var(--neutral-soft); color: var(--muted);
}
.pill svg { width: 13px; height: 13px; stroke-width: 2.2; }
.p-ok { background: var(--ok-soft); color: var(--ok); }
.p-warn { background: var(--warn-soft); color: var(--warn); }
.p-bad { background: var(--bad-soft); color: var(--bad); }
.p-info { background: var(--info-soft); color: var(--info); }
.p-violet { background: var(--violet-soft); color: var(--violet); }
.p-gold { background: var(--gold-soft); color: #8a6517; }
.p-dark { background: var(--brand); color: #fff; }
.p-out { background: transparent; border: 1px dashed var(--soft); }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ───────── Filters / forms ───────── */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.field.wide { max-width: none; flex-basis: 100%; }
.field label, .lbl-s { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 11px; background: var(--surface); width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,137,44,.18); }
textarea.input { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field { max-width: none; }

/* ───────── Modal ───────── */
.modal-back {
  position: fixed; inset: 0; z-index: 80; background: rgba(12, 28, 20, .45); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 16px; animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(640px, 100%);
  max-height: calc(100vh - 32px); overflow: auto; animation: modal-in .32s var(--ease);
}
.modal.wide { width: min(820px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-size: 22px; color: var(--brand); }
.modal-b { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.modal .icon-btn { color: var(--muted); }
.modal .icon-btn:hover { background: var(--surface-2); }

/* ───────── Toast ───────── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; background: var(--brand); color: #fff; padding: 12px 16px;
  border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 380px; animation: toast-in .4s var(--ease);
}
.toast svg { color: var(--gold-2); margin-top: 2px; }
.toast small { display: block; opacity: .78; }
.toast.out { animation: toast-out .35s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ───────── Misc blocks ───────── */
.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 8px; font-size: 13.5px;
  background: var(--info-soft); color: #1e3f73;
}
.note svg { margin-top: 2px; }
.note.gold { background: var(--gold-soft); color: #6d4f12; }
.note.bad { background: var(--bad-soft); color: #8c1c13; }
.note.ok { background: var(--ok-soft); color: #145536; }
.footnote { font-size: 12px; color: var(--soft); margin-top: 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.formula {
  font-family: var(--f-mono); font-size: 13px; background: var(--surface-2); border: 1px dashed var(--line);
  padding: 12px 14px; border-radius: 8px; line-height: 1.7;
}
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; }
.kv > div { min-width: 0; }
.kv dt { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.kv dd { margin: 0; font-weight: 500; }
.prose dt { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 14px; }
.prose dd { margin: 4px 0 0; max-width: 75ch; }
.section-title { font: 600 20px var(--f-display); color: var(--brand); margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--fg); font-family: var(--f-display); font-size: 19px; margin-bottom: 4px; }

/* progress */
.bar { height: 8px; border-radius: 6px; background: var(--line-2); overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--brand-2); transform-origin: left; animation: grow-x .9s var(--ease) both; }
.bar.gold > i { background: var(--gold); }
.bar.bad > i { background: var(--bad); }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar { flex: 1; }

/* Process flow chips */
.flow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.flow-step {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  background: var(--neutral-soft); color: var(--muted); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
  padding-inline: 22px; transition: background .3s, color .3s;
}
.flow-step:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
.flow-step.done { background: var(--ok-soft); color: var(--ok); }
.flow-step.now { background: var(--gold-soft); color: #7d5a14; box-shadow: inset 0 -3px 0 var(--gold); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 36px; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--ok); }
.tl-dot {
  position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); background: var(--surface);
}
.tl-dot svg { width: 13px; height: 13px; stroke-width: 3; }
li.done .tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
li.now .tl-dot { border-color: var(--gold); background: var(--gold-soft); }
li.now .tl-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--gold); animation: ring 1.8s infinite; }
@keyframes ring { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.tl-row { display: flex; justify-content: space-between; gap: 8px; }
.tl-row b { font-size: 14px; }
.tl-row small, .timeline p { font-size: 12.5px; color: var(--muted); }

/* Heat map */
.heat { display: grid; grid-template-columns: 30px repeat(5, minmax(48px, 1fr)); gap: 5px; max-width: 520px; }
.heat .ax { font-size: 12px; color: var(--muted); display: grid; place-items: center; font-weight: 600; }
.heat .cell {
  aspect-ratio: 1.35; border-radius: 7px; display: grid; place-items: center; font: 700 20px var(--f-display); color: #fff;
  animation: cell-in .5s var(--ease) both; transition: transform .2s; cursor: default;
}
.heat .cell:hover { transform: scale(1.06); }
.heat .cell.zero { color: rgba(0,0,0,.25); font-weight: 500; }
@keyframes cell-in { from { opacity: 0; transform: scale(.6); } }
.lv1 { background: #9cc9a6; } .lv2 { background: #c9d97d; } .lv3 { background: #f1c75b; } .lv4 { background: #ec8b4a; } .lv5 { background: #d64535; }

/* Gantt */
.gantt { min-width: 820px; }
.g-row { display: grid; grid-template-columns: 250px repeat(12, 1fr); align-items: center; border-bottom: 1px solid var(--line-2); min-height: 40px; position: relative; }
.g-row.head { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); min-height: 34px; }
.g-row.head > div { text-align: center; }
.g-row.head > div:first-child { text-align: left; }
.g-row > div:first-child { padding: 0 14px; font-size: 13.5px; }
.g-bar {
  height: 22px; border-radius: 6px; margin: 0 3px; font-size: 11.5px; font-weight: 600; color: #fff; display: flex; align-items: center;
  padding: 0 8px; white-space: nowrap; overflow: hidden; transform-origin: left; animation: grow-x .8s var(--ease) both;
}
.g-bar.done { background: var(--ok); } .g-bar.cur { background: var(--gold); } .g-bar.prog { background: var(--info); }
.g-bar.tbd { background: repeating-linear-gradient(45deg, var(--neutral-soft) 0 6px, #e2e7e2 6px 12px); color: var(--muted); border: 1px dashed var(--soft); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.g-today span { position: absolute; top: -2px; left: 4px; font-size: 10.5px; color: var(--bad); font-weight: 700; white-space: nowrap; }

/* Bars chart (horizontal) */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hb-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 13.5px; }
.hb-track { position: relative; height: 18px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.hb-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; transform-origin: left; animation: grow-x .9s var(--ease) both; }
.hb-track i.plan { background: #cfdcd3; }
.hb-track i.real { background: var(--brand-2); top: 4px; bottom: 4px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; }
.donut svg { width: 140px; height: 140px; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 16; }
.donut .seg { animation: dash 1.2s var(--ease) both; }
@keyframes dash { from { stroke-dasharray: 0 999; } }

/* KPI ring cards */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi .big { font: 700 34px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.kpi .big.na { font-size: 22px; color: var(--soft); }
.kpi .frac { font-size: 12.5px; color: var(--muted); }
.kpi .rule { font-size: 12px; color: var(--soft); border-top: 1px dashed var(--line); padding-top: 8px; }

.ico-box { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--warn-soft); color: var(--warn); }
.ico-box svg { width: 22px; height: 22px; }

/* Finding cards (bandeja) */
.fcard { display: grid; grid-template-columns: 90px minmax(0, 1fr) 170px minmax(220px, 260px); gap: 18px; padding: 18px 20px; align-items: start; }
.fcard + .fcard { border-top: 1px solid var(--line); }
.fcard .id { font: 700 22px var(--f-display); color: var(--brand); }
.fcard h4 { font-size: 18px; }
.fcard .meta { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.fcard .due { display: flex; flex-direction: column; gap: 6px; }
.fcard .reminder { background: var(--info-soft); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: #1e3f73; display: flex; gap: 8px; }
.fcard .reminder b { display: block; font-size: 13px; }
.fcard .acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.fcard .reminder svg { animation: ring-bell 2.4s infinite; transform-origin: top center; }
@keyframes ring-bell { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 85% { transform: rotate(-12deg); } 92% { transform: rotate(6deg); } }

/* Messages thread */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); animation: view-in .3s var(--ease); }
.msg.aud { align-self: flex-end; background: var(--gold-soft); border-color: #eedcb2; }
.msg header { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; gap: 12px; }
.msg header b { color: var(--fg); }

/* Evidence */
.file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; }
.file + .file { margin-top: 8px; }
.file .fi { width: 38px; height: 44px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.file .fi.x { background: var(--ok-soft); color: var(--ok); }
.file .fi.img { background: var(--info-soft); color: var(--info); }
.file .fn { font-weight: 600; word-break: break-all; }
.file small { color: var(--muted); display: block; }
.drop {
  border: 2px dashed var(--line); border-radius: 10px; padding: 22px; text-align: center; color: var(--muted);
  transition: border-color .2s, background .2s; cursor: pointer; display: block;
}
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-soft); }
.drop input { display: none; }

/* Email preview */
.mail { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mail-h { background: var(--surface-2); padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; }
.mail-h span { color: var(--muted); }
.mail-b { padding: 18px 20px; font-size: 14px; }
.mail-band { background: var(--brand); color: #fff; padding: 12px 20px; font: 700 18px var(--f-display); letter-spacing: .04em; }
.mail-tbl td { padding: 6px 0; border: 0; }
.mail-tbl td:first-child { color: var(--muted); width: 150px; }

/* Home */
.hero {
  position: relative; overflow: hidden; border-radius: 14px; padding: 26px 28px; color: #fff;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 70%, #2b6e4f 100%);
}
.hero h1 { font-size: 30px; }
.hero p { opacity: .85; margin-top: 6px; max-width: 62ch; }
.hero .mtn { position: absolute; right: -10px; bottom: -6px; width: 360px; height: 140px; opacity: .16; }
.hero .mtn path { fill: var(--gold-2); stroke: none; animation: rise 1.2s var(--ease) both; }
.hero .mtn path:nth-child(2) { animation-delay: .15s; opacity: .7; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hero-chips span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 4px 12px; border-radius: 999px; font-size: 13px; }
.quick { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s; }
.quick:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,50,35,.1); }
.quick .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
.quick b { display: block; }
.quick small { color: var(--muted); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; gap: 12px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line-2); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.list-plain small { color: var(--muted); display: block; }

/* Split panel (revision detail) */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.tool-row { display: flex; gap: 0; flex-wrap: wrap; border-top: 1px solid var(--line-2); }
.tool-row > div { flex: 1 1 150px; padding: 14px 18px; border-right: 1px solid var(--line-2); display: flex; gap: 10px; align-items: flex-start; }
.tool-row > div:last-child { border-right: 0; }
.tool-row svg { color: var(--brand-2); margin-top: 2px; }
.tool-row b { display: block; font-size: 13.5px; }
.tool-row small { color: var(--muted); font-size: 12.5px; }

/* Toggle */
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 22px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }

/* Skeleton shimmer for loading */
.loading { position: relative; overflow: hidden; }
.loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: shimmer 1s; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ───────── Responsive ───────── */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .fcard { grid-template-columns: 80px minmax(0, 1fr) 160px; }
  .fcard .reminder { grid-column: 2 / -1; }
}
@media (max-width: 900px) {
  .menu-toggle { display: grid; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--top-h); left: 0; bottom: 0; width: 270px; height: auto; z-index: 50;
    transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  .main { padding: 20px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
  .g3, .split { grid-template-columns: minmax(0, 1fr); }
  .user-txt, .topbar-sep, .topbar-title { display: none; }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .g2, .g4 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 26px; }
  .sel-wrap select { min-width: 0; padding-right: 26px; }
  .brand-text small { display: none; }
  .fcard { grid-template-columns: minmax(0, 1fr); }
  .fcard .reminder { grid-column: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .field { max-width: none; }
  .hb-row { grid-template-columns: 90px minmax(0, 1fr) 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
