/* ============================================================
   PARQUEADERO CMS — Estilos principales
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #0a0e1a;
  --bg2:     #111827;
  --bg3:     #1e2535;
  --bg4:     #273044;
  --accent:  #3b82f6;
  --accent2: #60a5fa;
  --green:   #22c55e;
  --amber:   #f59e0b;
  --red:     #ef4444;
  --purple:  #a855f7;
  --teal:    #14b8a6;
  --border:  rgba(255,255,255,.08);
  --text:    #e2e8f0;
  --muted:   #94a3b8;
  --faint:   #374151;
  --shadow:  0 4px 24px rgba(0,0,0,.4);
  --radius:  10px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── LOGIN ───────────────────────────────────────────── */
#loginScreen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 40%, #1a2a4a 0%, #0a0e1a 70%);
  z-index: 300;
}
.login-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px; width: 380px;
  box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-icon { font-size: 48px; display: block; margin-bottom: 10px; }
.login-logo h1 { font-size: 20px; font-weight: 700; }
.login-logo p  { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── LAYOUT APP ──────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: 220px; background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sb-logo { padding: 18px 16px; border-bottom: 1px solid var(--border); }
.sb-logo-icon {
  width: 36px; height: 36px; background: var(--accent); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 8px;
}
.sb-logo h2  { font-size: 13px; font-weight: 700; }
.sb-logo p   { font-size: 10px; color: var(--muted); margin-top: 2px; }

.nav         { padding: 10px 6px; flex: 1; overflow-y: auto; }
.nav-group   { font-size: 10px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; padding: 12px 8px 4px; }
.nav-item    { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); transition: all .15s; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .ni { font-size: 16px; width: 20px; text-align: center; }
.nav-item.hidden { display: none; }

.sb-foot { padding: 12px 14px; border-top: 1px solid var(--border); }
.sb-user { font-size: 10px; color: var(--faint); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── MAIN ────────────────────────────────────────────── */
.main        { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar      { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.topbar h2   { font-size: 15px; font-weight: 600; }
.topbar-right{ display: flex; align-items: center; gap: 10px; }
.content     { flex: 1; overflow-y: auto; padding: 20px 24px; }
.page        { display: none; }
.page.active { display: block; }

/* ── CARDS ───────────────────────────────────────────── */
.card        { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card-title  { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 14px; }
.grid-2      { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-4      { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
@media(max-width:900px){ .grid-2,.grid-4 { grid-template-columns: 1fr; } }

/* ── STATS ───────────────────────────────────────────── */
.stat-card   { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-label  { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.stat-value  { font-size: 28px; font-weight: 700; }
.stat-sub    { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── FORMS ───────────────────────────────────────────── */
.form-row    { margin-bottom: 13px; }
.form-label  { font-size: 11px; color: var(--muted); margin-bottom: 5px; display: block; font-weight: 600; }
.form-input,
.form-select,
.form-textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 7px; padding: 9px 12px; color: var(--text); font-size: 13px;
  outline: none; transition: border .15s; font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { resize: vertical; }
.form-select   { cursor: pointer; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-full   { width: 100%; justify-content: center; }
.btn-primary{ background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-green  { background: var(--green); color: #fff; }
.btn-green:hover  { background: #16a34a; }
.btn-red    { background: var(--red); color: #fff; }
.btn-amber  { background: var(--amber); color: #111; }
.btn-ghost  { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover  { background: var(--bg3); }
.btn-sm     { padding: 6px 12px; font-size: 12px; }
.btn-xs     { padding: 4px 8px; font-size: 11px; border-radius: 5px; }

/* ── BADGES ──────────────────────────────────────────── */
.badge       { background: var(--accent); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.badge-green { background: rgba(34,197,94,.2);  color: #4ade80; }
.badge-amber { background: rgba(245,158,11,.2); color: #fbbf24; }
.badge-red   { background: rgba(239,68,68,.2);  color: #f87171; }
.badge-purple{ background: rgba(168,85,247,.2); color: #c084fc; }
.role-admin  { background: rgba(168,85,247,.2); color: #c084fc; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.role-op     { background: rgba(34,197,94,.2);  color: #4ade80; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }

/* ── VEHICLE TABS ────────────────────────────────────── */
.vtabs       { display: flex; gap: 8px; margin-bottom: 14px; }
.vtab        { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; text-align: center; font-size: 13px; font-weight: 600; transition: all .15s; background: var(--bg3); color: var(--muted); }
.vtab:hover  { border-color: var(--accent); }
.vtab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.vtab span   { font-size: 22px; display: block; margin-bottom: 3px; }

/* ── DATETIME BOX ────────────────────────────────────── */
.dt-box      { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 12px; text-align: center; margin-bottom: 12px; }
.dt-time     { font-size: 30px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.dt-date     { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── TARIFA PICKER ───────────────────────────────────── */
.tarifa-pick { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 13px; margin-bottom: 6px; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: space-between; }
.tarifa-pick:hover  { border-color: var(--accent); }
.tarifa-pick.sel    { border-color: var(--accent); background: rgba(59,130,246,.1); }
.tp-name     { font-size: 13px; font-weight: 600; }
.tp-desc     { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tp-price    { font-size: 17px; font-weight: 700; color: var(--accent); }
.tp-unit     { font-size: 10px; color: var(--muted); }

/* ── TARIFA EDITOR ───────────────────────────────────── */
.te-row      { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.te-grid     { display: grid; grid-template-columns: 1.5fr 1.5fr 90px 100px 80px 36px; gap: 6px; align-items: center; margin-bottom: 8px; }
.te-grid2    { display: grid; grid-template-columns: 130px 1fr; gap: 8px; align-items: center; }

/* ── WHATSAPP PREVIEW ────────────────────────────────── */
.wa-box      { background: #0d1117; border: 1px solid #1e3a2f; border-radius: 10px; padding: 13px; }
.wa-head     { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #1e3a2f; }
.wa-av       { width: 32px; height: 32px; background: #25d366; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.wa-name     { font-size: 13px; font-weight: 600; }
.wa-online   { font-size: 9px; color: #22c55e; }
.wa-bubble   { background: #1f2d1f; border-radius: 4px 10px 10px 10px; padding: 10px 12px; font-size: 11px; line-height: 1.7; color: #d4edda; }
.wa-ts       { font-size: 9px; color: #4a7a4a; text-align: right; margin-top: 4px; }

/* ── TABLE ───────────────────────────────────────────── */
.tbl-wrap    { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
table        { width: 100%; border-collapse: collapse; min-width: 600px; }
th           { background: var(--bg3); padding: 9px 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
td           { padding: 9px 14px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
tr:last-child td { border: none; }
tr:hover td  { background: var(--bg3); }
.plate       { background: var(--amber); color: #111; font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 4px; letter-spacing: 1px; font-family: monospace; white-space: nowrap; }

/* ── STATUS DOTS ─────────────────────────────────────── */
.dot         { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.dot-green   { background: var(--green); }
.dot-amber   { background: var(--amber); }
.dot-red     { background: var(--red); }

/* ── PERIOD TABS ─────────────────────────────────────── */
.ptabs       { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.ptab        { padding: 5px 13px; border-radius: 6px; font-size: 12px; cursor: pointer; border: 1px solid var(--border); color: var(--muted); background: var(--bg3); transition: all .15s; }
.ptab:hover  { border-color: var(--accent); color: var(--text); }
.ptab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── MODAL ───────────────────────────────────────────── */
.overlay     { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.overlay.open{ display: flex; }
.modal       { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 500px; max-width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 0; }

/* ── SEARCH BAR ──────────────────────────────────────── */
.srow        { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.sinput      { background: var(--bg2); border: 1px solid var(--border); border-radius: 7px; padding: 7px 12px; color: var(--text); font-size: 13px; outline: none; width: 220px; transition: border .15s; }
.sinput:focus{ border-color: var(--accent); }

/* ── TOAST ───────────────────────────────────────────── */
.toast       { position: fixed; bottom: 18px; right: 18px; background: var(--green); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; z-index: 999; display: none; box-shadow: var(--shadow); animation: slideUp .2s ease; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── USER TAG ────────────────────────────────────────── */
.user-tag    { font-size: 11px; color: var(--muted); background: var(--bg3); padding: 4px 10px; border-radius: 6px; }
.clk         { font-size: 12px; color: var(--muted); font-family: monospace; }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .icon { font-size: 40px; display: block; margin-bottom: 12px; opacity: .5; }

/* ── SCROLL ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 4px; }

/* ── LOADING ─────────────────────────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--muted); gap: 8px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
