[hidden] { display: none !important; }
:root {
  --brand: #2f6bff; --brand-soft: #14264d; --ink: #f2f6ff; --ink2: #aab6cc; --muted: #7d8aa5;
  --bg: #070d1a; --card: #0f1a2e; --line: #1c2a44; --card2: #16233b;
  --ok: #22c55e; --ok-soft: #0f2e22; --warn: #f5b301; --warn-soft: #3a2c0a; --bad: #ff6b66; --bad-soft: #3b1618;
  color-scheme: dark;
  --r: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.4; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 17px; margin: 0 0 12px; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* inputs & buttons */
label { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 12px; font-weight: 500; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); }
input:focus, select:focus, textarea:focus { outline: 2px solid #2f6bff; border-color: var(--brand); }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--card2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: #6b2a2a; }
.btn.block { width: 100%; padding: 14px; font-size: 16px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn { border: 0; background: none; padding: 4px 0; color: var(--brand); font-weight: 500; display: block; }
.iconbtn { border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.iconbtn.light { background: rgba(0,0,0,.4); color: #fff; }

/* login */

/* shell: sidebar on desktop, top bar + bottom tabs on phone */
.shell { display: flex; min-height: 100vh; }
.side { width: 230px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; padding: 18px 18px 14px; }
.side-brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink2); font-weight: 500; }
.nav a:hover { background: var(--card2); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav svg, .tabbar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.side-me { border-top: 1px solid var(--line); padding: 14px 18px; }
.me-name { font-weight: 600; }
.topbar, .tabbar { display: none; }
.main { flex: 1; min-width: 0; padding: 26px 30px 40px; max-width: 1180px; }

@media (max-width: 800px) {
  .side { display: none; }
  .shell { flex-direction: column; }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-bottom: 1px solid var(--line); padding: env(safe-area-inset-top) 8px 0 0; position: sticky; top: 0; z-index: 20; }
  .topbar .side-brand { padding: 10px 14px; }
  .main { padding: 16px 14px calc(90px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); overflow-x: auto; }
  .tabbar a { flex: 1 0 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 7px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
  .tabbar a.active { color: var(--brand); }
  .tabbar .count { position: absolute; top: 3px; left: 50%; margin-left: 6px; }
  h1 { font-size: 20px; }
}

/* page pieces */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head .sub { color: var(--muted); margin-top: 3px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tools input, .tools select { margin: 0; width: auto; padding: 8px 10px; font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g4 { grid-template-columns: 1fr 1fr; } .g2 { grid-template-columns: 1fr; } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.tile .v { font-size: 26px; font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (max-width: 800px) { .tile .v { font-size: 21px; } }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.grey { background: var(--card2); color: var(--ink2); } .pill.blue { background: var(--brand-soft); color: var(--brand); }
.segs { display: inline-flex; background: var(--card2); border-radius: 10px; padding: 3px; gap: 2px; }
.segs button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink2); }
.segs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: contain; background: var(--card2); cursor: zoom-in; flex-shrink: 0; border: 1px solid var(--line); }

/* My Day */
.status { display: flex; align-items: center; gap: 14px; }
.status .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.status .t { font-size: 18px; font-weight: 700; }
.bigacts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.bigact { border: 0; border-radius: var(--r); padding: 18px 16px; text-align: left; background: var(--card); border: 1px solid var(--line); }
.bigact b { display: block; font-size: 16px; margin-top: 8px; }
.bigact span { font-size: 13px; color: var(--muted); }
.bigact svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bigact.primary { background: var(--brand); color: #fff; border-color: var(--brand); } .bigact.primary span { color: #cfe0ff; }
.bigact.full { grid-column: span 2; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font-weight: 600; font-size: 14px; display: flex; flex-direction: column; min-width: 78px; }
.slot small { font-weight: 500; font-size: 11px; color: var(--muted); }
.slot.done { background: var(--ok-soft); border-color: #1d5a3b; color: var(--ok); }
.slot.miss { background: var(--card2); color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .w { flex: 1; min-width: 0; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* usage bar */
.ubar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; display: flex; gap: 2px; }
.ubar .u { background: var(--brand); border-radius: 6px 0 0 6px; }
.ubar .p { background: #3d63b8; }
.ubar.over .u { background: var(--bad); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink2); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* bills */
.bill { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.bill:first-child { border-top: 0; }
.bill .w { flex: 1; min-width: 0; }
.bill .amt { font-weight: 750; font-size: 16px; font-variant-numeric: tabular-nums; }
.members { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.review { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 14px; margin-bottom: 12px; display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
.review .ph { width: 120px; height: 150px; object-fit: contain; border-radius: 10px; cursor: zoom-in; background: var(--card2); }
.review .top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.review .amt { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.shares { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: 14px; }
.shares th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; padding: 4px 6px; font-weight: 600; }
.shares td { padding: 6px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.shares td.r, .shares th.r { text-align: right; }
.neg { color: var(--bad); font-weight: 700; }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; margin: 8px 0; }
.badbox { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-top: 6px; }
.review .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 600px) { .review { grid-template-columns: 1fr; } .review .ph { width: 100%; height: 200px; } }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }

/* attendance cards */
.person { border-top: 1px solid var(--line); padding: 12px 0; }
.person:first-child { border-top: 0; }
.person .ph-row { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.person .ph-row figure { margin: 0; width: 120px; flex-shrink: 0; }
.person .ph-row img { width: 120px; height: 120px; object-fit: contain; border-radius: 10px; cursor: zoom-in; background: var(--card2); }
.person .ph-row figcaption { font-size: 12px; color: var(--ink2); margin-top: 3px; }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--brand); }
.chart .bar.dim { fill: #2c4a8f; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart g:hover .bar { fill: #1a43ad; }
.tip { position: absolute; pointer-events: none; background: #243553; color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.45; white-space: nowrap; z-index: 5; transform: translate(-50%, -100%); margin-top: -8px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar .lbl { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; gap: 8px; }
.hbar .track { position: relative; height: 10px; background: var(--line); border-radius: 6px; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 6px; }
.hbar .fill.over { background: var(--bad); }
.hbar .limit { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }

/* camera */
.cam { position: fixed; inset: 0; background: #000; z-index: 60; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-top { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 700; text-shadow: 0 1px 3px #000; }
.cam-info { position: absolute; left: 0; right: 0; bottom: calc(104px + env(safe-area-inset-bottom)); background: rgba(0,0,0,.55); color: #fff; padding: 10px 14px; font-size: 13px; line-height: 1.5; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: calc(104px + env(safe-area-inset-bottom)); display: grid; place-items: center; padding-bottom: env(safe-area-inset-bottom); }
.shutter { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); }
.shutter:active { background: var(--card); } .shutter:disabled { opacity: .35; }

/* sheet (bottom on phone, centered on desktop) */
.sheet { position: fixed; inset: 0; background: rgba(15,20,30,.45); z-index: 70; display: flex; align-items: center; justify-content: center; }
.sheet-card { background: var(--card); border-radius: 18px; width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 20px; }
@media (max-width: 800px) { .sheet { align-items: flex-end; } .sheet-card { border-radius: 18px 18px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); } }
.sheet-photo { width: 100%; max-height: 34vh; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 7px 14px; font-size: 14px; font-weight: 500; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; font-weight: 600; }
.switch input { width: 22px; height: 22px; margin: 0; }
.people { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.people label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); font-weight: 500; color: var(--ink); }
.people label:first-child { border-top: 0; }
.people input { width: 20px; height: 20px; margin: 0; }
.split-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.split-row span { flex: 1; font-weight: 500; }
.split-row input { width: 120px; margin: 0; text-align: right; }
.sumline { display: flex; justify-content: space-between; font-weight: 700; padding: 8px 2px; }

.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 90; display: flex; padding: 12px; overflow: auto; cursor: zoom-out; touch-action: pan-x pan-y pinch-zoom; }
.viewer img { margin: auto; max-width: 100%; max-height: calc(100dvh - 24px); width: auto; height: auto; object-fit: contain; border-radius: 6px; cursor: zoom-in; }
.viewer.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.viewer-x { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 91; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 20px; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 100; max-width: 90vw; text-align: center; font-weight: 500; }
.toast.err { background: var(--bad); }
.busy { position: fixed; inset: 0; background: rgba(7,13,26,.85); z-index: 95; display: grid; place-content: center; justify-items: center; gap: 12px; font-weight: 600; }
.spin { width: 38px; height: 38px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Attendance: one collapsed row per employee; click to see photos and details */
details.person > summary { cursor: pointer; list-style: none; }
details.person > summary::-webkit-details-marker { display: none; }
details.person .chev { display: inline-block; transition: transform .15s; color: var(--ink2); }
details.person[open] .chev { transform: rotate(90deg); }
details.person[open] .ph-row figure { width: 200px; }
details.person[open] .ph-row img { width: 200px; height: 200px; }
details.person[open] .ph-row figcaption { font-size: 13px; }

details.person[open] .ph-row figure { width: 220px; }
details.person .ph-row figcaption div { white-space: normal; }

/* Approvals: employee folders with day groups */
.emp { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; }
.emp > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px; }
.emp > summary::-webkit-details-marker { display: none; }
.emp[open] > summary { border-bottom: 1px solid var(--line); }
.emp[open] .chev { display: inline-block; transform: rotate(90deg); }
.emp .amt-sum { font-variant-numeric: tabular-nums; }
.emp-body { padding: 4px 14px 2px; }
.empty-emp { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; opacity: .65; }
.dayhead { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 8px; padding: 6px 10px; background: var(--brand-soft); border-radius: 8px; font-weight: 650; font-size: 14px; }

.exportbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 4px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--card); font-size: 14px; }
.exportbar b { flex-basis: 100%; }
.exportbar label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink2); }

/* ---- Dark theme (Home) ---- */
html, body { background: radial-gradient(1200px 500px at 50% -10%, #0e1b38 0, var(--bg) 60%) fixed; }
.card, .tile, .emp { border-radius: 22px; background: linear-gradient(180deg, #111e36, #0d172a); }
.card { padding: 18px; }
.tile { padding: 14px 16px; }
.btn { background: var(--card2); border-radius: 16px; }
.btn.primary, .bigact.primary { background: #2f6bff; box-shadow: 0 8px 24px rgba(47,107,255,.35); }
.bigact { border-radius: 20px; background: var(--card2); }
input, select, textarea { background: var(--bg); border-radius: 14px; }
.topbar, .tabbar, .side { background: #0a1224; border-color: var(--line); }
.tabbar a { border-radius: 14px; margin: 6px 2px; }
.tabbar a.active, .nav a.active { background: #14264d; color: #6ea0ff; }
.pill { padding: 4px 12px; font-size: 13px; }
.pill.blue { background: #14264d; color: #6ea0ff; }
.pill.ok { background: #0f2e22; color: #22c55e; }
.chip { background: var(--card2); }
.sheet-card { background: #0f1a2e; }
.sheet { background: rgba(0,0,0,.6); }
.status .t { font-size: 24px; font-weight: 800; }
.leaflet-container { filter: brightness(.9) contrast(1.05); }

/* Home layout */
.hm-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hm-logo { width: 46px; height: 46px; border-radius: 14px; background: #2f6bff; display: grid; place-items: center; }
.hm-logo svg { width: 26px; stroke: #fff; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hm-hi { flex: 1; min-width: 0; } .hm-hi b { display: block; font-size: 19px; } .hm-hi span { color: var(--muted); font-size: 14px; }
.hm-sq { position: relative; width: 46px; height: 46px; border-radius: 14px; background: #0f1a2e; border: 1px solid var(--line); display: grid; place-items: center; color: #e6edff; font-weight: 800; font-size: 18px; }
.hm-sq svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hm-sq.av { background: #14264d; color: #6ea0ff; }
.hm-dot { position: absolute; top: 9px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: #ff5a52; }
.hm-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.hm-title h1 { font-size: 34px; font-weight: 800; } .hm-title .sub { color: var(--muted); }
.hm-next { display: inline-flex; gap: 6px; align-items: center; background: #14264d; color: #6ea0ff; border: 1px solid #1f3a73; border-radius: 20px; padding: 8px 14px; font-weight: 700; white-space: nowrap; }
.hm-next .s { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hm-card { border: 1px solid var(--line); border-radius: 26px; padding: 22px; background: linear-gradient(180deg, #111e36, #0d172a); margin-bottom: 14px; }
.hm-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hm-row.end { align-items: flex-end; margin-top: 4px; }
.hm-lbl { color: var(--muted); font-size: 14px; }
.hm-shift { display: inline-flex; align-items: center; gap: 8px; color: var(--ink2); }
.hm-shift i { width: 12px; height: 12px; border-radius: 50%; background: #5b6a86; } .hm-shift i.on { background: #22c55e; box-shadow: 0 0 0 5px rgba(34,197,94,.2); }
.hm-big { font-size: 42px; font-weight: 800; letter-spacing: -1px; line-height: 1.15; }
.hm-pct { text-align: right; } .hm-pct b { display: block; font-size: 38px; font-weight: 800; color: #22c55e; line-height: 1.1; } .hm-pct span { color: #22c55e; font-size: 14px; }
.hm-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.hm-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 6px; border-radius: 18px; border: 1px solid var(--line); background: var(--card2); font-weight: 700; font-size: 15px; }
.hm-act svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hm-act.pri { background: #2f6bff; border-color: #2f6bff; color: #fff; box-shadow: 0 8px 24px rgba(47,107,255,.4); }
.hm-act.wide { grid-column: 1 / -1; flex-direction: row; font-size: 17px; }
.hm-due { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: 22px; border: 1px solid #1f3a73; background: #102248; margin-bottom: 14px; }
.hm-due .ic { width: 52px; height: 52px; border-radius: 14px; background: #19305f; display: grid; place-items: center; color: #6ea0ff; flex-shrink: 0; }
.hm-due .ic svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hm-due .tx { flex: 1; } .hm-due b { display: block; font-size: 17px; } .hm-due em { font-style: normal; color: #6ea0ff; } .hm-due .tx span { color: var(--ink2); font-size: 14px; }
.hm-due .go { width: 46px; height: 46px; border-radius: 50%; background: #2f6bff; display: grid; place-items: center; flex-shrink: 0; }
.hm-due .go svg { width: 20px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.hm-stats a { border: 1px solid var(--line); border-radius: 20px; padding: 14px; background: linear-gradient(180deg, #111e36, #0d172a); color: var(--ink); display: block; }
.hm-stats span { color: var(--ink2); font-size: 14px; } .hm-stats b { display: block; font-size: 26px; font-weight: 800; margin: 2px 0; }
.hm-stats small { color: #22c55e; font-size: 14px; } .hm-stats small.o { color: #ff9b3d; } .hm-stats small.y { color: #f5b301; }
.hm-th { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .hm-th h2 { margin: 0; font-size: 20px; } .hm-th a { font-weight: 700; }
.hm-task { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.hm-task .bx { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #2a3b5c; flex-shrink: 0; display: grid; place-items: center; }
.hm-task .bx.on { background: #22c55e; border-color: #22c55e; } .hm-task .bx svg { width: 16px; stroke: #fff; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 800px) { body.home .topbar { display: none; } body.home .main { padding-top: calc(18px + env(safe-area-inset-top)); } }
@media (min-width: 801px) { .hm-top .hm-sq.av, .hm-top .hm-sq:not(.av) { display: none; } .main:has(.hm-top) { max-width: 560px; } }

/* Compact mobile sizing for Home (matches the reference at 390px wide) */
.hm-top { margin-bottom: 14px; gap: 10px; }
.hm-logo { width: 38px; height: 38px; border-radius: 11px; } .hm-logo svg { width: 20px; }
.hm-hi b { font-size: 16px; } .hm-hi span { font-size: 12.5px; }
.hm-sq { width: 38px; height: 38px; border-radius: 11px; font-size: 15px; } .hm-sq svg { width: 18px; } .hm-dot { top: 7px; right: 9px; width: 7px; height: 7px; }
.hm-title { margin-bottom: 12px; } .hm-title h1 { font-size: 26px; } .hm-title .sub { font-size: 13px; }
.hm-next { padding: 6px 11px; font-size: 13px; border-radius: 16px; } .hm-next .s { width: 15px; }
.hm-card { padding: 16px; border-radius: 20px; margin-bottom: 12px; }
.hm-lbl { font-size: 12.5px; } .hm-shift { font-size: 14px; gap: 6px; } .hm-shift i { width: 10px; height: 10px; }
.hm-big { font-size: 30px; } .hm-pct b { font-size: 28px; } .hm-pct span { font-size: 12.5px; }
.hm-acts { gap: 8px; margin-top: 14px; }
.hm-act { padding: 12px 4px; gap: 6px; border-radius: 14px; font-size: 13px; } .hm-act svg { width: 20px; } .hm-act.wide { font-size: 15px; }
.hm-due { padding: 12px; gap: 12px; border-radius: 18px; margin-bottom: 12px; }
.hm-due .ic { width: 42px; height: 42px; border-radius: 12px; } .hm-due .ic svg { width: 21px; }
.hm-due b { font-size: 14.5px; } .hm-due .tx span { font-size: 12.5px; } .hm-due .go { width: 36px; height: 36px; } .hm-due .go svg { width: 16px; }
.hm-stats { gap: 8px; margin-bottom: 12px; } .hm-stats a { padding: 11px 12px; border-radius: 16px; }
.hm-stats span, .hm-stats small { font-size: 12.5px; } .hm-stats b { font-size: 20px; }
.hm-th h2 { font-size: 16px; } .hm-th a { font-size: 14px; }
.hm-task { padding: 11px 0; gap: 10px; } .hm-task .bx { width: 22px; height: 22px; border-radius: 7px; } .hm-task b { font-size: 14.5px; }
body.home .card { padding: 14px; border-radius: 18px; } body.home .card h2 { font-size: 16px; }
body.home .pill { padding: 3px 10px; font-size: 12px; }
body.home { font-size: 14px; }

.hm-stats { grid-template-columns: repeat(2, 1fr); }

/* Desktop / laptop view for Home: full-width layout with the sidebar */
@media (min-width: 801px) {
  body.home { font-size: 15px; }
  .main:has(.hm-top) { max-width: 1180px; margin: 0; }
  .hm-title h1 { font-size: 34px; } .hm-title .sub { font-size: 15px; }
  .hm-next { font-size: 15px; padding: 8px 14px; }
  .hm-card { padding: 26px; border-radius: 24px; }
  .hm-big { font-size: 42px; } .hm-pct b { font-size: 38px; } .hm-lbl, .hm-pct span { font-size: 14px; } .hm-shift { font-size: 16px; }
  .hm-acts { gap: 14px; margin-top: 22px; }
  .hm-act { padding: 20px 10px; font-size: 15px; border-radius: 18px; } .hm-act svg { width: 24px; } .hm-act.wide { font-size: 17px; }
  .hm-due { padding: 16px 20px; } .hm-due b { font-size: 17px; } .hm-due .tx span { font-size: 14px; }
  .hm-stats { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .hm-stats a { padding: 18px; } .hm-stats span, .hm-stats small { font-size: 14px; } .hm-stats b { font-size: 28px; }
  .hm-th h2 { font-size: 20px; } .hm-task { padding: 14px 0; } .hm-task b { font-size: 16px; }
  body.home .card { padding: 20px; border-radius: 22px; } body.home .card h2 { font-size: 18px; }
}

.hm-cols { display: block; }
@media (min-width: 801px) {
  .hm-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .hm-top { display: flex; margin-bottom: 18px; } .hm-top .hm-sq { display: none; }
  .main:has(.hm-top) { max-width: 1280px; }
}
.side-brand img { background: #000; object-fit: cover; }
.hm-logo { background: #000 !important; overflow: hidden; } .hm-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* bigger Lensar logo */
.side-brand { font-size: 20px; gap: 12px; }
.side-brand img { width: 52px; height: 52px; border-radius: 12px; }
.topbar .side-brand img { width: 42px; height: 42px; border-radius: 10px; }
.hm-logo, .hm-top .hm-logo { width: 64px !important; height: 64px !important; border-radius: 16px !important; }
@media (max-width: 800px) { .hm-logo, .hm-top .hm-logo { width: 54px !important; height: 54px !important; } }
/* full Lensar logo (with text), large */
.side-brand { justify-content: center; padding: 16px 14px 12px; }
.side-brand img { width: 170px; height: auto; border-radius: 14px; }
.topbar .side-brand { padding: 6px 12px; }
.topbar .side-brand img { width: auto; height: 64px; border-radius: 10px; }
.hm-logo, .hm-top .hm-logo { width: 110px !important; height: auto !important; aspect-ratio: 658/560; border-radius: 16px !important; }
.hm-logo img { object-fit: contain; }
@media (max-width: 800px) { .hm-logo, .hm-top .hm-logo { width: 88px !important; height: auto !important; } }
/* transparent logo: no background box */
.side-brand img, .topbar .side-brand img { background: none !important; border-radius: 0 !important; }
.hm-logo, .hm-top .hm-logo { background: none !important; border-radius: 0 !important; overflow: visible; }

/* dashboard drill-down */
.tile.click { cursor: pointer; transition: border-color .15s; } .tile.click:hover { border-color: var(--brand); }
a.dlink { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; } a.dlink:hover { color: var(--brand); }
.dl-row { padding: 10px 0; border-top: 1px solid var(--line); } .dl-row:first-of-type { border-top: 0; }
.dl-main > div { margin-top: 3px; }
#sheet-card:has(.dl-row) { width: min(640px, 100%); }

.g3 { grid-template-columns: repeat(3, 1fr); } @media (max-width: 700px) { .g3 { grid-template-columns: 1fr; } }

/* pop-up forms on phones: always scrollable, buttons always reachable (Android browser bars / keyboard) */
.sheet { height: 100vh; height: 100dvh; overscroll-behavior: contain; }
.sheet-card { max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.sheet-card > .row:last-child { position: sticky; bottom: -20px; margin: 12px -20px -20px; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--card, #0f1a2e); border-top: 1px solid var(--line); z-index: 2; }
@media (max-width: 800px) {
  .sheet-card { max-height: 94vh; max-height: 94dvh; }
  .sheet-photo { max-height: 20vh; max-height: 20dvh; }
}
body.sheet-open { overflow: hidden; }

/* swipe-back arrow */
#swipe-back { position: fixed; left: 0; top: 50%; width: 44px; height: 44px; border-radius: 50%; background: rgba(47,107,255,.92); display: grid; place-items: center; z-index: 200; opacity: 0; transform: translate(-44px, -50%); pointer-events: none; box-shadow: 0 2px 10px rgba(0,0,0,.4); transition: opacity .12s; }
#swipe-back svg { width: 22px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
#swipe-back.ready { background: #16a34a; }
@media (min-width: 801px) { #swipe-back { display: none; } }

/* =====================================================================
   LIGHT THEME — white background, blue text (overrides the dark theme above)
   ===================================================================== */
:root {
  --brand: #1d4ed8; --brand-soft: #e8f0ff; --ink: #14327f; --ink2: #3556b0; --muted: #5f78b8;
  --bg: #ffffff; --card: #ffffff; --line: #d9e3fa; --card2: #f1f5ff;
  --ok: #15803d; --ok-soft: #e3f6ea; --warn: #b45309; --warn-soft: #fff3d6; --bad: #dc2626; --bad-soft: #fde8e8;
  color-scheme: light;
}
html, body { background: #ffffff; color: var(--ink); }
.card, .tile, .emp, .hm-card, .hm-stats a { background: #ffffff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(29,78,216,.08); }
.topbar, .tabbar, .side { background: #ffffff; border-color: var(--line); }
.nav a { color: var(--ink2); }
.tabbar a.active, .nav a.active { background: #e8f0ff; color: #1d4ed8; }
.pill.blue { background: #e8f0ff; color: #1d4ed8; } .pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.grey { background: #eef2fb; color: var(--ink2); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.btn, .bigact { background: #ffffff; color: var(--brand); border-color: #bcd0fa; }
.btn:hover { background: #f1f5ff; }
.btn.primary, .bigact.primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; box-shadow: 0 6px 18px rgba(29,78,216,.28); }
.bigact.primary span { color: #dbe7ff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f2b8b8; }
input, select, textarea { background: #ffffff; color: var(--ink); border-color: #bcd0fa; }
input::placeholder, textarea::placeholder { color: #8ea3d4; }
input:focus, select:focus, textarea:focus { outline: 2px solid #1d4ed8; border-color: #1d4ed8; }
.chip { background: #f1f5ff; color: var(--brand); border-color: #bcd0fa; } .chip.on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.segs { background: #eef3ff; } .segs button { color: var(--ink2); } .segs button.on { background: #1d4ed8; color: #fff; }
.sheet-card { background: #ffffff; } .sheet { background: rgba(20,50,127,.35); }
.sheet-card > .row:last-child { background: #ffffff; }
.table th { color: var(--muted); } .table td { border-color: var(--line); }
.slot { background: #ffffff; } .slot.done { background: var(--ok-soft); border-color: #a7e3bd; color: var(--ok); } .slot.miss { background: #f1f5ff; }
.hm-sq { background: #ffffff; color: var(--brand); border-color: var(--line); } .hm-sq.av { background: #e8f0ff; color: #1d4ed8; }
.hm-next { background: #e8f0ff; color: #1d4ed8; border-color: #bcd0fa; }
.hm-due { background: #eef3ff; border-color: #bcd0fa; } .hm-due .ic { background: #dbe7ff; color: #1d4ed8; } .hm-due em { color: #1d4ed8; }
.hm-shift i { background: #9aaed8; } .hm-shift i.on { background: #16a34a; box-shadow: 0 0 0 5px rgba(22,163,74,.18); }
.hm-task .bx { border-color: #9db8f5; }
.hm-act { background: #ffffff; color: var(--brand); border-color: #bcd0fa; } .hm-act.pri { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.hm-pct b, .hm-lbl { color: var(--ink); }
.ubar { background: #e3ebfc; } .ubar .p { background: #7f9fe8; }
.chart .bar.dim { fill: #9db8f5; } .chart .hit:hover + .bar, .chart g:hover .bar { fill: #1e40af; }
.tabbar a { color: var(--muted); }
.card.err, .err { color: var(--bad); }
a.dlink:hover { color: var(--brand); }
.tile.click:hover { border-color: #1d4ed8; }
.dl-row { border-color: var(--line); }
#swipe-back { background: rgba(29,78,216,.92); }
.empty { color: var(--muted); }
.leaflet-container { background: #eef3ff; }

/* tab-bar badges: one tidy line, sitting on the top-right of the icon */
@media (max-width: 800px) { .tabbar .count { white-space: nowrap; line-height: 1.35; font-size: 10px; padding: 0 6px; top: 2px; left: calc(50% + 4px); margin-left: 0; } }

/* =====================================================================
   FLUID LAYOUT — fills any screen: phones, tablets, laptops, full-HD, 2K, 4K
   ===================================================================== */
:root { --z: 1; }
/* no zoom: the interface keeps its normal size on every screen */
/* heights that mean "the screen" must be divided by the zoom */
.shell { min-height: calc(100vh / var(--z)); }
.side { height: calc(100vh / var(--z)); width: clamp(200px, 16vw, 260px); }
.sheet { height: calc(100dvh / var(--z)); }
.sheet-card { max-height: calc(92dvh / var(--z)); }
.viewer img { max-height: calc((100dvh - 24px) / var(--z)); }
@media (max-width: 800px) { .sheet-card { max-height: calc(94dvh / var(--z)); } .side { width: auto; } }
/* content uses the whole width (no fixed cap), padding grows with the screen */
.main, .main:has(.hm-top) { max-width: none; width: 100%; padding-left: clamp(14px, 2.2vw, 40px); padding-right: clamp(14px, 2.2vw, 40px); }
@media (max-width: 800px) { .main { padding-left: 14px; padding-right: 14px; } }
/* grids add or drop columns to suit the width */
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); }
/* tablets: Home stacks in one column until there is room for two */
@media (min-width: 801px) and (max-width: 1100px) { .hm-cols { grid-template-columns: minmax(0, 1fr); } }
/* tables never push the page sideways */
.card.scroll, .scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
img, svg { max-width: 100%; }

/* tasks waiting for the employee are red so they cannot be missed */
.nav a.alert, .tabbar a.alert { color: var(--bad); font-weight: 700; }
.nav a.alert.active, .tabbar a.alert.active { background: var(--bad-soft); color: var(--bad); }
.card.task-alert { border-color: #f2b8b8; box-shadow: 0 0 0 2px rgba(220,38,38,.10), 0 1px 4px rgba(220,38,38,.12); }
.red-left { color: var(--bad); font-weight: 800; font-size: 14px; }
.hm-task.pend b { color: var(--bad); } .hm-task.pend .bx { border-color: var(--bad); }
.hm-task.pend .pill.blue { background: var(--bad-soft); color: var(--bad); }
.card.task-red { border-left: 5px solid var(--bad); background: #fff7f7; }
.card.task-red b { color: var(--bad); }

/* visit details */
.vd-photo { width: 100%; max-height: 42vh; max-height: calc(42dvh / var(--z)); object-fit: contain; background: #eef3ff; border-radius: 14px; display: block; cursor: zoom-in; }
.dl-block { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fbfdff; }
#sheet-card:has(.vd-photo) { width: min(620px, 100%); }

/* =====================================================================
   LENSAR REDESIGN — soft light theme, one colour per section, motion
   ===================================================================== */
:root {
  --bg: #f3f4fb; --card: #ffffff; --card2: #f4f5fb; --line: #e7e9f4;
  --ink: #1e1b4b; --ink2: #464c7a; --muted: #6e7397;
  --ok: #047857; --ok-soft: #e3f8ef; --warn: #b45309; --warn-soft: #fff6dc; --bad: #be123c; --bad-soft: #ffe9ee;
  --acc: #4f46e5; --acc2: #312e81; --acc-soft: #eef0ff; --acc-ink: #3730a3;
  --brand: var(--acc); --brand-soft: var(--acc-soft);
  --r: 22px; --sh: 0 1px 2px rgba(30,27,75,.04), 0 8px 24px rgba(30,27,75,.06);
  --ease: cubic-bezier(.2,.8,.2,1);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body.pg-visits  { --acc: #0f766e; --acc2: #0b4f4a; --acc-soft: #e2f4f1; --acc-ink: #0f766e; }
body.pg-leads   { --acc: #ea580c; --acc2: #9a3412; --acc-soft: #fff0e5; --acc-ink: #c2410c; }
body.pg-bills   { --acc: #7c3aed; --acc2: #4c1d95; --acc-soft: #f1eaff; --acc-ink: #6d28d9; }
body.pg-mytasks { --acc: #e11d48; --acc2: #881337; --acc-soft: #ffe9ee; --acc-ink: #be123c; }
html, body { background: var(--bg) !important; color: var(--ink); }
body { font-family: inherit; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; }
h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
a { color: var(--acc); }
input, select, textarea { border-radius: 14px; border-color: var(--line); background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--acc) 25%, transparent); border-color: var(--acc); }

/* cards, pills, buttons */
.card, .tile, .emp, .hm-stats a { background: #fff !important; border: 1px solid var(--line) !important; border-radius: var(--r) !important; box-shadow: var(--sh) !important; }
.card { padding: 18px; }
.pill { padding: 5px 12px; font-size: 12.5px; font-weight: 700; border-radius: 999px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.grey { background: #eef0f6; color: var(--ink2); }
.pill.blue { background: var(--acc-soft); color: var(--acc-ink); }
.btn { border-radius: 16px; border: 1.5px solid var(--line); background: #fff; color: var(--acc-ink); font-weight: 700; transition: transform .15s var(--ease), box-shadow .2s, background .2s; }
.btn:hover { background: var(--acc-soft); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--acc) 70%, transparent); }
.btn.primary:hover { background: var(--acc); filter: brightness(1.06); }
.btn.big { padding: 15px 20px; font-size: 16px; border-radius: 18px; }
.btn.big svg { width: 21px; height: 21px; }
.btn:active, .hbtn:active, .stat:active, .banner:active, .ltile:active, .wd:active, .card[data-open]:active, .card.visit:active, .trow:active, .avatar:active, .sq-btn:active { transform: scale(.97); }
.segs { background: var(--acc-soft); border-radius: 18px; padding: 5px; }
.segs button { color: var(--acc-ink); font-weight: 700; border-radius: 14px; transition: background .25s var(--ease), color .25s, box-shadow .25s; }
.segs button.on { background: #fff; color: var(--acc-ink); box-shadow: 0 2px 8px rgba(30,27,75,.1); }
.segs.wide { display: flex; width: 100%; margin: 4px 0 14px; } .segs.wide button { flex: 1; padding: 11px 4px; font-size: 15px; }
.chip.on { background: var(--acc); border-color: var(--acc); }
.empty { color: var(--muted); }
.count { background: #e11d48; } .count.o { background: #ea580c; }

/* shell: phone top bar, bottom tab bar, desktop sidebar */
.tb-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 800; font-size: 21px; letter-spacing: -.02em; padding: 10px 0; }
.mark, .brand-sq { width: 46px; height: 46px; border-radius: 15px; background: linear-gradient(145deg, #5b5cf0, #4338ca); display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(79,70,229,.55); flex-shrink: 0; }
.mark img, .brand-sq img { width: 72%; height: 72%; object-fit: contain; filter: brightness(0) invert(1); }
.avatar { width: 46px; height: 46px; border-radius: 15px; border: 0; background: #ffedd5; color: #c2410c; font-weight: 800; font-size: 19px; display: grid; place-items: center; flex-shrink: 0; transition: transform .15s var(--ease); }
.sq-btn { position: relative; width: 46px; height: 46px; border-radius: 15px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--acc-ink); flex-shrink: 0; transition: transform .15s var(--ease); }
.sq-btn svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sq-btn .dot { position: absolute; top: 10px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 0 2px #fff; animation: pulse 2s infinite; }
@media (max-width: 800px) {
  .topbar { background: color-mix(in srgb, var(--bg) 88%, transparent) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 0 !important; padding: env(safe-area-inset-top) 16px 0 !important; }
  .main { padding: 8px 16px calc(104px + env(safe-area-inset-bottom)) !important; }
  .tabbar { background: #fff !important; border: 0 !important; box-shadow: 0 -6px 24px rgba(30,27,75,.07); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) !important; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar a { flex: 1 0 62px; margin: 0 !important; padding: 9px 2px 8px; border-radius: 20px !important; color: #6b7280 !important; font-size: 12.5px; font-weight: 700; gap: 4px; background: none !important; transition: background .3s var(--ease), color .3s; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar a.active { color: #fff !important; background: var(--acc) !important; box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--acc) 75%, transparent); animation: tabpop .45s var(--ease); }
  .tabbar a.alert:not(.active) { color: #6b7280 !important; }
  .tabbar .count { top: 0 !important; left: calc(50% + 6px) !important; min-width: 22px; height: 22px; padding: 0 6px !important; border-radius: 11px; font-size: 12px !important; display: grid; place-items: center; box-shadow: 0 0 0 2.5px #fff; animation: badge .5s var(--ease) both; }
  h1 { font-size: 30px; }
}
@media (min-width: 801px) {
  .side { background: #fff !important; border-right: 1px solid var(--line) !important; }
  .nav a { border-radius: 14px; font-weight: 600; color: var(--ink2); transition: background .2s, color .2s; }
  .nav a:hover { background: var(--card2); }
  .nav a.active { background: var(--acc-soft) !important; color: var(--acc-ink) !important; font-weight: 800; }
  body:is(.pg-visits, .pg-leads, .pg-bills, .pg-mytasks) .main { max-width: 880px !important; }
}

/* page title */
.pg-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 6px 0 18px; }
.pg-title .sub, .head .sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.pg-title .sub em { font-style: normal; color: var(--acc); font-weight: 700; }
.chip-next { display: inline-flex; align-items: center; gap: 7px; background: var(--acc-soft); color: var(--acc-ink); border-radius: 999px; padding: 9px 15px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.chip-next svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* home header */
.hm-top { display: flex !important; align-items: center; gap: 12px; margin: 4px 0 16px !important; }
.hm-hi { flex: 1; min-width: 0; } .hm-hi span { display: block; color: var(--muted); font-size: 14px; font-weight: 600; } .hm-hi b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }

/* hero cards (Home / Tasks / Bills) */
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 22px; margin-bottom: 14px; color: #fff; isolation: isolate;
  background: linear-gradient(135deg, var(--acc2), var(--acc)); box-shadow: 0 22px 40px -22px color-mix(in srgb, var(--acc2) 85%, transparent); }
.hero-home { background: linear-gradient(135deg, #1e1b4b 0%, #24215e 55%, #312e81 100%); }
.hero-tasks { background: linear-gradient(135deg, #881337, #9f1239 60%, #be123c); }
.hero-bills { background: linear-gradient(135deg, #4c1d95, #6d28d9); }
.blob { position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; animation: drift 12s ease-in-out infinite alternate; }
.hero .b1 { width: 240px; height: 240px; right: -60px; top: -80px; background: color-mix(in srgb, #fff 14%, transparent); }
.hero-home .b1 { background: #4338ca; right: -70px; top: -50px; width: 250px; height: 250px; }
.hero .b2 { width: 160px; height: 160px; left: -50px; bottom: -70px; background: rgba(244,63,94,.28); animation-delay: -6s; }
.hero-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.hero-row.start { justify-content: flex-start; gap: 20px; }
.shift { display: inline-flex; align-items: center; gap: 9px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 8px 15px; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.shift i { width: 11px; height: 11px; border-radius: 50%; background: #94a3b8; } .shift.on i { background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: ping 2s infinite; }
.h-lbl { color: rgba(255,255,255,.75); font-size: 15px; font-weight: 600; }
.h-big { font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.h-big.sm { font-size: 27px; }
.h-sub { color: rgba(255,255,255,.7); font-size: 14px; margin-top: 6px; }
.hero-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.hbtn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 10px; border-radius: 18px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; font-weight: 800; font-size: 15px; transition: transform .15s var(--ease), background .2s; }
.hbtn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hbtn.solid { background: #fff; color: var(--acc2); border-color: #fff; } .hero-home .hbtn.solid { color: #312e81; }
.hbtn.wide { grid-column: 1 / -1; padding: 17px; font-size: 17px; }
/* progress ring */
.ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring .tr { stroke: rgba(255,255,255,.18); }
.ring .fg { stroke: #fda4af; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p)); transition: stroke-dashoffset .8s var(--ease); }
.hero-home .ring .fg { stroke: #34d399; }
.ring .rv { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .rv b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ring .rv span { font-size: 12.5px; opacity: .75; margin-top: 2px; }
.ring.light { background: radial-gradient(circle, rgba(255,255,255,.08) 0 55%, transparent 56%); border-radius: 50%; }

/* two stat tiles on Home */
.stat2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); color: var(--ink); transition: transform .15s var(--ease), box-shadow .2s; }
.stat:hover { box-shadow: 0 14px 30px -14px rgba(30,27,75,.25); }
.stat .ic { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 14px; }
.stat .ic svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.stat .k { display: block; color: var(--ink2); font-size: 16px; font-weight: 600; }
.stat .v { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; } .stat .v b { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat .v small { font-size: 15px; font-weight: 700; }
.stat.t-teal .ic { background: #d5f5ee; color: #0f766e; } .stat.t-teal small { color: #047857; }
.stat.t-orange .ic { background: #ffedd5; color: #c2410c; } .stat.t-orange small { color: #c2410c; }

/* Home: today's tasks and activity */
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h2 { margin: 0; display: flex; align-items: center; gap: 10px; } .card-h a { font-weight: 800; white-space: nowrap; }
.tasks-card.alert { border-color: #fecdd3 !important; box-shadow: 0 0 0 4px rgba(225,29,72,.05), var(--sh) !important; }
.trow { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: 18px; background: var(--card2); cursor: pointer; margin-top: 8px; transition: transform .15s var(--ease); }
.trow.pending { background: #fff1f3; } .trow.pending b { color: #be123c; }
.trow .tx { flex: 1; min-width: 0; } .trow b { display: block; font-size: 17px; font-weight: 800; } .trow small { color: var(--muted); font-size: 14px; }
.bx { width: 30px; height: 30px; border-radius: 9px; border: 2.5px solid #c7cbe0; display: grid; place-items: center; flex-shrink: 0; color: #fff; font-weight: 800; }
.trow.pending .bx, .task.due .bx { border-color: #e11d48; }
.trow.done .bx, .task.done .bx { background: #10b981; border-color: #10b981; } .task.rejected .bx { background: #fda4af; border-color: #fda4af; }
.bx svg { width: 17px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trow.done b { text-decoration: line-through; opacity: .55; }
.acts-list { list-style: none; margin: 0; padding: 0; }
.acts-list li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); } .acts-list li:first-child { border-top: 0; padding-top: 4px; }
.act-ic { width: 54px; height: 54px; border-radius: 17px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; flex-shrink: 0; object-fit: cover; cursor: zoom-in; }
span.act-ic { cursor: default; } .act-ic svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.acts-list .w { flex: 1; min-width: 0; } .acts-list .t { font-size: 16px; margin-left: 4px; }
.acts-list .note { font-size: 18px; font-weight: 700; margin-top: 5px; }
.where { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); font-size: 14px; margin-top: 5px; }
.where svg { width: 17px; flex-shrink: 0; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.9; }

/* Visits: week strip, banner, visit cards */
.cal-btn { position: relative; width: 48px; height: 48px; border-radius: 15px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--acc); margin: 0; cursor: pointer; flex-shrink: 0; }
.cal-btn svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.cal-btn input { position: absolute; inset: 0; opacity: 0; margin: 0; padding: 0; width: 100%; height: 100%; cursor: pointer; }
.cal-btn input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.week { display: flex; gap: 6px; align-items: stretch; margin-bottom: 16px; }
.wd { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 0 12px; border-radius: 18px; border: 1px solid var(--line); background: #fff; color: var(--ink); position: relative; transition: background .3s var(--ease), color .3s, transform .15s var(--ease); }
.wd span { font-size: 13px; color: var(--muted); font-weight: 600; } .wd b { font-size: 21px; font-weight: 800; }
.wd i { position: absolute; bottom: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.wd.today:not(.on) { border-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.wd.on { background: var(--acc); border-color: var(--acc); color: #fff; box-shadow: 0 12px 22px -10px color-mix(in srgb, var(--acc) 80%, transparent); transform: translateY(-2px); }
.wd.on span { color: rgba(255,255,255,.85); } .wd.on i { background: #fff; }
.wd:disabled { opacity: .4; }
.wk-arrow { width: 26px; flex-shrink: 0; border: 0; background: none; color: var(--muted); display: grid; place-items: center; padding: 0; }
.wk-arrow svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; } .wk-arrow:disabled { opacity: .25; }
.banner { position: relative; overflow: hidden; isolation: isolate; width: 100%; display: flex; align-items: center; gap: 16px; text-align: left; border: 0; border-radius: 28px; padding: 20px; margin-bottom: 16px; color: #fff; background: linear-gradient(120deg, var(--acc2), var(--acc)); box-shadow: 0 20px 36px -20px color-mix(in srgb, var(--acc) 90%, transparent); transition: transform .15s var(--ease); }
.banner .b1 { width: 230px; height: 230px; right: -50px; top: -60px; background: color-mix(in srgb, #fff 12%, transparent); }
.banner .ic { width: 64px; height: 64px; border-radius: 20px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex-shrink: 0; }
.banner .ic svg { width: 30px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.banner .tx { flex: 1; } .banner b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.02em; } .banner small { font-size: 15px; opacity: .85; }
.banner .go { width: 50px; height: 50px; border-radius: 50%; background: #fff; color: var(--acc); display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 6px 14px rgba(0,0,0,.18); animation: breathe 2.6s ease-in-out infinite; }
.banner .go svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.card.visit { padding: 0 !important; overflow: hidden; cursor: pointer; transition: transform .15s var(--ease), box-shadow .25s; }
.card.visit:hover { box-shadow: 0 18px 36px -18px rgba(30,27,75,.3) !important; }
.v-photo { position: relative; height: 190px; background: linear-gradient(135deg, #e0e7ff, #eef2ff); }
.v-photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.v-time { position: absolute; left: 14px; top: 14px; background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 13px; font-weight: 800; font-size: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.v-badge { position: absolute; right: 14px; top: 14px; background: var(--acc); color: #fff; border-radius: 999px; padding: 6px 13px; font-weight: 800; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.v-badge.ok { background: #047857; } .v-badge.bad { background: #be123c; } .v-badge.grey { background: #475569; } .v-badge.blue { background: #4338ca; }
.v-body { padding: 18px; }
.v-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } .v-h b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; } .v-h span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.v-who { color: var(--muted); font-size: 14px; margin-top: 2px; }
.quote { display: flex; gap: 10px; align-items: flex-start; background: var(--card2); border-radius: 16px; padding: 12px 14px; margin-top: 12px; font-size: 16px; }
.quote svg { width: 21px; flex-shrink: 0; fill: none; stroke: #4f46e5; stroke-width: 1.9; stroke-linejoin: round; margin-top: 1px; }
.fu-box { display: flex; gap: 12px; align-items: center; border: 1.5px dashed #fdba74; background: #fff7ed; border-radius: 16px; padding: 11px 14px; margin-top: 10px; color: #9a3412; }
.fu-box svg { width: 24px; flex-shrink: 0; fill: none; stroke: #ea580c; stroke-width: 1.9; stroke-linecap: round; }
.fu-box span { display: block; font-size: 14.5px; } .fu-box b { display: block; font-size: 17px; font-weight: 800; }
.v-resp { margin-top: 10px; } .v-resp svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.v-body .where { margin-top: 12px; color: var(--muted); }
.v-more { margin-top: 14px; background: var(--acc-soft); color: var(--acc-ink); text-align: center; font-weight: 800; font-size: 16px; padding: 13px; border-radius: 16px; transition: background .2s; }
.card.visit:hover .v-more { background: color-mix(in srgb, var(--acc) 16%, #fff); }

/* Leads */
.pg-title .btn.big { box-shadow: 0 14px 26px -12px color-mix(in srgb, var(--acc) 85%, transparent); }
.ltiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.ltile { display: block; border-radius: 20px; padding: 16px; border: 2px solid transparent; transition: transform .15s var(--ease), border-color .2s, box-shadow .2s; }
.ltile b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; } .ltile span { font-size: 15px; font-weight: 700; }
.ltile.accepted { background: #e6f9f0; color: #047857; } .ltile.pending { background: #fff8e1; color: #b45309; } .ltile.rejected { background: #ffeef1; color: #be123c; }
.ltile.on { border-color: currentColor; box-shadow: 0 10px 20px -12px currentColor; }
.filter-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 15px; }
.fchip { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font-weight: 800; transition: background .2s, color .2s; }
.fchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.card.lead.accepted { border-color: #fed7aa !important; }
.l-h { display: flex; gap: 14px; align-items: flex-start; }
.l-ic { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; flex-shrink: 0; background: #f1f2f7; color: #6b7280; }
.lead.accepted .l-ic { background: #ffedd5; color: #c2410c; } .lead.pending .l-ic { background: #fff8e1; color: #b45309; }
.l-ic svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.l-t { flex: 1; min-width: 0; } .l-t b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; } .l-t small { color: var(--muted); font-size: 14px; }
.l-who { display: inline-block; font-size: 13px; color: var(--acc-ink); font-weight: 700; margin-bottom: 2px; }
.l-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.l-grid div { background: var(--card2); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.l-grid span { display: block; color: var(--muted); font-size: 13px; } .l-grid b { display: block; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.l-notes { color: var(--ink2); margin-top: 12px; font-size: 15px; }
.l-shared { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.l-shared .mchip { padding: 4px 11px; font-size: 12.5px; }
.l-q { margin-bottom: 2px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.reason { display: flex; gap: 10px; align-items: flex-start; background: #fff0f2; color: #be123c; border-radius: 14px; padding: 12px 14px; margin-top: 12px; font-size: 15px; }
.reason svg { width: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; } .reason b { font-weight: 700; margin-left: 4px; }

/* Bills */
.h-month { position: relative; display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 18px; font-weight: 800; margin: 0 0 12px; cursor: pointer; }
.h-month .caret { font-size: 12px; opacity: .8; }
.h-month input { position: absolute; inset: 0; opacity: 0; margin: 0; padding: 0; width: 100%; cursor: pointer; }
.h-month input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.h-chip { background: rgba(255,255,255,.16); border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: 13.5px; margin-bottom: 12px; white-space: nowrap; }
.hero-bills .h-big { font-size: 44px; margin: 2px 0 14px; }
.hbar { display: flex; gap: 3px; height: 10px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; }
.hbar i { width: var(--w); border-radius: 999px; transition: width .9s var(--ease); }
.hbar .u { background: #ddd6fe; } .hbar .p { background: rgba(221,214,254,.45); } .hbar.over .u { background: #fda4af; }
.h-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.h-boxes div { background: rgba(255,255,255,.12); border-radius: 16px; padding: 11px 14px; }
.h-boxes span { display: block; font-size: 13px; opacity: .8; } .h-boxes b { font-size: 19px; font-weight: 800; } .h-boxes .neg { color: #fecdd3; }
.bill-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.bill-acts .btn:not(.primary) { border-color: color-mix(in srgb, var(--acc) 25%, #fff); }
.card.billc { padding: 16px; }
.b-top { display: flex; gap: 14px; align-items: flex-start; }
.b-ph { width: 66px; height: 66px; border-radius: 18px; padding: 4px; flex-shrink: 0; background: var(--card2); }
.billc.approved .b-ph { background: #e3f8ef; } .billc.rejected .b-ph { background: #ffe9ee; } .billc.pending .b-ph { background: #fff6dc; }
.b-ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; cursor: zoom-in; }
.billc .w { flex: 1; min-width: 0; }
.b-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.billc .amt { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .billc .share { color: var(--muted); font-size: 14px; }
.b-reason { font-size: 17px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; } .b-meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.billc .members { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mchip { background: var(--acc-soft); color: var(--acc-ink); border-radius: 999px; padding: 7px 13px; font-weight: 700; font-size: 14px; }
.linkbtn.del { display: inline-flex; align-items: center; gap: 6px; color: var(--bad); font-weight: 700; margin-top: 10px; }
.linkbtn.del svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Tasks */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.tabs a { display: inline-flex; align-items: center; gap: 10px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px 10px 20px; font-weight: 800; font-size: 16px; transition: background .25s var(--ease), color .25s, box-shadow .25s; }
.tabs a i { font-style: normal; min-width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; font-size: 13px; background: var(--acc-soft); color: var(--acc-ink); padding: 0 6px; }
.tabs a.on { background: var(--acc); color: #fff; border-color: var(--acc); box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--acc) 85%, transparent); }
.tabs a.on i { background: #fff; color: var(--acc); }
.card.task { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; position: relative; overflow: hidden; transition: transform .15s var(--ease); }
.card.task.due { border-color: #fecdd3 !important; box-shadow: 0 12px 24px -16px rgba(225,29,72,.45) !important; }
.card.task.due::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: #e11d48; }
.card.task .w { flex: 1; min-width: 0; }
.task .th { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; } .task .th b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.task.due .th b { color: #be123c; } .task.done .th b { text-decoration: line-through; opacity: .55; }
.task .det { color: var(--ink2); font-size: 16px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task .from { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 10px; }
.mini-av { width: 26px; height: 26px; border-radius: 50%; background: #e0e7ff; color: #4338ca; font-weight: 800; font-size: 12px; display: grid; place-items: center; }

/* sheets, toast, viewer */
.sheet { background: rgba(30,27,75,.38) !important; backdrop-filter: blur(3px); }
.sheet:not(.hidden) { animation: fade .25s ease both; }
.sheet:not(.hidden) .sheet-card { animation: sheetup .38s var(--ease) both; }
.sheet-card { border-radius: 28px; }
@media (max-width: 800px) { .sheet-card { border-radius: 28px 28px 0 0; } }
.toast { background: var(--ink); border-radius: 16px; box-shadow: 0 14px 30px -12px rgba(30,27,75,.5); }
.toast:not(.hidden) { animation: toastin .35s var(--ease) both; }
.viewer:not(.hidden) { animation: fade .2s ease both; }

/* loading shimmer */
.skel { display: grid; gap: 14px; padding-top: 6px; }
.skel i { display: block; border-radius: 22px; background: linear-gradient(90deg, #e9ebf5 0%, #f6f7fc 45%, #e9ebf5 90%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel .s1 { height: 54px; width: 55%; } .skel .s2 { height: 170px; } .skel .s3 { height: 110px; } .skel .s4 { height: 90px; }

/* entrance: cards slide up one after another */
.main.anim :is(.hm-top, .pg-title, .head, .hero, .stat, .banner, .week, .tabs, .ltile, .filter-row, .bill-acts, .segs, .card, .tile, .emp) {
  animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.main.anim .ring .fg { animation: ringin 1.1s var(--ease) both; animation-delay: .25s; }
.main.anim .hbar i { animation: grow 1s var(--ease) both; animation-delay: .3s; }
.main.anim .wd { animation: pop .45s var(--ease) both; } .main.anim .wd:nth-child(3) { animation-delay: .04s; } .main.anim .wd:nth-child(4) { animation-delay: .08s; }
.main.anim .wd:nth-child(5) { animation-delay: .12s; } .main.anim .wd:nth-child(6) { animation-delay: .16s; } .main.anim .wd:nth-child(7) { animation-delay: .2s; } .main.anim .wd:nth-child(8) { animation-delay: .24s; }

@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.9); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: none; } }
@keyframes tabpop { 0% { transform: scale(.85); } 55% { transform: scale(1.06); } 100% { transform: none; } }
@keyframes badge { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes ringin { from { stroke-dashoffset: 100; } }
@keyframes grow { from { width: 0; } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-18px, 14px) scale(1.08); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(52,211,153,0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastin { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* small phones */
@media (max-width: 380px) {
  h1 { font-size: 26px !important; } .h-big { font-size: 32px; } .hero-bills .h-big { font-size: 36px; } .ring { width: 96px; height: 96px; }
  .wd b { font-size: 18px; } .wd span { font-size: 11.5px; } .week { gap: 4px; } .wk-arrow { width: 18px; }
  .stat .v b { font-size: 34px; } .ltile b { font-size: 26px; } .ltile span { font-size: 13px; } .tabs a { font-size: 15px; padding: 9px 12px 9px 16px; }
  .banner b { font-size: 18px; } .banner .ic { width: 54px; height: 54px; }
}

/* =====================================================================
   PHONE SIZING — matches the design's proportions (it was ~25% too large, looked zoomed in)
   ===================================================================== */
@media (max-width: 800px) {
  html, body { font-size: 14px; }
  .main { padding: 4px 14px calc(84px + env(safe-area-inset-bottom)) !important; }
  h1, .pg-title h1 { font-size: 25px !important; }
  h2, .card h2 { font-size: 16px; }
  .card { padding: 14px; } .card, .stat, .tile, .emp { border-radius: 18px !important; }
  .pg-title { margin: 2px 0 12px; } .pg-title .sub, .head .sub { font-size: 13px; margin-top: 2px; }
  .chip-next { padding: 6px 10px; font-size: 12px; gap: 5px; } .chip-next svg { width: 15px; }
  /* top bar + home header */
  .tb-brand { font-size: 17px; gap: 9px; padding: 8px 0; }
  .mark, .brand-sq, .avatar, .sq-btn { width: 37px; height: 37px; border-radius: 12px; }
  .avatar { font-size: 15px; } .sq-btn svg { width: 18px; } .sq-btn .dot { top: 8px; right: 9px; width: 7px; height: 7px; }
  .hm-top { gap: 10px; margin: 2px 0 12px !important; } .hm-hi span { font-size: 12px; } .hm-hi b { font-size: 17px; }
  /* bottom bar */
  .tabbar { padding: 6px 6px calc(6px + env(safe-area-inset-bottom)) !important; gap: 2px; }
  .tabbar a { flex: 1 0 54px; padding: 7px 2px 6px; font-size: 11px; gap: 2px; border-radius: 16px !important; }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar .count { min-width: 18px; height: 18px; font-size: 10.5px !important; padding: 0 5px !important; border-radius: 9px; left: calc(50% + 4px) !important; }
  /* hero cards */
  .hero { border-radius: 22px; padding: 16px; margin-bottom: 12px; }
  .shift { padding: 5px 11px; font-size: 13px; gap: 7px; margin-bottom: 10px; } .shift i { width: 9px; height: 9px; }
  .h-lbl { font-size: 13px; } .h-big { font-size: 29px; } .h-big.sm { font-size: 21px; } .h-sub { font-size: 12.5px; margin-top: 3px; }
  .ring { width: 82px; height: 82px; } .ring circle { stroke-width: 10; } .ring .rv b { font-size: 19px; } .ring .rv span { font-size: 10.5px; }
  .hero-row.start { gap: 14px; }
  .hero-acts { gap: 8px; margin-top: 14px; } .hbtn { padding: 11px 8px; border-radius: 14px; font-size: 14px; gap: 6px; } .hbtn svg { width: 18px; height: 18px; }
  .hbtn.wide { padding: 13px; font-size: 15px; }
  .hero .b1 { width: 180px; height: 180px; } .hero .b2 { width: 120px; height: 120px; }
  /* home tiles, tasks, activity */
  .stat2 { gap: 10px; margin-bottom: 12px; } .stat { padding: 14px; }
  .stat .ic { width: 38px; height: 38px; border-radius: 12px; margin-bottom: 10px; } .stat .ic svg { width: 20px; }
  .stat .k { font-size: 13.5px; } .stat .v b { font-size: 29px; } .stat .v small { font-size: 12.5px; }
  .card-h { margin-bottom: 8px; } .card-h a { font-size: 13.5px; }
  .trow { padding: 10px 11px; gap: 10px; border-radius: 14px; margin-top: 6px; } .trow b { font-size: 14.5px; } .trow small { font-size: 12px; }
  .bx { width: 24px; height: 24px; border-radius: 7px; border-width: 2px; } .bx svg { width: 14px; }
  .acts-list li { gap: 11px; padding: 10px 0; } .act-ic { width: 42px; height: 42px; border-radius: 13px; } .act-ic svg { width: 19px; }
  .acts-list .t { font-size: 14px; } .acts-list .note { font-size: 15px; margin-top: 3px; } .where { font-size: 12.5px; } .where svg { width: 14px; }
  .pill { padding: 3px 9px; font-size: 11.5px; }
  /* visits */
  .cal-btn { width: 38px; height: 38px; border-radius: 12px; } .cal-btn svg { width: 18px; }
  .week { gap: 4px; margin-bottom: 12px; } .wd { padding: 7px 0 9px; border-radius: 14px; } .wd span { font-size: 11px; } .wd b { font-size: 16px; }
  .wd i { width: 5px; height: 5px; bottom: 4px; } .wk-arrow { width: 18px; } .wk-arrow svg { width: 16px; }
  .banner { border-radius: 22px; padding: 14px; gap: 12px; margin-bottom: 12px; }
  .banner .ic { width: 46px; height: 46px; border-radius: 14px; } .banner .ic svg { width: 22px; }
  .banner b { font-size: 16.5px; } .banner small { font-size: 12.5px; } .banner .go { width: 38px; height: 38px; } .banner .go svg { width: 18px; }
  .v-photo { height: 140px; } .v-time, .v-badge { top: 10px; padding: 4px 10px; font-size: 12px; } .v-time { left: 10px; } .v-badge { right: 10px; }
  .v-body { padding: 14px; } .v-h b { font-size: 17px; } .v-h span, .v-who { font-size: 12.5px; }
  .quote { padding: 9px 11px; margin-top: 10px; font-size: 14px; border-radius: 13px; gap: 8px; } .quote svg { width: 17px; }
  .fu-box { padding: 9px 11px; gap: 10px; border-radius: 13px; } .fu-box svg { width: 20px; } .fu-box span { font-size: 12.5px; } .fu-box b { font-size: 14.5px; }
  .v-more { margin-top: 10px; padding: 10px; font-size: 14px; border-radius: 13px; }
  /* leads */
  .btn { padding: 9px 14px; font-size: 14px; border-radius: 13px; } .btn.big { padding: 11px 15px; font-size: 14.5px; border-radius: 14px; } .btn.big svg { width: 18px; height: 18px; }
  .btn.sm { padding: 6px 11px; font-size: 12.5px; }
  .ltiles { gap: 8px; margin-bottom: 12px; } .ltile { padding: 11px 12px; border-radius: 16px; } .ltile b { font-size: 23px; } .ltile span { font-size: 12.5px; }
  .filter-row { font-size: 12.5px; gap: 10px; margin-bottom: 12px; } .fchip { padding: 7px 14px; font-size: 13.5px; }
  .l-h { gap: 11px; } .l-ic { width: 42px; height: 42px; border-radius: 13px; } .l-ic svg { width: 20px; }
  .l-t b { font-size: 16.5px; } .l-t small { font-size: 12px; }
  .l-grid { gap: 6px; margin-top: 11px; } .l-grid div { padding: 7px 9px; border-radius: 11px; } .l-grid span { font-size: 11px; } .l-grid b { font-size: 13.5px; }
  .l-notes { font-size: 13px; margin-top: 9px; } .reason { padding: 9px 11px; font-size: 13px; margin-top: 9px; border-radius: 12px; } .reason svg { width: 17px; }
  /* bills */
  .h-month { font-size: 15px; margin-bottom: 8px; } .h-chip { font-size: 11.5px; padding: 4px 10px; margin-bottom: 8px; }
  .hero-bills .h-big { font-size: 33px; margin: 0 0 10px; } .hbar { height: 8px; }
  .h-boxes { gap: 8px; margin-top: 12px; } .h-boxes div { padding: 8px 11px; border-radius: 13px; } .h-boxes span { font-size: 11.5px; } .h-boxes b { font-size: 15.5px; }
  .bill-acts { gap: 10px; margin-bottom: 12px; }
  .segs.wide { margin: 0 0 12px; padding: 4px; border-radius: 14px; } .segs.wide button { padding: 8px 2px; font-size: 13px; border-radius: 11px; }
  .card.billc { padding: 13px; } .b-top { gap: 11px; } .b-ph { width: 52px; height: 52px; border-radius: 14px; padding: 3px; } .b-ph img { border-radius: 11px; }
  .billc .amt { font-size: 19px; } .billc .share { font-size: 12px; } .b-reason { font-size: 14.5px; } .b-meta { font-size: 12px; }
  .billc .members { gap: 6px; margin-top: 10px; } .mchip { padding: 4px 10px; font-size: 12px; }
  /* tasks */
  .tabs { gap: 8px; margin-bottom: 12px; } .tabs a { padding: 7px 10px 7px 14px; font-size: 13.5px; gap: 7px; }
  .tabs a i { min-width: 20px; height: 20px; font-size: 11px; border-radius: 10px; }
  .card.task { gap: 11px; } .task .th b { font-size: 16px; } .task .det { font-size: 13.5px; margin-top: 4px; }
  .task .from { font-size: 12px; margin-top: 8px; gap: 6px; } .mini-av { width: 21px; height: 21px; font-size: 10.5px; } .card.task.due::before { width: 5px; }
  /* forms & sheets */
  label { font-size: 12.5px; } input, select, textarea { padding: 10px 11px; font-size: 16px; border-radius: 12px; }
  .sheet-card { padding: 16px; } .sheet-card h2 { font-size: 18px; }
  .skel i { border-radius: 18px; } .skel .s2 { height: 140px; } .skel .s3 { height: 90px; } .skel .s4 { height: 70px; }
}
@media (max-width: 360px) {
  h1, .pg-title h1 { font-size: 22px !important; } .h-big { font-size: 25px; } .hero-bills .h-big { font-size: 28px; }
  .ring { width: 72px; height: 72px; } .ring .rv b { font-size: 17px; } .stat .v b { font-size: 25px; }
  .wd b { font-size: 14.5px; } .wd span { font-size: 10px; } .tabs a { font-size: 12.5px; } .ltile b { font-size: 20px; } .ltile span { font-size: 11.5px; }
  .tabbar a { font-size: 10px; } .segs.wide button { font-size: 12px; }
}
/* iPhone zooms the whole page in when a box with text under 16px is tapped — keep every input at 16px on phones */
@media (max-width: 800px) { input, select, textarea, .tools input, .tools select, .exportbar input, .exportbar select { font-size: 16px !important; } }
/* show / hide password eye */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(calc(-50% + 2.5px)); width: 38px; height: 38px; border: 0; background: none; border-radius: 10px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.pw-eye:hover { background: var(--card2); color: var(--acc); }
.pw-eye svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* black Lensar logo (white mark on black) */
.side-brand img { width: 160px !important; height: auto !important; border-radius: 18px !important; background: #000 !important; }
.mark, .brand-sq { background: #000 !important; box-shadow: 0 8px 18px -8px rgba(0,0,0,.55) !important; overflow: hidden; }
.mark img, .brand-sq img { width: 100% !important; height: 100% !important; filter: none !important; object-fit: cover; }
/* revisit / demo lists and their full-details view */
.fu-row { cursor: pointer; transition: background .15s; } .fu-row:hover, .fu-row:focus-visible { background: var(--acc-soft); }
.fd-line { display: flex; justify-content: space-between; gap: 14px; margin-top: 6px; font-size: 14px; }
.fd-line span { color: var(--muted); flex-shrink: 0; } .fd-line b { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.fd-details { white-space: pre-wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink2); }
.fd-assign { border-color: var(--acc); background: var(--acc-soft); }
#sheet-card:has(.fd-assign), #sheet-card:has(.fd-line) { width: min(620px, 100%); }

/* =====================================================================
   ADMIN CONSOLE (Super Admin, HR, Admin, Accounts) — body.console only
   ===================================================================== */
.cbrand { display: none; }
.me-row { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }
.me-row .avatar { display: none; }
.pav { width: 38px; height: 38px; border-radius: 13px; display: inline-grid; place-items: center; font-weight: 800; font-size: 15px; flex-shrink: 0; }
.pav.c0 { background: #e0e7ff; color: #4338ca; } .pav.c1 { background: #d5f5ee; color: #0f766e; } .pav.c2 { background: #ffedd5; color: #c2410c; }
.pav.c3 { background: #fce7f3; color: #be185d; } .pav.c4 { background: #f1eaff; color: #6d28d9; } .pav.c5 { background: #e0f2fe; color: #0369a1; }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.count.soft { background: #ffe4e9; color: #be123c; }

body.console.pg-map { --acc: #2563eb; --acc2: #1e3a8a; --acc-soft: #e8f0ff; --acc-ink: #1d4ed8; }
body.console.pg-tasks { --acc: #e11d48; --acc2: #881337; --acc-soft: #ffe9ee; --acc-ink: #be123c; }
body.console.pg-approvals { --acc: #7c3aed; --acc2: #4c1d95; --acc-soft: #f1eaff; --acc-ink: #6d28d9; }
body.console.pg-attendance, body.console.pg-visitlog { --acc: #0f766e; --acc2: #0b4f4a; --acc-soft: #e2f4f1; --acc-ink: #0f766e; }
body.console.pg-leadreview { --acc: #ea580c; --acc2: #9a3412; --acc-soft: #fff0e5; --acc-ink: #c2410c; }
body.console.pg-settings { --acc: #4f46e5; }

/* sidebar */
@media (min-width: 801px) {
  body.console .side { width: clamp(220px, 17vw, 262px); overflow-y: auto; }
  body.console .side-brand { display: none; }
  body.console .cbrand { display: flex; align-items: center; gap: 12px; padding: 24px 22px 18px; }
  body.console .cbrand .mark { width: 48px; height: 48px; border-radius: 15px; }
  .cbrand b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
  .cbrand small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
  body.console .nav { padding: 4px 14px; gap: 5px; flex: 1 0 auto; }
  body.console .nav a { padding: 12px 15px; border-radius: 15px; gap: 13px; font-size: 15px; position: relative; transition: background .25s var(--ease), color .2s, transform .2s var(--ease), box-shadow .25s; }
  body.console .nav a:not(.active):hover { transform: translateX(4px); background: var(--card2); }
  body.console .nav a:hover svg { transform: scale(1.14) rotate(-4deg); }
  body.console .nav svg { transition: transform .25s var(--ease); }
  body.console .nav a.active { background: var(--acc) !important; color: #fff !important; box-shadow: 0 12px 22px -10px color-mix(in srgb, var(--acc) 80%, transparent); animation: navin .45s var(--ease); }
  body.console .nav a.active .count { background: #fff; color: var(--acc); }
  body.console .side-me { margin: 0 14px; padding: 16px 6px 16px; }
  body.console .me-row .avatar { display: grid; width: 44px; height: 44px; font-size: 17px; }
  body.console .side-me .linkbtn { font-weight: 700; padding: 6px 0; transition: transform .2s var(--ease); }
  body.console .side-me .linkbtn:hover { transform: translateX(4px); }
  body.console .side-me [data-action="logout"] { color: var(--bad); }
  body.console .main { padding: 28px clamp(18px, 2.6vw, 40px) 48px; }
}

/* page header with icon tile */
body.console .head { margin-bottom: 20px; align-items: center; }
.head-main { display: flex; align-items: center; gap: 15px; min-width: 0; }
.head-ic { width: 56px; height: 56px; border-radius: 18px; flex-shrink: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--acc) 82%, #fff), var(--acc)); box-shadow: 0 14px 24px -12px color-mix(in srgb, var(--acc) 85%, transparent); }
.head-ic svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.console .head h1 { font-size: 31px; } body.console .head .sub { margin-top: 3px; }
body.console .tools select, body.console .tools input { border-radius: 14px; padding: 11px 14px; font-weight: 600; background-color: #fff; transition: border-color .2s, box-shadow .2s; }
body.console .tools select:hover, body.console .tools input:hover { border-color: color-mix(in srgb, var(--acc) 45%, #fff); box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--acc) 70%, transparent); }
body.console .segs { padding: 5px; border-radius: 17px; }
body.console .segs button { padding: 9px 20px; }
body.console .head .segs button.on, body.console.pg-approvals .segs button.on { background: var(--acc); color: #fff; box-shadow: 0 10px 18px -9px color-mix(in srgb, var(--acc) 85%, transparent); }
body.console .segs button:not(.on):hover { background: color-mix(in srgb, #fff 70%, transparent); }
body.console .card { border-radius: 24px !important; }
body.console .btn:hover:not(:disabled) { transform: translateY(-1px); }
body.console .btn:active:not(:disabled) { transform: scale(.96); }

/* dashboard: the three big numbers */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
body.console .tile.kpi { position: relative; overflow: hidden; isolation: isolate; padding: 22px; border-radius: 26px !important; transition: transform .25s var(--ease), box-shadow .25s; --k: #4f46e5; --kb: #e0e7ff; --kt: #4338ca; }
body.console .tile.kpi.teal { --k: #0f766e; --kb: #ccfbf1; --kt: #0f766e; }
body.console .tile.kpi.orange { --k: #ea580c; --kb: #ffedd5; --kt: #c2410c; }
body.console .tile.kpi:hover, body.console .tile.kpi:focus-visible { transform: translateY(-5px); box-shadow: 0 24px 38px -22px color-mix(in srgb, var(--k) 70%, transparent) !important; outline: none; }
.kpi-blob { position: absolute; z-index: -1; right: -34px; top: -48px; width: 150px; height: 150px; border-radius: 50%; background: var(--kb); transition: transform .5s var(--ease); animation: drift 11s ease-in-out infinite alternate; }
.tile.kpi:hover .kpi-blob { transform: scale(1.35); animation: none; }
.kpi-h { display: flex; align-items: center; gap: 12px; }
.kpi-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--k); color: #fff; display: grid; place-items: center; transition: transform .3s var(--ease); flex-shrink: 0; }
.tile.kpi:hover .kpi-ic { transform: rotate(-8deg) scale(1.08); }
.kpi-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.console .tile.kpi .k { font-size: 12.5px; letter-spacing: .07em; font-weight: 700; }
body.console .tile.kpi .v { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-top: 8px; }
body.console .tile.kpi .s { color: var(--kt); font-weight: 600; }

/* tables */
body.console .table th { font-size: 12px; letter-spacing: .07em; padding: 10px 12px; }
body.console .table td { padding: 14px 12px; }
body.console .table tbody tr { transition: background .2s; }
body.console .table tbody tr:hover { background: var(--card2); }
body.console .table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--acc); }
.perf .p-name b { font-size: 15.5px; }
.p-bar { display: block; width: 160px; max-width: 100%; height: 6px; border-radius: 6px; background: #eceefb; margin-top: 7px; overflow: hidden; }
.p-bar i { display: block; height: 100%; width: var(--w); border-radius: 6px; background: linear-gradient(90deg, #6366f1, #4338ca); }
.perf td.r .muted { font-size: 15px; }
.perf a.dlink { display: inline-block; min-width: 34px; padding: 5px 8px; text-align: center; border-radius: 10px; font-weight: 700; font-size: 15px; text-underline-offset: 5px; transition: background .2s, color .2s, transform .2s var(--ease); }
body.console .perf a.dlink:hover { background: var(--acc); color: #fff; transform: scale(1.15); text-decoration: none; }
body.console .fu-row:hover { background: var(--acc-soft); }

/* lists: map, tasks, attendance, approvals, people */
body.console .card.mrow, body.console .card.atask { transition: transform .22s var(--ease), box-shadow .22s, border-color .22s; }
body.console .card.mrow:hover, body.console .card.atask:hover { transform: translateY(-3px); box-shadow: 0 18px 30px -20px rgba(30,27,75,.35) !important; border-color: color-mix(in srgb, var(--acc) 35%, #fff) !important; }
body.console .card.mrow[data-pt] > .pill { width: 36px; height: 36px; border-radius: 12px; justify-content: center; background: var(--acc); color: #fff; font-size: 14px; }
.card.atask { position: relative; overflow: hidden; }
.card.atask::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--acc); opacity: .85; }
.card.atask.st-done::before { background: #10b981; } .card.atask.st-rejected::before { background: #be123c; }
body.console #map { border-radius: 0; }
body.console .card:has(> #map) { box-shadow: 0 22px 40px -26px rgba(30,27,75,.4) !important; }

body.console .card:has(> details.person) { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0; }
body.console details.person { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px 18px; margin-bottom: 10px; box-shadow: var(--sh); transition: box-shadow .22s, border-color .22s, transform .22s var(--ease); }
body.console details.person:not([open]):hover, body.console .emp:not([open]):not(.empty-emp):hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--acc) 35%, #fff) !important; }
body.console details.person[open] { border-color: color-mix(in srgb, var(--acc) 35%, #fff); }
body.console details.person[open] > :not(summary), body.console .emp[open] > .emp-body { animation: unfold .38s var(--ease) both; }
body.console .chev { transition: transform .25s var(--ease); color: var(--muted); }
body.console .slot { border-radius: 14px; }
body.console .person .ph-row img { border-radius: 16px; transition: transform .25s var(--ease); }
body.console .person .ph-row img:hover { transform: scale(1.03); }

body.console .emp { border-radius: 22px !important; overflow: clip; transition: transform .22s var(--ease), border-color .22s; }
body.console .emp > summary { padding: 15px 18px; }
body.console .empty-emp { align-items: center; padding: 12px 18px; }
body.console .emp-body { padding: 4px 18px 6px; }
body.console .dayhead { background: var(--acc-soft); border-radius: 13px; padding: 9px 13px; }
body.console .exportbar { border: 1.5px dashed color-mix(in srgb, var(--acc) 35%, #fff); border-radius: 18px; background: color-mix(in srgb, var(--acc-soft) 45%, #fff); }
body.console .review { border-radius: 20px; transition: box-shadow .22s, border-color .22s; }
body.console .review:hover { box-shadow: 0 18px 30px -22px rgba(30,27,75,.35); border-color: color-mix(in srgb, var(--acc) 35%, #fff); }
body.console .review .ph { border-radius: 16px; transition: transform .25s var(--ease); } body.console .review .ph:hover { transform: scale(1.03); }
body.console .review .amt { font-weight: 800; letter-spacing: -.02em; }

.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; }
.cgrid > .card { margin-bottom: 0; }
body.console .card.visit:hover, body.console .card.lead:hover { transform: translateY(-4px); box-shadow: 0 22px 36px -22px rgba(30,27,75,.35) !important; }
body.console .card.lead { transition: transform .22s var(--ease), box-shadow .22s; }
body.console .card.visit:hover .v-photo img { transform: scale(1.05); }
.v-photo { overflow: hidden; } .v-photo img { transition: transform .5s var(--ease); }

.ptable td { vertical-align: middle; }
.role-chip { display: inline-block; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 12.5px; background: #eef0f6; color: var(--ink2); white-space: nowrap; }
.role-chip.r-super_admin { background: #e0e7ff; color: #3730a3; } .role-chip.r-admin { background: #fce7f3; color: #be185d; }
.role-chip.r-office_admin { background: #f1eaff; color: #6d28d9; } .role-chip.r-accounts { background: #fff6dc; color: #b45309; } .role-chip.r-employee { background: #e2f4f1; color: #0f766e; }
.set-card { max-width: 640px; }

/* dialogs */
body.console .dl-row { border-radius: 14px; padding: 12px 10px; transition: background .2s; } body.console .dl-row:hover { background: var(--card2); }

/* entrance and motion */
.main.anim .table tbody tr { animation: rowin .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + 120ms); }
.main.anim :is(.person, .review) { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.main.anim .p-bar i { animation: grow 1.1s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + 300ms); }
.main.anim .head-ic { animation: icpop .65s var(--ease) both; }
@keyframes rowin { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes icpop { 0% { transform: scale(.4) rotate(-25deg); opacity: 0; } 65% { transform: scale(1.1) rotate(5deg); opacity: 1; } 100% { transform: none; } }
@keyframes navin { 0% { transform: scale(.93); } 60% { transform: scale(1.03); } 100% { transform: none; } }
@keyframes unfold { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* narrower screens */
@media (max-width: 1000px) { .kpis { gap: 12px; } body.console .tile.kpi { padding: 16px; } body.console .tile.kpi .v { font-size: 36px; } }
@media (max-width: 800px) {
  body.console .head { gap: 10px; margin-bottom: 14px; }
  .head-ic { width: 42px; height: 42px; border-radius: 14px; } .head-ic svg { width: 21px; height: 21px; }
  body.console .head h1 { font-size: 22px !important; } .head-main { gap: 11px; }
  body.console .segs button { padding: 7px 14px; font-size: 13px; }
  body.console .tools select, body.console .tools input { padding: 8px 11px; }
  .kpis { grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
  body.console .tile.kpi { padding: 14px 16px; } .kpi-ic { width: 36px; height: 36px; border-radius: 12px; } .kpi-ic svg { width: 19px; height: 19px; }
  body.console .tile.kpi .v { font-size: 31px; margin-top: 4px; } .kpi-blob { width: 120px; height: 120px; }
  body.console .card { border-radius: 18px !important; }
  body.console .table th { padding: 8px; font-size: 10.5px; } body.console .table td { padding: 10px 8px; }
  .p-bar { width: 90px; }
  body.console .perf .p-name { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 110px; }
  .pav { width: 32px; height: 32px; border-radius: 11px; font-size: 13px; }
  body.console details.person, body.console .emp > summary { padding: 12px; } body.console .emp-body { padding: 4px 10px 6px; }
}
/* logo + "Lensar" stay put: only the menu between them and the account links scrolls */
@media (min-width: 801px) {
  body.console .side { overflow: hidden; }
  body.console .cbrand, .side .side-brand, body.console .side-me { flex-shrink: 0; }
  body.console .nav, .side .nav { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  body.console .nav a, .side .nav a { flex-shrink: 0; }
}
/* short laptop screens: tighter spacing so the menu keeps enough room */
@media (min-width: 801px) and (max-height: 700px) {
  body.console .cbrand { padding: 14px 22px 10px; }
  body.console .nav a { padding: 8px 15px; }
  body.console .side-me { padding: 8px 6px; }
  body.console .side-me .linkbtn { padding: 2px 0; }
  body.console .me-row { margin-bottom: 4px; }
}

/* =====================================================================
   LOGIN PAGE
   ===================================================================== */
.lx { position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; display: flex; padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); color: #1e1b4b; font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
.lx-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #f4f5fb; }
.lx-blob { position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%; opacity: .85; }
.lx-blob.b1 { left: -35vmax; top: -40vmax; background: radial-gradient(closest-side, #c7d2fe, transparent); animation: lx-drift1 14s ease-in-out infinite alternate; }
.lx-blob.b2 { right: -40vmax; top: -12vmax; background: radial-gradient(closest-side, #fbcfe8, transparent); animation: lx-drift2 17s ease-in-out infinite alternate; }
.lx-blob.b3 { left: 10vw; bottom: -58vmax; background: radial-gradient(closest-side, #a7f3e4, transparent); animation: lx-drift3 20s ease-in-out infinite alternate; }
.lx-dots { position: absolute; inset: 0; width: 100%; height: 100%; }
.lx-tile { position: absolute; width: 62px; height: 62px; display: grid; place-items: center; background: #fff; border-radius: 19px; color: var(--c); box-shadow: 0 18px 34px -14px color-mix(in srgb, var(--c) 55%, transparent); animation: lx-pop .7s cubic-bezier(.2,.8,.2,1) var(--d) both, lx-float var(--s) ease-in-out var(--d) infinite; }
.lx-tile svg { width: 27px; height: 27px; }
.lx-tile.t1 { left: 10%; top: 18%; --c: #0f766e; --d: .15s; --s: 6s; }
.lx-tile.t2 { left: 5%; top: 62%; --c: #ea580c; --d: .3s; --s: 7.4s; }
.lx-tile.t3 { left: 18%; top: 84%; --c: #e11d48; --d: .45s; --s: 5.6s; }
.lx-tile.t4 { right: 12%; top: 21%; --c: #0e7490; --d: .22s; --s: 6.8s; }
.lx-tile.t5 { right: 8%; top: 63%; --c: #7c3aed; --d: .38s; --s: 5.9s; }
.lx-tile.t6 { right: 22%; top: 87%; --c: #0284c7; --d: .52s; --s: 7s; }

.lx-wrap { width: min(430px, 100%); margin: auto; }
.lx-eyes { position: relative; z-index: 2; display: flex; justify-content: center; margin-bottom: -22px; filter: drop-shadow(0 16px 18px rgba(79,70,229,.3)); animation: lx-drop .8s cubic-bezier(.3,1.5,.5,1) .15s both; }
.lx-eye { position: relative; width: 98px; height: 98px; border-radius: 50%; overflow: hidden; background: #fff; border: 7px solid #1e1b4b; box-shadow: 0 0 0 9px #4f46e5; margin: 9px; }
.lx-eye + .lx-eye { margin-left: -3px; }
.lx-pupil { position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; margin: -23% 0 0 -23%; border-radius: 50%; background: radial-gradient(circle, #0b0a1f 0 46%, #4f46e5 49%); transform: translate(var(--x, 0px), var(--y, 0px)); transition: transform .14s ease-out; }
.lx-pupil::after { content: ""; position: absolute; left: 24%; top: 20%; width: 22%; height: 22%; border-radius: 50%; background: #fff; }
.lx-lid { position: absolute; inset: 0; background: linear-gradient(#818cf8, #4f46e5); border-bottom: 5px solid #1e1b4b; transform: translateY(-105%); animation: lx-blink 5s infinite; }
.lx-eyes.shut .lx-lid { animation: none; transform: translateY(-14%); transition: transform .25s ease; }

.lx-card { background: rgba(255,255,255,.94); border: 1px solid #fff; border-radius: 34px; padding: 40px 36px 34px; text-align: center; box-shadow: 0 34px 60px -28px rgba(49,46,129,.35); animation: lx-rise .65s cubic-bezier(.2,.8,.2,1) both; }
.lx-card.shake { animation: lx-shake .45s ease; }
.lx-logo { width: 156px; margin: 0 auto 16px; padding: 8px; border-radius: 22px; background: #000; box-shadow: 0 16px 28px -14px rgba(30,27,75,.65); animation: lx-pop .7s cubic-bezier(.2,.8,.2,1) .25s both; }
.lx-logo img { display: block; width: 100%; height: auto; }
.lx-card h1 { font-size: 31px; font-weight: 800; letter-spacing: -.03em; color: #1e1b4b; }
.lx-sub { margin: 4px 0 22px; color: #62678c; }
.lx .lx-label { text-align: left; margin: 0 0 7px 2px; font-weight: 700; color: #312e81; }
.lx-field { position: relative; display: flex; align-items: center; margin-bottom: 17px; background: #eef0ff; border: 2px solid transparent; border-radius: 18px; transition: border-color .2s, background .2s, box-shadow .2s; }
.lx-field:focus-within { background: #fff; border-color: #4f46e5; box-shadow: 0 0 0 4px rgba(79,70,229,.15); }
.lx svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lx-field > svg { width: 21px; height: 21px; flex: none; margin-left: 17px; color: #8186c4; }
.lx .lx-field input { flex: 1; min-width: 0; margin: 0; padding: 17px 14px 17px 12px; background: transparent; border: 0; border-radius: 16px; outline: 0; font-weight: 600; color: #1e1b4b; }
.lx .lx-field input::placeholder { color: #7b80a6; font-weight: 500; }
.lx .lx-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #eef0ff inset; -webkit-text-fill-color: #1e1b4b; }
.lx-peek { flex: none; width: 46px; height: 46px; margin-right: 6px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 14px; background: none; color: #4f46e5; }
.lx-peek:hover { background: #e0e3ff; }
.lx-peek svg { width: 22px; height: 22px; }
.lx-peek .on, .lx-peek[aria-pressed="true"] .off { display: none; }
.lx-peek[aria-pressed="true"] .on { display: block; }
.lx-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 4px; }
.lx .lx-keep { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 0; font-size: 14px; color: #464c7a; cursor: pointer; }
.lx .lx-keep input { width: 22px; height: 22px; margin: 0; padding: 0; accent-color: #4f46e5; cursor: pointer; }
.lx-link { border: 0; background: none; padding: 6px 0; font-size: 14px; font-weight: 700; color: #4f46e5; }
.lx-link:hover { text-decoration: underline; }
.lx-note { margin-top: 10px; padding: 10px 14px; border-radius: 14px; background: #eef0ff; color: #3730a3; font-size: 13px; font-weight: 600; animation: lx-rise .3s ease both; }
.lx-err { min-height: 18px; margin: 6px 0; font-size: 14px; font-weight: 600; color: #be123c; }
.lx-btn { position: relative; overflow: hidden; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border: 0; border-radius: 20px; color: #fff; font-size: 17px; font-weight: 800; background: linear-gradient(100deg, #4f46e5, #7c3aed, #4f46e5) 0 0 / 200% 100%; box-shadow: 0 18px 28px -12px rgba(79,70,229,.75); transition: transform .2s, box-shadow .2s; animation: lx-flow 5s linear infinite; }
.lx-btn::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60px; left: -90px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); animation: lx-shine 3.8s ease-in-out infinite; }
.lx-btn:hover { transform: translateY(-2px); box-shadow: 0 24px 32px -14px rgba(79,70,229,.8); }
.lx-btn:active { transform: scale(.98); }
.lx-btn:disabled { cursor: wait; }
.lx-btn svg { width: 21px; height: 21px; transition: transform .2s; }
.lx-btn:hover svg { transform: translateX(4px); }
.lx-btn.wait span { opacity: .75; }
.lx-btn.wait svg { border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.lx-btn.wait svg path { display: none; }
.lx button:focus-visible, .lx-keep input:focus-visible { outline: 3px solid #1e1b4b; outline-offset: 2px; }
.lx-foot { margin: 20px 8px 0; text-align: center; font-size: 13px; font-weight: 500; color: #565b7e; }

/* tablets and phones: the floating icons move to the top and bottom edges so they never cover the form */
@media (max-width: 860px) {
  .lx-tile { width: 42px; height: 42px; border-radius: 14px; }
  .lx-tile svg { width: 20px; height: 20px; }
  .lx-tile.t1 { left: 5%; top: 2.5%; } .lx-tile.t4 { right: 5%; top: 3.5%; }
  .lx-tile.t2 { left: 11%; top: 10.5%; } .lx-tile.t5 { right: 11%; top: 11.5%; }
  .lx-tile.t3 { left: 3%; top: auto; bottom: 1.5%; } .lx-tile.t6 { right: 3%; top: auto; bottom: 2%; }
  .lx-foot { padding: 0 38px; }
}
@media (max-width: 480px) {
  .lx { padding-left: 14px; padding-right: 14px; }
  .lx-card { padding: 34px 20px 24px; border-radius: 28px; }
  .lx-card h1 { font-size: 26px; }
  .lx-sub { font-size: 13.5px; margin-bottom: 18px; }
  .lx-eye { width: 74px; height: 74px; border-width: 6px; box-shadow: 0 0 0 7px #4f46e5; margin: 7px; }
  .lx-eyes { margin-bottom: -17px; }
  .lx-logo { width: 132px; margin-bottom: 12px; }
  .lx .lx-field input { padding-top: 15px; padding-bottom: 15px; }
  .lx-btn { padding: 16px; }
}
/* short screens (small laptops, small phones, landscape) */
@media (max-height: 820px) {
  .lx-eye { width: 68px; height: 68px; border-width: 5px; box-shadow: 0 0 0 6px #4f46e5; margin: 6px; }
  .lx-eyes { margin-bottom: -15px; }
  .lx-card { padding-top: 26px; padding-bottom: 20px; }
  .lx-logo { width: 108px; margin-bottom: 8px; padding: 6px; border-radius: 17px; }
  .lx-card h1 { font-size: 24px; }
  .lx-sub { margin-bottom: 12px; }
  .lx .lx-field input { padding-top: 11px; padding-bottom: 11px; }
  .lx-field { margin-bottom: 11px; }
  .lx-peek { width: 40px; height: 40px; }
  .lx-err { margin: 4px 0; }
  .lx-btn { padding: 13px; }
  .lx-foot { margin-top: 12px; }
}
.lx-eye + .lx-eye { margin-left: -3px; }

@media (max-width: 360px) { .lx-tile.t2, .lx-tile.t5 { display: none; } }

/* phones: a smaller, compact sign-in (typed text stays 16px so iPhones do not zoom in). Keep this after the rules above. */
@media (max-width: 480px) {
  .lx-wrap { width: min(330px, 100%); }
  .lx-eye { width: 56px; height: 56px; border-width: 4px; box-shadow: 0 0 0 5px #4f46e5; margin: 5px; }
  .lx-eye + .lx-eye { margin-left: -2px; }
  .lx-lid { border-bottom-width: 3px; }
  .lx-eyes { margin-bottom: -12px; }
  .lx-card { padding: 22px 18px 16px; border-radius: 24px; }
  .lx-logo { width: 92px; margin-bottom: 8px; padding: 5px; border-radius: 15px; }
  .lx-card h1 { font-size: 21px; }
  .lx-sub { font-size: 12px; margin: 2px 0 12px; }
  .lx .lx-label { font-size: 12px; margin-bottom: 4px; }
  .lx-field { margin-bottom: 10px; border-radius: 13px; }
  .lx-field > svg { width: 18px; height: 18px; margin-left: 12px; }
  .lx .lx-field input { padding: 9px 10px 9px 9px; }
  .lx .lx-field input::placeholder { font-size: 14px; }
  .lx-peek { width: 36px; height: 36px; margin-right: 4px; border-radius: 10px; }
  .lx-peek svg { width: 19px; height: 19px; }
  .lx-row { margin-top: 0; }
  .lx .lx-keep { font-size: 12.5px; gap: 7px; }
  .lx .lx-keep input { width: 18px; height: 18px; }
  .lx-link { font-size: 12.5px; }
  .lx-note { margin-top: 6px; padding: 8px 10px; font-size: 12px; }
  .lx-err { min-height: 10px; margin: 3px 0; font-size: 12.5px; }
  .lx-btn { padding: 12px; font-size: 15px; border-radius: 14px; }
  .lx-btn svg { width: 18px; height: 18px; }
  .lx-foot { margin-top: 10px; font-size: 11.5px; }
  .lx-tile { width: 36px; height: 36px; border-radius: 12px; }
  .lx-tile svg { width: 18px; height: 18px; }
}

@keyframes lx-drift1 { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes lx-drift2 { to { transform: translate(-12vmax, 14vmax) scale(.9); } }
@keyframes lx-drift3 { to { transform: translate(16vmax, -12vmax) scale(1.15); } }
@keyframes lx-float { 0%, 100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -14px; rotate: 4deg; } }
@keyframes lx-pop { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes lx-drop { from { opacity: 0; transform: translateY(-40px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes lx-rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lx-blink { 0%, 93%, 100% { transform: translateY(-105%); } 96% { transform: translateY(0); } }
@keyframes lx-flow { to { background-position: -200% 0; } }
@keyframes lx-shine { 0%, 60% { left: -90px; } 100% { left: 115%; } }
@keyframes lx-shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
@media (prefers-reduced-motion: reduce) { .lx *, .lx *::after { animation: none !important; transition: none !important; } .lx-btn::after { display: none; } }

/* =====================================================================
   BILL APPROVALS and ATTENDANCE
   ===================================================================== */
body.console.pg-approvals { --acc: #7e14e0; --acc2: #4c0d8a; --acc-soft: #f2e8ff; --acc-ink: #6a0dc2; }
body.console.pg-attendance { --acc: #327fc7; --acc2: #1d4f80; --acc-soft: #e7f1fb; --acc-ink: #2468a6; }
svg.ln { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ap-export { padding: 11px 18px; }
.ap-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.ap-tabs { display: flex; gap: 4px; padding: 5px; border-radius: 18px; background: var(--acc-soft); }
.ap-tabs button { display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; background: none; padding: 9px 18px; border-radius: 14px; font-weight: 800; font-size: 14px; color: var(--acc-ink); transition: background .2s, box-shadow .2s; }
.ap-tabs button span { min-width: 22px; padding: 1px 6px; border-radius: 20px; background: var(--acc-soft); font-size: 12px; }
.ap-tabs button.on { background: #fff; box-shadow: 0 8px 16px -10px rgba(76,13,138,.5); }
.ap-month { padding: 9px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink2); }
.ap-month b { color: var(--ok); }

.ap-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.ap-stat { padding: 16px 18px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh); }
.ap-stat small { display: block; text-transform: uppercase; letter-spacing: .07em; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.ap-stat b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.ap-stat span { font-weight: 700; font-size: 13px; color: var(--muted); margin-left: 4px; }
.ap-stat.look { background: #fff8f0; border-color: #fadcb8; }
.ap-stat.look :is(small, b, span) { color: #a5380c; }
.ap-approve { border: 0; border-radius: 16px; background: #1f9660; color: #fff; font-weight: 800; box-shadow: 0 14px 22px -12px rgba(31,150,96,.8); transition: transform .15s, filter .2s; }
.ap-approve:hover { filter: brightness(1.07); transform: translateY(-1px); }

.ap-grid { display: grid; grid-template-columns: minmax(180px, 220px) minmax(270px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ap-grid.none { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); }
#ap-root.wait { pointer-events: none; opacity: .65; }
.ap-box { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh); }
.ap-people, .ap-list { max-height: calc(100vh - 36px); overflow-y: auto; scrollbar-width: thin; padding: 10px; }
.ap-title { padding: 6px 8px 8px; text-transform: uppercase; letter-spacing: .07em; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.ap-person { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 8px; margin-bottom: 4px; text-align: left; background: none; border: 1.5px solid transparent; border-radius: 16px; transition: background .2s, border-color .2s; }
.ap-person:hover { background: var(--card2); }
.ap-person.on { background: var(--acc-soft); border-color: var(--acc); }
.ap-person.dim { opacity: .55; }
.ap-who { flex: 1; min-width: 0; display: block; line-height: 1.3; overflow-wrap: anywhere; }
.ap-who > * { display: block; }
.ap-who b { font-size: 14px; }
.ap-who span small { font-size: 11.5px; color: var(--muted); }
.ap-who > small { font-size: 11.5px; color: var(--muted); }
.ap-who em { font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--acc-ink); }
.ap-badge { min-width: 23px; height: 23px; padding: 0 6px; display: grid; place-items: center; border-radius: 20px; background: #d6044a; color: #fff; font-size: 11.5px; font-weight: 800; flex-shrink: 0; }

.ap-pick { display: flex; justify-content: space-between; gap: 8px; padding: 2px 4px 10px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.ap-link { border: 0; background: none; padding: 0; font-size: 12px; font-weight: 800; color: var(--acc-ink); white-space: nowrap; }
.ap-day { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; margin: 10px 0 7px; padding: 8px 11px; border-radius: 12px; background: var(--acc-soft); color: var(--acc2); font-size: 12px; font-weight: 800; }
.ap-dayok { margin-left: 6px; padding: 3px 9px; border: 0; border-radius: 20px; background: #1f9660; color: #fff; font-size: 11.5px; font-weight: 800; }
.ap-row { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.ap-row input { width: 20px; height: 20px; flex-shrink: 0; margin: 0 0 0 2px; padding: 0; accent-color: var(--acc); cursor: pointer; }
.ap-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 9px; text-align: left; background: #fff; border: 1.5px solid transparent; border-radius: 16px; transition: background .2s, border-color .2s, transform .2s; }
.ap-item:hover { background: var(--card2); transform: translateX(2px); }
.ap-item.on { background: var(--acc-soft); border-color: var(--acc); }
.ap-it { flex: 1; min-width: 0; display: block; }
.ap-it b { display: block; font-size: 15px; font-weight: 800; }
.ap-it small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11.5px; color: var(--muted); }
.ap-cat { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: #fdecd2; color: #b93a0c; }
.ap-cat.c-Travel { background: #e0ecff; color: #1d4ed8; } .ap-cat.c-Fuel { background: #fde4e4; color: #b91c1c; } .ap-cat.c-Stay { background: #d9f3ee; color: #0f766e; } .ap-cat.c-Other { background: #ece9f6; color: #5b4b9a; }
.ap-tag { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 3px 9px; border-radius: 20px; background: var(--acc-soft); color: var(--acc-ink); font-size: 11px; font-weight: 800; }
.ap-tag.bad { background: #ffe9ee; color: #be123c; } .ap-tag svg.ln { width: 13px; height: 13px; }
.ap-bulk { position: sticky; bottom: -10px; padding: 10px 0; background: #fff; }
.ap-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-weight: 600; }

.ap-detail { overflow: hidden auto; scrollbar-width: thin; position: sticky; top: 16px; max-height: calc(100vh - 32px); }
.ap-photo { position: relative; display: grid; place-items: center; padding: 18px; background: #fdefd6; }
.ap-photo img { display: block; max-width: 100%; height: clamp(120px, 26vh, 260px); object-fit: contain; border-radius: 12px; background: #fff; box-shadow: 0 18px 30px -16px rgba(90,50,0,.45); cursor: zoom-in; transition: transform .25s; }
.ap-photo img:hover { transform: scale(1.025); }
.ap-state, .ap-no { position: absolute; top: 14px; z-index: 1; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; }
.ap-state { left: 14px; background: #fff4cc; color: #92500a; } .ap-state.approved { background: #d5f7e3; color: #0f6b45; } .ap-state.rejected { background: #ffe3ea; color: #be123c; }
.ap-no { right: 14px; background: #fff; color: var(--ink2); }
.ap-back { display: none; }
.ap-body { padding: 18px 20px 20px; animation: lx-rise .35s ease both; }
.ap-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ap-amt { font-size: 36px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.ap-reason { font-size: 15.5px; font-weight: 600; overflow-wrap: anywhere; }
.ap-meta { text-align: right; font-size: 12.5px; color: var(--muted); margin-left: auto; }
.ap-meta b { color: var(--ink); }
.ap-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.ap-chip { padding: 4px 11px; border-radius: 20px; background: var(--acc-soft); color: var(--acc-ink); font-size: 12px; font-weight: 800; }
.ap-chip.warn { background: #fdecd2; color: #a5380c; }
.ap-alert { display: flex; gap: 11px; margin-top: 12px; padding: 12px 14px; border-radius: 16px; font-size: 12.5px; overflow-wrap: anywhere; }
.ap-alert b, .ap-alert span { display: block; } .ap-alert b { font-size: 13.5px; }
.ap-alert.bad { background: #fff0f3; border: 1px solid #fbc4d0; color: #be123c; }
.ap-alert.warn { background: #fff8e8; border: 1px solid #f8ddA0; color: #92500a; }
.ap-loc { display: flex; gap: 6px; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--acc-ink); }
.ap-loc svg.ln { width: 16px; height: 16px; }
.ap-tbl { margin-top: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.ap-tbl table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ap-tbl th { padding: 9px 12px; background: var(--card2); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; color: var(--muted); text-align: right; }
.ap-tbl td { padding: 11px 12px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.ap-tbl th:first-child, .ap-tbl td:first-child { text-align: left; }
.ap-tbl small { color: var(--muted); }
#ap-root .neg { color: #be123c; }
.ap-acts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; margin-top: 14px; }
.ap-approve { padding: 15px; font-size: 15.5px; } .ap-approve span { margin-left: 8px; }
.ap-reject { padding: 15px; border: 1.5px solid #f3a6b8; border-radius: 16px; background: #fff; color: #be123c; font-weight: 800; }
.ap-reject:hover { background: #fff0f3; }
.ap-hint { margin-top: 8px; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ap-done { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--card2); font-size: 13.5px; }
.ap-done span { display: block; font-size: 12.5px; font-weight: 700; }

/* Attendance */
.at-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.at-stat { padding: 16px 18px; border-radius: 20px !important; }
.at-stat small { display: block; text-transform: uppercase; letter-spacing: .07em; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.at-stat b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; white-space: nowrap; }
.at-stat.in b { color: #157a52; } .at-stat.up b { color: #5b25e0; } .at-stat.out b { color: #be0a45; } .at-stat.due b { color: #327fc7; }
body.console .at-list.card { padding: 4px 18px; }
.at-row + .at-row { border-top: 1px solid var(--line); }
.at-row > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 4px; border-radius: 14px; transition: background .2s; }
.at-row > summary::-webkit-details-marker { display: none; }
.at-row > summary:hover { background: var(--card2); }
.at-chev { display: grid; color: var(--muted); transition: transform .2s; }
.at-row[open] .at-chev { transform: rotate(90deg); }
.at-name { min-width: 0; overflow-wrap: anywhere; } .at-name b { font-size: 15.5px; } .at-name small { color: var(--muted); margin-left: 4px; }
.at-pills { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.at-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.at-pill svg.ln { width: 13px; height: 13px; }
.at-pill.ok { background: #dcf8ea; color: #0f6b45; } .at-pill.blue { background: #e3e8ff; color: #3730a3; } .at-pill.bad { background: #ffe3ea; color: #be0a45; } .at-pill.grey { background: #eef0f8; color: #4b5175; }
.at-pill.live i { width: 7px; height: 7px; border-radius: 50%; background: #16a36a; animation: ping 1.6s infinite; }
.at-body { padding: 2px 4px 16px 34px; animation: unfold .3s ease both; }
.at-body .slots { margin-bottom: 12px; } .at-body .slot { min-width: 64px; padding: 4px 10px; }
.at-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.at-photos figure { margin: 0; min-width: 0; }
.at-photos img, .at-nophoto { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 16px; background: var(--card2); cursor: zoom-in; }
.at-nophoto { display: grid; place-items: center; font-size: 30px; cursor: default; }
.at-photos figcaption { margin-top: 6px; font-size: 12px; color: var(--ink2); overflow-wrap: anywhere; }
.at-photos figcaption > * { display: block; }

/* narrower screens: people become a row of chips above the list */
@media (max-width: 1180px) {
  .ap-grid { grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); }
  .ap-grid.none { grid-template-columns: minmax(0, 1fr); }
  .ap-people { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; max-height: none; }
  .ap-title { display: none; }
  .ap-person { width: auto; flex: 0 0 auto; max-width: 240px; margin: 0; border-color: var(--line); }
}
/* phones: one column, and a tapped bill opens over the whole screen */
@media (max-width: 800px) {
  .ap-grid, .ap-grid.none { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ap-list { max-height: none; overflow: visible; }
  .ap-bulk { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .ap-detail { display: none; }
  .ap-detail.show { display: block; position: fixed; inset: 0; max-height: none; z-index: 30; overflow-y: auto; border: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
  .main.anim .ap-detail { animation: none; }
  .ap-photo { padding: 62px 14px 18px; } .ap-photo img { height: clamp(170px, 32vh, 300px); }
  .ap-state { top: auto; bottom: 8px; left: 12px; } .ap-no { top: 16px; }
  .ap-back { display: block; position: absolute; left: 12px; top: 12px; padding: 8px 14px; border: 0; border-radius: 20px; background: #fff; font-weight: 800; color: var(--ink); }
  .ap-body { padding: 16px 14px 24px; }
  .ap-stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
  .ap-stat { padding: 12px 14px; border-radius: 16px; } .ap-stat b { font-size: 24px; }
  .ap-tabs { width: 100%; } .ap-tabs button { flex: 1; gap: 6px; padding: 9px 4px; font-size: 13px; }
  .ap-month { width: 100%; text-align: center; }
  .ap-export { padding: 8px 13px; }
  .at-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .at-stat { padding: 12px 14px; } .at-stat b { font-size: 24px; }
  body.console .at-list.card { padding: 2px 10px; }
  .at-pills { margin-left: 0; width: 100%; justify-content: flex-start; padding-left: 30px; gap: 6px; }
  .at-body { padding-left: 4px; }
  .at-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 420px) { .ap-tbl th, .ap-tbl td { padding: 8px 7px; } .ap-tbl table { font-size: 12px; } .ap-tbl th { font-size: 9.5px; } .ap-acts { grid-template-columns: 1.4fr 1fr; } }

/* ---- amount transferred (HR) and the 3-box employee card ---- */
.h-boxes.three { grid-template-columns: 1fr 1fr 1fr; }
.ap-xfer { margin: 0 0 14px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #f4f1ff, #eef3ff); border: 1px solid var(--line); }
.ap-xnums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ap-xnums small { display: block; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 800; color: var(--muted); }
.ap-xnums b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.ap-xnums b.ok { color: var(--ok); } .ap-xnums b.due { color: #b45309; }
.ap-xbtns { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.ap-xgo { border: 0; cursor: pointer; padding: 11px 18px; border-radius: 14px; background: var(--ok, #16a34a); color: #fff; font-weight: 800; font-size: 14px; }
.ap-xgo:active { transform: scale(.98); }
.ap-xdone { font-weight: 800; color: var(--ok); font-size: 14px; }
@media (max-width: 700px) { .ap-xnums b { font-size: 16px; } .ap-xgo { width: 100%; } }

/* ---- a photo removed by the 15th-and-30th cleanup (the text record stays) ---- */
.photo-gone { display: grid; place-items: center; align-content: center; gap: 2px; text-align: center; padding: 18px 14px; height: 100%; min-height: 110px; background: repeating-linear-gradient(135deg, #f1f3fb, #f1f3fb 10px, #eaedf8 10px, #eaedf8 20px); color: var(--muted); border-radius: 14px; }
.photo-gone span { font-size: 28px; opacity: .6; } .photo-gone b { font-size: 14px; color: var(--ink2); } .photo-gone small { font-size: 11.5px; max-width: 28ch; }
.photo-gone-s { display: grid; place-items: center; font-size: 22px; cursor: default; color: var(--muted); } .photo-gone-s small { font-size: 10px; }
#sheet-card > .photo-gone { margin-bottom: 12px; }

/* ---- employee's own reminder ("Self task") ---- */
.pill.selftag { background: #ede9fe; color: #6d28d9; font-weight: 800; }
.card.task .from .pill.selftag { margin-right: 6px; }
.pg-title #add-mytask { white-space: nowrap; flex: 0 0 auto; }
