/* Parking · Grupo Technology — interfaz */
:root {
  --ink: #0E1726;
  --ink-2: #16233A;
  --ink-3: #22324D;
  --signal: #F2B705;
  --signal-ink: #2A2000;
  --bg: #F3F4F6;
  --card: #FFFFFF;
  --line: #E3E6EB;
  --line-2: #EEF0F3;
  --text: #121826;
  --muted: #5B6475;
  --faint: #8A93A3;
  --ok: #1E8E4F;
  --warn: #B7791F;
  --bad: #C53030;
  --info: #2B6CB0;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.ico { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #C9D2E0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--signal); color: var(--signal-ink); display: grid; place-items: center; font-weight: 800; font-size: 19px; letter-spacing: -.5px; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; flex: none; }
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .2px; }
.brand small { color: #8291A8; font-size: 11.5px; }
.nav { padding: 10px 10px; overflow-y: auto; flex: 1; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: #63738C; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: #C9D2E0; font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: var(--ink-3); color: #fff; box-shadow: inset 3px 0 0 var(--signal); }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.side-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12.5px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.side-foot button { background: none; border: 1px solid rgba(255,255,255,.14); color: #C9D2E0; padding: 4px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.side-foot button:hover { border-color: rgba(255,255,255,.3); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(243,244,246,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 12px 26px; display: flex; align-items: center; gap: 16px; }
.top h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
.top .sub { color: var(--muted); font-size: 12.5px; }
.top .spacer { flex: 1; }
.content { padding: 22px 26px 60px; }
.top .menu-btn { display: none; }

/* ---------- Elements ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-h h2, .card-h h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-b { padding: 16px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.kpi { padding: 16px 18px; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .val { font-size: 26px; font-weight: 750; letter-spacing: -.6px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--faint); margin-top: 2px; }
.kpi.accent { border-top: 3px solid var(--signal); }
.kpi.danger .val { color: var(--bad); }
.bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--ink-3); border-radius: 3px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 13px; border-radius: 7px; font-weight: 550; cursor: pointer; white-space: nowrap; font-size: 13.5px; line-height: 1.3; }
.btn:hover { border-color: #C8CDD5; background: #FAFAFB; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-3); }
.btn.signal { background: var(--signal); border-color: #D9A404; color: var(--signal-ink); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: #FFF5F5; border-color: #F3B4B4; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 6px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn svg { width: 15px; height: 15px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: #344054; }
.field small { color: var(--faint); font-size: 11.5px; }
.input, select.input, textarea.input { border: 1px solid #D0D5DD; background: #fff; border-radius: 7px; padding: 7px 10px; outline: none; width: 100%; min-height: 35px; }
textarea.input { min-height: 74px; resize: vertical; }
.input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(34,50,77,.12); }
.input.sm { min-height: 31px; padding: 4px 8px; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: #344054; white-space: nowrap; }
.chip.ok { background: #E6F4EC; color: #146C3B; }
.chip.bad { background: #FDECEC; color: #9B2C2C; }
.chip.warn { background: #FEF3DC; color: #8A5A0B; }
.chip.info { background: #E8F0FA; color: #24578F; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.18); flex: none; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 650; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #FAFBFC; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:hover td { background: #FAFBFD; }
.tbl tr.clickable { cursor: pointer; }
.tbl .acts { white-space: nowrap; text-align: right; }
.empty { text-align: center; color: var(--faint); padding: 34px 10px; }

/* ---------- Matriz ---------- */
.mx-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 10px 3px 6px; font-size: 12px; cursor: pointer; font-weight: 550; }
.legend button .sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.2); }
.legend button.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.legend .n { color: var(--faint); font-weight: 500; }
.paintbar { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.paintbar .sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(255,255,255,.4); }
.mx-wrap { overflow: auto; max-height: calc(100vh - 250px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.mx { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.mx th, .mx td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 0; }
.mx thead th { position: sticky; top: 0; background: #F7F8FA; z-index: 3; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 6px; font-weight: 650; }
.mx .stk { position: sticky; background: #fff; z-index: 2; }
.mx thead .stk { z-index: 4; background: #F7F8FA; }
.mx .c-cli { left: 0; min-width: 250px; max-width: 250px; }
.mx .c-pat { left: 250px; min-width: 84px; }
.mx .c-tar { left: 334px; min-width: 54px; box-shadow: 1px 0 0 var(--line); }
.mx td.info { padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx td.info .sub { color: var(--faint); font-size: 11px; }
.mx tr.baja td.info { color: var(--faint); }
.mx tr.baja td.info .nm { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.mx td.cell { min-width: 76px; height: 38px; text-align: center; cursor: pointer; position: relative; font-variant-numeric: tabular-nums; font-size: 12px; }
.mx td.cell:hover { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 1; }
.mx td.cell.now { box-shadow: inset 0 -3px 0 var(--signal); }
.mx td.cell .pg { position: absolute; right: 3px; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.35); }
.mx td.cell.empty-c { color: var(--faint); }
.mx td.cell.empty-c:hover::after { content: "+"; color: var(--muted); font-size: 15px; }
.mx td.c-mon { padding: 6px 8px; text-align: right; white-space: nowrap; }
.mx tfoot td { position: sticky; bottom: 0; background: #F7F8FA; font-size: 11.5px; padding: 6px; text-align: center; color: var(--muted); font-weight: 600; z-index: 2; }
.mx tfoot td.stk { z-index: 4; }

/* ---------- Charts ---------- */
.stackbar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.stackbar > div { height: 100%; }
.leg-list { display: grid; gap: 7px; margin-top: 14px; }
.leg-list .it { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.leg-list .it .q { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
svg.chart text { font: 11px var(--font); fill: var(--faint); }

/* ---------- Modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(14,23,38,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: pop .14s ease-out; }
.modal.wide { max-width: 860px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; }
.modal-h h3 { margin: 0; font-size: 16px; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; background: #FAFBFC; border-radius: 0 0 12px 12px; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--faint); }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 420px; font-size: 13.5px; animation: pop .15s ease-out; }
.toast.err { background: #9B2C2C; }
.toast.ok { background: #146C3B; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
.alert { padding: 10px 14px; border-radius: 8px; border: 1px solid; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert.warn { background: #FFFAEB; border-color: #F5D58A; color: #6B4A08; }
.alert.bad { background: #FEF3F2; border-color: #F5B5AE; color: #8B1D12; }
.alert.info { background: #EFF6FF; border-color: #BCD5F5; color: #1D4F86; }
.alert.ok { background: #ECFDF3; border-color: #A6E5BF; color: #0E5B31; }
.secret { font-family: var(--mono); font-size: 17px; background: #FFF8DB; border: 1px dashed #E2B93B; padding: 10px 14px; border-radius: 8px; letter-spacing: .5px; user-select: all; }

/* ---------- Perfiles ---------- */
.perm-mod { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.perm-mod + .perm-mod { margin-top: 8px; }
.perm-mod .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.perm-mod .hd b { font-size: 13.5px; }
.perm-acts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.perm-acts label { font-size: 13px; }
.perm-mod.full { border-color: #9FB3D1; background: #F7FAFE; }
.list-sel .it { padding: 10px 12px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.list-sel .it:hover { background: #F7F8FA; }
.list-sel .it.on { background: #EEF2F8; border-color: #C9D5E7; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art > div { position: relative; z-index: 1; }
.login-art h2 { font-size: 34px; line-height: 1.12; letter-spacing: -1px; margin: 0; max-width: 420px; }
.login-art p { color: #9AA8BE; max-width: 400px; }
.login-art .brand { border: 0; padding: 0; }
.login-datos { display: flex; flex-wrap: wrap; gap: 4px 16px; color: #8291A8; font-size: 12.5px; position: relative; z-index: 1; max-width: 52%; }
.lanes { position: absolute; right: -40px; bottom: -40px; width: 380px; opacity: .9; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-form h1 { margin: 0 0 4px; font-size: 22px; }

.drop { border: 2px dashed #C3CAD5; border-radius: 12px; padding: 36px; text-align: center; background: #FBFCFD; cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--ink-3); background: #F3F6FA; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 9px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-color: var(--signal); }
details.audit summary { cursor: pointer; color: var(--info); font-size: 12.5px; }
pre.json { background: #F7F8FA; border: 1px solid var(--line-2); padding: 8px; border-radius: 6px; max-width: 520px; overflow: auto; font-size: 11.5px; margin: 6px 0 0; white-space: pre-wrap; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: -260px; width: 240px; z-index: 50; transition: left .2s; }
  .side.open { left: 0; }
  .top .menu-btn { display: inline-flex; }
  .top { flex-wrap: wrap; gap: 10px; }
  .top .spacer { display: none; }
  #page-actions { width: 100%; }
  #page-actions .input { flex: 1 1 150px; min-width: 0 !important; }
  .content, .top { padding-left: 16px; padding-right: 16px; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .mx .c-cli { min-width: 170px; max-width: 170px; }
  .mx .c-pat { left: 170px; }
  .mx .c-tar { left: 254px; }
}
@media print { .side, .top, .btn { display: none !important; } .shell { display: block; } }

.logo-box { width: 140px; height: 140px; border: 1px dashed #C3CAD5; border-radius: 12px; display: grid; place-items: center; background: #FBFCFD; }
.logo-box img { max-width: 120px; max-height: 120px; object-fit: contain; }
@media (max-width: 860px) { #idf .card-b { grid-template-columns: 1fr !important; } }

/* ---------- Analítica ---------- */
.dash-card { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.dash-card:hover { border-color: #C8CDD5; box-shadow: 0 4px 14px rgba(16,24,40,.08); }
.dash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.widget { display: flex; flex-direction: column; min-width: 0; }
.widget-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 0 14px; min-height: 36px; }
.widget-h b { font-size: 13.5px; font-weight: 650; }
.widget-b { padding: 8px 14px 14px; flex: 1; min-width: 0; }
.xf-chip { gap: 6px; }
.xf-chip button { border: 0; background: none; cursor: pointer; font-size: 14px; line-height: 1; color: inherit; padding: 0; }
.ch-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.ch-leg i, .ch-dleg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ch-dona { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.ch-dona svg { flex: none; }
.ch-dleg { flex: 1 1 140px; min-width: 0; display: grid; gap: 5px; font-size: 12.5px; }
.ch-dleg > div { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ch-dleg b { flex: none; padding-left: 6px; }
.ch-dleg span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-kpi { padding: 6px 0 2px; }
.ch-kpi .v { font-size: 30px; font-weight: 750; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.ch-kpi .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ch-tabla { max-height: 420px; }
.ch-tabla .tbl td, .ch-tabla .tbl th { padding: 6px 10px; font-size: 12.5px; }
.ch-tabla tr.tot td { font-weight: 700; background: #F7F8FA; position: sticky; bottom: 0; }
.ch-mx td:first-child, .ch-mx th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 220px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-mx td { white-space: nowrap; }
svg.chart rect[data-xf-campo]:hover, svg path[data-xf-campo]:hover, svg circle[data-xf-campo]:hover { opacity: .8; }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; }
.ed-prev { border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 260px; background: #fff; position: sticky; top: 0; }
.ed-meds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin-top: 4px; font-size: 13px; }
.ed-filtro { margin-bottom: 6px; }
.ed-filtro .input { min-width: 0; }
.modal.wide:has(.ed-grid) { max-width: 1100px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } .widget { grid-column: span 6 !important; } .ed-grid { grid-template-columns: 1fr; } }
.envio-dest { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.envio-dest label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.envio-dest label.off { opacity: .55; }
iframe.mail-prev { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: #F3F4F6; }
