/* QTomatik 2.0 — sistema de diseño (azul marino + azul eléctrico) */
@font-face { font-family: 'Outfit'; font-weight: 400; font-display: swap; src: url('/tv/fonts/outfit-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 500; font-display: swap; src: url('/tv/fonts/outfit-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 700; font-display: swap; src: url('/tv/fonts/outfit-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 800; font-display: swap; src: url('/tv/fonts/outfit-latin-800-normal.woff2') format('woff2'); }
:root {
  --navy-950: #040b1c; --navy-900: #071530; --navy-800: #0c2049; --navy-700: #13306a;
  --blue: #1f6bff; --blue-600: #1557e0; --blue-300: #7fb0ff; --blue-50: #eef4ff; --cyan: #33c7ff;
  --ink: #0d1a33; --ink-2: #44526e; --ink-3: #7a879f; --line: #e3e8f2; --bg: #f4f7fc; --card: #fff;
  --ok: #12a46b; --ok-50: #e7f8f0; --warn: #d98a00; --warn-50: #fff6e3; --bad: #e0384f; --bad-50: #fdecef; --violet: #7a5af8;
  --r: 14px; --r-lg: 20px; --shadow: 0 1px 2px rgba(7,21,48,.06), 0 6px 24px rgba(7,21,48,.06);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--ink-3); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; }
.stack { display: grid; gap: 12px; } .grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; transition: transform .06s, background .15s, box-shadow .15s; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: #f7f9fd; } .btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(31,107,255,.28); } .btn-primary:hover { background: var(--blue-600); }
.btn-navy { background: var(--navy-900); border-color: var(--navy-900); color: #fff; } .btn-navy:hover { background: var(--navy-800); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn-ok:hover { filter: brightness(.95); background: var(--ok); }
.btn-bad { color: var(--bad); border-color: #f5c5cd; } .btn-bad:hover { background: var(--bad-50); }
.btn-ghost { background: transparent; border-color: transparent; } .btn-ghost:hover { background: rgba(31,107,255,.08); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 17px; border-radius: 14px; }
.btn-block { width: 100%; }

/* Formularios */
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid #d3dbea; border-radius: 11px; background: #fff; font-size: 16px; outline: none; transition: border .15s, box-shadow .15s; }
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31,107,255,.14); }
.req::after { content: ' *'; color: var(--bad); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.seg { display: inline-flex; background: #eef2f9; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Tarjetas y etiquetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f9; color: var(--ink-2); }
.pill.ok { background: var(--ok-50); color: var(--ok); } .pill.warn { background: var(--warn-50); color: var(--warn); } .pill.bad { background: var(--bad-50); color: var(--bad); }
.pill.blue { background: var(--blue-50); color: var(--blue); } .pill.violet { background: #f1edff; color: var(--violet); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.code { font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi { display: grid; gap: 2px; } .kpi b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; } .kpi span { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.empty { text-align: center; padding: 26px 10px; color: var(--ink-3); font-size: 14px; }

/* Avisos */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 100; background: var(--navy-900); color: #fff;
  padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: all .25s; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } #toast.err { background: var(--bad); }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--blue-50); color: var(--navy-800); }
.alert.warn { background: var(--warn-50); color: #8a5800; } .alert.bad { background: var(--bad-50); color: #a01d31; } .alert.ok { background: var(--ok-50); color: #0b6b46; }

/* Diálogo */
.modal-bg { position: fixed; inset: 0; background: rgba(4,11,28,.55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; z-index: 90; padding: 0; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@media (min-width: 700px) { .modal-bg { align-items: center; padding: 20px; } .modal { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { margin-bottom: 14px; }
.modal .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* Marca */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: inherit; }
.brand i { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--blue), var(--cyan)); display: grid; place-items: center; color: #fff; font-style: normal; font-size: 17px; box-shadow: 0 6px 16px rgba(31,107,255,.35); }
.brand span b { color: var(--blue-300); font-weight: 800; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(31,107,255,.2); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Menús con buscador (Año → Marca → Modelo) */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid #d3dbea; border-radius: 12px; box-shadow: 0 12px 30px rgba(7,21,48,.16); -webkit-overflow-scrolling: touch; }
.combo-list button { display: block; width: 100%; text-align: left; padding: 11px 13px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font-size: 15px; }
.combo-list button:hover, .combo-list button.on { background: var(--blue-50); color: var(--blue); }
.combo-list .combo-manual { color: var(--blue); font-weight: 600; background: #f8faff; position: sticky; bottom: 0; border-top: 1px solid var(--line); }
.combo-msg { padding: 11px 13px; color: var(--ink-3); font-size: 14px; }
