/* ============ Control Teletrabajo - Sistema de diseno (3 skins) ============ */
:root {
  --radius: 14px;
  --sidebar-w: 236px;
  --bottomnav-h: 62px;
}

/* ---- Skin AURORA: oscura glass, teal -> cielo ---- */
:root, html[data-skin="aurora"] {
  --bg: #070d17;
  --surface: rgba(16, 25, 43, .68);
  --surface-2: rgba(148, 180, 255, .07);
  --text: #eef4ff;
  --muted: #8ea0bd;
  --border: rgba(148, 180, 255, .15);
  --ink: #0b1526;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --accent-soft: rgba(45, 212, 191, .13);
  --grad: linear-gradient(135deg, #2dd4bf, #38bdf8);
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #34d399;
  --shadow: 0 8px 30px rgba(2, 6, 16, .45);
  --c-teletrabajo: #2dd4bf;
  --c-presencial: #3b82f6;
  --c-vacaciones: #fbbf24;
  --c-ausencia: #f87171;
  --c-libre_disposicion: #a3e635;
  --c-ld_adicional: #fb923c;
  --c-compensacion: #38bdf8;
  --c-festivo: #64748b;
}

/* ---- Skin BENTO: crema neo-brutalista, tinta + ambar ---- */
html[data-skin="bento"] {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #f3ecdd;
  --text: #211d19;
  --muted: #7a7266;
  --border: #e4dcc9;
  --ink: #211d19;
  --accent: #0d9488;
  --accent-2: #f59e0b;
  --accent-soft: rgba(251, 191, 36, .25);
  --grad: linear-gradient(135deg, #0d9488, #0ea5e9);
  --danger: #dc2626;
  --warn: #b45309;
  --ok: #4d7c0f;
  --shadow: 4px 4px 0 #211d19;
  --c-teletrabajo: #0d9488;
  --c-presencial: #0ea5e9;
  --c-vacaciones: #fbbf24;
  --c-ausencia: #ef4444;
  --c-libre_disposicion: #65a30d;
  --c-ld_adicional: #f97316;
  --c-compensacion: #2563eb;
  --c-festivo: #a8a29e;
}

/* ---- Skin HOLO: casi negro neon, cian + lima ---- */
html[data-skin="holo"] {
  --bg: #04070d;
  --surface: rgba(8, 22, 32, .66);
  --surface-2: rgba(0, 229, 255, .06);
  --text: #ecfeff;
  --muted: #7da2b8;
  --border: rgba(0, 229, 255, .18);
  --ink: #03141c;
  --accent: #00e5ff;
  --accent-2: #a3e635;
  --accent-soft: rgba(0, 229, 255, .12);
  --grad: linear-gradient(135deg, #00e5ff, #a3e635);
  --danger: #ff6b6b;
  --warn: #fde047;
  --ok: #a3e635;
  --shadow: 0 10px 40px rgba(0, 10, 20, .55);
  --c-teletrabajo: #00e5ff;
  --c-presencial: #4d8dff;
  --c-vacaciones: #fde047;
  --c-ausencia: #ff6b6b;
  --c-libre_disposicion: #a3e635;
  --c-ld_adicional: #ff9e2c;
  --c-compensacion: #34d399;
  --c-festivo: #64748b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 700; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
svg.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ============ Layout ============ */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 17px; padding: 6px 10px 18px;
}
.brand-logo { width: 34px; height: 34px; border-radius: 9px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 14.5px;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.sidebar .spacer { flex: 1; }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 26px 30px 40px;
  max-width: 1240px;
  width: 100%;
}

/* Barra superior movil */
.appbar {
  display: none;
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  height: 54px;
  align-items: center; gap: 6px;
  padding-top: env(safe-area-inset-top);
}
.appbar .title { font-weight: 800; font-size: 16px; flex: 1; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: none; background: none; color: var(--text); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); }

/* Bottom nav movil */
.bottomnav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--border);
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  justify-content: space-around; align-items: stretch;
}
.bottomnav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: none; background: none; color: var(--muted); font-size: 10.5px; font-weight: 600; cursor: pointer;
}
.bottomnav button.active { color: var(--accent); }
.bottomnav svg.icon { width: 22px; height: 22px; }

