:root {
  color-scheme: light dark;
  --bg: #edf5ff;
  --bg-2: #f9fbff;
  --ink: #10213c;
  --muted: #61718a;
  --glass: rgba(255, 255, 255, .68);
  --glass-strong: rgba(255, 255, 255, .88);
  --stroke: rgba(255, 255, 255, .9);
  --hairline: rgba(32, 76, 128, .12);
  --blue: #0868e8;
  --blue-deep: #0649ab;
  --green: #149c65;
  --orange: #e88618;
  --red: #d6414b;
  --shadow: 0 18px 48px rgba(39, 78, 122, .16), 0 2px 8px rgba(31, 55, 88, .08);
  --radius-xl: 30px;
  --radius-lg: 23px;
  --radius-md: 17px;
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #06101d;
    --bg-2: #0a1727;
    --ink: #f5f8ff;
    --muted: #9aa9bd;
    --glass: rgba(16, 30, 48, .64);
    --glass-strong: rgba(15, 29, 46, .9);
    --stroke: rgba(255, 255, 255, .13);
    --hairline: rgba(255, 255, 255, .09);
    --blue: #3694ff;
    --blue-deep: #0b5ec8;
    --green: #36ce8c;
    --orange: #ffad4f;
    --red: #ff6670;
    --shadow: 0 22px 58px rgba(0, 0, 0, .36), inset 0 1px rgba(255, 255, 255, .06);
  }
}

