/* ==========================================================================
   Cuadrante Rosa - estilos globales
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root {
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 232px;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 6px 24px rgba(190, 24, 93, .10);
  --shadow-lg: 0 18px 50px rgba(157, 23, 77, .18);
}

/* ---------- Paletas por skin ---------- */
[data-skin="rosa"] {
  --bg: #fff5f9;
  --bg-2: #ffe9f2;
  --surface: #ffffff;
  --surface-2: #fdeaf2;
  --border: #f6d3e2;
  --text: #3d1f2e;
  --muted: #9d6b82;
  --accent: #ec4899;
  --accent-2: #f472b6;
  --accent-grad: linear-gradient(135deg, #f472b6, #ec4899);
  --ok: #16a34a; --warn: #d97706; --danger: #dc2626;
  --on-accent: #ffffff;
}
[data-skin="coral"] {
  --bg: #fff6f3;
  --bg-2: #ffe9e3;
  --surface: #ffffff;
  --surface-2: #ffe7e0;
  --border: #fbd5cc;
  --text: #3d241f;
  --muted: #a56a5c;
  --accent: #f43f5e;
  --accent-2: #fb7185;
  --accent-grad: linear-gradient(135deg, #fb7185, #f43f5e);
  --ok: #15803d; --warn: #c2410c; --danger: #dc2626;
  --on-accent: #ffffff;
}
[data-skin="fucsia"] {
  --bg: #12040e;
  --bg-2: #1d0817;
  --surface: #23101c;
  --surface-2: #2e1526;
  --border: #45213a;
  --text: #fbe6f1;
  --muted: #d19bb8;
  --accent: #f472b6;
  --accent-2: #a855f7;
  --accent-grad: linear-gradient(135deg, #f472b6, #a855f7);
  --ok: #4ade80; --warn: #fbbf24; --danger: #fb7185;
  --on-accent: #1a0612;
  --shadow: 0 6px 24px rgba(0, 0, 0, .5);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
}

body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 700px at 100% -10%, var(--bg-2), var(--bg));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#fx-stars {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; line-height: 1.05;
  padding: 4px 8px 18px;
}
.spacer { flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  background: transparent; border: 0; color: var(--muted);
  font: inherit; font-weight: 600; cursor: pointer; text-align: left; width: 100%;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-grad); color: var(--on-accent); box-shadow: var(--shadow); }

.appbar {
  display: none; align-items: center; gap: 8px;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border);
}
.appbar .title { font-weight: 800; font-size: 17px; flex: 1; text-align: center; }

.main { padding: 22px; max-width: 1180px; margin: 0 auto; }
.topbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }

/* ---------- Cards / tipografia ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.card h3 .icon { color: var(--accent); }
.page-title { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; margin: 0 0 16px; }
.page-title .icon { color: var(--accent); width: 24px; height: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 12px; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: var(--radius-sm); border: 0;
  background: var(--accent-grad); color: var(--on-accent);
  font: inherit; font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .1s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.secondary { background: var(--surface-2); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn .icon { width: 18px; height: 18px; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input {
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 500; width: 100%;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
select.input { cursor: pointer; }
code.inline {
  display: block; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-family: ui-monospace, monospace;
  font-size: 12px; word-break: break-all;
}
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.kpis { grid-template-columns: repeat(4, 1fr); }

/* ---------- KPI ---------- */
.kpi .label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .label .icon { width: 16px; height: 16px; }
.kpi .value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.tone-accent .value { color: var(--accent); }
.kpi.tone-warn .value { color: var(--warn); }

/* ---------- Hero (dashboard) ---------- */
.hero { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hero-title { font-size: 18px; font-weight: 800; }
.today-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}
.today-pill .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(236,72,153,.5); } 70% { box-shadow: 0 0 0 8px rgba(236,72,153,0); } 100% { box-shadow: 0 0 0 0 rgba(236,72,153,0); } }
.hero-body { display: flex; align-items: center; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.big-hours { flex: 0 0 auto; }
.bh-value { font-size: 54px; font-weight: 800; line-height: 1; color: var(--accent); }
.bh-value .bh-u { font-size: 24px; margin-left: 4px; color: var(--muted); }
.bh-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; flex: 1; min-width: 240px; }
.hero-stats .stat, .vac-nums .stat { text-align: center; }
.hero-stats .k, .vac-nums .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.hero-stats .v, .vac-nums .v { font-size: 24px; font-weight: 800; }
.vac-nums .s { font-size: 11px; color: var(--muted); }
.ausencia-strip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: 14px; font-size: 13px; }
.ausencia-strip .icon { color: var(--accent); flex: 0 0 auto; }