/* Drawer movil */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: 270px; z-index: 51;
  background: var(--surface); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px;
  animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

@media (max-width: 1023px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px 14px calc(var(--bottomnav-h) + 30px); }
  .appbar { display: flex; }
  .bottomnav { display: flex; }
}

/* ============ Componentes ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .grid.two { grid-template-columns: 1fr; } }

.kpi { padding: 14px 16px; }
.kpi .label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.kpi .label svg.icon { width: 15px; height: 15px; }
.kpi .value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.tone-ok .value { color: var(--ok); }
.kpi.tone-warn .value { color: var(--warn); }
.kpi.tone-danger .value { color: var(--danger); }
.kpi.tone-accent .value { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 700;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }

.input, select.input, textarea.input {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-family: inherit;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
label.field { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
label.field .input { margin-top: 5px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; border-radius: 99px; transition: width .4s ease; }

/* Toasts */
.toasts { position: fixed; bottom: calc(var(--bottomnav-h) + 16px); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 400px); }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }
.toast {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 11px 14px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 9px;
}
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8, 12, 22, .55); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--surface); border-radius: 16px;
  width: min(520px, 100%); max-height: 88vh; overflow: auto;
  padding: 22px; box-shadow: var(--shadow);
}
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ============ Calendario (celdas llenas de color) ============ */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.cal-title { font-size: 17px; font-weight: 800; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 4px 0; }
.cal-cell {
  --cc: var(--c-festivo); --cd: var(--c-festivo);
  min-height: 76px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
  padding: 7px 8px; cursor: pointer; position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cal-cell:hover { transform: translateY(-2px); }
.cal-cell.out { visibility: hidden; pointer-events: none; }
.cal-cell.weekend { opacity: .3; cursor: default; }
.cal-cell.weekend:hover { transform: none; }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-cell.no-tracking { opacity: .35; cursor: default; }
.cal-cell .num { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.cal-cell .st {
  font-size: 9.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Dia con estado consumado: celda llena */
.cal-cell.filled { background: linear-gradient(145deg, var(--cc), var(--cd)); border-color: transparent; box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
.cal-cell.filled .num { color: rgba(255, 255, 255, .93); }
.cal-cell.filled .st { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
/* Dia futuro planificado: rayado + borde discontinuo */
.cal-cell.plan {
  background: repeating-linear-gradient(-45deg,
    color-mix(in srgb, var(--cc) 10%, transparent) 0 5px,
    color-mix(in srgb, var(--cc) 24%, transparent) 5px 10px);
  border: 1.5px dashed color-mix(in srgb, var(--cc) 55%, transparent);
}
.cal-cell.plan .num, .cal-cell.plan .st { color: var(--cc); text-shadow: none; }
.cal-cell .festivo { font-size: 10.5px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cal-cell .origen-badge { position: absolute; top: 6px; right: 7px; color: rgba(255, 255, 255, .85); }
.cal-cell:not(.filled) .origen-badge { color: var(--muted); }
.cal-cell .origen-badge svg.icon { width: 12px; height: 12px; }
@media (max-width: 640px) {
  .cal-cell { min-height: 56px; padding: 5px 6px; border-radius: 9px; }
  .cal-cell .num { font-size: 11px; }
  .cal-cell .st { font-size: 7.5px; }
  .cal-cell .festivo { font-size: 8.5px; }
}

/* Selector de estados */
.estado-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.estado-opt {
  padding: 8px 13px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--border); background: var(--surface-2);
  font-size: 13.5px; font-weight: 700; color: var(--text);
  display: inline-flex; align-items: center; gap: 7px;
}
.estado-opt .dot { width: 10px; height: 10px; border-radius: 50%; }
.estado-opt.selected { border-color: var(--accent); background: var(--accent-soft); }

/* Simulador */
.sim-banner {
  border: 1px dashed var(--accent); background: var(--accent-soft);
  border-radius: var(--radius); padding: 12px 16px; font-size: 13.5px; font-weight: 600;
  display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
}
.sim-cell-override { box-shadow: inset 0 0 0 2px var(--accent); }

/* Utilidades */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.hidden-mobile { display: initial; }
@media (max-width: 640px) { .hidden-mobile { display: none; } }
.page-title { font-size: 21px; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.page-title svg.icon { width: 24px; height: 24px; color: var(--accent); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(400px, 100%); }
.login-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.login-logo img { width: 72px; height: 72px; border-radius: 18px; }

/* Festivos list */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 6px; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }

.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
code.inline {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 7px; font-size: 12.5px;
  word-break: break-all;
}

/* ============ Topbar + conmutador de vista ============ */
.topbar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 14px; }
.skin-switch {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.skin-switch button {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; background: none; color: var(--muted);
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  padding: 6px 12px; border-radius: 9px; cursor: pointer;
}
.skin-switch button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.skin-switch .dots { display: inline-flex; gap: 3px; }
.skin-switch .dots i { width: 8px; height: 8px; border-radius: 50%; }
@media (max-width: 1023px) { .topbar { display: none; } }

/* ============ Logo (SVG por skin) ============ */
.brand-stop-a { stop-color: var(--accent); }
.brand-stop-b { stop-color: var(--accent-2); }
.brand-glyph { stroke: #fff; }
.brand-ring { stroke: none; }
html[data-skin="bento"] .brand-bg { fill: #fbbf24; stroke: var(--ink); stroke-width: 3; }
html[data-skin="bento"] .brand-glyph { stroke: var(--ink); }
html[data-skin="holo"] .brand-bg { fill: #04070d; }
html[data-skin="holo"] .brand-ring { stroke: url(#brandgrad); stroke-width: 2.5; }
html[data-skin="holo"] .brand-glyph { stroke: url(#brandgrad); }

/* ============ Hero del dashboard ============ */
.hero-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-title { font-size: 15px; font-weight: 800; text-transform: capitalize; }
.today-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600;
}
.today-pill b { color: var(--accent); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); position: relative; flex-shrink: 0; }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.hero-body { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.gauge-wrap { position: relative; width: 200px; height: 200px; flex-shrink: 0; margin: 0 auto; }
.gauge-wrap svg { width: 100%; height: 100%; display: block; }
.ringsvg .track { stroke: var(--surface-2); }
.ringsvg .ga { stop-color: var(--accent); }
.ringsvg .gb { stop-color: var(--accent-2); }
.ringsvg .val { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--accent) 50%, transparent)); }
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.gauge-center .big {
  font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gauge-center .lbl { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-top: 6px; }
.gauge-center .sub { font-size: 11px; color: var(--muted); opacity: .85; }
.hero-stats { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 12px; min-width: 270px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 13px 15px; }
.stat .k { font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; }
.stat .v.ok { color: var(--ok); }
.stat .v.warn { color: var(--warn); }
.stat .v.danger { color: var(--danger); }
.stat .v.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .v .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .v .sep { color: var(--muted); font-size: 17px; font-weight: 700; margin: 0 6px; opacity: .7; }
.stat .v .n2 { color: var(--warn); }
.stat .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 640px) { .hero-stats { grid-template-columns: 1fr 1fr; min-width: 0; } .gauge-wrap { width: 170px; height: 170px; } }

/* Tira de progreso del mes */
.strip-wrap { margin-top: 18px; }
.strip-cap { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 7px; }
.strip { display: flex; gap: 4px; }
.strip span { flex: 1; height: 12px; border-radius: 4px; background: var(--surface-2); min-width: 4px; }
.strip span.plan { opacity: .45; }
.strip span.today-seg { outline: 2px solid var(--text); outline-offset: 1.5px; }
.legend { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend.center { justify-content: center; }

/* Permisos: mini anillos */
.permiso-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .permiso-grid { grid-template-columns: 1fr; } }
.permiso {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px;
  padding: 12px; display: flex; align-items: center; gap: 11px;
}
.permiso .ring { width: 50px; height: 50px; position: relative; flex-shrink: 0; }
.permiso .ring svg { width: 100%; height: 100%; display: block; }
.permiso .ring .n { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; }
.permiso .t { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.permiso .d { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.ausencia-strip {
  margin-top: 12px; display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border-radius: 12px; font-size: 12.5px;
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent);
}
.ausencia-strip b { color: var(--danger); }
.ausencia-strip svg.icon { width: 16px; height: 16px; color: var(--danger); }

/* Permisos: tracks segmentados (1 segmento = 1 dia) */
.segs { display: flex; gap: 2.5px; }
.segs i { flex: 1; height: 13px; border-radius: 3.5px; background: var(--surface-2); border: 1px solid var(--border); min-width: 3px; }

/* Festivos: bloque de fecha */
.leaf {
  width: 44px; height: 46px; border-radius: 11px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
}
.leaf .d { font-size: 16px; font-weight: 800; line-height: 1; }
.leaf .m { font-size: 9px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .09em; margin-top: 2px; }

/* ============ Overrides por skin ============ */
/* -- Aurora: glass + brillos -- */
html[data-skin="aurora"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 420px at 12% -8%, rgba(45, 212, 191, .16), transparent 65%),
    radial-gradient(700px 500px at 95% 8%, rgba(56, 189, 248, .12), transparent 60%),
    radial-gradient(700px 600px at 55% 112%, rgba(45, 212, 191, .07), transparent 60%);
}
html[data-skin="aurora"] .card, html[data-skin="aurora"] .sidebar,
html[data-skin="aurora"] .appbar, html[data-skin="aurora"] .drawer,
html[data-skin="aurora"] .bottomnav, html[data-skin="aurora"] .modal {
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
html[data-skin="aurora"] .nav-item.active {
  background: linear-gradient(135deg, rgba(45, 212, 191, .2), rgba(56, 189, 248, .13));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .35);
}
html[data-skin="aurora"] .page-title { letter-spacing: -.02em; }

/* -- Bento: bordes tinta + sombras duras -- */
html[data-skin="bento"] .card { border: 2px solid var(--ink); box-shadow: var(--shadow); }
html[data-skin="bento"] .sidebar { border-right: 2px solid var(--ink); }
html[data-skin="bento"] .appbar { border-bottom: 2px solid var(--ink); }
html[data-skin="bento"] .bottomnav { border-top: 2px solid var(--ink); }
html[data-skin="bento"] .nav-item { border: 2px solid transparent; font-weight: 700; }
html[data-skin="bento"] .nav-item.active {
  background: #fbbf24; color: var(--ink); border-color: var(--ink);
  box-shadow: 2.5px 2.5px 0 var(--ink);
}
html[data-skin="bento"] .btn { border: 2px solid var(--ink); box-shadow: 2.5px 2.5px 0 var(--ink); }
html[data-skin="bento"] .btn:active { transform: translate(2px, 2px); box-shadow: none; }
html[data-skin="bento"] .input, html[data-skin="bento"] select.input { border: 2px solid #d8d2c4; background: #fff; }
html[data-skin="bento"] .chip { border: 1.5px solid var(--ink); background: #fff; color: var(--ink); }
html[data-skin="bento"] .page-title { text-transform: uppercase; letter-spacing: -.01em; }
html[data-skin="bento"] .cal-cell { border: 2px solid #e4dcc9; background: #fff; }
html[data-skin="bento"] .cal-cell.filled { background: var(--cc); border: 2px solid var(--ink); box-shadow: 2.5px 2.5px 0 var(--ink); }
html[data-skin="bento"] .cal-cell.plan { border: 2px dashed color-mix(in srgb, var(--cc) 65%, transparent); }
html[data-skin="bento"] .cal-cell.today { outline: 2.5px solid var(--ink); outline-offset: 2px; }
html[data-skin="bento"] .stat, html[data-skin="bento"] .permiso { background: #fff; border: 2px solid var(--ink); box-shadow: 2.5px 2.5px 0 var(--ink); }
html[data-skin="bento"] .leaf { background: #fbbf24; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
html[data-skin="bento"] .leaf .m { color: var(--ink); }
html[data-skin="bento"] .skin-switch { background: #fff; border: 2px solid var(--ink); }
html[data-skin="bento"] .skin-switch button.active { background: #fbbf24; color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
html[data-skin="bento"] .segs i { background: #efe9db; border-color: #ded6c3; }
html[data-skin="bento"] .today-pill { background: #fff; border: 2px solid var(--ink); color: var(--ink); }
html[data-skin="bento"] .today-pill b { color: var(--ink); }
html[data-skin="bento"] .gauge-center .big { background: none; color: var(--ink); -webkit-background-clip: initial; background-clip: initial; }
html[data-skin="bento"] .stat .v.grad { background: none; color: var(--accent); -webkit-background-clip: initial; background-clip: initial; }
html[data-skin="bento"] .toast { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
html[data-skin="bento"] .modal { border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }

/* -- Holo: neon cian/lima -- */
html[data-skin="holo"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(800px 500px at 85% -10%, rgba(0, 229, 255, .10), transparent 60%),
    radial-gradient(700px 500px at 8% 18%, rgba(163, 230, 53, .06), transparent 55%),
    radial-gradient(900px 500px at 50% 115%, rgba(0, 229, 255, .08), transparent 60%);
}
html[data-skin="holo"] .card, html[data-skin="holo"] .sidebar,
html[data-skin="holo"] .appbar, html[data-skin="holo"] .drawer,
html[data-skin="holo"] .bottomnav, html[data-skin="holo"] .modal {
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
html[data-skin="holo"] .nav-item.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, .16), rgba(163, 230, 53, .10));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(0, 229, 255, .4), 0 0 16px rgba(0, 229, 255, .12);
}
html[data-skin="holo"] .page-title {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[data-skin="holo"] .page-title svg.icon { color: var(--accent); }
html[data-skin="holo"] .cal-cell.filled { box-shadow: 0 4px 16px color-mix(in srgb, var(--cc) 35%, transparent); }
html[data-skin="holo"] .cal-cell.today { animation: todayGlow 2.4s ease-in-out infinite; }
@keyframes todayGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 229, 255, .45); }
  50% { box-shadow: 0 0 22px rgba(163, 230, 53, .55); }
}
html[data-skin="holo"] .btn { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 25%, transparent); }
html[data-skin="holo"] .legend i { box-shadow: 0 0 6px currentColor; }

/* ============ Canvas de estrellas (fx.js) ============ */
#fx-stars {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
}

/* ============ Holo: profundidad 3D real ============ */
html[data-skin="holo"] body::after {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 42vh;
  z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(420px) rotateX(58deg);
  transform-origin: bottom;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.75), transparent 85%);
  mask-image: linear-gradient(to top, rgba(0,0,0,.75), transparent 85%);
}
html[data-skin="holo"] .main .card {
  position: relative;
  border-color: transparent;
  transform-style: preserve-3d;
  transition: transform .18s ease-out, box-shadow .3s ease;
  will-change: transform;
}
/* borde neon degradado */
html[data-skin="holo"] .main .card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px; pointer-events: none;
  background: linear-gradient(135deg,
    rgba(0, 229, 255, .55), rgba(0, 229, 255, .08) 30%,
    rgba(163, 230, 53, .08) 65%, rgba(163, 230, 53, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
/* brillo que sigue al raton (coords via fx.js) */
html[data-skin="holo"] .main .card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; opacity: 0; transition: opacity .25s ease;
  background: radial-gradient(460px circle at var(--gx, 50%) var(--gy, -30%),
    rgba(0, 229, 255, .12), rgba(163, 230, 53, .05) 45%, transparent 65%);
}
html[data-skin="holo"] .main .card:hover::after { opacity: 1; }
html[data-skin="holo"] .main .card:hover {
  box-shadow: 0 22px 50px rgba(0, 0, 0, .5), 0 0 30px rgba(0, 229, 255, .10);
}
html[data-skin="holo"] .gauge-wrap .ringsvg .val {
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, .65)) drop-shadow(0 0 26px rgba(0, 229, 255, .3));
}
html[data-skin="holo"] .gauge-center .big { text-shadow: 0 0 24px rgba(0, 229, 255, .45); }
html[data-skin="holo"] .stat { border-color: rgba(0, 229, 255, .16); }
html[data-skin="holo"] .stat .v.grad { text-shadow: 0 0 18px rgba(0, 229, 255, .35); }
html[data-skin="holo"] .strip span:not(.plan) { box-shadow: 0 0 8px color-mix(in srgb, currentColor 0%, transparent); }
html[data-skin="holo"] .brand { text-shadow: 0 0 16px rgba(0, 229, 255, .35); }
html[data-skin="holo"] .today-pill { box-shadow: 0 0 16px rgba(0, 229, 255, .14); }
@media (prefers-reduced-motion: reduce) {
  html[data-skin="holo"] .main .card { transition: none; }
  html[data-skin="holo"] .cal-cell.today { animation: none; }
}

/* ============ Mapa de oficina (Leaflet) ============ */
.map-box {
  height: 280px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 8px;
  position: relative; z-index: 0;
  background: var(--surface-2);
}
.map-box .leaflet-container { width: 100%; height: 100%; background: var(--surface-2); font: inherit; }
/* tiles oscurecidos en skins oscuras (marcador y circulo no se ven afectados) */
html[data-skin="aurora"] .map-box .leaflet-tile-pane,
html[data-skin="holo"] .map-box .leaflet-tile-pane {
  filter: invert(1) hue-rotate(200deg) brightness(.9) contrast(.88) saturate(.55);
}
html[data-skin="holo"] .map-box { border-color: rgba(0, 229, 255, .25); }
.map-box .leaflet-control-attribution { font-size: 9px; opacity: .75; }

/* ============ Seleccion multiple del calendario ============ */
.cal-grid.selecting .cal-cell:not(.out):not(.weekend):not(.no-tracking) { cursor: copy; }
.cal-cell.sel {
  outline: 2.5px solid var(--accent); outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.cal-cell.sel .num { color: var(--accent); }
.bulkbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 15px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
  padding: 10px 13px; max-width: min(94vw, 680px);
}
@media (min-width: 1024px) { .bulkbar { bottom: 18px; } }
.bulkbar .count {
  font-weight: 800; font-size: 12.5px; white-space: nowrap;
  color: var(--accent); margin-right: 3px;
}
.bulkbar .estado-opt { padding: 6px 11px; font-size: 12px; }
.bulkbar .estado-opt.dis { opacity: .5; pointer-events: none; }
html[data-skin="bento"] .bulkbar { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
html[data-skin="holo"] .bulkbar {
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .55), 0 0 22px rgba(0, 229, 255, .14);
  border-color: rgba(0, 229, 255, .3);
}

/* ============ Barras isometricas 3D (Bar3D) ============ */
.c3d-legend { display: flex; gap: 16px; justify-content: center; margin-bottom: 6px; }
.c3d-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.c3d-legend i { width: 9px; height: 9px; border-radius: 3px; }
.c3d-plot { position: relative; }
.c3d-area { position: absolute; inset: 30px 10px 26px 40px; }
.c3d-grid {
  position: absolute; left: 0; right: 0; height: 1px;
  background: color-mix(in srgb, var(--border) 75%, transparent);
}
.c3d-grid span {
  position: absolute; left: -36px; top: -6px; width: 30px;
  text-align: right; font-size: 10px; color: var(--muted);
}
.c3d-goal { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed; z-index: 3; pointer-events: none; }
.c3d-goal.ok { border-color: var(--ok); }
.c3d-goal.danger { border-color: var(--danger); }
.c3d-goal b {
  position: absolute; top: -9px; font-size: 9px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px; color: #04121a; white-space: nowrap;
}
.c3d-goal.ok b { left: 0; background: var(--ok); box-shadow: 0 0 10px color-mix(in srgb, var(--ok) 60%, transparent); }
.c3d-goal.danger b { right: 0; background: var(--danger); box-shadow: 0 0 10px color-mix(in srgb, var(--danger) 60%, transparent); }
.c3d-cats { display: flex; height: 100%; align-items: flex-end; }
.c3d-cat {
  flex: 1; height: 100%; position: relative;
  display: flex; align-items: flex-end; justify-content: center;
}
.c3d-bars { display: flex; align-items: flex-end; gap: 7px; height: 100%; }
.c3d-x {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 8px;
  text-align: center; font-size: 10px; color: var(--muted); white-space: nowrap;
}
.c3d-bar {
  --d: 7px;
  position: relative;
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 55%, #000));
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent);
  transition: height .9s cubic-bezier(.22, .9, .26, 1);
}
.c3d-bar .t {
  position: absolute; bottom: 100%; left: 0; width: 100%; height: var(--d);
  background: var(--cl);
  transform: skewX(-45deg); transform-origin: 0 100%;
}
.c3d-bar .s {
  position: absolute; top: 0; left: 100%; width: var(--d); height: 100%;
  background: var(--cd);
  transform: skewY(-45deg); transform-origin: 0 0;
}
.c3d-bar .v {
  position: absolute; bottom: calc(100% + var(--d) + 3px); left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px; font-weight: 800; color: var(--c);
  text-shadow: 0 0 8px color-mix(in srgb, var(--c) 70%, transparent);
  white-space: nowrap;
}
@media (max-width: 640px) { .c3d-bars { gap: 4px; } .c3d-bar { --d: 5px; } }

/* ============ Donut 3D (Donut3D) ============ */
.d3d-scene { position: relative; margin: 6px auto 0; perspective: 780px; }
.d3d-scene::after {
  content: ""; position: absolute; left: 50%; bottom: -4px;
  width: 74%; height: 13%; transform: translateX(-50%);
  background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%);
  filter: blur(7px); pointer-events: none;
}
.d3d-tilt {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -52%) rotateX(57deg);
  transform-style: preserve-3d;
}
.d3d-spin {
  position: relative; transform-style: preserve-3d;
  animation: d3dspin 30s linear infinite;
}
@keyframes d3dspin { to { transform: rotateZ(360deg); } }
.d3d-layer, .d3d-face {
  position: absolute; inset: 0; border-radius: 50%;
  -webkit-mask: radial-gradient(closest-side, transparent 53%, #000 53.6%);
  mask: radial-gradient(closest-side, transparent 53%, #000 53.6%);
}
.d3d-layer { filter: brightness(.42) saturate(1.15); }
.d3d-face { box-shadow: 0 0 30px rgba(0, 0, 0, .35); }
.d3d-center {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; transform: translateY(-6%);
}
.d3d-center b {
  font-size: 30px; font-weight: 800; letter-spacing: -.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 45%, transparent));
}
.d3d-center span { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
@media (prefers-reduced-motion: reduce) {
  .d3d-spin { animation: none; }
  .c3d-bar { transition: none; }
}

/* ============ Responsive movil ============ */
/* Columnas del simulador (gauge + calendario) */
.sim-cols { grid-template-columns: 300px 1fr; gap: 18px; }
.sim-cols.single { grid-template-columns: 1fr; }

.c3d-bar { min-width: 3px; }
.c3d-cat { min-width: 0; }

@media (max-width: 1023px) {
  /* la appbar ya muestra el nombre de la pagina */
  .page-title { display: none; }
  .row.between > select.input { margin-left: auto; }
  /* Inputs date/time en iOS: ancho completo real y texto a la izquierda */
  input.input[type="date"], input.input[type="time"] {
    -webkit-appearance: none; appearance: none;
    display: block; width: 100%; min-width: 0; min-height: 40px;
  }
  input.input::-webkit-date-and-time-value { text-align: left; }
}

@media (max-width: 800px) {
  .main { overflow-x: clip; }
  .grid > * { min-width: 0; }
  .sim-cols { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero-body { flex-direction: column; align-items: stretch; gap: 16px; }
  .gauge-wrap { width: 180px; height: 180px; }
  .hero-stats { width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat { padding: 11px 12px; }
  .stat .k { font-size: 9.5px; letter-spacing: .05em; }
  .stat .v { font-size: 22px; }
  .stat .s { font-size: 10.5px; }
  .today-pill { margin-left: 0; width: 100%; }
}
