/* sgs-flota — design system
   Basado en el patrón de sgs-cargador / sgs-visitor.
   Dark theme con CSS variables + Tailwind + Boxicons. */

/* ── Variables ────────────────────────────────── */
:root {
  --bg: #0b1117; --bg2: #161b22; --surface: #20262f;
  --text: #e8edf4; --dim: #8a96a7; --border: rgba(255,255,255,.08);
  --accent: #6366f1; --accent2: #a855f7;
  --ok: #10b981; --warn: #f59e0b; --err: #ef4444; --info: #3b82f6;
}
body.lia-theme-light {
  --bg: #f5f7fa; --bg2: #ffffff; --surface: #f1f5f9;
  --text: #1e293b; --dim: #64748b; --border: rgba(0,0,0,.1);
}

/* ── Base ─────────────────────────────────────── */
* { box-sizing: border-box; }
body { margin: 0; font-family: 'DM Sans','Segoe UI',system-ui,sans-serif; background: var(--bg); color: var(--text); }
.content { max-width: none; margin: 2rem auto; padding: 0 2rem 6rem; }
h1 { margin: 0 0 .4rem; font-size: 1.6rem; }
h2 { margin: 0 0 .8rem; font-size: 1.2rem; }
.sub { color: var(--dim); font-size: .88rem; margin-bottom: 1.2rem; }
code { background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 4px; font-size: .82rem; }
body.lia-theme-light code { background: rgba(0,0,0,.06); }
.gradient-text { background: linear-gradient(90deg,var(--accent),var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.hidden { display: none !important; }

/* ── Layout ───────────────────────────────────── */
.row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }

/* ── Card ─────────────────────────────────────── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem; margin-bottom: 1rem; }

/* ── Buttons ──────────────────────────────────── */
button, .btn {
  background: var(--accent); color: #fff; border: none; padding: .55rem 1rem; border-radius: 8px;
  cursor: pointer; font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: .5rem;
  transition: all .15s; font-family: inherit;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sec { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--err); }
.btn-ok { background: var(--ok); }
.btn-warn { background: var(--warn); }
.btn-ghost { background: transparent; color: var(--dim); border: 1px solid var(--border); }

/* ── Pills ────────────────────────────────────── */
.pill { display: inline-block; padding: .18rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.pill-ok { background: rgba(16,185,129,.15); color: var(--ok); }
.pill-warn { background: rgba(245,158,11,.15); color: var(--warn); }
.pill-err { background: rgba(239,68,68,.15); color: var(--err); }
.pill-info { background: rgba(59,130,246,.15); color: var(--info); }

/* ── Inputs ───────────────────────────────────── */
input[type="text"], input[type="password"], select {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: .55rem .8rem; font-size: .9rem; font-family: inherit; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Stat grid ────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .7rem; }
.stat .n { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: .72rem; color: var(--dim); margin-top: .2rem; }
.stat.ok { border-left: 3px solid var(--ok); } .stat.ok .n { color: var(--ok); }
.stat.warn { border-left: 3px solid var(--warn); } .stat.warn .n { color: var(--warn); }
.stat.err { border-left: 3px solid var(--err); } .stat.err .n { color: var(--err); }
.stat.info { border-left: 3px solid var(--info); } .stat.info .n { color: var(--info); }

/* ── Tabs ─────────────────────────────────────── */
.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: .6rem; }
.tabs .tab { padding: .5rem 1rem; border-radius: 8px 8px 0 0; cursor: pointer; color: var(--dim); font-weight: 600;
  font-size: .88rem; border: none; background: transparent; }
.tabs .tab.active { background: var(--accent); color: #fff; }
.tabs .tab:hover:not(.active) { background: var(--surface); color: var(--text); }

/* ── Toolbar ──────────────────────────────────── */
.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }

/* ── Table ────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--dim); font-weight: 600; text-transform: uppercase; font-size: .7rem; letter-spacing: .05em;
  position: sticky; top: 0; background: var(--bg2); z-index: 2; }
tr:hover td { background: var(--surface); }
.scroll-x { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.mono { font-family: ui-monospace,monospace; }
.empty { text-align: center; padding: 2rem; color: var(--dim); font-size: .88rem; }

/* ── Modal ────────────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center;
  justify-content: center; z-index: 100; padding: 1rem; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem;
  max-width: 480px; width: 100%; }

/* ── Toast ────────────────────────────────────── */
.toast { position: fixed; bottom: 5rem; right: 1rem; background: var(--bg2); border: 1px solid var(--border);
  border-left: 4px solid var(--ok); padding: .8rem 1rem; border-radius: 8px; z-index: 50;
  box-shadow: 0 8px 16px rgba(0,0,0,.25); font-size: .88rem; animation: slidein .25s; }
.toast.err { border-left-color: var(--err); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Progress ─────────────────────────────────── */
.progress { width: 100%; height: 8px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .3s; }

/* ── Log ──────────────────────────────────────── */
.log { background: #000; border-radius: 8px; padding: .8rem; font-family: ui-monospace,monospace;
  font-size: .75rem; max-height: 200px; overflow-y: auto; color: #86efac; }
.log .warn { color: #fbbf24; } .log .err { color: #fca5a5; } .log .info { color: #93c5fd; }

/* ── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }
