/* ==========================================================
   Lockers — tema oscuro con acento #FFAB00
   ========================================================== */
:root {
  --bg: #0a0c10;
  --sidebar: #0d1016;
  --panel: #10131a;
  --card: #151922;
  --card-2: #1b202b;
  --border: #232935;
  --border-2: #303747;
  --text: #f3f4f6;
  --muted: #9aa3b2;
  --faint: #677084;

  --accent: #ffab00;
  --accent-hover: #ffbd33;
  --accent-ink: #141414;
  --accent-soft: rgba(255, 171, 0, 0.12);

  --ok: #22c55e;
  --busy: #ef4444;
  --warn: #f97316;
  --expired: #f43f5e;
  --maint: #94a3b8;

  --radius: 8px;
  --sidebar-w: 240px;
  --panel-w: 380px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.txt-danger { color: var(--expired) !important; }
.txt-warn { color: var(--warn) !important; }
.txt-ok { color: var(--ok) !important; }

/* ---------- Estructura ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--panel-w);
  height: 100vh;
  overflow: hidden;
}
.app--config { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 0 8px; }
.brand-logo { max-width: 150px; max-height: 72px; object-fit: contain; }
.brand-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.brand-text strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--card); color: var(--text); }
.nav-link.active { background: var(--card-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav-link.active .ico { color: var(--accent); }
.nav-link--quiet { font-weight: 500; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 16px; }
.who { display: flex; align-items: center; gap: 10px; padding: 4px 12px 8px; }
.who strong { display: block; font-size: 13px; }
.who small { color: var(--faint); font-size: 12px; }
.who-avatar {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--card-2); border: 1px solid var(--border-2); color: var(--muted);
}

.main { overflow-y: auto; padding: 22px 28px 32px; min-width: 0; }
.main--page { max-width: 1200px; }

.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.topbar h1 span { font-weight: 400; color: var(--muted); font-size: 22px; letter-spacing: -0.02em; }
.topbar .sub { margin: 2px 0 0; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.clock {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.clock .ico { width: 16px; height: 16px; color: var(--accent); }
.clock-sep { width: 1px; height: 16px; background: var(--border-2); margin: 0 4px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn .ico { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 0 14px rgba(255, 171, 0, 0.3); }
.btn-secondary { background: var(--card-2); border-color: var(--border-2); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--faint); background: #232937; }
.btn-danger { background: transparent; border-color: rgba(239, 68, 68, 0.55); color: #f87171; }
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.12); }
.btn-danger-solid { background: #dc2626; color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: #ef4444; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }

/* ---------- Barra de filtros ---------- */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.seg {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
}
.seg button {
  padding: 7px 18px;
  background: transparent; border: 0; border-radius: 7px;
  color: var(--muted); font-weight: 700; cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--accent); color: var(--accent-ink); }
.seg-sm button { padding: 5px 12px; font-size: 12.5px; }

