/* ============================================================
   Gestión comercial — sistema de diseño (portado de doc/rediseno/App.jsx)
   Papel cálido + tinta navy + un acento terracota. Fuente de verdad de tokens.
   Mantiene alias de compatibilidad con las clases legacy de las plantillas.
   ============================================================ */
:root{
  --accent: oklch(0.66 0.17 35);
  --ink: oklch(0.27 0.05 262);
  --rad: 14px;
  --den: 1;
  --paper: oklch(0.965 0.011 84);
  --surface: oklch(0.995 0.004 90);
  --muted: oklch(0.50 0.03 262);
  --border: oklch(0.905 0.012 262);
  --navy: oklch(0.235 0.05 262);
  --navy-2: oklch(0.30 0.055 262);
  --on-navy: oklch(0.955 0.008 84);
  --ok: oklch(0.58 0.13 155);
  --ok-bg: oklch(0.952 0.042 152);
  --warn: oklch(0.60 0.13 75);
  --warn-bg: oklch(0.955 0.048 85);
  --bad: oklch(0.55 0.19 25);
  --bad-bg: oklch(0.947 0.038 25);
  --info-bg: oklch(0.945 0.022 262);
  --s1: calc(4px * var(--den)); --s2: calc(8px * var(--den));
  --s3: calc(12px * var(--den)); --s4: calc(16px * var(--den));
  --s5: calc(24px * var(--den)); --s6: calc(32px * var(--den));
}
*{ box-sizing:border-box; }
html,body{ margin:0; min-height:100%; }
body{
  font-family:"DM Sans","Segoe UI",sans-serif;
  font-size:15px; line-height:1.5; color:var(--ink);
  background:var(--paper);
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{ font-family:"Sora","DM Sans",sans-serif; letter-spacing:-0.02em; margin:0; }
button{ font:inherit; cursor:pointer; }
input,select,textarea{ font:inherit; color:inherit; }
a{ color:var(--accent); }
:focus-visible{ outline:3px solid var(--accent); outline-offset:2px; border-radius:6px; }

/* ---------- App shell ---------- */
.app{ display:grid; grid-template-columns:262px minmax(0,1fr); min-height:100vh; }
.sidebar{
  background:
    radial-gradient(120% 60% at 0% 0%, var(--navy-2) 0%, transparent 60%),
    var(--navy);
  color:var(--on-navy);
  padding:var(--s4); display:flex; flex-direction:column; gap:var(--s5);
  position:sticky; top:0; height:100vh; z-index:40;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{
  width:38px; height:38px; border-radius:calc(var(--rad) * 0.75); flex:0 0 auto;
  background:var(--accent); color:#fff; display:grid; place-items:center;
  font-family:"Sora"; font-weight:800; font-size:15px; letter-spacing:0.02em;
  box-shadow:0 6px 16px oklch(0.66 0.17 35 / 0.35);
}
.brand-name{ font-weight:700; font-size:15.5px; }
.brand-sub{ font-size:12px; opacity:0.62; }
.nav{ display:grid; gap:4px; }
.nav-item{
  display:flex; align-items:center; gap:11px; width:100%;
  min-height:42px; padding:0 12px; border:0; border-radius:10px;
  background:transparent; color:var(--on-navy); text-align:left; font-weight:500;
  text-decoration:none; transition:background 0.15s ease;
}
.nav-item:hover{ background:oklch(1 0 0 / 0.09); text-decoration:none; }
.nav-item[aria-current="page"]{
  background:oklch(1 0 0 / 0.14); font-weight:700;
  box-shadow:inset 3px 0 0 var(--accent);
}
.nav-item svg{ flex:0 0 auto; opacity:0.85; }
.nav-item .count{
  margin-left:auto; font-size:11.5px; font-weight:700;
  background:var(--accent); color:#fff; border-radius:999px; padding:1px 8px;
}
.sidebar-foot{ margin-top:auto; display:grid; gap:var(--s3); }
.user-card{
  display:flex; align-items:center; gap:10px; padding:10px;
  border-radius:12px; background:oklch(1 0 0 / 0.08);
}
.avatar{
  width:34px; height:34px; border-radius:50%; flex:0 0 auto;
  background:oklch(1 0 0 / 0.16); display:grid; place-items:center;
  font-size:12.5px; font-weight:800; letter-spacing:0.04em;
}
.user-meta{ min-width:0; }
.user-name{ font-size:13.5px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-mail{ font-size:11.5px; opacity:0.6; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.main{ min-width:0; display:flex; flex-direction:column; }
.topbar{
  position:sticky; top:0; z-index:30;
  background:oklch(0.965 0.011 84 / 0.85); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
  padding:var(--s3) var(--s6); display:flex; align-items:center; gap:var(--s4);
}
.crumb{ font-size:12.5px; color:var(--muted); }
.crumb strong{ color:var(--ink); font-weight:600; }
.search{
  margin-left:auto; display:flex; align-items:center; gap:9px;
  min-height:42px; width:min(320px, 38vw); padding:0 14px;
  background:var(--surface); border:1px solid var(--border); border-radius:999px;
}
.search input{ flex:1; min-width:0; border:0; outline:0; background:transparent; }
.search svg{ color:var(--muted); }
.icon-btn{
  position:relative; width:42px; height:42px; flex:0 0 auto;
  display:grid; place-items:center; border:1px solid var(--border);
  border-radius:999px; background:var(--surface); color:inherit;
}
.icon-btn:hover{ border-color:var(--ink); }
.icon-btn .dot{
  position:absolute; top:8px; right:9px; width:9px; height:9px;
  border-radius:50%; background:var(--accent); border:2px solid var(--surface);
}
.menu-btn{ display:none; }
.notif-wrap{ position:relative; }
.content [hidden]{ display:none !important; }
.content{ padding:var(--s5) var(--s6) var(--s6); max-width:1240px; width:100%; margin:0 auto; }
.page-head{ display:flex; flex-wrap:wrap; gap:var(--s3); align-items:flex-end; justify-content:space-between; margin-bottom:var(--s5); }
.page-head h1{ font-size:clamp(1.45rem, 2.6vw, 1.85rem); display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.page-head .sub, .page-head .subtitle{ margin:4px 0 0; color:var(--muted); font-size:14px; }
.head-actions, .actions{ display:flex; gap:var(--s2); flex-wrap:wrap; align-items:center; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:42px; padding:0 18px; border-radius:10px;
  border:1px solid var(--border); background:var(--surface); color:var(--ink);
  font-weight:600; text-decoration:none; font-size:14px;
  transition:transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover{ border-color:var(--ink); text-decoration:none; }
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--accent); border-color:var(--accent); color:#fff; box-shadow:0 4px 14px oklch(0.66 0.17 35 / 0.32); }
.btn-primary:hover{ filter:brightness(1.06); border-color:var(--accent); }
.btn-ghost, .btn--secondary{ border-color:transparent; background:transparent; color:var(--accent); }
.btn-danger{ border-color:var(--bad); color:var(--bad); background:var(--surface); }
.btn-small{ min-height:34px; padding:0 12px; font-size:13px; border-radius:8px; }

/* ---------- Cards / KPIs ---------- */
.card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--rad); padding:var(--s4);
}
.card h2{ font-size:16.5px; margin-bottom:var(--s3); }
.card-head{ display:flex; align-items:center; justify-content:space-between; gap:var(--s3); margin-bottom:var(--s3); flex-wrap:wrap; }
.card-head h2{ margin-bottom:0; }
.kpis, .cards{ display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:var(--s3); }
.kpi .k-label, .metric-label{ font-size:12.5px; color:var(--muted); font-weight:600; display:block; }
.kpi .k-value, .metric-value{ font-family:"Sora"; font-size:clamp(1.5rem, 2.4vw, 1.9rem); font-weight:800; margin-top:6px; font-variant-numeric:tabular-nums; display:block; }
.kpi .k-hint{ font-size:12.5px; margin-top:5px; color:var(--muted); }
.kpi .k-hint.up{ color:var(--ok); font-weight:600; }
.kpi .k-hint.down{ color:var(--bad); font-weight:600; }

.grid-2, .columns{ display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:var(--s4); margin-top:var(--s4); }
.grid-2 > .stack{ display:grid; gap:var(--s4); align-content:start; }
.grid-2 > *{ min-width:0; }
.grid-2 .card, .grid-2 .pend-card{ overflow:hidden; }
.grid-2 table.data, .grid-2 table.data-table{ min-width:0; }
.grid-2 .table-scroll{ overflow-x:auto; }
.grid-2 .num, .grid-2 .right{ white-space:nowrap; }
.stack{ display:grid; gap:var(--s4); align-content:start; }

/* ---------- Tables ---------- */
.table-scroll, .table-responsive{ overflow-x:auto; }
table.data, table.data-table{ width:100%; border-collapse:collapse; min-width:640px; }
table.data th, table.data-table th{
  text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:0.08em;
  color:var(--muted); font-weight:700; padding:8px 10px; border-bottom:1px solid var(--border);
}
table.data td, table.data-table td{ padding:11px 10px; border-bottom:1px solid var(--border); vertical-align:middle; font-size:14px; }
table.data tbody tr:last-child td, table.data-table tbody tr:last-child td{ border-bottom:0; }
table.data tbody tr, table.data-table tbody tr{ transition:background 0.12s ease; }
table.data tbody tr:hover, table.data-table tbody tr:hover{ background:oklch(0.965 0.011 84 / 0.6); }
td.num, th.num, td.right, th.right{ text-align:right; font-variant-numeric:tabular-nums; }
td.actions-cell{ text-align:right; white-space:nowrap; }
.row-link{
  background:none; border:0; padding:0; font-weight:700; color:var(--ink);
  text-decoration:underline; text-decoration-color:var(--accent); text-underline-offset:3px;
}
a.row-link{ font-weight:700; }
.row-title{ font-weight:600; }
.row-sub{ font-size:12.5px; color:var(--muted); }
.actions-cell .actions-cell, .actions-cell{ display:flex; gap:6px; justify-content:flex-end; align-items:center; }

/* ---------- Badges & chips ---------- */
.badge{
  display:inline-flex; align-items:center; gap:5px; padding:3px 10px;
  border-radius:999px; font-size:12px; font-weight:700; letter-spacing:0.01em;
}
.badge::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge-borrador{ background:var(--info-bg); color:var(--muted); }
.badge-enviada, .badge-emitida{ background:var(--warn-bg); color:var(--warn); }
.badge-aceptada, .badge-pagada{ background:var(--ok-bg); color:var(--ok); }
.badge-rechazada{ background:var(--bad-bg); color:var(--bad); }
.badge-pendiente{ background:var(--warn-bg); color:var(--warn); }
.badge-vencida{ background:var(--bad-bg); color:var(--bad); }
.badge-anulada{ background:var(--info-bg); color:var(--muted); text-decoration:line-through; }
.badge-firmada, .badge-sellada, .badge-incorporado{ background:var(--ok-bg); color:var(--ok); }
.badge-visto{ background:var(--info-bg); color:var(--muted); }
.badge-nuevo{ background:oklch(0.66 0.17 35 / 0.14); color:var(--accent); }
.badge-tipo{ background:oklch(0.60 0.13 295 / 0.14); color:oklch(0.45 0.14 295); }
.badge-tipo::before{ background:currentColor; }
.chips, .actividad-chips{ display:flex; gap:6px; flex-wrap:wrap; margin-top:5px; }
.chip{
  display:inline-flex; align-items:center; gap:5px; padding:2px 8px;
  border-radius:999px; font-size:11.5px; font-weight:600;
  background:var(--info-bg); color:var(--muted); white-space:nowrap;
}
.chip[hidden]{ display:none; }
.chip svg{ flex:0 0 auto; }
.chip.nueva, .chip-nuevas{ background:oklch(0.66 0.17 35 / 0.14); color:var(--accent); }
.chip.ok{ background:var(--ok-bg); color:var(--ok); }
.chip.aviso, .chip-aceptacion{ background:var(--warn-bg); color:var(--warn); }
.chip-visita{ background:var(--info-bg); color:var(--muted); }

/* ---------- Filters ---------- */
.filters{ display:flex; flex-wrap:wrap; gap:var(--s3); align-items:end; margin-bottom:var(--s4); }
.filters .field{ min-width:180px; flex:1; max-width:260px; }

/* ---------- Forms ---------- */
.field{ display:grid; gap:6px; }
.field > span{ font-size:13px; font-weight:600; }
.field .hint, .field-hint{ font-size:12px; color:var(--muted); }
.field input, .field select, .field textarea,
input, select, textarea{
  min-height:44px; padding:9px 12px; border:1px solid var(--border);
  border-radius:10px; background:var(--surface); width:100%;
}
input[type="checkbox"], input[type="radio"]{ width:auto; min-height:0; accent-color:var(--accent); }
.field textarea, textarea{ min-height:84px; resize:vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
input:focus, select:focus, textarea:focus{
  outline:3px solid oklch(0.66 0.17 35 / 0.35); outline-offset:0; border-color:var(--accent);
}
.field .err{ font-size:12.5px; color:var(--bad); font-weight:600; }
.form-grid{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:var(--s3) var(--s4); }
.form-grid .span-2{ grid-column:1 / -1; }
.form-actions{ display:flex; gap:var(--s2); justify-content:flex-end; flex-wrap:wrap; align-items:center; margin-top:4px; }
.inline-form{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.inline-form select{ max-width:220px; width:auto; min-height:38px; }
fieldset{ border:0; margin:0; padding:0; min-width:0; }
.card fieldset + fieldset{ margin-top:var(--s5); }
.card > fieldset:last-of-type{ margin-bottom:0; }
fieldset legend{
  font-family:"Sora"; font-weight:700; font-size:15.5px; margin-bottom:var(--s3); color:var(--ink);
}

/* ---------- Dashboard extras ---------- */
.chart{ display:flex; align-items:flex-end; gap:calc(10px * var(--den)); height:170px; padding-top:8px; }
.chart .bar-wrap{ flex:1; display:flex; flex-direction:column; align-items:center; gap:7px; min-width:0; }
.chart .bar{
  width:100%; max-width:52px; border-radius:8px 8px 4px 4px;
  background:linear-gradient(180deg, var(--accent), oklch(0.66 0.17 35 / 0.55));
  min-height:6px; transition:filter 0.15s ease;
}
.chart .bar-wrap:hover .bar{ filter:brightness(1.12); }
.chart .bar-val{ font-size:11.5px; font-weight:700; font-variant-numeric:tabular-nums; }
.chart .bar-month{ font-size:12px; color:var(--muted); font-weight:600; }
.feed{ display:grid; gap:0; }
.feed-item{ display:flex; gap:12px; padding:11px 0; border-bottom:1px solid var(--border); align-items:flex-start; }
.feed-item:last-child{ border-bottom:0; padding-bottom:0; }
.feed-ico{
  width:32px; height:32px; flex:0 0 auto; border-radius:10px; display:grid; place-items:center;
  background:var(--info-bg); color:var(--muted);
}
.feed-ico.ok{ background:var(--ok-bg); color:var(--ok); }
.feed-ico.alerta{ background:var(--bad-bg); color:var(--bad); }
.feed-ico.acento{ background:oklch(0.66 0.17 35 / 0.14); color:var(--accent); }
.feed-txt{ font-size:13.5px; }
.feed-txt b{ font-weight:700; }
.feed-txt a{ color:inherit; text-decoration:underline; text-decoration-color:var(--accent); text-underline-offset:3px; }
.feed-time{ font-size:11.5px; color:var(--muted); margin-top:1px; }
.pend-card{ background:var(--navy); color:var(--on-navy); border:0; display:flex; flex-direction:column; gap:var(--s3); }
.pend-card h2{ color:var(--on-navy); }
.pend-list{ display:grid; gap:8px; }
.pend-item{
  display:flex; align-items:center; gap:10px; font-size:13.5px;
  background:oklch(1 0 0 / 0.08); border-radius:10px; padding:9px 12px;
}
.pend-item b{ margin-left:auto; font-variant-numeric:tabular-nums; }
.pend-item a{ color:inherit; text-decoration:underline; text-decoration-color:var(--accent); text-underline-offset:3px; }

/* ---------- Timeline / drawer / modal ---------- */
.timeline{ display:grid; gap:0; position:relative; padding-left:26px; }
.timeline::before{ content:""; position:absolute; left:8px; top:8px; bottom:8px; width:2px; background:var(--border); }
.tl-item{ position:relative; padding:0 0 var(--s3); }
.tl-item::before{
  content:""; position:absolute; left:-24px; top:4px; width:12px; height:12px;
  border-radius:50%; background:var(--surface); border:3px solid var(--border);
}
.tl-item.done::before{ background:var(--accent); border-color:var(--accent); }
.tl-item.now::before{ border-color:var(--accent); box-shadow:0 0 0 4px oklch(0.66 0.17 35 / 0.22); }
.tl-title{ font-weight:700; font-size:13.5px; }
.tl-time{ font-size:12px; color:var(--muted); }
.scrim{
  position:fixed; inset:0; background:oklch(0.235 0.05 262 / 0.45);
  backdrop-filter:blur(3px); z-index:60; display:flex; justify-content:flex-end;
  animation:fadeIn 0.18s ease;
}
.drawer{
  width:min(480px, 100%); height:100%; background:var(--paper);
  box-shadow:-24px 0 64px oklch(0.235 0.05 262 / 0.35);
  display:flex; flex-direction:column; animation:slideIn 0.22s ease;
}
.drawer-head{ padding:var(--s4); border-bottom:1px solid var(--border); display:flex; align-items:flex-start; gap:var(--s3); }
.drawer-body{ padding:var(--s4); overflow-y:auto; flex:1; display:grid; gap:var(--s4); align-content:start; }
.drawer-foot{ padding:var(--s3) var(--s4); border-top:1px solid var(--border); display:flex; gap:var(--s2); flex-wrap:wrap; background:var(--surface); border-radius:0 0 var(--rad) var(--rad); }
.modal-wrap{ align-items:center; justify-content:center; padding:var(--s4); }
.modal{
  width:min(620px, 100%); max-height:100%; overflow-y:auto; background:var(--paper);
  border-radius:var(--rad); box-shadow:0 30px 80px oklch(0.235 0.05 262 / 0.4);
  padding:var(--s5); animation:popIn 0.2s ease;
}
.partidas{ display:grid; gap:0; border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.partida{ display:flex; justify-content:space-between; gap:12px; padding:10px 14px; border-bottom:1px solid var(--border); background:var(--surface); font-size:13.5px; }
.partida:last-child{ border-bottom:0; }
.partida .h{ color:var(--muted); font-size:12.5px; }
.partida.total{ background:var(--info-bg); font-weight:700; }
.comentario{ background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px 14px; }
.comentario .who{ font-weight:700; font-size:13px; }
.comentario .when{ font-size:11.5px; color:var(--muted); margin-left:6px; font-weight:500; }
.comentario p{ margin:6px 0 0; font-size:13.5px; }
.firma-box{
  border:1px dashed var(--border); border-radius:12px; background:var(--surface);
  display:grid; place-items:center; padding:var(--s3); min-height:96px;
}
.analisis{ background:var(--info-bg); border-radius:12px; padding:var(--s3) var(--s4); display:grid; gap:8px; }
.analisis li{ font-size:13.5px; }
.analisis ul{ margin:0; padding-left:18px; display:grid; gap:6px; }

/* ---------- Empty state ---------- */
.empty{
  text-align:center; padding:var(--s6) var(--s4); display:grid; gap:10px; justify-items:center;
  color:var(--muted);
}
.empty h3{ font-size:16px; color:var(--ink); }
.empty p{ margin:0; color:var(--muted); font-size:14px; }

/* ---------- Toasts ---------- */
.toasts{ position:fixed; bottom:var(--s4); left:50%; transform:translateX(-50%); z-index:90; display:grid; gap:8px; width:min(420px, calc(100vw - 32px)); }
.toast{
  display:flex; align-items:center; gap:10px; padding:12px 14px;
  background:var(--navy); color:var(--on-navy); border-radius:12px;
  box-shadow:0 12px 32px oklch(0.235 0.05 262 / 0.4); font-size:13.5px; font-weight:500;
  animation:popIn 0.2s ease;
}
.toast button{ margin-left:auto; background:none; border:0; color:var(--on-navy); opacity:0.7; font-size:16px; }
.toast button:hover{ opacity:1; }

/* ---------- Notificaciones ---------- */
.notif-pop{
  position:absolute; top:50px; right:0; width:min(360px, 86vw); z-index:50;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--rad);
  box-shadow:0 20px 50px oklch(0.235 0.05 262 / 0.22); overflow:hidden;
}
.notif-head{ display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--border); font-weight:700; font-size:14px; }
.notif-item{ display:flex; gap:10px; padding:12px 16px; border-bottom:1px solid var(--border); font-size:13.5px; }
.notif-item:last-child{ border-bottom:0; }
.notif-item b{ font-weight:700; }
.notif-item .t{ display:block; font-size:11.5px; color:var(--muted); margin-top:2px; }

/* ---------- Login (referencia del mock; sin uso hasta que exista acceso) ---------- */
.login{ display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); min-height:100vh; }
.login-side{
  position:relative; overflow:hidden; color:var(--on-navy);
  background:radial-gradient(90% 90% at 10% 0%, var(--navy-2) 0%, var(--navy) 70%);
  padding:var(--s6); display:flex; flex-direction:column; gap:var(--s6);
}
.login-claim{ position:relative; margin:auto 0; display:grid; gap:var(--s4); max-width:520px; }
.login-claim h1{ font-size:clamp(1.9rem, 3.4vw, 2.7rem); line-height:1.12; }
.login-claim h1 em{ font-style:normal; color:var(--accent); }
.login-claim p{ margin:0; color:oklch(0.955 0.008 84 / 0.75); font-size:15.5px; }
.login-form-wrap{ display:grid; place-items:center; padding:var(--s6) var(--s4); background:var(--paper); }
.login-card{ width:min(420px, 100%); display:grid; gap:var(--s4); }
.login-error{
  display:flex; gap:9px; align-items:flex-start; background:var(--bad-bg); color:var(--bad);
  border-radius:12px; padding:12px 14px; font-size:13.5px; font-weight:600;
}
.login-foot{ text-align:center; font-size:12.5px; color:var(--muted); }

/* ---------- Avisos emergentes (avisos.js) ---------- */
.avisos{
  bottom:18px; display:flex; flex-direction:column; gap:10px; position:fixed;
  right:18px; width:min(380px, calc(100vw - 32px)); z-index:90;
}
.aviso-toast{
  background:var(--navy); color:var(--on-navy);
  border:1px solid oklch(1 0 0 / 0.12);
  border-radius:12px;
  box-shadow:0 12px 32px oklch(0.235 0.05 262 / 0.4);
  opacity:0; padding:11px 30px 11px 13px; position:relative;
  transform:translateY(10px);
  transition:opacity 0.22s ease, transform 0.22s ease;
  font-size:13.5px;
}
.aviso-toast.aviso-visible{ opacity:1; transform:translateY(0); }
.aviso-cuerpo{ align-items:flex-start; color:inherit; display:flex; gap:10px; text-decoration:none; }
.aviso-cuerpo:hover{ text-decoration:none; }
.aviso-cuerpo::after{ border-radius:12px; content:""; inset:0; position:absolute; z-index:1; }
.aviso-icono{ font-size:16px; line-height:1.35; }
.aviso-bloque{ display:block; min-width:0; }
.aviso-titulo{ display:block; font-size:13px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aviso-texto, .aviso-restantes{ color:oklch(0.955 0.008 84 / 0.72); display:block; font-size:13px; }
.aviso-restantes{ font-size:12px; margin-top:2px; }
.aviso-cerrar{
  align-items:center; background:transparent; border:0; border-radius:6px;
  color:var(--on-navy); cursor:pointer; display:flex; font:inherit; font-size:15px;
  height:22px; justify-content:center; line-height:1; opacity:0.7; position:absolute;
  right:6px; top:6px; width:22px; z-index:2;
}
.aviso-cerrar:hover{ background:oklch(1 0 0 / 0.12); opacity:1; }

/* ---------- Componentes legacy conservados ---------- */
.notice{
  background:var(--ok-bg); border:1px solid oklch(0.58 0.13 155 / 0.35);
  border-radius:12px; color:var(--ok); font-weight:600;
  margin:0 0 var(--s4); padding:10px 14px;
}
.aviso{
  align-items:center; background:var(--warn-bg); border:1px solid oklch(0.60 0.13 75 / 0.35);
  border-radius:12px; display:flex; flex-wrap:wrap; gap:10px 18px; color:var(--ink);
  justify-content:space-between; margin-bottom:var(--s4); padding:12px 16px;
}
.aviso p{ margin:0; }
.muted{ color:var(--muted); }
.total-hint{ font-size:15px; }
.detail-grid{ display:grid; gap:10px 24px; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); }
.detail-grid dt{ color:var(--muted); font-size:11.5px; text-transform:uppercase; letter-spacing:0.08em; font-weight:700; }
.detail-grid dd{ margin:2px 0 0; }
.doc-text{ margin:0; white-space:pre-line; }
.steps{ margin:0; padding-left:18px; }
.steps li{ margin-bottom:4px; }
.raw-output{
  background:var(--navy); border-radius:12px; color:var(--on-navy);
  font-family:Consolas, "Cascadia Mono", monospace; font-size:13px; line-height:1.5;
  margin:0; max-height:360px; overflow:auto; padding:12px 14px;
  white-space:pre-wrap; word-break:break-word;
}
.hitos-grid{ display:grid; gap:10px; grid-template-columns:2fr 1fr 1fr 2fr; }
.items-grid{ display:grid; gap:10px; grid-template-columns:3fr 1fr; }
.bloques-grid{ display:grid; gap:10px; grid-template-columns:1.2fr 0.5fr 2fr; }
.arq-grid{ display:grid; gap:10px; grid-template-columns:1.2fr 2fr 0.7fr; }
.hitos-grid .head, .items-grid .head, .bloques-grid .head, .arq-grid .head{
  color:var(--muted); font-size:11.5px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
}
.responder__status{ color:var(--muted); font-size:13px; min-height:1.3em; margin:4px 0; }
.responder__option{ align-items:flex-start; display:flex; gap:10px; padding:8px 0; }
.responder__option input[type="checkbox"]{ margin-top:13px; }
.responder__option-text{ display:grid; gap:4px; }
.firma-list{ display:grid; gap:10px; list-style:none; margin:var(--s4) 0 0; padding:0; }
.firma-item{
  align-items:center; background:var(--surface); border:1px solid var(--border);
  border-radius:12px; display:flex; flex-wrap:wrap; gap:12px; padding:12px 14px;
}
.firma-item p{ margin:0; }

/* ---------- Correo de entrega ---------- */
.correo-grid{ align-items:start; display:grid; gap:20px; grid-template-columns:repeat(2, minmax(0,1fr)); }
#correo-mensaje{ min-height:320px; }
.correo-preview{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--rad);
  display:block; height:560px; width:100%;
}
.correo-estado{ color:var(--muted); margin:6px 0 0; min-height:1.3em; }
.correo-estado-ok{ color:var(--ok); font-weight:600; }
.correo-estado-error{ color:var(--bad); font-weight:600; }
.correo-aviso-cred{ background:var(--warn-bg); border-color:oklch(0.60 0.13 75 / 0.4); color:var(--warn); }
.respuesta{ border-top:1px solid var(--border); padding:14px 0; }
.respuesta:first-of-type{ border-top:0; padding-top:0; }
.respuesta > p{ margin:6px 0; }
.respuesta-meta{ align-items:center; display:flex; flex-wrap:wrap; gap:8px; }
.actividad-linea{ margin:0 0 12px; }
.actividad-linea p{ margin:0; }

/* ---------- Animaciones ---------- */
.rise{ animation:rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rise{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:none; } }
@keyframes fadeIn{ from{ opacity:0; } to{ opacity:1; } }
@keyframes slideIn{ from{ transform:translateX(30px); opacity:0; } to{ transform:none; opacity:1; } }
@keyframes popIn{ from{ transform:translateY(10px) scale(0.98); opacity:0; } to{ transform:none; opacity:1; } }
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation:none !important; transition:none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px){
  .grid-2, .columns{ grid-template-columns:1fr; }
}
@media (max-width: 940px){
  .app{ grid-template-columns:1fr; }
  .sidebar{
    position:fixed; inset:0 auto 0 0; width:min(300px, 84vw); height:100%;
    transform:translateX(-105%); transition:transform 0.24s ease;
    box-shadow:24px 0 64px oklch(0.235 0.05 262 / 0.4);
  }
  .sidebar.open{ transform:none; }
  .menu-btn{ display:grid; }
  .topbar, .content{ padding-left:var(--s4); padding-right:var(--s4); }
  .search{ width:min(220px, 44vw); }
  .login{ grid-template-columns:1fr; }
}
@media (max-width: 760px){
  .form-grid, .hitos-grid, .items-grid, .correo-grid, .bloques-grid, .arq-grid{ grid-template-columns:1fr; }
  .hitos-grid .head, .items-grid .head, .bloques-grid .head, .arq-grid .head{ display:none; }
}
@media (max-width: 640px){
  .search{ display:none; }
  .crumb{ display:none; }
}