/* ---------- Calendario ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-title { font-size: 18px; font-weight: 800; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1.06; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; cursor: pointer; overflow: hidden; transition: transform .08s, box-shadow .15s;
  --cc: var(--accent); --cd: var(--accent);
}
.cal-cell:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.cal-cell.out { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.out:hover { transform: none; box-shadow: none; }
.cal-cell.weekend:not(.filled):not(.plan) { background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); }
.cal-cell .num { font-size: 13px; font-weight: 700; }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-cell.filled { background: linear-gradient(160deg, var(--cc), var(--cd)); border-color: transparent; color: #fff; }
.cal-cell.plan { background: color-mix(in srgb, var(--cc) 26%, var(--surface)); border-color: var(--cc); }
.cal-cell .st { font-size: 10px; font-weight: 700; opacity: .95; }
.cal-cell .st-h { font-size: 9px; opacity: .85; }
.cal-cell .origen-badge { position: absolute; top: 3px; right: 3px; }
.cal-cell .origen-badge .icon { width: 12px; height: 12px; }
.cal-cell.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.cal-grid.selecting .cal-cell { cursor: pointer; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-lg { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; }

/* Barra de accion multiple */
.bulkbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  border-radius: 999px; padding: 8px 12px; max-width: calc(100vw - 24px);
}
.bulkbar .count { font-weight: 800; font-size: 13px; padding: 0 6px; color: var(--accent); }

/* ---------- Picker de estado ---------- */
.estado-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.estado-opt {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 600;
}
.estado-opt:hover { border-color: var(--accent); }
.estado-opt.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.estado-opt.dis { opacity: .5; pointer-events: none; }
.estado-opt .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }

.hours-box { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* Chip select (companeras) */
.chip-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-pick {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip-pick.on { background: var(--accent-grad); color: var(--on-accent); border-color: transparent; }

/* ---------- Listas ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.cambio-with { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); padding: 5px 10px; border-radius: 999px; }

/* ---------- Vacaciones ring ---------- */
.vac-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.vac-ring { position: relative; width: 120px; height: 120px; flex: 0 0 auto; }
.vac-ring svg { width: 100%; height: 100%; }
.vac-ring-n { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; color: var(--accent); }
.vac-ring-n span { font-size: 11px; font-weight: 600; color: var(--muted); }
.vac-nums { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; flex: 1; min-width: 220px; }

/* ---------- Tags / chips wrap ---------- */
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.tag-x { display: inline-flex; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 50%; }
.tag-x:hover { background: var(--border); color: var(--danger); }
.tag-x .icon { width: 14px; height: 14px; }

/* ---------- Switch ---------- */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; }

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

/* ---------- Skin switch ---------- */
.skin-switch { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.skin-switch button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.skin-switch button.active { background: var(--accent-grad); color: var(--on-accent); }
.skin-switch .dots { display: inline-flex; gap: 2px; }
.skin-switch .dots i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Brand logo ---------- */
.brand-stop-a { stop-color: var(--accent-2); }
.brand-stop-b { stop-color: var(--accent); }
.brand-glyph rect { fill: #fff; }
.brand-ring { stroke: url(#brandgrad); stroke-width: 2.5; display: none; }
[data-skin="fucsia"] .brand-bg { fill: var(--surface) !important; }
[data-skin="fucsia"] .brand-ring { display: block; }
[data-skin="fucsia"] .brand-glyph rect { fill: var(--accent); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; position: relative; z-index: 1; }
.login-card { width: 100%; max-width: 380px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 8px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(60, 12, 36, .5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: max-content; max-width: 92vw; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: 12px; padding: 11px 15px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; animation: slideup .25s; }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast .icon { width: 18px; height: 18px; }
.toast.error .icon { color: var(--danger); } .toast.warn .icon { color: var(--warn); } .toast.ok .icon { color: var(--ok); }
@keyframes slideup { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Drawer + bottom nav (movil) ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(60, 12, 36, .45); z-index: 50; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; background: var(--surface); border-right: 1px solid var(--border); z-index: 51; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; animation: slidein .2s; }
@keyframes slidein { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.bottomnav { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .appbar { display: flex; }
  .topbar { display: none; }
  .main { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .grid.kpis { grid-template-columns: 1fr 1fr; }
  .grid.two { grid-template-columns: 1fr; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 10px; font-weight: 600; cursor: pointer; padding: 4px 2px;
  }
  .bottomnav button .icon { width: 22px; height: 22px; }
  .bottomnav button.active { color: var(--accent); }
  .bh-value { font-size: 44px; }
  .estado-picker { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .cal-cell .st-h { display: none; }
}