.search {
  flex: 1; min-width: 260px; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.search:focus-within { border-color: var(--accent); }
.search .ico { color: var(--faint); }
.search input { flex: 1; min-width: 0; padding: 10px 0; background: transparent; border: 0; outline: 0; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-align: left; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.kpi:hover { border-color: var(--border-2); }
.kpi.active { border-color: var(--accent); background: var(--accent-soft); }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.s-disponible { background: var(--ok); }
.dot.s-ocupado { background: var(--busy); }
.dot.s-por_vencer { background: var(--warn); }
.dot.s-vencido { background: var(--expired); box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.25); }
.dot.s-mantenimiento { background: var(--maint); }
.dot.s-total { background: var(--accent); }

/* ---------- Cuadrícula de lockers ---------- */
.grids { display: grid; gap: 22px; }
.grids.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.area-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.area-head h2 {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.area-head h2 .dot { background: var(--accent); border-radius: 2px; }
.area-head span { color: var(--faint); font-size: 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: clamp(86px, calc((100vh - 390px) / 6), 150px);
  gap: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #0f1218, #0c0e13);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.grids.two .grid { gap: 7px; padding: 10px; }

.door {
  --d1: #16803c; --d2: #0f5f2c;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  min-width: 0;
  padding: 8px 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  background: linear-gradient(160deg, var(--d1), var(--d2));
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.16), inset -2px -2px 6px rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.2s, filter 0.2s;
}
.door:hover { transform: translateY(-2px); }
.door:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.door.selected {
  box-shadow: 0 0 0 2px var(--accent), 0 0 22px rgba(255, 171, 0, 0.35), inset 2px 2px 4px rgba(255, 255, 255, 0.16);
}
.door.dim { opacity: 0.22; filter: saturate(0.3); }

.plate {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.38);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.45), inset 1px 1px 1px rgba(255, 255, 255, 0.18);
  font-size: 13px; font-weight: 800; letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.handle {
  position: absolute; left: 9px; top: 36%;
  width: 5px; height: 22%;
  border-radius: 3px;
  background: linear-gradient(180deg, #94a3b8, #475569 50%, #cbd5e1);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}
.door-info { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; padding: 0 6px 0 16px; min-width: 0; }
.door-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 700; }
.door-date { font-size: 11px; opacity: 0.85; font-variant-numeric: tabular-nums; white-space: nowrap; }
.door-tag {
  padding: 1px 6px; border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.vents { display: flex; flex-direction: column; gap: 3px; width: 46%; }
.vents i { display: block; height: 2px; border-radius: 1px; background: rgba(0, 0, 0, 0.5); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06); }

.door.s-ocupado { --d1: #b91c1c; --d2: #861414; }
.door.s-por_vencer { --d1: #d9590c; --d2: #9f3d08; }
.door.s-vencido { --d1: #2b303b; --d2: #1c2029; border: 1.5px solid #e11d48; }
.door.s-vencido .door-tag { background: #e11d48; color: #fff; }
.door.s-mantenimiento { --d1: #4b5563; --d2: #323a46; }
.door.s-mantenimiento .door-tag { background: rgba(255, 171, 0, 0.18); color: var(--accent); }

.grids.two .door { padding: 6px 3px 7px; }
.grids.two .plate { font-size: 11px; padding: 1px 5px; }
.grids.two .door-info { padding: 0 2px; overflow: hidden; }
.grids.two .handle { left: 4px; width: 3px; height: 18%; }
.grids.two .door-tag { font-size: 8.5px; padding: 1px 4px; letter-spacing: 0.03em; }
.grids.two .door-date { font-size: 11px; font-weight: 700; }
.grids.two .vents { width: 40%; }

/* ---------- Panel de detalle ---------- */
.panel {
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px 22px 28px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}
.panel-empty { margin: auto 0; text-align: center; color: var(--muted); padding: 20px; }
.panel-empty h3 { margin: 18px 0 6px; color: var(--text); font-size: 17px; }
.panel-empty p { margin: 0; }
.ghost-door {
  width: 92px; height: 120px; margin: 0 auto;
  border: 1.5px dashed var(--border-2); border-radius: 6px; position: relative;
}
.ghost-door::after { content: ""; position: absolute; left: 12px; top: 40%; width: 5px; height: 24px; border-radius: 3px; background: var(--border-2); }

.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.panel-code { margin: 2px 0 0; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--card-2);
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.chip.s-disponible { color: #4ade80; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.1); }
.chip.s-ocupado { color: #f87171; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.1); }
.chip.s-por_vencer { color: #fb923c; border-color: rgba(249, 115, 22, 0.45); background: rgba(249, 115, 22, 0.1); }
.chip.s-vencido { color: #fb7185; border-color: rgba(244, 63, 94, 0.5); background: rgba(244, 63, 94, 0.12); }
.chip.s-mantenimiento { color: #cbd5e1; border-color: rgba(148, 163, 184, 0.4); background: rgba(148, 163, 184, 0.1); }
.chip-muted { height: 22px; font-size: 10.5px; color: var(--muted); margin-left: 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.card-title { display: flex; align-items: center; margin: 0 0 14px; font-size: 15px; font-weight: 800; }
.card-label { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.banner {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 171, 0, 0.35);
  background: var(--accent-soft);
}
.banner strong { color: var(--accent); font-size: 13px; }
.banner p { margin: 0; color: var(--text); font-size: 13px; }

.member { display: flex; gap: 12px; align-items: center; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--border-2);
  color: var(--accent); font-weight: 800;
}
.member-name { font-size: 16px; font-weight: 800; line-height: 1.25; word-break: break-word; }
.member-meta { color: var(--muted); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.notes { margin: 12px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.card-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dates span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.dates b { font-size: 16px; font-variant-numeric: tabular-nums; }
.days-left {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  font-weight: 700;
}

.days-left .dot { background: currentColor; box-shadow: none; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .btn-primary, .actions .full { grid-column: 1 / -1; }

.history h3 { margin: 6px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.timeline li {
  position: relative;
  padding: 10px 12px 10px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12.5px;
}
.timeline li::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--border-2); }
.timeline li.a-asignacion::before, .timeline li.a-renovacion::before { background: var(--accent); }
.timeline li.a-liberacion::before { background: var(--busy); }
.timeline li.a-correccion::before, .timeline li.a-anulacion::before { background: var(--warn); }
.timeline li.voided { opacity: 0.55; }
.timeline li.voided .tl-title { text-decoration: line-through; }
.tl-top { display: flex; justify-content: space-between; gap: 8px; }
.tl-title { font-weight: 700; font-size: 13px; }
.tl-when { color: var(--faint); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-body { margin-top: 3px; color: var(--muted); word-break: break-word; }
.tl-body b { color: var(--text); font-weight: 600; }
.tl-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; color: var(--faint); font-size: 11.5px; }
.tag-voided { color: var(--expired); font-weight: 700; }

/* ---------- Formularios ---------- */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field label em { font-style: normal; font-weight: 700; font-size: 11px; margin-left: 6px; color: var(--faint); }
.field label em.req { color: var(--accent); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 171, 0, 0.15); }
.field input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 2px 0; }

.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.plan { position: relative; cursor: pointer; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan span {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  padding: 10px;
  background: var(--bg); border: 1px solid var(--border-2); border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.plan b { font-size: 13px; }
.plan small { color: var(--faint); font-size: 11.5px; }
.plan:hover span { border-color: var(--faint); }
.plan input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.plan input:checked + span small { color: var(--accent); }
.plan input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255, 171, 0, 0.25); }

.preview {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--radius);
}
.preview span { color: var(--muted); font-size: 12.5px; }
.preview strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.preview small { width: 100%; color: var(--faint); font-size: 12px; }

.summary-box { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 14px; background: var(--card-2); border: 1px solid var(--border-2); border-radius: var(--radius); }
.summary-box span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.summary-box b { display: block; font-size: 14.5px; word-break: break-word; }
.summary-box small { color: var(--muted); font-size: 12px; }

.member-search { position: relative; }
.results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 210px; overflow-y: auto; }
.result {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  text-align: left; cursor: pointer;
}
.result:hover { border-color: var(--accent); }
.result span { color: var(--muted); font-size: 12px; }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); }
.picked b { display: block; }
.picked span { color: var(--muted); font-size: 12px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.switch-row strong { display: block; }
.switch-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.switch { position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { display: block; width: 44px; height: 24px; border-radius: 999px; background: var(--border-2); position: relative; transition: background 0.15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px rgba(255, 171, 0, 0.3); }

.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13.5px; border: 1px solid; }
.alert-ok { color: #86efac; background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.35); }
.alert-error { color: #fca5a5; background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.35); }

.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* ---------- Modal ---------- */
.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal::backdrop { background: rgba(5, 6, 9, 0.7); backdrop-filter: blur(6px); }
.modal-box { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; overflow-y: auto; }
.modal-error { margin: 0 20px 12px; padding: 10px 12px; border-radius: var(--radius); color: #fca5a5; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.35); font-size: 13px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ---------- Avisos ---------- */
.toasts { position: fixed; right: calc(var(--panel-w) + 20px); bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  padding: 11px 16px;
  background: var(--card-2); border: 1px solid var(--border-2); border-left: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-weight: 600; animation: toast-in 0.2s ease-out;
}
.toast.error { border-left-color: var(--busy); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Login / instalación ---------- */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: radial-gradient(circle at 50% 0%, #1a1608 0%, var(--bg) 55%); }
.auth-card { width: 100%; max-width: 380px; padding: 32px 28px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
.auth-card--wide { max-width: 560px; }
.auth-logo { display: block; max-width: 180px; max-height: 90px; margin: 0 auto 18px; object-fit: contain; }
.auth-card .brand-kicker { text-align: center; }
.auth-title { margin: 4px 0 20px; text-align: center; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }

/* ---------- Pantallas más chicas ---------- */
@media (max-width: 1440px) {
  :root { --sidebar-w: 210px; --panel-w: 350px; }
  .main { padding: 18px 20px 28px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar h1 span { display: none; }
}
@media (max-width: 1180px) {
  .grids.two { grid-template-columns: 1fr; }
  .config-grid { grid-template-columns: 1fr; }
}
