:root {
  --black: #000;
  --ink: #000;
  --ink-2: #545454;
  --ink-3: #757575;
  --bg: #fff;
  --surface: #f6f6f6;
  --surface-2: #eeeeee;
  --line: #e8e8e8;
  --green: #05a357;
  --green-bg: #e6f6ee;
  --red: #e11900;
  --red-bg: #fdeceb;
  --amber: #c88a00;
  --amber-bg: #fff4d9;
  --blue: #276ef1;
  --blue-bg: #eef3fe;
  --purple: #7356bf;
  --purple-bg: #f1eefa;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.18);
  --side: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--black); color: #fff;
  display: flex; flex-direction: column; padding: 22px 14px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; letter-spacing: -.02em; padding: 0 10px 26px; }
.brand b { font-weight: 800; margin-left: 2px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: #fff; color: #000; display: grid; place-items: center; font-weight: 800; }
#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 999px;
  text-decoration: none; color: #cbcbcb; font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover { background: #1f1f1f; color: #fff; }
.nav-item.active { background: #fff; color: #000; font-weight: 600; }
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item .count { margin-left: auto; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 14px 10px 0; border-top: 1px solid #262626; }
.sf-name { font-weight: 600; font-size: 14px; }
.sf-role { color: #a6a6a6; font-size: 12px; }

/* ---------- Layout ---------- */
.data-panel { margin: 24px 40px 0 calc(var(--side) + 40px); max-width: 1072px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.data-panel strong { font-size: 14px; }
.data-panel p { margin: 3px 0 0; font-size: 13px; color: var(--ink-2); }
.data-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.data-buttons .chip { font-size: 13px; }
.data-buttons .chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.data-buttons .chip:disabled { cursor: wait; opacity: .6; }
@media (max-width: 860px) { .data-panel { margin: 16px 16px 0; } }
main { margin-left: var(--side); padding: 32px 40px 60px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 36px; line-height: 1.1; letter-spacing: -.03em; margin: 0; font-weight: 700; }
.page-head p { margin: 6px 0 0; color: var(--ink-3); }
h2.section { font-size: 20px; letter-spacing: -.01em; margin: 32px 0 14px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
h2.section .muted { font-weight: 500; font-size: 15px; }
.muted { color: var(--ink-3); }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.two-col > * { min-width: 0; }

/* ---------- Buttons / chips ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600; cursor: pointer;
  background: var(--black); color: #fff; display: inline-flex; align-items: center; gap: 8px; transition: transform .08s, background .15s;
}
.btn:hover { background: #333; }
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--surface-2); color: var(--ink); }
.btn.secondary:hover { background: #e2e2e2; }
.btn.ghost { background: transparent; color: var(--ink); padding: 8px 12px; }
.btn.ghost:hover { background: var(--surface); }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  border: 0; background: var(--surface-2); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 14px;
}
.chip:hover { background: #e2e2e2; }
.chip.active { background: var(--black); color: #fff; }
.chip .n { opacity: .6; margin-left: 4px; }

/* ---------- Search ---------- */
.search { position: relative; }
.search input {
  background: var(--surface-2); border: 2px solid transparent; border-radius: 999px; padding: 10px 16px 10px 40px; width: 260px; outline: none;
}
.search input:focus { border-color: var(--black); background: #fff; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--ink-3); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 20px; }
.card.white { background: #fff; border: 1px solid var(--line); }
.card.click { cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.card.click:hover { background: #f0f0f0; }
.kpi { position: relative; overflow: hidden; }
.kpi .label { color: var(--ink-2); font-size: 14px; font-weight: 500; padding-right: 40px; }
.kpi .value { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 8px; }
.kpi .sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.kpi.dark { background: var(--black); color: #fff; }
.kpi.dark .label, .kpi.dark .sub { color: #bdbdbd; }
.kpi .ico { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.kpi.dark .ico { background: #262626; }
.kpi .ico svg { width: 18px; height: 18px; }

.hero {
  background: var(--black); color: #fff; border-radius: var(--r-lg); padding: 28px 32px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; flex-wrap: wrap;
}
.hero h1 { margin: 0; font-size: 34px; letter-spacing: -.03em; line-height: 1.15; }
.hero p { margin: 6px 0 0; color: #bdbdbd; }
.hero .btn { background: #fff; color: #000; }
.hero .btn:hover { background: #e8e8e8; }

/* ---------- List rows ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row.click { cursor: pointer; border-radius: var(--r-sm); padding-left: 10px; padding-right: 10px; }
.row.click:hover { background: var(--surface); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { display: flex; align-items: center; gap: 8px; flex: none; }
.ic-circle { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.ic-circle svg { width: 20px; height: 20px; }
.ic-circle.red { background: var(--red-bg); color: var(--red); }
.ic-circle.amber { background: var(--amber-bg); color: var(--amber); }
.ic-circle.green { background: var(--green-bg); color: var(--green); }
.ic-circle.blue { background: var(--blue-bg); color: var(--blue); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.badge.dark { background: var(--black); color: #fff; }

/* ---------- Avatar ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.none { background: var(--surface-2); color: var(--ink-3); }

/* ---------- Vehicle card ---------- */
.vcard .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.plate {
  display: inline-flex; align-items: stretch; white-space: nowrap; flex: none; border: 2px solid #000; border-radius: 6px; overflow: hidden; font-weight: 700; letter-spacing: .06em; background: #fff; font-size: 15px;
}
.plate .eu { background: #1f47b8; color: #fff; font-size: 9px; padding: 2px 4px; display: flex; flex-direction: column; justify-content: flex-end; letter-spacing: 0; }
.plate .num { padding: 3px 10px; }
.vcard h3 { margin: 14px 0 2px; font-size: 18px; letter-spacing: -.01em; }
.vcard .specs { color: var(--ink-3); font-size: 13px; }
.vcard .dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.date-box { background: #fff; border-radius: 10px; padding: 10px 12px; }
.date-box .k { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.date-box .v { font-weight: 600; font-size: 14px; margin-top: 2px; }
.date-box.red { background: var(--red-bg); color: var(--red); }
.date-box.amber { background: var(--amber-bg); color: #8a5f00; }
.date-box.red .k, .date-box.amber .k { color: inherit; opacity: .8; }
.vcard .driver { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.vcard .driver .n { font-weight: 600; font-size: 14px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; background: var(--surface); white-space: nowrap; }
td:first-child { min-width: 220px; }
td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafafa; }
td .who { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.inline-select { border: 0; background: var(--surface-2); border-radius: 999px; padding: 7px 12px; font-weight: 500; font-size: 14px; cursor: pointer; max-width: 220px; }

/* ---------- Cleaner chips ---------- */
.cleaners { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.cleaner { flex: none; min-width: 170px; background: var(--surface); border-radius: var(--r); padding: 14px; display: flex; gap: 10px; align-items: center; cursor: pointer; border: 2px solid transparent; }
.cleaner.active { border-color: #000; background: #fff; }
.cleaner .n { font-weight: 600; font-size: 14px; }
.cleaner .s { font-size: 12px; color: var(--ink-3); }

/* ---------- RRHH timeline ---------- */
.timeline { border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.tl-grid { display: grid; min-width: 900px; }
.tl-head, .tl-row { display: contents; }
.tl-cell { height: 40px; border-bottom: 1px solid var(--line); border-left: 1px solid #f2f2f2; position: relative; font-size: 11px; display: grid; place-items: center; color: var(--ink-3); }
.tl-cell.name { place-items: center start; padding: 0 14px; font-size: 13px; color: var(--ink); font-weight: 500; position: sticky; left: 0; background: #fff; z-index: 2; border-left: 0; white-space: nowrap; gap: 8px; display: flex; }
.tl-cell.we { background: #fafafa; }
.tl-cell.today { background: #f1f6ff; }
.tl-cell.headc { font-weight: 600; background: var(--surface); height: 44px; line-height: 1.1; text-align: center; }
.tl-cell.headc.today { background: var(--black); color: #fff; }
.tl-bar { position: absolute; inset: 8px 0; z-index: 1; }
.tl-bar.vacaciones { background: var(--blue); }
.tl-bar.baja_medica { background: var(--red); }
.tl-bar.asuntos_propios { background: var(--purple); }
.tl-bar.pend { opacity: .35; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,.6) 4px 8px); }
.tl-bar.start { margin-left: 3px; border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.tl-bar.end { margin-right: 3px; border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 8px; border-radius: 99px; display: inline-block; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--black); border-radius: 99px; }

/* ---------- Map ---------- */
.map-layout { display: grid; grid-template-columns: 340px 1fr; gap: 0; height: 100vh; margin: -32px -40px -60px; }
main.full { max-width: none; }
.map-panel { padding: 28px 20px; overflow-y: auto; border-right: 1px solid var(--line); }
.map-panel h1 { font-size: 30px; margin: 0 0 4px; letter-spacing: -.03em; }
.map-person { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; }
.map-person:hover, .map-person.active { background: var(--surface); }
.map-person .swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.map-person .main { flex: 1; min-width: 0; }
.map-person .title { font-weight: 600; font-size: 14px; }
.map-person .meta { font-size: 12px; color: var(--ink-3); }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px; font-weight: 500; font-size: 14px; }
.switch { position: relative; width: 44px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbcbcb; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: #000; }
.switch input:checked + span::after { transform: translateX(18px); }
/* Mapa SVG */
.svgmap { position: relative; overflow: hidden; background: #f2f2ef; min-height: 400px; height: 100%; }
#msvg { width: 100%; height: 100%; display: block; overflow: visible; cursor: grab; user-select: none; touch-action: none; }
#msvg.dragging { cursor: grabbing; }
.m-land { fill: #f2f2ef; }
.m-hill { fill: #e4e9e0; }
.m-sea { fill: #d5dde3; }
.m-coast { fill: none; stroke: #c3ccd3; stroke-width: 1.5; }
.m-river { fill: none; stroke: #d5dde3; stroke-linecap: round; }
.m-road-c { fill: none; stroke: #e0e0dc; stroke-width: 8; stroke-linecap: round; }
.m-road { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; }
.m-runway { stroke: #d8d8d4; stroke-width: 12; stroke-linecap: round; }
.m-barrio { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; fill: #9a9a96; text-anchor: middle; paint-order: stroke; stroke: #f2f2ef; stroke-width: 4px; pointer-events: none; }
.m-lbl { font-size: 13px; text-anchor: middle; pointer-events: none; fill: #8f9aa3; font-weight: 500; }
.m-lbl.sea { font-size: 18px; font-style: italic; letter-spacing: .2em; fill: #9fb0bd; }
.m-lbl.hill { font-style: italic; fill: #9aa894; letter-spacing: .1em; }
.m-lbl.river { font-size: 11px; font-style: italic; fill: #8fa6b5; }
.m-lbl.poi { font-size: 11px; font-weight: 600; fill: #a0a09c; }
.m-scale line { stroke: #757575; stroke-width: 2; }
.m-scale text { font-size: 11px; fill: #757575; text-anchor: middle; font-weight: 600; }
.m-zone { fill-opacity: .13; stroke-width: 2; cursor: pointer; transition: opacity .2s, fill-opacity .2s; }
.m-zone:hover { fill-opacity: .22; }
.m-portal { stroke: #fff; stroke-width: 2; cursor: pointer; transition: opacity .2s; }
.m-pin { cursor: pointer; transition: opacity .2s; }
.m-pin circle { stroke: #fff; stroke-width: 3; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.m-pin text { fill: #fff; font-size: 11px; font-weight: 700; text-anchor: middle; pointer-events: none; }
#msvg.has-sel [data-id]:not(.sel), #msvg.has-sel [data-emp]:not(.sel) { opacity: .18; }
#msvg.has-sel .m-zone.sel { fill-opacity: .2; stroke-width: 3; }
.map-ctrl { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.map-ctrl button { width: 44px; height: 44px; border: 0; background: #fff; cursor: pointer; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.map-ctrl button:last-child { border-bottom: 0; }
.map-ctrl button:hover { background: var(--surface); }
.map-ctrl svg { width: 20px; height: 20px; }
.map-card { position: absolute; left: 16px; bottom: 16px; width: 300px; max-width: calc(100% - 92px); background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 18px; }
.map-card .close-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; }
.map-card .close-x svg { width: 16px; }

/* ---------- Sheet (modal) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1000; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.98); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); z-index: 1001; display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: .2s;
}
.sheet.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 8px; }
.sheet-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.sheet-body { padding: 8px 24px 8px; overflow-y: auto; }
.sheet-foot { padding: 16px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 8px; }
.sheet-foot .spacer { flex: 1; }
.close-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.close-x:hover { background: #e2e2e2; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  background: var(--surface-2); border: 2px solid transparent; border-radius: var(--r-sm); padding: 11px 12px; outline: none; width: 100%;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #000; background: #fff; }
.field input[type=color] { height: 46px; padding: 4px; }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 14px; }
.detail-list .k { font-size: 12px; color: var(--ink-3); }
.detail-list .v { font-weight: 600; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px); background: #000; color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 500; opacity: 0; transition: .25s; z-index: 2000; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.actions { display: flex; gap: 6px; }

/* ---------- Material ---------- */
.quick { background: #000; color: #fff; border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 24px; }
.quick h3 { margin: 0 0 14px; font-size: 22px; letter-spacing: -.02em; }
.quick form { display: flex; gap: 10px; flex-wrap: wrap; }
.quick input, .quick select { background: #fff; color: #000; border: 2px solid transparent; border-radius: 999px; padding: 11px 16px; outline: none; }
.quick input:focus, .quick select:focus { border-color: #8a8a8a; }
.quick input[name=material] { flex: 1; min-width: 200px; }
.quick .btn { background: #fff; color: #000; }
.quick .btn:hover { background: #e8e8e8; }
.sugs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.sugs button { background: #262626; color: #fff; border: 0; border-radius: 999px; padding: 6px 13px; font-size: 13px; cursor: pointer; }
.sugs button:hover { background: #3a3a3a; }

/* ---------- En directo ---------- */
.live-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; background: #000; color: #fff; border-radius: var(--r-lg); padding: 24px 28px; margin-bottom: 24px; }
.live-clock { font-size: 60px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.live-date { color: #bdbdbd; margin-top: 8px; text-transform: capitalize; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: #262626; border-radius: 999px; padding: 5px 12px; margin-bottom: 14px; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
.live-pill.sim i { background: #ffc043; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(225,25,0,.7); } 70% { box-shadow: 0 0 0 8px rgba(225,25,0,0); } 100% { box-shadow: 0 0 0 0 rgba(225,25,0,0); } }
.live-ctrl { display: flex; flex-direction: column; gap: 14px; align-items: flex-end; }
.daychips { display: flex; gap: 6px; }
.daychips button { width: 46px; height: 54px; border-radius: 12px; border: 0; background: #1f1f1f; color: #a6a6a6; cursor: pointer; font-weight: 600; font-size: 12px; line-height: 1.2; position: relative; }
.daychips button b { display: block; font-size: 17px; color: #fff; }
.daychips button.today::after { content: ''; position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--red); }
.daychips button.active { background: #fff; color: #545454; }
.daychips button.active b { color: #000; }
.slider-row { display: flex; gap: 10px; align-items: center; color: #a6a6a6; font-size: 12px; font-weight: 600; }
.slider-row input[type=range] { width: 260px; accent-color: #fff; }
.live-head .btn { background: #fff; color: #000; }
.gantt { border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.g-inner { min-width: 900px; }
.g-row { display: grid; grid-template-columns: 210px 1fr; border-bottom: 1px solid var(--line); min-height: 50px; }
.g-row:last-child { border-bottom: 0; }
.g-name { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600; position: sticky; left: 0; background: #fff; z-index: 3; border-right: 1px solid var(--line); }
.g-name small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.g-head { min-height: 38px; background: var(--surface); }
.g-head .g-name { background: var(--surface); color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.g-track { position: relative; background-image: repeating-linear-gradient(to right, #f1f1f1 0 1px, transparent 1px calc(100% / 11)); }
.g-tick { position: absolute; top: 11px; font-size: 11px; color: var(--ink-3); transform: translateX(-50%); font-weight: 600; }
.g-tick:first-child { transform: none; margin-left: 4px; }
.g-shift { position: absolute; top: 50%; height: 6px; margin-top: -3px; background: #e6e6e6; border-radius: 99px; }
.g-blk { position: absolute; top: 9px; bottom: 9px; border-radius: 8px; font-size: 11px; font-weight: 600; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: pointer; min-width: 6px; transition: transform .1s; }
.g-blk:hover { transform: translateY(-1px); }
.g-blk span { overflow: hidden; text-overflow: ellipsis; }
.g-blk.done { background: var(--green-bg); color: var(--green); }
.g-blk.live { background: #000; color: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.12); }
.g-blk.next { background: #fff; border: 1.5px solid #cbcbcb; color: var(--ink-2); }
.g-blk.uncovered { background: repeating-linear-gradient(45deg, #fdeceb 0 6px, #fbd5d1 6px 12px); color: var(--red); }
.g-row.off .g-name { opacity: .6; }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--red); z-index: 2; pointer-events: none; }
.g-head .g-now::before { content: attr(data-t); position: absolute; top: 9px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.time-tag { flex: none; width: 74px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.time-tag small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }

/* ---------- Mobile tabbar ---------- */
.tabbar { display: none; }

@media (max-width: 1100px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  main { margin-left: 0; padding: 20px 16px 100px; }
  .page-head h1 { font-size: 28px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 26px; }
  .search input { width: 100%; }
  .search { width: 100%; }
  .grid.cards { grid-template-columns: 1fr; }
  .grid.kpis { grid-template-columns: 1fr 1fr; }
  .quick select, .quick input, .quick input[name=material], .quick .btn { width: 100%; }
  .tabbar { overflow-x: auto; justify-content: flex-start; }
  .tabbar a { padding: 4px 2px; font-size: 9px; flex: none; min-width: 52px; }
  .live-clock { font-size: 44px; }
  .live-ctrl { align-items: stretch; width: 100%; }
  .slider-row input[type=range] { width: 100%; flex: 1; }
  .daychips button { flex: 1; width: auto; }
  .kpi .value { font-size: 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; grid-template-rows: 50vh auto; height: auto; margin: -20px -16px 0; }
  .map-layout .svgmap { order: -1; height: 50vh; }
  .map-panel { border-right: 0; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 900;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; text-decoration: none; color: var(--ink-3); padding: 4px 6px; font-weight: 500; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: #000; font-weight: 700; }
  .sheet { top: auto; bottom: 0; left: 0; width: 100%; transform: translateY(100%); border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 90vh; }
  .sheet.open { transform: translateY(0); }
}

/* =========================================================
   WordPress: login, cabecera móvil, cierre de sesión
   ========================================================= */
.sidebar-foot { align-items: center; }
.sf-text { flex: 1; min-width: 0; }
.sf-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-logout { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #a6a6a6; text-decoration: none; flex: none; }
.sf-logout:hover { background: #1f1f1f; color: #fff; }
.sf-logout svg { width: 18px; height: 18px; }
.mobile-top { display: none; }

.auth-page { background: var(--surface); }
main.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 0; max-width: none; }
main.auth.single { grid-template-columns: 1fr; }
.auth-side { background: #000; color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .brand { padding: 0; }
.auth-side h1 { font-size: 44px; letter-spacing: -.03em; line-height: 1.05; margin: 0 0 12px; max-width: 460px; }
.auth-side p { color: #bdbdbd; margin: 0; max-width: 420px; font-size: 17px; }
.auth-side small { color: #757575; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-card .brand { color: #000; padding: 0 0 8px; }
.auth-card .brand-mark { background: #000; color: #fff; }
.auth-card h2 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.auth-card p { margin: -6px 0 4px; }
.auth-remember { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.auth-submit { width: 100%; justify-content: center; padding: 14px; font-size: 16px; text-decoration: none; text-align: center; }
.auth-link { text-align: center; font-size: 14px; color: var(--ink-3); }
.auth-error { background: var(--red-bg); color: var(--red); border-radius: var(--r-sm); padding: 10px 14px; font-weight: 600; font-size: 14px; }
@media (max-width: 860px) {
  main.auth { grid-template-columns: 1fr; padding: 0; }
  .auth-side { padding: 28px 20px; gap: 24px; }
  .auth-side h1 { font-size: 30px; }
  .auth-side small { display: none; }
  .auth-form { place-items: start center; }
  .auth-card { padding: 24px 20px; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; background: #000; color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 30; }
  .mobile-top .brand { padding: 0; font-size: 17px; }
  .mobile-top .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  .mobile-top .sf-logout { width: auto; height: auto; border-radius: 999px; padding: 6px 12px; gap: 6px; display: flex; color: #fff; background: #1f1f1f; font-size: 13px; font-weight: 600; }
  .mobile-top .sf-logout svg { width: 16px; height: 16px; }
}

/* ---------- Formularios: ayudas ---------- */
.field .hint { font-size: 12px; color: var(--ink-3); }
.field input[readonly] { color: var(--ink-3); cursor: not-allowed; }
.form-section { grid-column: 1 / -1; font-weight: 700; font-size: 15px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.filters .field { min-width: 150px; }
.filters .field input, .filters .field select { padding: 9px 12px; }

/* =========================================================
   Partes de trabajo y app de empleado
   ========================================================= */
.punch { background: #000; color: #fff; border-radius: var(--r-lg); padding: 24px; margin-bottom: 24px; }
.punch h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.punch p { margin: 0; color: #bdbdbd; }
.punch .big { font-size: 52px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; margin: 18px 0 6px; }
.punch form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.punch select, .punch input { background: #fff; color: #000; border: 2px solid transparent; border-radius: 999px; padding: 11px 16px; outline: none; }
.punch select { flex: 1; min-width: 220px; }
.punch input[type=time] { width: 130px; }
.punch input[name=notas] { flex: 1; min-width: 160px; }
.punch .btn { background: #fff; color: #000; }
.punch .btn:hover { background: #e8e8e8; }
.punch .btn.secondary { background: #262626; color: #fff; }
.punch .btn.secondary:hover { background: #3a3a3a; }
.punch .actions { margin-top: 18px; flex-wrap: wrap; gap: 10px; }
.punch.live { background: linear-gradient(135deg, #000 0%, #0b2a12 100%); }
.punch .live-pill { margin-bottom: 10px; }
.notice-bar { border-radius: var(--r); padding: 14px 18px; margin-bottom: 20px; display: flex; gap: 12px; align-items: center; font-weight: 500; }
.notice-bar svg { width: 20px; height: 20px; flex: none; }
.notice-bar.blue { background: var(--blue-bg); color: var(--blue); }
.notice-bar.red { background: var(--red-bg); color: var(--red); }
.notice-bar.amber { background: var(--amber-bg); color: #8a5f00; }
.day-group { margin-bottom: 18px; }
.day-group h3 { font-size: 14px; color: var(--ink-2); margin: 0 0 6px; display: flex; justify-content: space-between; }
.dur { font-variant-numeric: tabular-nums; font-weight: 700; }
@media (max-width: 860px) {
  .punch .big { font-size: 40px; }
  .punch select, .punch input, .punch input[type=time], .punch .btn { width: 100%; }
  .filters .field { flex: 1; min-width: 130px; }
}
.nav-item .count.live { background: var(--green); }
.nav-wp { margin-top: 10px; border-top: 1px solid #262626; border-radius: 0 0 10px 10px; padding-top: 14px; }
.nav-item .count.amber { background: var(--amber); }