[data-theme="light"] { color-scheme: light; --bg:#edf5ff; --bg-2:#f9fbff; --ink:#10213c; --muted:#61718a; --glass:rgba(255,255,255,.68); --glass-strong:rgba(255,255,255,.88); --stroke:rgba(255,255,255,.9); --hairline:rgba(32,76,128,.12); --blue:#0868e8; --blue-deep:#0649ab; --green:#149c65; --orange:#e88618; --red:#d6414b; --shadow:0 18px 48px rgba(39,78,122,.16),0 2px 8px rgba(31,55,88,.08); }
[data-theme="dark"] { color-scheme: dark; --bg:#06101d; --bg-2:#0a1727; --ink:#f5f8ff; --muted:#9aa9bd; --glass:rgba(16,30,48,.64); --glass-strong:rgba(15,29,46,.9); --stroke:rgba(255,255,255,.13); --hairline:rgba(255,255,255,.09); --blue:#3694ff; --blue-deep:#0b5ec8; --green:#36ce8c; --orange:#ffad4f; --red:#ff6670; --shadow:0 22px 58px rgba(0,0,0,.36),inset 0 1px rgba(255,255,255,.06); }

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(70% 50% at 8% -5%, rgba(56, 149, 255, .28), transparent 70%),
    radial-gradient(64% 45% at 102% 30%, rgba(61, 211, 171, .17), transparent 72%),
    linear-gradient(150deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before, body::after { content:""; position:fixed; z-index:-1; width:260px; height:260px; border-radius:50%; filter:blur(70px); opacity:.32; pointer-events:none; }
body::before { top:18%; left:-150px; background:#3a9cff; }
body::after { right:-170px; bottom:10%; background:#49d8a3; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 3px; }
a { color: inherit; }

.app-shell { width: min(100%, 560px); min-height:100dvh; margin:0 auto; padding:var(--safe-top) 17px calc(98px + var(--safe-bottom)); position:relative; }
.app-shell.no-nav { padding-bottom:var(--safe-bottom); display:grid; place-items:center; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:4px 2px 20px; min-height:48px; }
.topbar h1 { margin:0; font-size:1.15rem; letter-spacing:-.02em; text-align:center; }
.eyebrow { margin:0 0 4px; color:var(--blue); font-size:.74rem; font-weight:750; letter-spacing:.11em; text-transform:uppercase; }
.page-title { margin:0 0 5px; font-size:clamp(1.85rem, 7vw, 2.3rem); line-height:1.04; letter-spacing:-.045em; }
.page-subtitle { color:var(--muted); margin:0; line-height:1.45; }

.glass {
  background:var(--glass);
  border:1px solid var(--stroke);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass, .bottom-nav, .sheet { -webkit-backdrop-filter:blur(24px) saturate(145%); backdrop-filter:blur(24px) saturate(145%); }
}
.card { padding:20px; }
.stack { display:grid; gap:14px; }
.section { margin-top:24px; }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:12px; margin:0 4px 12px; }
.section-heading h2 { margin:0; font-size:1.12rem; letter-spacing:-.025em; }
.section-heading span { color:var(--muted); font-size:.84rem; }

.icon-button, .back-button { width:46px; height:46px; border:1px solid var(--stroke); border-radius:50%; color:var(--ink); background:var(--glass); display:grid; place-items:center; box-shadow:0 8px 22px rgba(22,52,90,.1); cursor:pointer; text-decoration:none; font-size:1.2rem; }
.header-placeholder { width:46px; }
.primary, .secondary, .danger, .soft-button { border:0; border-radius:16px; min-height:54px; padding:0 20px; font-weight:720; cursor:pointer; transition:transform .18s ease, filter .18s ease, opacity .18s ease; }
.primary { color:#fff; background:linear-gradient(145deg, #258bff, var(--blue-deep)); box-shadow:0 12px 24px rgba(3,93,211,.28); }
.primary.green { background:linear-gradient(145deg, #2dca88, #07834e); box-shadow:0 12px 24px rgba(7,131,78,.24); }
.secondary { color:var(--ink); background:color-mix(in srgb, var(--glass-strong) 88%, transparent); border:1px solid var(--stroke); }
.danger { color:#fff; background:linear-gradient(145deg, #ff6570, #c72f3c); }
.soft-button { color:var(--blue); background:color-mix(in srgb, var(--blue) 10%, var(--glass)); border:1px solid color-mix(in srgb, var(--blue) 22%, transparent); }
.primary:active, .secondary:active, .danger:active, .soft-button:active { transform:scale(.985); }
button:disabled { cursor:not-allowed; opacity:.42; filter:grayscale(.25); box-shadow:none; }
.full { width:100%; }

.login { width:100%; padding:clamp(24px, 7vw, 36px); border-radius:36px; }
.brand-lockup { display:flex; align-items:center; gap:15px; margin-bottom:30px; }
.brand-mark { width:58px; height:58px; border-radius:18px; display:grid; place-items:center; color:#fff; font-weight:850; letter-spacing:-.05em; background:linear-gradient(145deg,#3a9cff,#0344a9); box-shadow:0 15px 32px rgba(3,82,181,.28); }
.brand-lockup strong { display:block; font-size:1.18rem; }
.brand-lockup small { display:block; color:var(--muted); margin-top:3px; }
.login h1 { margin:0 0 7px; font-size:2rem; letter-spacing:-.04em; }
.login > p { color:var(--muted); margin:0 0 26px; }
.field { display:grid; gap:8px; margin-bottom:16px; min-width:0; }
.field label { font-size:.86rem; font-weight:690; margin-left:3px; }
.control { min-width:0; min-height:55px; border:1px solid var(--hairline); border-radius:17px; background:color-mix(in srgb,var(--glass-strong) 78%, transparent); color:var(--ink); padding:0 16px; width:100%; }
textarea.control { min-height:110px; padding-top:15px; resize:vertical; }
.pin-wrap { position:relative; }
.pin-wrap .control { padding-right:58px; }
.pin-toggle { position:absolute; right:5px; top:5px; width:44px; height:44px; min-height:44px; border:0; border-radius:13px; color:var(--blue); background:transparent; cursor:pointer; }
.form-message { min-height:22px; margin:10px 2px; color:var(--red); font-size:.87rem; line-height:1.35; }
.privacy-note { display:flex; gap:9px; margin:20px 3px 0; color:var(--muted); font-size:.76rem; line-height:1.4; }
.spinner { width:18px; height:18px; display:inline-block; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; border-radius:50%; animation:spin .75s linear infinite; vertical-align:middle; margin-right:8px; }

.employee-card { padding:19px; display:grid; grid-template-columns:auto 1fr; gap:14px; align-items:center; }
.avatar { width:58px; height:58px; border-radius:20px; display:grid; place-items:center; background:linear-gradient(145deg,color-mix(in srgb,var(--blue) 76%,#fff),var(--blue-deep)); color:#fff; font-weight:800; box-shadow:0 10px 24px rgba(9,96,205,.25); }
.employee-card h2 { margin:0 0 3px; font-size:1.22rem; letter-spacing:-.025em; }
.employee-card p { margin:0; color:var(--muted); font-size:.87rem; }
.employee-meta { grid-column:1/-1; border-top:1px solid var(--hairline); padding-top:14px; display:flex; justify-content:space-between; align-items:center; gap:10px; }
.live-time strong { display:block; font-size:1.04rem; }
.live-time small { color:var(--muted); font-size:.76rem; }
.network-pill, .status-pill { min-height:30px; display:inline-flex; align-items:center; gap:7px; padding:6px 10px; border-radius:999px; font-size:.74rem; font-weight:720; line-height:1.15; }
.network-pill.connected { color:var(--green); background:color-mix(in srgb,var(--green) 12%,transparent); }
.network-pill.restricted { color:var(--red); background:color-mix(in srgb,var(--red) 10%,transparent); max-width:220px; }
.dot { width:7px; height:7px; border-radius:50%; background:currentColor; flex:0 0 auto; }

.attendance-hero { position:relative; overflow:hidden; padding:24px; min-height:258px; }
.attendance-hero::after { content:""; position:absolute; width:180px; height:180px; right:-55px; top:-45px; border-radius:50%; background:color-mix(in srgb,var(--blue) 20%,transparent); filter:blur(4px); }
.state-label { position:relative; z-index:1; color:var(--muted); font-size:.78rem; font-weight:700; letter-spacing:.09em; text-transform:uppercase; }
.attendance-hero h2 { position:relative; z-index:1; margin:9px 0 5px; font-size:1.65rem; letter-spacing:-.04em; }
.attendance-hero > p { position:relative; z-index:1; margin:0; color:var(--muted); }
.action-grid { position:relative; z-index:1; display:grid; gap:10px; margin-top:24px; }
.action-content { display:flex; align-items:center; justify-content:center; gap:11px; }
.action-icon { width:32px; height:32px; border-radius:11px; display:grid; place-items:center; background:rgba(255,255,255,.17); }
.last-event { margin-top:13px; padding:14px 16px; display:flex; justify-content:space-between; gap:14px; align-items:center; color:var(--muted); font-size:.82rem; }
.last-event strong { color:var(--ink); display:block; margin-bottom:2px; }

.quick-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.quick-link { min-height:112px; padding:17px; text-decoration:none; display:flex; flex-direction:column; justify-content:space-between; transition:transform .2s ease; }
.quick-link:active { transform:scale(.98); }
.quick-icon { width:38px; height:38px; border-radius:13px; display:grid; place-items:center; color:var(--blue); background:color-mix(in srgb,var(--blue) 10%,transparent); }
.quick-link strong { font-size:.93rem; }

.bottom-nav { position:fixed; z-index:20; left:50%; transform:translateX(-50%); bottom:max(8px, env(safe-area-inset-bottom)); width:min(calc(100% - 22px), 526px); min-height:72px; display:grid; grid-template-columns:repeat(4,1fr); padding:7px; border:1px solid var(--stroke); border-radius:24px; background:color-mix(in srgb,var(--glass-strong) 88%,transparent); box-shadow:0 18px 44px rgba(10,33,61,.22); }
.nav-item { min-height:58px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; color:var(--muted); border-radius:18px; text-decoration:none; font-size:.68rem; font-weight:650; }
.nav-item .nav-icon { font-size:1.15rem; line-height:1; }
.nav-item.active { color:var(--blue); background:color-mix(in srgb,var(--blue) 11%,transparent); }

.filter-row { display:flex; gap:8px; overflow:auto; padding:2px 2px 7px; scrollbar-width:none; }
.filter-row::-webkit-scrollbar { display:none; }
.filter-chip { min-height:44px; flex:0 0 auto; border:1px solid var(--stroke); border-radius:999px; padding:0 15px; color:var(--muted); background:var(--glass); cursor:pointer; }
.filter-chip.active { color:#fff; background:var(--blue); border-color:transparent; }
.absence-card { display:block; padding:18px; text-decoration:none; }
.absence-top { display:flex; justify-content:space-between; gap:12px; align-items:start; }
.absence-card h3 { margin:0 0 5px; font-size:1rem; }
.absence-card p { margin:0; color:var(--muted); font-size:.84rem; line-height:1.4; }
.absence-note { margin-top:13px!important; padding-top:12px; border-top:1px solid var(--hairline); overflow-wrap:anywhere; }
.status-pill.pending { color:var(--orange); background:color-mix(in srgb,var(--orange) 12%,transparent); }
.status-pill.approved { color:var(--green); background:color-mix(in srgb,var(--green) 12%,transparent); }
.status-pill.rejected { color:var(--red); background:color-mix(in srgb,var(--red) 10%,transparent); }
.empty-state { text-align:center; padding:36px 24px; }
.empty-icon { width:58px; height:58px; margin:0 auto 14px; border-radius:20px; display:grid; place-items:center; color:var(--blue); background:color-mix(in srgb,var(--blue) 10%,transparent); font-size:1.5rem; }
.empty-state h3 { margin:0 0 7px; }
.empty-state p { margin:0; color:var(--muted); }
.fab { position:fixed; z-index:15; right:max(22px, calc((100vw - 560px)/2 + 22px)); bottom:calc(93px + var(--safe-bottom)); width:58px; height:58px; border:0; border-radius:19px; color:#fff; background:linear-gradient(145deg,#3297ff,var(--blue-deep)); box-shadow:0 14px 28px rgba(4,83,184,.3); font-size:1.65rem; cursor:pointer; text-decoration:none; display:grid; place-items:center; }

.attachment-box { border:1px dashed color-mix(in srgb,var(--blue) 34%,var(--hairline)); border-radius:18px; padding:17px; background:color-mix(in srgb,var(--blue) 5%,transparent); }
.attachment-box label { min-height:48px; display:flex; align-items:center; gap:11px; cursor:pointer; font-weight:680; }
.attachment-box input { position:absolute; width:1px; height:1px; opacity:0; }
.attachment-help, .sickness-note { color:var(--muted); font-size:.78rem; line-height:1.45; margin:7px 0 0; }
.attachment-unavailable { color:var(--orange); font-weight:650; }
.sickness-note { display:none; padding:12px 14px; border-radius:14px; color:var(--blue); background:color-mix(in srgb,var(--blue) 8%,transparent); }
.sickness-note.visible { display:block; }

.detail-list { margin:0; display:grid; }
.detail-row { display:grid; grid-template-columns:1fr minmax(0,1.4fr); gap:14px; padding:14px 0; border-bottom:1px solid var(--hairline); align-items:start; }
.detail-row:last-child { border:0; }
.detail-row dt { color:var(--muted); }
.detail-row dd { margin:0; text-align:right; font-weight:650; overflow-wrap:anywhere; }
.decision-note { margin-top:16px; padding:15px; border-radius:16px; background:color-mix(in srgb,var(--blue) 7%,transparent); }

.history-group { margin-top:22px; }
.history-group h2 { margin:0 4px 10px; font-size:.92rem; color:var(--muted); }
.timeline { position:relative; padding:4px 0; }
.timeline::before { content:""; position:absolute; left:28px; top:24px; bottom:24px; width:2px; background:var(--hairline); }
.event-row { position:relative; display:grid; grid-template-columns:40px 1fr auto; gap:12px; align-items:center; padding:13px 14px; }
.event-icon { width:30px; height:30px; z-index:1; border-radius:50%; display:grid; place-items:center; color:#fff; background:var(--green); border:4px solid color-mix(in srgb,var(--glass-strong) 90%,transparent); }
.event-icon.out { background:var(--blue); }
.event-row strong { display:block; font-size:.9rem; }
.event-row small { color:var(--muted); }
.event-time { font-weight:750; }
.summary-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:12px; }
.summary-item { padding:14px; border-radius:16px; background:color-mix(in srgb,var(--glass-strong) 70%,transparent); }
.summary-item small { display:block; color:var(--muted); margin-bottom:4px; }

.profile-hero { text-align:center; padding:27px 20px; }
.profile-hero .avatar { margin:0 auto 13px; width:72px; height:72px; border-radius:24px; font-size:1.25rem; }
.profile-hero h2 { margin:0 0 4px; }
.profile-hero p { margin:0; color:var(--muted); }
.security-row { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.security-row h3 { margin:0 0 4px; font-size:.96rem; }
.security-row p { margin:0; color:var(--muted); font-size:.78rem; }

.overlay { position:fixed; z-index:50; inset:0; display:flex; align-items:flex-end; justify-content:center; padding:18px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)); background:rgba(2,10,21,.38); animation:fade .2s ease; }
.sheet { width:min(100%, 540px); padding:25px; border:1px solid var(--stroke); border-radius:32px; background:var(--glass-strong); box-shadow:0 30px 70px rgba(0,0,0,.32); animation:rise .26s cubic-bezier(.2,.8,.2,1); }
.success-orb, .denied-orb { width:70px; height:70px; margin:0 auto 18px; border-radius:24px; display:grid; place-items:center; color:#fff; font-size:2rem; font-weight:800; background:linear-gradient(145deg,#3be19b,#099057); box-shadow:0 15px 32px rgba(9,144,87,.28); }
.denied-orb { background:linear-gradient(145deg,#ff8a64,#d23d46); box-shadow:0 15px 32px rgba(210,61,70,.23); }
.sheet h2 { text-align:center; margin:0 0 7px; font-size:1.45rem; }
.sheet > p { text-align:center; color:var(--muted); margin:0 0 20px; line-height:1.45; }
.sheet-actions { display:grid; gap:9px; margin-top:18px; }

.toast { position:fixed; z-index:70; left:50%; transform:translateX(-50%); top:calc(var(--safe-top) + 10px); width:min(calc(100% - 30px),500px); padding:14px 16px; display:flex; gap:12px; border-radius:17px; background:var(--glass-strong); border:1px solid var(--stroke); box-shadow:var(--shadow); animation:drop .22s ease; }
.toast strong { display:block; font-size:.88rem; }
.toast span { display:block; color:var(--muted); font-size:.77rem; margin-top:2px; }
.skeleton { min-height:96px; border-radius:20px; background:linear-gradient(100deg, color-mix(in srgb,var(--glass) 80%,transparent) 20%, color-mix(in srgb,var(--glass-strong) 95%,transparent) 45%, color-mix(in srgb,var(--glass) 80%,transparent) 70%); background-size:240% 100%; animation:shimmer 1.3s linear infinite; }

@keyframes spin { to { transform:rotate(360deg); } }
@keyframes fade { from { opacity:0; } }
@keyframes rise { from { transform:translateY(24px); opacity:.5; } }
@keyframes drop { from { transform:translate(-50%,-12px); opacity:0; } }
@keyframes shimmer { to { background-position:-240% 0; } }

@media (max-width:360px) {
  .app-shell { padding-left:12px; padding-right:12px; }
  .card { padding:17px; }
  .quick-grid { grid-template-columns:1fr; }
  .employee-meta { align-items:start; flex-direction:column; }
  .network-pill.restricted { max-width:none; }
}
@media (min-width:720px) {
  .app-shell { padding-top:max(28px, env(safe-area-inset-top)); }
  .overlay { align-items:center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.01ms!important; animation-iteration-count:1!important; scroll-behavior:auto!important; transition-duration:.01ms!important; }
}
@media (prefers-contrast: more) {
  :root { --stroke:currentColor; --hairline:color-mix(in srgb,currentColor 35%,transparent); }
  .glass, .bottom-nav, .sheet { -webkit-backdrop-filter:none; backdrop-filter:none; }
}
