/* REVANET Attendance — paleta azul REVANET */
:root {
  --navy-950: #061229;
  --navy-900: #081A3D;
  --navy: #0B2554;
  --blue-800: #0E3A86;
  --blue-700: #1255B8;
  --blue-600: #1167D8;
  --brand: #0598FA;
  --sky: #5CC0FF;
  --ice: #EAF4FF;
  --ice-2: #D7E9FF;
  --bg: #F2F6FC;
  --surface: #FFFFFF;
  --ink: #0E1B33;
  --ink-2: #32425E;
  --muted: #64748F;
  --line: #DCE5F2;
  --line-2: #E9EFF8;
  --ok: #0F9E6E; --ok-bg: #E3F6EF;
  --warn: #C27C00; --warn-bg: #FFF3DB;
  --danger: #D23347; --danger-bg: #FDE8EB;
  --info: var(--blue-600); --info-bg: var(--ice);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(8, 26, 61, .06), 0 4px 16px rgba(8, 26, 61, .06);
  --shadow-lg: 0 12px 40px rgba(8, 26, 61, .22);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --side: 244px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0 0 .6em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.txt-danger { color: var(--danger) !important; }
.txt-ok { color: var(--ok) !important; }
.txt-warn { color: var(--warn) !important; }

.ic { width: 18px; height: 18px; flex: none; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--surface); transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; white-space: nowrap; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #129FFB, var(--blue-600)); color: #fff; box-shadow: 0 2px 8px rgba(17, 103, 216, .3); }
.btn-primary:hover { background: linear-gradient(180deg, #0B91EE, var(--blue-700)); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--sky); background: var(--ice); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-xl { padding: 16px 26px; font-size: 17px; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 20px; }
.icon-btn:hover { background: var(--ice); color: var(--blue-600); }
.link { font-weight: 600; font-size: 14px; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-size: 12px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(5, 152, 250, .18); }
input:disabled { background: var(--bg); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.span-2 { grid-column: 1 / -1; }
.form-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--blue-700); margin: 8px 0 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.form-error { background: var(--danger-bg); color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; margin: 4px 0 12px; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.chk input, .day input, .pill input { width: 18px; height: 18px; accent-color: var(--blue-600); }
.search { max-width: 240px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label > span { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; color: var(--ink); }
.seg label > span .ic { color: var(--blue-600); margin-bottom: 2px; }
.seg small { font-weight: 500; color: var(--muted); font-size: 12px; }
.seg input:checked + span { border-color: var(--brand); background: var(--ice); box-shadow: 0 0 0 3px rgba(5, 152, 250, .12); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day { cursor: pointer; }
.day input { position: absolute; opacity: 0; }
.day span { display: grid; place-items: center; width: 46px; height: 40px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--muted); }
.day input:checked + span { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; margin: 1px 3px 1px 0; }
.badge .ic { width: 13px; height: 13px; }
.badge-muted { background: var(--line-2); color: var(--muted); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--sky); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; margin: 0 6px 6px 0; }
.pill:has(input:checked) { background: var(--ice); border-color: var(--brand); }

/* ---------- Avatares ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--sky), var(--blue-700)); color: #fff; font-weight: 700; font-size: 14px; flex: none; vertical-align: middle; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; }
.avatar.xl { width: 88px; height: 88px; font-size: 28px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { background: radial-gradient(1200px 600px at 0% 0%, #1A4FA8 0%, transparent 60%), radial-gradient(800px 500px at 100% 100%, #0598FA55 0%, transparent 60%), var(--navy-900); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-brand::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); pointer-events: none; }
.login-logo { width: 220px; margin-bottom: 48px; }
.login-brand h1 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 16px; }
.login-brand p { color: #B9CCEA; font-size: 17px; max-width: 30em; }
.login-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.login-points li { display: flex; align-items: center; gap: 12px; color: #DCE8FA; font-weight: 600; }
.login-points .ic { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(92, 192, 255, .14); color: var(--sky); }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); border: 1px solid var(--line-2); }
.login-logo-sm { display: none; width: 150px; margin-bottom: 20px; }
.login-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.login-card > p { margin-bottom: 20px; }
.login-foot { margin-top: 20px; color: var(--muted); font-size: 13px; }

/* ---------- Shell ---------- */
body.is-app #app { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--navy-900); color: #C9D8F0; display: flex; flex-direction: column; padding: 20px 14px; z-index: 20; background-image: radial-gradient(500px 300px at 0% 0%, #13408F 0%, transparent 70%); }
.side-logo { display: flex; flex-direction: column; gap: 4px; padding: 4px 10px 26px; }
.side-logo img { width: 150px; }
.side-logo span { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--sky); font-weight: 700; padding-left: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #C9D8F0; font-weight: 600; text-decoration: none; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.active { background: linear-gradient(90deg, rgba(5, 152, 250, .28), rgba(5, 152, 250, .08)); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.side-nav a.active .ic { color: var(--sky); }
.side-foot { margin-top: auto; padding: 10px; font-size: 12px; color: #7F95BC; display: flex; flex-direction: column; gap: 8px; }
.main { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: rgba(242, 246, 252, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.top-logo { display: none; height: 26px; }
.top-ctx { flex: 1; min-width: 0; }
.co-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.co-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-logo { width: 38px; height: 38px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; }
.co-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.co-logo-txt { background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; border: 0; }
.co-logo-xl { width: 88px; height: 88px; border-radius: 16px; color: var(--muted); }
.co-logo-xl .ic { width: 32px; height: 32px; }
.co-switch { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 4px 0 12px; max-width: 360px; color: var(--blue-600); }
.co-switch select { border: 0; min-height: 40px; padding-left: 0; font-weight: 700; background: transparent; box-shadow: none !important; }
.me-btn { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 12px; text-align: left; }
.me-btn:hover { background: #fff; }
.me-name { display: flex; flex-direction: column; line-height: 1.2; }
.me-name strong { font-size: 14px; }
.me-name small { color: var(--muted); font-size: 12px; }
.view { padding: 26px 28px 60px; max-width: 1280px; width: 100%; }
.tabbar { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.date-pick { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding-left: 10px; color: var(--blue-600); }
.date-pick input { border: 0 !important; box-shadow: none !important; min-height: 38px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; border: 1px solid var(--line-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 .ic { color: var(--blue-600); }
.count { background: var(--ice); color: var(--blue-700); font-weight: 800; font-size: 13px; padding: 2px 10px; border-radius: 999px; }
.sec-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; color: var(--ink-2); }
.sec-title .ic { color: var(--blue-600); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select { width: auto; min-width: 170px; }
.toolbar .search { margin-left: auto; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 16px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: var(--sky); margin-bottom: 4px; }
.empty strong { color: var(--ink-2); }
.empty p { margin: 0; font-size: 14px; }
.note { display: flex; gap: 8px; align-items: center; background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.loading { display: grid; place-items: center; padding: 60px; }
.loading.full { min-height: 100vh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--ice-2); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.fatal { display: flex; flex-direction: column; align-items: center; padding: 80px 20px; color: var(--danger); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.kpi span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi strong { display: block; font-size: 26px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi strong small { font-size: 15px; color: var(--muted); font-weight: 600; }
.kpi-ok::before { background: var(--ok); } .kpi-warn::before { background: #F0B429; } .kpi-danger::before { background: var(--danger); } .kpi-info::before { background: var(--brand); }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFCFF; }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #F8FBFF; }
.table tfoot td { font-weight: 700; background: var(--ice); border: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.inactive { opacity: .55; }
.who { display: flex; align-items: center; gap: 10px; }
.who > div { display: flex; flex-direction: column; min-width: 0; }
.who strong { white-space: nowrap; }
.who small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.row-actions { white-space: nowrap; text-align: right; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.thumb-lg { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; cursor: zoom-in; margin-top: 8px; }

/* ---------- Mi jornada (empleado) ---------- */
.punch-hero { background: radial-gradient(600px 300px at 100% 0%, rgba(5, 152, 250, .5), transparent 70%), linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%); color: #fff; border-radius: 20px; padding: 22px 22px 18px; margin-bottom: 16px; box-shadow: var(--shadow-lg); }
.ph-top { display: flex; align-items: center; gap: 12px; }
.ph-top > div { display: flex; flex-direction: column; }
.ph-co { width: 44px; height: 44px; border-radius: 12px; background: #fff; overflow: hidden; flex: none; }
.ph-co img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.ph-hello { font-weight: 800; font-size: 18px; }
.ph-date { color: #A9C3EA; font-size: 14px; }
.ph-clock { font-size: 64px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 10px 0 2px; line-height: 1; }
.ph-sched { display: flex; align-items: center; gap: 6px; color: #BCD2F2; font-size: 13px; }
.ph-sched .ic { width: 15px; height: 15px; }
.stepper { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: relative; }
.stepper li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; position: relative; font-size: 12px; color: #8EA8D2; }
.stepper li::before { content: ''; position: absolute; top: 18px; left: -50%; width: 100%; height: 2px; background: rgba(255, 255, 255, .14); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.current::before { background: var(--brand); }
.st-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .16); position: relative; z-index: 1; }
.st-dot .ic { width: 17px; height: 17px; }
.stepper li.done .st-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper li.current .st-dot { background: #fff; border-color: #fff; color: var(--blue-600); box-shadow: 0 0 0 6px rgba(5, 152, 250, .35); }
.stepper li.current { color: #fff; font-weight: 700; }
.stepper li.done { color: #D6E6FF; }
.st-label { line-height: 1.2; }
.st-time { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; min-height: 1em; }
.punch-action { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; border: 2px solid var(--ice-2); }
.pa-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--ice); color: var(--blue-600); display: grid; place-items: center; }
.pa-icon .ic { width: 26px; height: 26px; }
.pa-text { display: flex; flex-direction: column; }
.pa-text strong { font-size: 18px; }
.pa-text span { color: var(--muted); font-size: 14px; }
.punch-done { display: flex; align-items: center; gap: 14px; background: var(--ok-bg); border-color: #BDE9D7; }
.punch-done > .ic { width: 40px; height: 40px; padding: 8px; border-radius: 50%; background: var(--ok); color: #fff; }
.punch-done div { flex: 1; display: flex; flex-direction: column; }
.punch-done strong { font-size: 17px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.task-list li:last-child { border-bottom: 0; }
.task-list p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line-2); }
.hist li.clickable { cursor: pointer; }
.hist li.clickable:hover { background: #F8FBFF; }
.hist-times { font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* Confirmación de paso */
.confirm-step { text-align: center; }
.cs-time { font-size: 52px; font-weight: 800; color: var(--blue-600); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.confirm-step .field { text-align: left; margin-top: 14px; }
.proxy-photo { display: flex; align-items: center; gap: 10px; justify-content: center; }
.proxy-photo .thumb { width: 64px; height: 64px; }

/* Reporte */
.task-checks { display: flex; flex-direction: column; gap: 8px; }
.task-check { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.chk-sub { margin-left: 26px; font-size: 13px; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(6, 18, 41, .7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ph-x .ic { width: 14px; height: 14px; }
.ph-add { border: 2px dashed var(--ice-2); background: var(--ice); color: var(--blue-600); cursor: pointer; display: grid; place-items: center; }
.ph-add .ic { width: 28px; height: 28px; }
.photo-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Detalle de jornada */
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-head > div:nth-child(2) { display: flex; flex-direction: column; }
.detail-kpis { margin-left: auto; }
.timeline { list-style: none; margin: 0 0 16px; padding: 0; }
.tl-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--muted); flex: none; }
.tl-item.done .tl-dot { background: var(--ice); color: var(--blue-600); }
.tl-body { flex: 1; min-width: 0; padding-top: 6px; }
.tl-top { display: flex; justify-content: space-between; gap: 10px; }
.tl-time { font-weight: 800; font-variant-numeric: tabular-nums; }
.tl-meta { display: flex; flex-direction: column; gap: 2px; font-size: 13px; margin-top: 2px; }
.tl-meta a { display: inline-flex; align-items: center; gap: 4px; }
.tl-meta .ic { width: 14px; height: 14px; }
.report-view { border-top: 1px solid var(--line-2); padding-top: 14px; }
.report-view h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.report-view h4 .ic { color: var(--blue-600); }
.report-text { background: var(--bg); padding: 12px 14px; border-radius: 10px; }
.report-tasks { margin: 8px 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: var(--bg); }
.viewer img { width: 100%; max-height: 70vh; object-fit: contain; background: #000; border-radius: 10px; }
.viewer-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* Planilla */
.bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--ice); border: 1px solid var(--ice-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; position: sticky; top: 66px; z-index: 5; }
.bulk select { width: auto; }
.roster { display: flex; flex-direction: column; }
.r-row { display: grid; grid-template-columns: 22px minmax(200px, 1.4fr) 170px minmax(300px, 2fr) 150px; gap: 14px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.r-row:hover { background: #F8FBFF; }
.r-row .sel { width: 18px; height: 18px; accent-color: var(--blue-600); }
.r-who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.r-who > div { display: flex; flex-direction: column; min-width: 0; }
.r-who strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-who small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-times { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rt { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); position: relative; }
.rt b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.rt i { position: absolute; top: -2px; right: 6px; font-style: normal; font-size: 9px; font-weight: 800; background: var(--warn-bg); color: var(--warn); border-radius: 4px; padding: 0 3px; }
.r-act { text-align: right; }

/* Planner de tareas */
.week-nav { display: flex; align-items: center; gap: 6px; }
.planner { display: grid; grid-template-columns: minmax(180px, 1.6fr) repeat(7, minmax(52px, 1fr)); gap: 4px; align-items: stretch; overflow-x: auto; }
.g-head { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; text-align: center; padding: 6px 0; border-radius: 8px; }
.g-head b { display: block; font-size: 16px; color: var(--ink); }
.g-head.today { background: var(--ice); color: var(--blue-600); }
.g-head.today b { color: var(--blue-600); }
.g-label { grid-column: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px 10px; border-radius: 10px; background: #FAFCFF; border: 1px solid var(--line-2); cursor: pointer; min-width: 0; }
.g-label strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-label small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-label:hover { border-color: var(--sky); }
.g-bar { border-radius: 10px; display: flex; align-items: center; padding: 0 8px; cursor: pointer; min-height: 44px; overflow: hidden; }
.g-bar .badge { background: rgba(255, 255, 255, .85); }
.g-info { background: linear-gradient(90deg, #BFE3FF, #8ECDFF); }
.g-warn { background: linear-gradient(90deg, #FFE2A6, #FFC963); }
.g-danger { background: linear-gradient(90deg, #FFC4CB, #FF94A1); }
.g-ok { background: linear-gradient(90deg, #BDEBD8, #8AD9B9); }
.g-empty { grid-column: 1 / -1; color: var(--muted); padding: 14px; text-align: center; background: #FAFCFF; border-radius: 10px; font-size: 14px; }
.d-cell { display: grid; place-items: center; border-radius: 8px; font-size: 12px; font-weight: 700; min-height: 44px; }
.d-cell.na { background: transparent; }
.d-cell.ok { background: var(--ok-bg); color: var(--ok); }
.d-cell.part { background: var(--warn-bg); color: var(--warn); }
.d-cell.miss { background: var(--danger-bg); color: var(--danger); }
.d-cell.future { background: var(--line-2); }
.assign-group { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.ag-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* Reportes */
.filters .tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line-2); padding-bottom: 12px; }
.tab { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--navy); color: #fff; }
.tab:not(.on):hover { background: var(--ice); color: var(--blue-600); }
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.calc-note { margin-top: 14px; }
.progress-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.progress-item { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; }
.pi-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pi-head > div { flex: 1; display: flex; flex-direction: column; }
.pi-head small { color: var(--muted); font-size: 12px; }
.print-head { display: none; }

/* Empresas */
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-bottom: 18px; }
.co-card { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.co-card.off { background: #FBFBFD; }
.co-card.off .co-card-head strong { color: var(--muted); }
.co-card-head { display: flex; align-items: center; gap: 12px; }
.co-card-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.co-card-head small { color: var(--muted); font-size: 13px; }
.co-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.co-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.co-meta dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; }
.co-actions { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.crew-list { list-style: none; padding: 0; margin: 0 0 16px; }
.crew-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.crew-list li > div { display: flex; flex-direction: column; }
.crew-list small { color: var(--muted); }
.crew-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; background: var(--bg); padding: 12px; border-radius: 12px; }
.crew-form .field { margin: 0; }
.photo-pick { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.photo-pick .btn { margin: 0 6px 6px 0; }
.me-card { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.me-card > div { display: flex; flex-direction: column; }
.me-card span { color: var(--ink-2); font-size: 14px; }
.me-card small { color: var(--muted); }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(6, 18, 41, .55); z-index: 100; display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .18s; backdrop-filter: blur(2px); }
.modal-wrap.in { opacity: 1; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .2s; }
.modal-wrap.in .modal { transform: none; }
.modal.sm { max-width: 420px; }
.modal.lg { max-width: 820px; }
.modal.full { max-width: 760px; }
.modal.cam { max-width: 520px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; align-items: center; }

/* Cámara */
.cam { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 3/4; max-height: 60vh; margin: 0 auto; }
.cam video, .cam .cam-preview { width: 100%; height: 100%; object-fit: cover; }
.cam video { transform: scaleX(-1); }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-align: center; padding: 24px; font-weight: 600; }
.cam-guide { position: absolute; left: 50%; top: 46%; width: 58%; aspect-ratio: 3/4; transform: translate(-50%, -50%); border: 2px dashed rgba(255, 255, 255, .55); border-radius: 50%; pointer-events: none; }
.cam:has(.cam-preview:not([hidden])) .cam-guide { display: none; }

/* Toast y ocupado */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 520px); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(10px); transition: all .25s; }
.toast.in { opacity: 1; transform: none; }
.toast-ok .ic { color: #5BE3B0; }
.toast-error { background: #7A1424; }
#busy { position: fixed; inset: 0; z-index: 300; background: rgba(6, 18, 41, .45); display: none; place-items: center; }
#busy.on { display: grid; }
.busy-box { background: #fff; padding: 18px 22px; border-radius: 14px; display: flex; gap: 12px; align-items: center; font-weight: 700; box-shadow: var(--shadow-lg); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .r-row { grid-template-columns: 22px 1fr auto; grid-template-areas: 'sel who act' 'sel st st' 'sel tm tm'; row-gap: 8px; }
  .r-row .sel { grid-area: sel; align-self: start; margin-top: 10px; }
  .r-who { grid-area: who; } .r-status { grid-area: st; } .r-times { grid-area: tm; } .r-act { grid-area: act; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; background: linear-gradient(180deg, var(--navy-900) 0, var(--navy-900) 190px, var(--bg) 190px); padding-top: 44px; justify-content: flex-start; }
  .login-panel::before { content: ''; display: block; width: 170px; height: 44px; background: url(../assets/logo-revanet-white.png) center/contain no-repeat; margin-bottom: 26px; }
  .side { display: none; }
  .main { margin-left: 0; }
  .top { padding: 10px 16px; gap: 10px; background: var(--navy-900); border-bottom: 0; }
  .top-logo { display: block; content: url(../assets/cloud-white.png); height: 28px; }
  .co-name, .me-name strong { color: #fff; }
  .me-name small { color: #9DB4DA; }
  .me-name { display: none; }
  .co-switch { max-width: 100%; }
  .co-brand .co-logo { width: 32px; height: 32px; }
  .view { padding: 18px 16px calc(96px + var(--safe-b)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b)); box-shadow: 0 -4px 20px rgba(8, 26, 61, .08); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; border-radius: 10px; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--blue-600); background: var(--ice); }
  .page-head h1 { font-size: 22px; }
  .card { padding: 16px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .bulk { top: 56px; }
  .toolbar .search { margin-left: 0; max-width: none; flex: 1 1 100%; }
  .toolbar select { flex: 1; min-width: 0; }
  .crew-form { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .seg { grid-template-columns: 1fr; }
  .modal-wrap { padding: 0; place-items: end center; }
  .modal { max-width: none !important; border-radius: 18px 18px 0 0; max-height: 94vh; }
  .modal.full { height: 94vh; }
  .modal-foot { padding-bottom: calc(14px + var(--safe-b)); }
  .modal-foot .btn { flex: 1; }
  .ph-clock { font-size: 56px; }
  .stepper li { font-size: 10.5px; }
  .st-dot { width: 34px; height: 34px; }
  .stepper li::before { top: 16px; }
  .punch-action { grid-template-columns: auto 1fr; }
  .punch-action .btn { grid-column: 1 / -1; width: 100%; }
  .punch-done { flex-wrap: wrap; }
  .hist li { grid-template-columns: 1fr auto; }
  .hist-badges { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi span { font-size: 10px; letter-spacing: .02em; }
  .kpi strong { font-size: 20px; }
  .r-times { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .co-grid { grid-template-columns: 1fr; }
  .progress-list { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
}

/* ---------- Impresión (reportes a PDF) ---------- */
@media print {
  @page { size: landscape; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .side, .top, .tabbar, .no-print, .page-head, #toasts, .bulk { display: none !important; }
  .main { margin: 0; }
  .view { padding: 0; max-width: none; }
  .card, .kpi { box-shadow: none; border: 1px solid #ccd; break-inside: avoid; }
  .print-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--navy); }
  .print-head > div { flex: 1; }
  .print-head h2 { font-size: 18px; }
  .print-head p { margin: 2px 0 0; color: #445; }
  .print-head .ph-logo { height: 44px; width: auto; }
  .print-head .ph-rv { height: 24px; width: auto; }
  .table th { background: #eef3fb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .day-block { break-inside: auto; }
  .progress-item { break-inside: avoid; }
  .gallery { grid-template-columns: repeat(6, 1fr); }
  a { color: inherit; }
}

/* Imagen de portada de empresa */
.co-card { overflow: hidden; position: relative; }
.co-cover { margin: -18px -18px 0; height: 0; overflow: hidden; background: linear-gradient(135deg, var(--navy), var(--blue-700)); }
.co-cover:has(img) { height: 120px; }
.co-cover img { width: 100%; height: 100%; object-fit: cover; }
.co-card.off .co-cover img { filter: grayscale(1); opacity: .6; }
.cover-pick { height: 150px; border-radius: 12px; border: 2px dashed var(--ice-2); background: var(--ice); overflow: hidden; display: grid; place-items: center; color: var(--blue-600); font-weight: 600; margin-bottom: 8px; }
.cover-pick span { display: inline-flex; gap: 8px; align-items: center; }
.cover-pick img { width: 100%; height: 100%; object-fit: cover; }
.punch-hero { position: relative; overflow: hidden; isolation: isolate; }
.ph-cover { position: absolute; inset: 0; z-index: -1; }
.ph-cover img { width: 100%; height: 100%; object-fit: cover; }
.ph-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(11, 37, 84, .66) 0%, rgba(8, 26, 61, .9) 75%); }

/* Vacaciones, permisos y festivos */
.ph-note { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(92, 192, 255, .16); color: #E3F1FF; font-size: 13px; font-weight: 600; }
.ph-note .ic { width: 16px; height: 16px; color: var(--sky); }
.leave-calc { background: var(--ice); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.leave-calc:empty { display: none; }
.note-info { display: flex; gap: 12px; background: var(--ice); border: 1px solid var(--ice-2); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.note-info > .ic { color: var(--blue-600); width: 22px; height: 22px; margin-top: 2px; }
.note-info > div { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.hol-list { list-style: none; padding: 0; margin: 0 0 8px; }
.hol-list li { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line-2); }
.hol-list li > span:nth-child(2) { flex: 1; }
.hol-date { min-width: 130px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hol-form { display: grid; grid-template-columns: 160px 1fr 1fr auto; gap: 10px; align-items: end; background: var(--bg); padding: 12px; border-radius: 12px; margin-top: 12px; }
.hol-form .field { margin: 0; }
.calc-note ul { margin: 6px 0 0; padding-left: 18px; }
.calc-note li { margin-bottom: 3px; }
.pay-table td small { font-size: 11px; }
.card > .tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line-2); padding-bottom: 12px; }
@media (max-width: 900px) { .hol-form { grid-template-columns: 1fr; } .hol-date { min-width: 100px; } }
