:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #e4e8ec;
  --line-strong: #d3d9df;
  --text: #0f1b26;
  --text-2: #4a5a68;
  --text-3: #7b8894;
  --brand: #0e7c66;
  --brand-strong: #0a6655;
  --brand-soft: #e3f3ef;
  --ink: #0d1b2a;
  --focus: 0 0 0 3px rgba(14, 124, 102, .22);
  --shadow-sm: 0 1px 2px rgba(15, 27, 38, .05);
  --shadow: 0 1px 2px rgba(15, 27, 38, .04), 0 4px 16px rgba(15, 27, 38, .06);
  --shadow-lg: 0 24px 64px rgba(15, 27, 38, .18);
  --radius: 14px;
  --radius-sm: 10px;

  --s-enviado: #11875d;   --s-enviado-bg: #e4f5ec;
  --s-pendiente: #b26b00; --s-pendiente-bg: #fdf2dc;
  --s-fallido: #c62f3a;   --s-fallido-bg: #fce8ea;
  --s-invalido: #b8430f;  --s-invalido-bg: #fdebe0;
  --s-incompleto: #5a57c7; --s-incompleto-bg: #ecebfb;
  --s-anulado: #66727d;   --s-anulado-bg: #eef1f3;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1218;
    --surface: #111b23;
    --surface-2: #15212b;
    --line: #1f2d38;
    --line-strong: #2a3a47;
    --text: #e7edf2;
    --text-2: #a9b6c1;
    --text-3: #7b8a96;
    --brand: #2bb593;
    --brand-strong: #3fcaa7;
    --brand-soft: rgba(43, 181, 147, .14);
    --focus: 0 0 0 3px rgba(43, 181, 147, .3);
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);

    --s-enviado: #4fd39a;   --s-enviado-bg: rgba(79, 211, 154, .12);
    --s-pendiente: #f2b84b; --s-pendiente-bg: rgba(242, 184, 75, .13);
    --s-fallido: #ff7a82;   --s-fallido-bg: rgba(255, 122, 130, .13);
    --s-invalido: #ff9a62;  --s-invalido-bg: rgba(255, 154, 98, .13);
    --s-incompleto: #a3a1ff; --s-incompleto-bg: rgba(163, 161, 255, .14);
    --s-anulado: #9aa7b2;   --s-anulado-bg: rgba(154, 167, 178, .13);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 14px/1.5 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
