/* Sistema visual: neutros fríos, una sola tinta de acento, bordes finos, tipografía Inter. */
:root {
  --bg: #fbfbfc; --panel: #ffffff; --panel-2: #f5f6f8; --line: #e6e8ec; --line-2: #d9dce2;
  --text: #0f1115; --text-2: #4a505c; --text-3: #7c8391;
  --accent: #2f5bea; --accent-ink: #ffffff; --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --ok: #12805c; --ok-soft: #e6f4ee; --warn: #b25e09; --warn-soft: #fdf1e3; --bad: #c62f3c; --bad-soft: #fcebec; --info: #3b5bdb; --info-soft: #eaefff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -6px rgba(16, 24, 40, .10);
  --shadow-lg: 0 24px 60px -12px rgba(16, 24, 40, .25);
  --r: 10px; --r-sm: 7px; --r-lg: 14px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0f; --panel: #121418; --panel-2: #181b20; --line: #23262d; --line-2: #2e323a;
    --text: #eceef2; --text-2: #a9afbb; --text-3: #737a87;
    --ok: #3ccf91; --ok-soft: #10261d; --warn: #f0a24a; --warn-soft: #2a1e10; --bad: #ff6b76; --bad-soft: #2c1417; --info: #8ea8ff; --info-soft: #151c33;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -6px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c0f; --panel: #121418; --panel-2: #181b20; --line: #23262d; --line-2: #2e323a;
  --text: #eceef2; --text-2: #a9afbb; --text-3: #737a87;
  --ok: #3ccf91; --ok-soft: #10261d; --warn: #f0a24a; --warn-soft: #2a1e10; --bad: #ff6b76; --bad-soft: #2c1417; --info: #8ea8ff; --info-soft: #151c33;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -6px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); font-feature-settings: 'cv11', 'ss01', 'tnum'; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; } .hide { display: none !important; }
::selection { background: var(--accent-soft); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 500 13px var(--font); cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, transform .06s; text-decoration: none; }
.btn:hover { background: var(--panel-2); } .btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.15); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: var(--r); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Formularios */
label.f { display: grid; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
input, select, textarea { width: 100%; min-width: 0; height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 14px var(--font); }
textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
input[type="color"] { padding: 2px; width: 46px; }
.grid { display: grid; gap: 14px; } .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)); }
.row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .between { justify-content: space-between; }

/* Tarjetas, insignias, tablas */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card .hd { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card .bd { padding: 18px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.borrador { color: var(--text-3); }
.badge.enviado { color: var(--info); background: var(--info-soft); border-color: transparent; }
.badge.visto { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge.aceptado { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge.rechazado { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; } table.t tbody tr.click:hover td { background: var(--panel-2); }
.kbd { font: 11px var(--font); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--text-3); }

/* Toast y modal */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; font-size: 13px; transition: .2s; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); } #toast.bad { background: var(--bad); color: #fff; }
.modal-bg { position: fixed; inset: 0; background: rgba(10, 12, 16, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { width: min(860px, 100%); }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal .mb { padding: 20px; overflow: auto; } .modal .mf { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0 } } @keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px) } }
.theme-btn svg { width: 16px; height: 16px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .ico { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); }