button, input, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--text-3); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: none; cursor: pointer;
  font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, .presets button:focus-visible, .seg button:focus-visible, .kpi:focus-visible, tr[tabindex]:focus-visible, .mcard:focus-visible {
  outline: none; box-shadow: var(--focus);
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { border-color: var(--line-strong); background: var(--surface); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--text-3); color: var(--text); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { filter: brightness(.97); }
.btn-block { width: 100%; height: 46px; font-size: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: default; background: none; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: .01em; }
input, select {
  height: 40px; width: 100%; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: var(--focus); }
select {
  appearance: none; padding-right: 34px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8894' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
input[type="date"] { font-feature-settings: "tnum" 1; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1.05fr 1fr;
}
.login-brand {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, #13463d 0%, var(--ink) 55%);
  color: #e9f1f4; padding: clamp(32px, 6vw, 80px);
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
}
.login-brand::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 60px rgba(255, 255, 255, .025), 0 0 0 130px rgba(255, 255, 255, .02);
}
.login-brand h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.08; font-weight: 800; }
.login-brand p { max-width: 420px; margin: 0; color: #a9bfc6; font-size: 16px; }
.login-points { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; color: #cfdde2; }
.login-points li { display: flex; align-items: center; gap: 10px; }
.login-points li::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: rgba(43, 181, 147, .2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234fd3b0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center/12px no-repeat;
}
.brand-mark {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, #1aa383, #0e7c66); color: #fff;
  box-shadow: 0 8px 24px rgba(14, 124, 102, .35);
}
.brand-mark svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.brand-mark.sm { width: 36px; height: 36px; border-radius: 10px; box-shadow: none; }
.brand-mark.sm svg { width: 19px; height: 19px; }

.login-card {
  align-self: center; justify-self: center; width: min(400px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 18px; padding: 24px 0;
}
.login-card h2 { font-size: 26px; font-weight: 800; }
.login-card .muted { margin: -10px 0 6px; }
.login-card input { height: 46px; font-size: 15px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 48px; }
.pass-wrap .icon-btn { position: absolute; right: 4px; top: 4px; }
.form-error {
  margin: 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--s-fallido-bg); color: var(--s-fallido); font-weight: 600;
}

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { padding: 36px 20px 30px; gap: 12px; }
  .login-brand h1 br { display: none; }
  .login-brand h1 { font-size: 28px; }
  .login-brand p { font-size: 14px; }
  .login-points { display: none; }
  .login-card { align-self: start; padding-top: 32px; }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 1360px; margin: 0 auto; height: 62px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.tb-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-brand strong { display: block; font-size: 15px; font-weight: 800; line-height: 1.2; }
.tb-sub { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { display: flex; align-items: center; gap: 6px; }
.tb-update { font-size: 12px; color: var(--text-3); margin-right: 4px; }
#refreshBtn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.container { max-width: 1360px; margin: 0 auto; padding: 28px 24px 40px; display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { margin: 2px 0 0; }
.presets {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.presets button {
  border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.presets button:hover { color: var(--text); }
.presets button.on { background: var(--ink); color: #fff; }
@media (prefers-color-scheme: dark) { .presets button.on { background: var(--brand); color: #04201a; } }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.kpi {
  position: relative; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.kpi:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.kpi .k-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--text-3)); flex: none; }
.kpi .k-val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.kpi .k-pct { font-size: 12px; color: var(--text-3); font-weight: 600; }
.kpi .k-bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.kpi .k-bar i { display: block; height: 100%; background: var(--c, var(--brand)); border-radius: 3px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.kpi.on { border-color: var(--c, var(--brand)); box-shadow: 0 0 0 1px var(--c, var(--brand)) inset, var(--shadow); }
.kpi.total { background: var(--ink); border-color: var(--ink); color: #fff; }
.kpi.total .k-label, .kpi.total .k-pct { color: #9fb3bd; }
.kpi.total .k-bar { background: rgba(255, 255, 255, .12); }
.kpi.total .k-bar i { background: #2bb593; }
@media (prefers-color-scheme: dark) { .kpi.total { background: var(--surface-2); border-color: var(--line-strong); } }
.kpi.total.on { box-shadow: 0 0 0 2px var(--brand), var(--shadow); }

@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .kpis {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px;
    margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none;
  }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 42%; scroll-snap-align: start; padding: 12px 14px 14px; }
  .kpi .k-val { font-size: 22px; }
}

/* ---------- Filtros ---------- */
.filters { padding: 14px; display: grid; gap: 14px; grid-template-columns: 1fr auto; }
.search { position: relative; grid-column: 1 / -1; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search input { height: 46px; padding-left: 42px; font-size: 15px; background: var(--surface-2); }
.filters-toggle { display: none; }
.filters-more {
  grid-column: 1 / -1; display: grid; gap: 12px; align-items: end;
  grid-template-columns: auto 150px 150px 170px minmax(160px, 1fr) minmax(180px, 1.3fr) auto;
}
.filters-actions { display: flex; gap: 8px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); height: 40px; background: var(--surface-2); }
.seg button { border: 0; background: none; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; }

@media (max-width: 1180px) {
  .filters-more { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters-actions { justify-content: flex-end; grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .filters { grid-template-columns: 1fr auto; padding: 12px; gap: 10px; }
  .search { grid-column: 1; }
  .search input { height: 44px; }
  .filters-toggle { display: inline-flex; height: 44px; }
  .filters-more { display: none; grid-template-columns: 1fr 1fr; }
  .filters.open .filters-more { display: grid; }
  .filters-more .field:first-child, .filters-more .field:nth-child(4), .filters-more .field:nth-child(5), .filters-more .field:nth-child(6), .filters-actions { grid-column: 1 / -1; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .filters-actions .btn { flex: 1; }
}

/* ---------- Resultados ---------- */
.results { overflow: hidden; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.results-head p { margin: 0; }
.results-head strong { color: var(--text); }
.sort { display: flex; align-items: center; gap: 8px; }
.sort select { height: 34px; width: auto; font-size: 13px; }

.table-wrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; }
.grid th {
  text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tbody tr { cursor: pointer; transition: background .12s; }
.grid tbody tr:hover { background: var(--surface-2); }
.grid tbody tr:last-child td { border-bottom: 0; }
.c-main { font-weight: 700; color: var(--text); }
.c-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.c-name { max-width: 280px; }
.c-clip { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowrap { white-space: nowrap; }

.status {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  color: var(--c); background: var(--cb);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-enviado { --c: var(--s-enviado); --cb: var(--s-enviado-bg); }
.st-pendiente { --c: var(--s-pendiente); --cb: var(--s-pendiente-bg); }
.st-fallido { --c: var(--s-fallido); --cb: var(--s-fallido-bg); }
.st-invalido { --c: var(--s-invalido); --cb: var(--s-invalido-bg); }
.st-incompleto { --c: var(--s-incompleto); --cb: var(--s-incompleto-bg); }
.st-anulado { --c: var(--s-anulado); --cb: var(--s-anulado-bg); }

.skeleton td div { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton td div + div { width: 60%; margin-top: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { display: grid; justify-items: center; gap: 6px; padding: 56px 16px; text-align: center; }
.empty svg { width: 40px; height: 40px; color: var(--text-3); stroke-width: 1.4; margin-bottom: 6px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.pager-size { display: flex; align-items: center; gap: 8px; }
.pager-size select { height: 34px; width: auto; font-size: 13px; }
.pager-nav { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.foot { text-align: center; font-size: 12px; }

/* ---------- Tarjetas móviles ---------- */
.mlist { display: none; }
@media (max-width: 860px) {
  .container { padding: 18px 16px 32px; gap: 14px; }
  .topbar-inner { padding: 0 16px; height: 58px; }
  .tb-update, #logoutBtn span { display: none; }
  #logoutBtn { width: 38px; padding: 0; }
  .page-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .page-head h1 { font-size: 22px; }
  .presets { display: flex; overflow-x: auto; scrollbar-width: none; }
  .presets button { flex: 1; }

  .grid thead { display: none; }
  .grid, .grid tbody { display: block; }
  .grid tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .grid tbody tr:last-child { border-bottom: 0; }
  .grid td { display: block; padding: 0; border: 0; }
  .grid td.t-pac { grid-column: 1; }
  .grid td.t-est { grid-column: 2; grid-row: 1; justify-self: end; }
  .grid td.t-cita, .grid td.t-esp, .grid td.t-con, .grid td.t-reg { grid-column: 1 / -1; }
  .grid td.t-cita { display: flex; gap: 6px; align-items: baseline; margin-top: 6px; }
  .grid td.t-cita .c-main::before { content: "Cita "; font-weight: 600; color: var(--text-3); }
  .grid td.t-con { display: flex; gap: 10px; }
  .grid td.t-con .c-main, .grid td.t-con .c-sub { font-size: 12.5px; font-weight: 600; color: var(--text-3); margin: 0; }
  .grid td.t-reg { display: none; }
  .c-name, .c-clip { max-width: none; }
  .t-esp .c-main { font-size: 13px; }
  .skeleton td div { width: 70%; }
  .results-head { padding: 10px 14px; }
  .results-head .sort .muted { display: none; }
  .results-head p { font-size: 13px; }
  .pager { padding: 10px 14px; }
}

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(8, 16, 24, .45); animation: fade .2s ease; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%);
  background: var(--surface); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide .28s cubic-bezier(.2, .8, .2, 1);
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--line); padding-top: calc(20px + env(safe-area-inset-top)); }
.drawer-head h2 { font-size: 19px; font-weight: 800; line-height: 1.25; margin-top: 2px; }
.drawer-head .muted { font-size: 12px; font-weight: 700; }
.drawer-body { overflow-y: auto; padding: 20px; display: grid; gap: 20px; align-content: start; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.d-section h3 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 10px; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.d-grid div span { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; }
.d-grid div strong { display: block; font-weight: 700; word-break: break-word; }
.d-grid .full { grid-column: 1 / -1; }
.bubble {
  position: relative; padding: 14px 16px; border-radius: 16px 16px 16px 4px;
  background: var(--surface-2); border: 1px solid var(--line); line-height: 1.6; word-break: break-word;
}
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--text-3)); box-shadow: 0 0 0 4px var(--surface); z-index: 1; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 12px; bottom: -4px; width: 2px; background: var(--line); }
.timeline strong { display: block; font-weight: 700; }
.timeline span { font-size: 12.5px; color: var(--text-3); }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--cb); color: var(--c); font-weight: 600; }
@keyframes slide { from { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 640px) {
  .drawer-panel { top: auto; left: 0; width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; animation-name: rise; }
  .drawer-head { padding-top: 20px; }
  .drawer-head::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); transform: translateX(-50%); }
  .d-grid { gap: 12px; }
}
@keyframes rise { from { transform: translateY(100%); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: fade .2s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Enviados hoy ---------- */
.kpi.today { cursor: default; background: var(--s-enviado-bg); border-color: color-mix(in srgb, var(--s-enviado) 30%, transparent); }
.kpi.today:hover { transform: none; box-shadow: var(--shadow-sm); }
.kpi.today .k-val { color: var(--s-enviado); }
.kpi.today .k-pct { text-transform: capitalize; }
.k-dot.pulse { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s-enviado) 50%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
