/* 1) Design tokens */
:root{
	--primary:#16A34A; --primary-600:#16a34a; --primary-700:#15803d; --primary-dark:#128a3e; --primary-50:#ecfdf5;
	--bg:#ffffff; --bg-elev:#ffffff; --surface:#f8fafc; --text:#0f172a; --muted:#64748b; --border:#e5e7eb;
	--bg-card:#ffffff; --bg-secondary:#f1f5f9; --bg-hover:#f8fafc;
	--border-color:#e5e7eb; --border-light:#f1f5f9;
	--text-primary:#0f172a; --text-secondary:#64748b;
	--success:#16a34a; --warning:#f59e0b; --danger:#dc2626; --info:#0ea5e9;
	--radius:12px; --radius-sm:8px; --radius-lg:16px;
	--shadow-sm:0 1px 2px rgba(0,0,0,.06);
	--shadow:0 4px 12px rgba(0,0,0,.08);
	--shadow-lg:0 10px 30px rgba(0,0,0,.12);
	--focus:#3b82f6;
	--space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-6:24px; --space-8:32px;
}

@media (prefers-color-scheme: dark){
	:root{
		--bg:#0b1220; --bg-elev:#0f172a; --surface:#0b1325; --text:#e5e7eb; --muted:#9ca3af; --border:#1f2937;
		--bg-card:#0f172a; --bg-secondary:#0b1325; --bg-hover:#1e293b;
		--border-color:#1f2937; --border-light:#1e293b;
		--text-primary:#e5e7eb; --text-secondary:#9ca3af;
		--primary-50:#052e16; --shadow:0 4px 12px rgba(0,0,0,.5); --shadow-lg:0 10px 30px rgba(0,0,0,.6);
	}
}

/* Manual theme overrides — these MUST win over @media (prefers-color-scheme) */
[data-theme="light"]{
	--bg:#ffffff; --bg-elev:#ffffff; --surface:#f8fafc; --text:#0f172a; --muted:#64748b; --border:#e5e7eb;
	--bg-card:#ffffff; --bg-secondary:#f1f5f9; --bg-hover:#f8fafc;
	--border-color:#e5e7eb; --border-light:#f1f5f9;
	--text-primary:#0f172a; --text-secondary:#64748b;
	--primary-50:#ecfdf5;
	--shadow-sm:0 1px 2px rgba(0,0,0,.06); --shadow:0 4px 12px rgba(0,0,0,.08); --shadow-lg:0 10px 30px rgba(0,0,0,.12);
}
[data-theme="dark"]{
	--bg:#0b1220; --bg-elev:#0f172a; --surface:#0b1325; --text:#e5e7eb; --muted:#9ca3af; --border:#1f2937;
	--bg-card:#0f172a; --bg-secondary:#0b1325; --bg-hover:#1e293b;
	--border-color:#1f2937; --border-light:#1e293b;
	--text-primary:#e5e7eb; --text-secondary:#9ca3af;
	--primary-50:#052e16;
	--shadow:0 4px 12px rgba(0,0,0,.5); --shadow-lg:0 10px 30px rgba(0,0,0,.6);
}

/* 2) Base reset and typography */
*{ box-sizing:border-box }
html, body { height:100% }
body{ font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; margin:0; min-height:100vh; background:
	radial-gradient(1200px 600px at 10% -10%, rgba(22,163,74,.12), transparent 55%),
	radial-gradient(900px 500px at 110% 10%, rgba(14,165,233,.10), transparent 60%),
	linear-gradient(180deg, rgba(2,6,23,.02), rgba(2,6,23,0)),
	var(--bg);
	background-attachment: fixed, fixed, fixed, scroll;
	color:var(--text); line-height:1.5; -webkit-font-smoothing:antialiased; }
	/* Safe area padding for iOS PWAs */
	body{ padding-bottom: env(safe-area-inset-bottom); }
img{ max-width:100%; height:auto; display:block }
a{ color:var(--primary-700); text-decoration:none }
a:hover{ text-decoration:underline }
h1,h2,h3{ letter-spacing:-.01em; margin:0 0 var(--space-4) }
h1{ font-size:clamp(22px, 2.2vw, 28px); }
h2{ font-size:clamp(18px, 1.8vw, 22px); }
h3{ font-size:clamp(16px, 1.6vw, 18px); }
.muted{ color:var(--muted) }

/* 3) Layout */
.container{ width:100%; max-width:960px; margin:0 auto; padding:var(--space-4); }
.grid{ display:grid; gap:var(--space-4) }
@media (min-width: 900px){ .grid-2{ grid-template-columns:1fr 1fr } }

/* 4) Header/Nav — Native mobile app style */
header{ position:sticky; top:0; z-index:50; display:grid; grid-template-columns:48px 1fr auto; align-items:center; padding:0 8px; height:56px; border-bottom:1px solid var(--border); background:var(--bg-elev); -webkit-backdrop-filter:saturate(140%) blur(12px); backdrop-filter:saturate(140%) blur(12px); }
header strong{ font-weight:700; font-size:17px; letter-spacing:-0.2px; }
header nav{ display:flex; align-items:center; gap:4px; }
header nav a{ padding:8px 12px; border-radius:8px; font-size:14px; font-weight:500; transition:background 0.2s; }
header nav a:hover{ background:var(--surface); text-decoration:none; }
.header-left{ display:flex; align-items:center; justify-content:flex-start; }
.header-center{ display:flex; align-items:center; justify-content:center; text-align:center; }
.header-right{ display:flex; align-items:center; justify-content:flex-end; gap:2px; }
.header-brand{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.header-actions{ display:flex; align-items:center; gap:8px; }
.icon-btn{ padding:10px; border-radius:50%; background:transparent; border:none; cursor:pointer; transition:background 0.15s; position:relative; -webkit-tap-highlight-color:transparent; }
.icon-btn:hover{ background:var(--surface); }
.icon-btn:active{ background:color-mix(in oklab, var(--surface) 80%, var(--border)); }
.header-user{ display:flex; align-items:center; gap:8px; }
.header-user .avatar{ width:24px; height:24px; border-radius:50%; background:var(--surface); border:1px solid var(--border); }
.theme-toggle{ margin-left:0; font-size:13px; padding:8px 12px; }

/* ── 4b) Admin Navbar ── */
body.admin-page header{
  display:flex; grid-template-columns:none; height:auto; min-height:56px; padding:0 20px;
  justify-content:space-between; flex-wrap:wrap; gap:0;
}
body.admin-page .admin-nav-left{
  display:flex; align-items:center; gap:10px; padding:10px 0; flex-shrink:0;
}
body.admin-page .admin-nav-left img{ width:32px; height:32px; border-radius:8px; }
body.admin-page .admin-nav-left strong{ font-size:16px; font-weight:700; color:var(--text); letter-spacing:-.2px; white-space:nowrap; }
body.admin-page .admin-nav-links{
  display:flex; align-items:center; gap:2px; flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch;
}
body.admin-page .admin-nav-links a{
  padding:8px 14px; border-radius:8px; font-size:13px; font-weight:500; color:var(--muted);
  text-decoration:none; white-space:nowrap; transition:all .15s; position:relative;
}
body.admin-page .admin-nav-links a:hover{ background:var(--surface); color:var(--text); }
body.admin-page .admin-nav-links a.active{
  color:var(--primary); font-weight:600;
}
body.admin-page .admin-nav-links a.active::after{
  content:''; position:absolute; bottom:0; left:14px; right:14px; height:2.5px;
  background:var(--primary); border-radius:2px;
}
body.admin-page .admin-nav-right{
  display:flex; align-items:center; gap:6px; padding:10px 0; flex-shrink:0;
}
body.admin-page .admin-nav-right .btn{ font-size:13px; padding:6px 12px; }
body.admin-page .admin-notif-btn{
  position:relative; background:none; border:none; cursor:pointer; padding:8px;
  border-radius:8px; color:var(--muted); transition:all .15s;
}
body.admin-page .admin-notif-btn:hover{ background:var(--surface); color:var(--text); }
body.admin-page .admin-notif-btn .notif-dot{
  position:absolute; top:4px; right:2px; min-width:8px; height:auto; min-height:8px;
  border-radius:10px; padding:0 4px; background:#dc3545; border:2px solid var(--bg-elev);
  display:none; font-size:10px; font-weight:700; color:#fff; text-align:center; line-height:14px;
}
body.admin-page .admin-notif-btn .notif-dot.show{ display:block; }
body.admin-page .admin-notif-btn .notif-dot:empty{ padding:0; width:8px; min-width:8px; height:8px; min-height:8px; }
/* ── Admin Sidebar Layout (replaces top nav for admin pages) ── */
body.admin-page { display:flex; align-items:flex-start; }
body.admin-page > main,
body.admin-page > .admin-content-wrap { flex:1; min-width:0; min-height:100vh; margin-left:260px; }

/* Sidebar container */
.admin-sidebar {
  width:260px; flex-shrink:0;
  height:100vh; position:fixed; left:0; top:0;
  overflow:hidden;
  display:flex; flex-direction:column;
  background:linear-gradient(180deg,#166534 0%,#14532d 100%);
  border-right:1px solid rgba(255,255,255,.07);
  z-index:50;
}

/* Brand */
.sb-brand { display:flex; align-items:center; gap:10px; padding:20px 16px 16px; border-bottom:1px solid rgba(255,255,255,.1); flex-shrink:0; }
.sb-logo { width:36px; height:36px; border-radius:10px; flex-shrink:0; }
.sb-brand-info { flex:1; min-width:0; }
.sb-brand-name { display:block; font-size:15px; font-weight:700; color:#fff; letter-spacing:-.2px; white-space:nowrap; }
.sb-brand-sub { display:block; font-size:10px; color:rgba(255,255,255,.5); text-transform:uppercase; letter-spacing:.1em; font-weight:600; margin-top:1px; }
.sb-close-btn { display:none; background:none; border:none; cursor:pointer; padding:6px; border-radius:8px; color:rgba(255,255,255,.65); transition:all .15s; flex-shrink:0; }
.sb-close-btn:hover { background:rgba(255,255,255,.1); color:#fff; }

/* Nav */
.sb-nav { flex:1; display:flex; flex-direction:column; padding:10px 0; gap:1px; overflow:visible; }
.sb-section { padding:8px 20px 3px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:rgba(255,255,255,.38); }
.sb-link {
  display:flex; align-items:center; gap:10px;
  padding:10px 14px; margin:0 8px; border-radius:10px;
  font-size:13.5px; font-weight:500; color:rgba(255,255,255,.75);
  text-decoration:none !important; cursor:pointer; transition:all .15s ease;
  white-space:nowrap; position:relative;
}
.sb-link:hover { background:rgba(255,255,255,.10); color:#fff; text-decoration:none !important; }
.sb-link.active { background:rgba(255,255,255,.15); color:#fff; font-weight:600; }
.sb-link.active::before {
  content:''; position:absolute; left:0; top:50%; transform:translateY(-50%);
  width:3px; height:60%; background:#4ade80; border-radius:0 2px 2px 0;
}
.sb-icon { width:20px; height:20px; flex-shrink:0; display:flex; align-items:center; justify-content:center; opacity:.85; }
.sb-link.active .sb-icon, .sb-link:hover .sb-icon { opacity:1; }
.sb-divider { height:1px; background:rgba(255,255,255,.1); margin:6px 16px; }

/* Footer */
.sb-footer { border-top:1px solid rgba(255,255,255,.1); padding:10px 14px; flex-shrink:0; display:flex; flex-direction:column; gap:6px; }
.sb-footer-actions { display:flex; align-items:center; gap:6px; }
.sb-icon-btn {
  width:36px; height:36px; border-radius:8px;
  background:rgba(255,255,255,.08); border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  color:rgba(255,255,255,.75); transition:all .15s; position:relative; flex-shrink:0;
}
.sb-icon-btn:hover { background:rgba(255,255,255,.16); color:#fff; }
.sb-icon-btn .notif-dot {
  position:absolute; top:4px; right:4px; min-width:8px; height:auto; min-height:8px;
  border-radius:10px; padding:0 3px; background:#dc3545; border:2px solid #14532d;
  display:none; font-size:9px; font-weight:700; color:#fff; text-align:center; line-height:13px;
}
.sb-icon-btn .notif-dot.show { display:block; }
.sb-icon-btn .notif-dot:empty { padding:0; width:8px; min-width:8px; height:8px; min-height:8px; }
.sb-logout-btn {
  flex:1; display:flex; align-items:center; justify-content:center; gap:8px;
  padding:8px 10px; border-radius:8px;
  background:rgba(255,255,255,.08); border:none; cursor:pointer;
  color:rgba(255,255,255,.75); font-size:13px; font-weight:500; transition:all .15s;
}
.sb-logout-btn:hover { background:rgba(220,38,38,.3); color:#fff; }

/* Mobile top bar (hidden on desktop) */
.admin-mobile-bar {
  display:none; position:sticky; top:0; z-index:100; height:56px;
  background:linear-gradient(90deg,#166534,#15803d);
  border-bottom:1px solid rgba(255,255,255,.12);
  align-items:center; padding:0 16px; gap:10px;
}
.sb-toggle-btn { background:none; border:none; cursor:pointer; padding:8px; border-radius:8px; color:#fff; display:flex; align-items:center; justify-content:center; transition:background .15s; }
.sb-toggle-btn:hover { background:rgba(255,255,255,.12); }
.sb-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:140; cursor:pointer; }
.sb-overlay.show { display:block; }

/* Mobile responsive */
@media (max-width:900px){
  body.admin-page { display:block; }
  body.admin-page > main,
  body.admin-page > .admin-content-wrap { margin-left:0; }
  .admin-mobile-bar { display:flex; }
  .admin-sidebar {
    position:fixed; top:0; left:-280px; height:100vh; z-index:150;
    transition:left .28s ease; box-shadow:4px 0 24px rgba(0,0,0,.35);
    width:260px;
  }
  .admin-sidebar.sb-open { left:0; }
  .sb-close-btn { display:flex; align-items:center; justify-content:center; }
  body.admin-page > main { min-height:calc(100vh - 56px); }
}

/* Legacy: keep .admin-hamburger harmless */
.admin-hamburger{ display:none !important; }

/* Tab badge for notification bell */
.tab-badge{ position:absolute; top:4px; right:4px; background:#dc3545; color:white; font-size:10px; font-weight:700; padding:2px 5px; border-radius:10px; min-width:18px; text-align:center; line-height:1.2; opacity:0; visibility:hidden; transition:all 0.2s; }
.tab-badge.show{ opacity:1; visibility:visible; }

/* Responsive helpers */
.hide-sm{ display:flex !important; }
@media (max-width: 768px){ .hide-sm{ display:none !important; } }

/* Footer */
footer:not(.bottom-nav){ margin-top:40px; padding:16px; color:var(--muted); border-top:1px solid var(--border); font-size:12px; text-align:center }

/* Safe area + bottom nav spacing on mobile */
body.staff-page{ padding-bottom:calc(64px + env(safe-area-inset-bottom)); }

/* Scroll to top */
.scroll-top{ position:fixed; right:16px; bottom:72px; width:40px; height:40px; border-radius:50%; border:1px solid var(--border); background:var(--bg-elev); box-shadow:var(--shadow); display:none; align-items:center; justify-content:center }
.scroll-top.show{ display:flex }
@media (max-width: 700px){ .scroll-top{ bottom:86px } }

/* Screen reader only */
.sr-only{ position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0 }
.hidden{ display:none !important }


/* 5) Buttons */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; background:var(--primary); color:#fff; padding:14px 18px; border:1px solid transparent; border-radius:var(--radius); font-size:16px; font-weight:600; box-shadow:var(--shadow); min-height:44px; cursor:pointer; transition:transform .04s ease, box-shadow .2s ease, background-color .2s ease; }
.btn:hover{ box-shadow:var(--shadow-lg) }
.btn:active{ transform:translateY(1px) }
.btn:disabled{ opacity:.6; cursor:not-allowed }
.btn-secondary{ background:var(--surface); color:var(--text); border-color:var(--border) }
.btn-ghost{ background:transparent; color:var(--text); border-color:var(--border) }
.btn-danger{ background:var(--danger) }
.btn-outline{ background:transparent; color:var(--primary-700); border-color:var(--primary-700) }
.btn .spinner{ width:16px; height:16px; border:2px solid rgba(255,255,255,.6); border-top-color:#fff; border-radius:50%; animation:spin 1s linear infinite }
@keyframes spin{ to{ transform:rotate(360deg) } }
.spin{ animation:spin 1s linear infinite }

/* Moon glow animation for night mode */
@keyframes moonGlow {
  0%, 100% { 
    opacity: 0.9; 
    transform: scale(1); 
    filter: brightness(1) drop-shadow(0 0 20px rgba(147, 197, 253, 0.4));
  }
  50% { 
    opacity: 1; 
    transform: scale(1.05); 
    filter: brightness(1.1) drop-shadow(0 0 30px rgba(147, 197, 253, 0.6));
  }
}

.btn-xs{ padding:6px 8px; min-height:28px; font-size:12px; border-radius:8px; }
.btn-sm{ padding:8px 12px; min-height:32px; font-size:13px; border-radius:8px; }
.btn .icon{ width:18px; height:18px; display:inline-block }
.btn-block{ width:100% }
body.staff-page .btn{ min-height:50px }

/* Primary gradient button variant */
.btn--gradient{ background:linear-gradient(180deg, color-mix(in oklab, var(--primary) 92%, #fff), var(--primary-700)); border:0 }
.btn--gradient:hover{ filter:brightness(1.03); box-shadow:var(--shadow-lg) }
.btn--gradient:focus-visible{ box-shadow:0 0 0 3px color-mix(in oklab, var(--primary) 25%, transparent), var(--shadow-lg) }
.btn--gradient:active{ transform:translateY(1px); filter:brightness(.98) }

/* Floating Action Button — disabled/removed */
.fab{ display:none !important }

/* Success animation for tap button */
.pulse-success{ position:relative; animation:pulseGlow .6s ease-out; }
.pulse-success::after{ content:""; position:absolute; inset:-4px; border-radius:inherit; border:2px solid rgba(22,163,74,.6); animation:ringPop .6s ease-out }
@keyframes pulseGlow{ 0%{ box-shadow:0 0 0 0 rgba(22,163,74,.6) } 100%{ box-shadow:0 0 0 12px rgba(22,163,74,0) } }
@keyframes ringPop{ 0%{ opacity:1; transform:scale(1) } 100%{ opacity:0; transform:scale(1.15) } }

/* Tiny success pop label */
.success-pop{ position:fixed; right:84px; bottom:30px; background:#111; color:#fff; padding:6px 10px; border-radius:8px; font-size:12px; box-shadow:var(--shadow-lg); opacity:0; transform:translateY(8px); animation:popIn .8s ease forwards }
@keyframes popIn{ to{ opacity:1; transform:translateY(0) } }

/* 6) Forms */
form{ display:grid; gap:var(--space-3) }
label{ display:grid; gap:6px; font-size:14px; color:var(--muted) }
input, select, textarea{ appearance:none; background:var(--bg); color:var(--text); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 12px; font-size:16px; outline:none; transition:border-color .15s ease, box-shadow .2s ease; }
input:focus, select:focus, textarea:focus{ border-color:var(--focus); box-shadow:0 0 0 3px color-mix(in oklab, var(--focus) 20%, transparent); }
input:invalid{ border-color:var(--danger) }
.form-hint{ font-size:12px; color:var(--muted) }
.form-row{ display:grid; gap:var(--space-3) }
@media (min-width: 900px){ .form-row{ grid-template-columns:1fr 1fr } }

/* 7) Cards & Elevation */
.card{ background:var(--bg-elev); border:1px solid var(--border); border-radius:var(--radius); padding:16px; margin:12px 0; box-shadow:var(--shadow); transition:transform .15s ease, box-shadow .15s ease }
.card + .card{ margin-top:10px }
.card:hover{ transform:translateY(-1px); box-shadow:var(--shadow-lg) }
.card .card-header{ font-weight:700; margin-bottom:8px }
/* Card accent strip */
.card.accent{ position:relative }
.card.accent::before{ content:""; position:absolute; left:-1px; top:-1px; bottom:-1px; width:4px; background:var(--primary); border-radius:4px 0 0 4px }

/* 8) Badges */
.badge{ display:inline-block; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:600; border:1px solid transparent }
.badge.auto{ background:#DCFCE7; color:#065F46 }
.badge.pending{ background:#FEF3C7; color:#92400E }
.badge.incomplete{ background:#F3F4F6; color:#374151 }
.badge.success{ background:rgba(22,163,74,.12); color:#16a34a; border-color:rgba(22,163,74,.35) }
.badge.warn{ background:rgba(245,158,11,.14); color:#b45309; border-color:rgba(245,158,11,.35) }
.badge.danger{ background:rgba(220,38,38,.12); color:#b91c1c; border-color:rgba(220,38,38,.38) }
/* Role badges */
.badge.role-ci{ background:#DBEAFE; color:#1D4ED8; border-color:#93C5FD }
.badge.role-field{ background:#CFFAFE; color:#0E7490; border-color:#22D3EE }
.badge.role-co{ background:#D1FAE5; color:#065F46; border-color:#6EE7B7 }

/* 9) Tables */
.table-wrap{ width:100%; overflow:auto }
.table{ width:100%; border-collapse:separate; border-spacing:0; background:var(--bg-elev); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden }
.table th, .table td{ padding:12px 14px; border-bottom:1px solid var(--border); text-align:left }
.table th{ background:var(--surface); font-weight:700; color:var(--muted) }
.table tr:hover td{ background:color-mix(in oklab, var(--surface) 60%, transparent) }
/* Slightly smoother appear animation */
.appear{ animation:fadeSlideIn .22s ease-out both; will-change:opacity, transform }
@media (prefers-reduced-motion: reduce){ .appear{ animation:none } }

/* Staff-only responsive touches */
body.staff-page header{ padding:0 8px; height:56px; }
body.staff-page .header-brand img{ width:40px; height:40px }
@media (max-width: 560px){
	body.staff-page .row-head{ flex-wrap:wrap; gap:8px }
	body.staff-page .row-head > div:last-child{ width:100%; display:flex; justify-content:flex-start }
	body.staff-page .container{ padding:12px 12px }
}

/* 10) Toasts & Alerts */
.toast{ position:fixed; bottom:max(16px, env(safe-area-inset-bottom)); left:50%; z-index:9800; width:max-content; max-width:calc(100vw - 24px); box-sizing:border-box; transform:translateX(-50%); background:#111; color:#fff; padding:12px 16px; border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.28); display:none; opacity:0; text-align:center; line-height:1.4; overflow-wrap:anywhere; pointer-events:none; transition:opacity .2s ease, transform .2s ease }
.toast[style*="display: block"], .toast.show{ display:block; opacity:1; transform:translateX(-50%) translateY(0) }
.toast.success{ background:#111; color:#fff }
.toast.error{ background:#7f1d1d; color:#fff }
body.staff-page .toast{ bottom:calc(94px + env(safe-area-inset-bottom)); }
.attendance-verify-overlay{position:fixed;inset:0;z-index:10060;display:grid;place-items:center;padding:20px;background:rgba(5,15,26,.72);backdrop-filter:blur(5px)}
.attendance-verify-card{width:min(420px,100%);box-sizing:border-box;padding:24px;border-radius:8px;background:var(--bg-elev);border:1px solid var(--border);box-shadow:0 24px 60px rgba(0,0,0,.35);color:var(--text)}
.attendance-verify-card h3{margin:0 0 18px;font-size:20px;letter-spacing:0}
.attendance-verify-card p{margin:16px 0 0;color:var(--muted);font-size:13px;line-height:1.5}
.attendance-verify-row{display:flex;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid var(--border-light);font-size:14px}
.attendance-verify-row span{width:11px;height:11px;border-radius:50%;background:#94a3b8;flex:none}
.attendance-verify-row.ok span{background:#16a34a;box-shadow:0 0 0 4px rgba(22,163,74,.13)}
.attendance-verify-row.warn span{background:#d97706;box-shadow:0 0 0 4px rgba(217,119,6,.13)}
.attendance-verify-row.pending span{background:#0ea5e9;animation:verify-pulse 1s ease-in-out infinite}
@keyframes verify-pulse{50%{opacity:.35;transform:scale(.75)}}
.alert{ padding:12px 14px; border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--surface) }
.alert.success{ border-color:rgba(22,163,74,.35) }
.alert.warn{ border-color:rgba(245,158,11,.35) }
.alert.danger{ border-color:rgba(220,38,38,.35) }

/* 11) Dialog / Modal (green theme) */
dialog{ border:none; border-radius:var(--radius); padding:0; box-shadow:var(--shadow-lg); background:var(--bg-elev); color:var(--text); }
dialog::backdrop{ background:color-mix(in oklab, var(--primary) 20%, #0000) }
dialog form{ padding:16px; border:1px solid var(--border); border-radius:var(--radius); }
dialog h3{ margin:0 0 8px; font-size:18px; }
dialog .muted{ color:var(--muted) }
dialog .btn{ background:var(--primary-600) }
dialog .btn.btn-ghost{ background:transparent; color:var(--text) }
@media (max-width:480px){ dialog form{ min-width:0; width:min(92vw, 420px) } }
@media (max-width:380px){ dialog form{ padding:12px } }

/* 12) Progress */
.progress{ width:100%; height:10px; background:var(--surface); border:1px solid var(--border); border-radius:999px; overflow:hidden }
.progress .bar{ height:100%; width:0%; background:linear-gradient(90deg, var(--primary-50), var(--primary)); transition:width .4s ease }

/* 13) Chips and kbd */
.chip{ display:inline-flex; align-items:center; gap:6px; background:var(--surface); border:1px solid var(--border); color:var(--text); border-radius:999px; padding:6px 10px; font-size:12px }
.kbd{ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background:var(--surface); border:1px solid var(--border); border-bottom-width:2px; padding:0 6px; border-radius:6px; font-size:12px }

/* 14) Compact mode */
body.compact .card{ padding:12px; margin:8px 0 }
body.compact .btn{ padding:10px 12px; min-height:36px; font-size:14px }
body.compact .badge{ font-size:11px }

/* Skeletons */
.skeleton{ position:relative; overflow:hidden; background:linear-gradient(90deg, rgba(0,0,0,.06), rgba(0,0,0,.12), rgba(0,0,0,.06)); background-size:200% 100%; animation:sheen 1.2s ease-in-out infinite }
@media (prefers-reduced-motion: reduce){ .skeleton{ animation:none } }
@keyframes sheen{ to{ background-position:-200% 0 } }

/* 15) Modern Tap Section */
.tap-section{ 
  margin: 24px 0 32px; 
  padding: 0; 
  border: none; 
  background: transparent; 
  box-shadow: none; 
  animation: fadeSlideIn .3s ease-out both;
}

.tap-container{ 
  background: linear-gradient(135deg, 
    color-mix(in oklab, var(--primary) 8%, transparent) 0%, 
    color-mix(in oklab, var(--primary) 3%, transparent) 100%);
  border: 1px solid color-mix(in oklab, var(--primary) 15%, var(--border));
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tap-container::before{
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, color-mix(in oklab, var(--primary) 12%, transparent), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.6;
}

.tap-button-wrapper{ 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  justify-content: center; 
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.btn-tap{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, var(--primary), var(--primary-700));
  color: #fff;
  padding: 24px 48px;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 
    0 4px 14px color-mix(in oklab, var(--primary) 35%, transparent),
    0 1px 3px rgba(0,0,0,.12);
  cursor: pointer;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 200px;
}

.btn-tap:hover{
  transform: translateY(-2px);
  box-shadow: 
    0 8px 24px color-mix(in oklab, var(--primary) 45%, transparent),
    0 4px 8px rgba(0,0,0,.15);
}

.btn-tap:active{
  transform: translateY(0px);
  box-shadow: 
    0 2px 8px color-mix(in oklab, var(--primary) 30%, transparent);
}

.btn-tap:disabled{
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.tap-icon{
  width: 32px;
  height: 32px;
  stroke-width: 2.5;
  animation: rotate 20s linear infinite;
}

@keyframes rotate{
  to{ transform: rotate(360deg); }
}

.tap-label{
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.btn-clock-out{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #059669, #047857);
  color: #fff;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(5, 150, 105, .3);
  cursor: pointer;
  transition: all .2s ease;
}

.btn-clock-out:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, .4);
}

.btn-clock-out:active{
  transform: translateY(0);
}

.tap-status-row{
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  min-height: 28px;
}

.status-badge{
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.net-badge{
  font-size: 12px;
  background: rgba(5, 150, 105, .15);
  color: #059669;
  border-color: rgba(5, 150, 105, .25);
}

.device-info{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  min-height: 18px;
}

.tap-hint{
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  padding: 12px 16px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in oklab, var(--border) 50%, transparent);
  line-height: 1.6;
}

@media (max-width: 560px){
  .tap-container{ padding: 24px 16px; }
  .btn-tap{ 
    min-width: 180px;
    padding: 20px 40px; 
  }
  .tap-icon{ width: 28px; height: 28px; }
  .tap-label{ font-size: 15px; }
  .btn-clock-out{ padding: 14px 28px; font-size: 15px; }
  .tap-hint{ font-size: 12px; padding: 10px 12px; }
}

/* Accessibility: focus */
*:focus-visible{ outline:2px solid var(--focus); outline-offset:2px; border-radius:6px }

/* Utilities */
.flex{ display:flex } .between{ justify-content:space-between; align-items:center }
.end{ justify-content:flex-end } .items-center{ align-items:center }
.mt-2{ margin-top:var(--space-2) } .mt-4{ margin-top:var(--space-4) } .mb-2{ margin-bottom:var(--space-2) } .mb-4{ margin-bottom:var(--space-4) }
.gap-2{ gap:var(--space-2) } .gap-4{ gap:var(--space-4) }
@media (max-width: 400px){ .between{ gap:6px } }

/* Mobile nav menu */
.nav-menu{ position:fixed; left:12px; right:12px; top:60px; background:var(--bg-elev); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow-lg); padding:8px; display:flex; flex-direction:column; gap:4px; z-index:70; max-width:320px; }
.nav-menu .menu-item{ background:transparent; border:none; border-radius:10px; padding:12px 14px; text-align:left; color:var(--text); cursor:pointer; font-size:15px; -webkit-tap-highlight-color:transparent; transition:background 0.12s; }
.nav-menu .menu-item:hover{ background:var(--surface) }
.nav-menu .menu-item:active{ background:color-mix(in oklab, var(--surface) 80%, var(--border)) }

/* Offline/Install banners */
.offline-banner{ position:fixed; left:12px; right:12px; bottom:calc(76px + env(safe-area-inset-bottom)); background:#1f2937; color:#fff; padding:10px 12px; border-radius:10px; font-size:12px; box-shadow:var(--shadow-lg); z-index:65 }
.install-banner{ 
  position:fixed !important; 
  left:12px !important; 
  right:12px !important; 
  bottom:calc(72px + env(safe-area-inset-bottom)) !important; 
  background:var(--bg-elev) !important; 
  color:var(--text) !important; 
  border:1px solid var(--border) !important; 
  border-radius:12px !important; 
  box-shadow:0 4px 20px rgba(0,0,0,0.15) !important; 
  z-index:65 !important;
  padding:12px !important;
  opacity:1 !important;
  display:block !important;
  pointer-events:auto !important;
  transition:opacity 0.22s ease, transform 0.22s ease !important;
}
.install-banner .install-content{ display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap }
.install-banner .install-text{ flex:1; min-width:150px; font-size:13px; font-weight:500 }
.install-banner .install-actions{ display:flex; gap:8px; flex-shrink:0 }
/* Banner transitions */
.offline-banner, .install-banner{ transition:transform .2s ease, opacity .2s ease }
.offline-banner[hidden], .install-banner[hidden]{ opacity:0 !important; transform:translateY(8px); pointer-events:none !important }

/* Mobile specific */
@media (max-width: 768px) {
  .install-banner{ 
    bottom:calc(68px + env(safe-area-inset-bottom)) !important; 
    left:8px !important; 
    right:8px !important; 
  }
  .install-banner .install-text{ font-size:12px }
}



/* Bottom sheet dialog on mobile */
@media (max-width: 700px){
	dialog.bottom-sheet{ margin:0; width:100vw; max-width:100vw; position:fixed; inset:auto 0 0 0; border-radius:16px 16px 0 0; }
	dialog.bottom-sheet::backdrop{ background:rgba(0,0,0,.35) }
	dialog.bottom-sheet form{ border-radius:16px 16px 0 0; }
}

/* Toast layout */
.toast .row{ display:flex; align-items:center; gap:8px }
.toast .icon{ width:16px; height:16px }

/* Pull-to-refresh indicator */
.pull-indicator{ position:fixed; top:8px; left:50%; transform:translateX(-50%) translateY(-40px); background:var(--bg-elev); color:var(--text); border:1px solid var(--border); border-radius:999px; padding:6px 10px; font-size:12px; box-shadow:var(--shadow); opacity:0; transition:transform .2s ease, opacity .2s ease; z-index:65 }
.pull-indicator.show{ transform:translateX(-50%) translateY(0); opacity:1 }

/* Ripple effect */
.ripple-container{ position:relative; overflow:hidden }
.ripple{ position:absolute; border-radius:50%; transform:scale(0); animation:ripple .6s linear; background:rgba(255,255,255,.35); pointer-events:none }
@keyframes ripple{ to{ transform:scale(4); opacity:0 } }

/* Header elevate on scroll */
header.elev{ box-shadow:0 1px 3px rgba(0,0,0,.08); }

/* Filter chips group */
.chip-group{ display:flex; gap:8px; flex-wrap:wrap }
.chip.btn{ padding:6px 10px; border-radius:999px; font-size:12px }

/* Swipe hint */
.swipe-hint{ font-size:11px; color:var(--muted); margin-top:6px }

/* ── Floating Glassmorphism Nav Bar (Telegram-style) ── */
.bottom-nav{ position:fixed; bottom:0; left:0; right:0; z-index:60; padding:0 16px calc(10px + env(safe-area-inset-bottom)) 16px; pointer-events:none; }
.bottom-nav-inner{ max-width:460px; margin:0 auto; display:flex; align-items:center; justify-content:center; gap:4px; padding:10px 14px; border-radius:26px; background:rgba(255,255,255,.55); -webkit-backdrop-filter:blur(24px) saturate(180%); backdrop-filter:blur(24px) saturate(180%); border:1px solid rgba(255,255,255,.35); box-shadow:0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04), 0 0 0 0.5px rgba(0,0,0,.03); pointer-events:auto; }
@supports not (backdrop-filter:blur(1px)){ .bottom-nav-inner{ background:rgba(255,255,255,.92) } }
.bottom-nav button, .bottom-nav .nav-btn{ position:relative; background:transparent; border:0; color:var(--muted); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; padding:10px 12px; border-radius:16px; transition:all .2s ease; -webkit-tap-highlight-color:transparent; min-width:0; flex:1; cursor:pointer; text-decoration:none; }
.bottom-nav button:hover, .bottom-nav .nav-btn:hover{ color:var(--text); background:rgba(0,0,0,.04); }
.bottom-nav button:active, .bottom-nav .nav-btn:active{ transform:scale(.9); }
.bottom-nav button:focus-visible, .bottom-nav .nav-btn:focus-visible{ outline:none; box-shadow:0 0 0 3px color-mix(in oklab, var(--focus) 24%, transparent); }
.bottom-nav button.is-active, .bottom-nav .nav-btn.is-active{ color:var(--primary); background:rgba(22,163,74,.08); }
.bottom-nav svg{ width:26px; height:26px; stroke-width:1.7; }
.bottom-nav button span.label, .bottom-nav .nav-btn span.label{ font-size:11.5px; font-weight:600; line-height:1; letter-spacing:.2px; margin-top:1px; }
.bottom-nav .nav-divider{ width:1px; height:34px; background:rgba(0,0,0,.07); border-radius:1px; flex-shrink:0; }
/* Dark mode glass */
[data-theme="dark"] .bottom-nav-inner{ background:rgba(28,28,30,.6); border-color:rgba(255,255,255,.08); box-shadow:0 8px 32px rgba(0,0,0,.25), 0 0 0 0.5px rgba(255,255,255,.06); }
[data-theme="dark"] .bottom-nav .nav-divider{ background:rgba(255,255,255,.08); }
[data-theme="dark"] .bottom-nav button, [data-theme="dark"] .bottom-nav .nav-btn{ color:rgba(255,255,255,.5); }
[data-theme="dark"] .bottom-nav button:hover, [data-theme="dark"] .bottom-nav .nav-btn:hover{ color:rgba(255,255,255,.85); background:rgba(255,255,255,.06); }
[data-theme="dark"] .bottom-nav button.is-active, [data-theme="dark"] .bottom-nav .nav-btn.is-active{ color:#4ADE80; background:rgba(74,222,128,.1); }
@media(prefers-color-scheme:dark){
  .bottom-nav-inner{ background:rgba(28,28,30,.6); border-color:rgba(255,255,255,.08); box-shadow:0 8px 32px rgba(0,0,0,.25), 0 0 0 0.5px rgba(255,255,255,.06); }
  .bottom-nav .nav-divider{ background:rgba(255,255,255,.08); }
  .bottom-nav button, .bottom-nav .nav-btn{ color:rgba(255,255,255,.5); }
  .bottom-nav button:hover, .bottom-nav .nav-btn:hover{ color:rgba(255,255,255,.85); background:rgba(255,255,255,.06); }
  .bottom-nav button.is-active, .bottom-nav .nav-btn.is-active{ color:#4ADE80; background:rgba(74,222,128,.1); }
}
[data-theme="light"] .bottom-nav-inner{ background:rgba(255,255,255,.55); border-color:rgba(255,255,255,.35); }
@media (max-width: 700px){
	.bottom-nav{ display:flex !important; }
	body.staff-page main.container{ padding-bottom:100px; }
	body.staff-page section.container:last-of-type{ padding-bottom:108px; }
}
/* Desktop: reposition as inline bar */
@media (min-width: 901px){
	.bottom-nav{ position:static; padding:10px 12px; pointer-events:auto; }
	.bottom-nav-inner{ max-width:600px; background:transparent; -webkit-backdrop-filter:none; backdrop-filter:none; border:none; box-shadow:none; border-top:1px solid var(--border); border-radius:0; padding:12px 14px; gap:8px; }
	.bottom-nav .nav-divider{ display:none; }
	.bottom-nav button, .bottom-nav .nav-btn{ flex-direction:row; gap:8px; padding:10px 14px; border-radius:12px; flex:0 1 auto; }
	.bottom-nav button.is-active, .bottom-nav .nav-btn.is-active{ background:linear-gradient(180deg, color-mix(in oklab, var(--primary) 12%, transparent), transparent); }
	#navTapBtn{ display:none; }
}



/* Desktop alignment for Tap row in the card (left align the Tap button) */
@media (min-width: 901px){
	.tap-row{ justify-content:flex-start }
	.tap-row #tapBtn{ margin-left:0; width:auto }
}

/* Header connection meter (4 bars) */
.conn-meter{ display:inline-flex; gap:2px; align-items:flex-end; margin-left:8px }
.conn-meter .bar{ width:3px; background:var(--muted); opacity:.45; height:6px; border-radius:2px }
.conn-meter .bar.on{ background:var(--success); opacity:1 }
.conn-meter .bar.b2{ height:9px } .conn-meter .bar.b3{ height:12px } .conn-meter .bar.b4{ height:15px }
@media (max-width: 700px){ .conn-meter{ display:none } }

/* Simple tooltip helper */
[data-tooltip]{ position:relative }
[data-tooltip]::after{ content:attr(data-tooltip); position:absolute; bottom:100%; left:50%; transform:translate(-50%, -6px); background:#111; color:#fff; font-size:11px; padding:4px 6px; border-radius:6px; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity .12s ease; box-shadow:var(--shadow) }
[data-tooltip]:hover::after{ opacity:1 }

/* Stats card small visuals */
#statsCard .muted strong{ color:var(--text) }

/* Prominent center Tap action inside footer */
.bottom-nav .footer-tap{ background:linear-gradient(180deg, var(--primary), var(--primary-700)); color:#fff !important; border:0; box-shadow:0 4px 16px color-mix(in oklab, var(--primary) 30%, transparent), 0 0 0 3px rgba(255,255,255,.25); padding:0; border-radius:50%; width:54px; height:54px; margin-top:-18px; display:flex; align-items:center; justify-content:center; position:relative; flex:0 0 54px; }
.bottom-nav .footer-tap svg{ width:26px; height:26px; stroke:#fff; }
.bottom-nav .footer-tap span.label{ display:none; }
.bottom-nav .footer-tap:hover{ background:linear-gradient(180deg, var(--primary), var(--primary-700)) !important; transform:scale(1.08); }
.bottom-nav .footer-tap:active{ transform:scale(0.9) !important; }
@media (max-width: 700px){ .bottom-nav .footer-tap{ width:54px; height:54px; } }
@media (min-width: 901px){ .bottom-nav .footer-tap{ display:none; } }

/* Eyebrow headings */
.eyebrow{ text-transform:uppercase; letter-spacing:.12em; font-size:11px; color:var(--muted) }

/* List row hover */
.list-row{ padding:8px 0; border-bottom:1px solid var(--border) }
.list-row:hover{ background:color-mix(in oklab, var(--surface) 60%, transparent) }

/* Entry appear animation */
@keyframes fadeSlideIn{ from{ opacity:0; transform:translateY(6px) } to{ opacity:1; transform:none } }
.appear{ animation:fadeSlideIn .22s ease-out both; will-change:opacity, transform }
@media (prefers-reduced-motion: reduce){ .appear{ animation:none } }

/* Tiny tab badge (e.g., Logs) */
.tab-badge{ position:absolute; top:2px; right:10px; min-width:16px; height:16px; padding:0 4px; border-radius:999px; background:var(--danger); color:#fff; font-size:10px; line-height:16px; box-shadow:var(--shadow); display:none }
.tab-badge.show{ display:inline-block }

/* Utilities: visibility on small screens */
.only-sm{ display:none }
@media (max-width: 700px){ .only-sm{ display:initial } }
.hide-sm{ display:initial }
@media (max-width: 700px){ .hide-sm{ display:none } }
/* --- polish: premium look and logs page helpers --- */
/* Enhanced primary gradient button */
.btn--gradient{
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--primary) 94%, #fff), var(--primary-700)),
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0));
  border:0;
  text-shadow:0 1px 0 rgba(0,0,0,.12);
}
.btn--gradient:hover{ filter:brightness(1.03); box-shadow:var(--shadow-lg) }
.btn--gradient:focus-visible{ box-shadow:0 0 0 3px color-mix(in oklab, var(--primary) 25%, transparent), var(--shadow-lg) }
.btn--gradient:active{ transform:translateY(1px); filter:brightness(.98) }

/* Bottom nav refinements (handled in main .bottom-nav block above) */

/* Logs timeline + filters */
.timeline{ position:relative; margin:6px 0 }
.timeline::before{ content:""; position:absolute; left:12px; top:0; bottom:0; width:2px; background:var(--border) }
.timeline .event{ position:relative; padding-left:36px; padding-bottom:12px }
.timeline .event:last-child{ padding-bottom:0 }
.timeline .event .dot{ position:absolute; left:6px; top:.35em; width:12px; height:12px; border-radius:50%; background:var(--primary); box-shadow:0 0 0 3px color-mix(in oklab, var(--primary) 20%, transparent) }
.timeline .event .meta{ font-size:12px; color:var(--muted) }

/* Sticky filters bar for logs */
.filters-bar{ position:sticky; top:56px; z-index:55; background:linear-gradient(180deg, var(--bg-elev), color-mix(in oklab, var(--bg-elev) 80%, transparent)); -webkit-backdrop-filter:saturate(140%) blur(6px); backdrop-filter:saturate(140%) blur(6px); border-bottom:1px solid var(--border); padding:8px 0 }

/* Active chip toggle */
.chip.is-active, .chip.btn.is-active{
	background:color-mix(in oklab, var(--primary) 10%, var(--surface));
	/* Fallback first for older browsers */
	border-color:var(--primary-600);
	color:var(--text)
}

/* Active state for bottom nav (added class) */
.bottom-nav button.is-active{ background:linear-gradient(180deg, color-mix(in oklab, var(--primary) 12%, transparent), transparent) }

/* Subtle zebra rows */
.table tr:nth-child(odd) td{ background:color-mix(in oklab, var(--surface) 40%, transparent) }

/* Empty state */
.empty-state{ text-align:center; color:var(--muted); padding:24px 12px }

/* Desktop web-only adjustments (keep mobile as-is) */
@media (min-width: 901px){
	body.web-split .container{ max-width:1100px }
	body.web-split .split{ display:grid; grid-template-columns: 420px 1fr; gap:16px }
	body.web-split .split .panel{ position:sticky; top:70px; align-self:start }
	body.web-split .bottom-nav{ position:static; box-shadow:none; background:transparent; border-top:0; justify-content:flex-start }
}

/* Splash overlay (PWA-style) */
.splash{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:9999; -webkit-backdrop-filter:saturate(140%) blur(10px); backdrop-filter:saturate(140%) blur(10px); background:linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.86)); width:100vw; height:100vh; }
.splash.show{ display:flex }
.splash .box{ background:rgba(255,255,255,.55); border:1px solid rgba(0,0,0,.06); border-radius:20px; padding:20px; box-shadow:0 10px 30px rgba(0,0,0,.12); text-align:center }
.splash .logo{ width:128px; height:128px; border-radius:24px; box-shadow:0 10px 24px rgba(0,0,0,.14); display:block; margin:0 auto; animation: breathe 2.5s ease-in-out infinite; }
.splash .sig{ margin-top:10px; font-size:12px; color:#334155 }

/* Breathing animation for splash logo */
@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.92;
  }
}

/* --- Desktop advanced UI polish (opt-in friendly, non-breaking) --- */
@media (min-width: 901px){
	:root{
		/* Default offset for sticky elements (header + optional filters); override per page if needed */
		--sticky-offset: 72px;
	}

		/* 1) Condensed header when elevated on scroll */
		header.elev{
			padding-top:8px;
			padding-bottom:8px;
			border-bottom-color: var(--border);
			background: linear-gradient(
				180deg,
				color-mix(in oklab, var(--bg-elev) 96%, transparent),
				color-mix(in oklab, var(--bg-elev) 86%, transparent)
			);
		}

		/* 2) Desktop scrollbars (WebKit) */
		::-webkit-scrollbar{ width:10px; height:10px }
		::-webkit-scrollbar-track{ background: var(--surface); border-radius:999px }
		::-webkit-scrollbar-thumb{
			background: var(--muted);
			border: 2px solid var(--surface);
			border-radius:999px;
		}
		::-webkit-scrollbar-thumb:hover{ background: var(--text) }

	/* 3) Sticky table header (opt-in: add .sticky to .table) */
	.table.sticky thead th{
		position: sticky;
		top: var(--sticky-offset);
		z-index: 2;
		background: var(--bg-elev);
		box-shadow: 0 1px 0 var(--border);
	}

	/* 4) Interactive cards with hover actions */
	.card.card--interactive{ transition: transform .18s ease, box-shadow .2s ease, background-color .2s ease; will-change: transform }
	.card.card--interactive:hover{ transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow-lg) }
	.card .hover-actions{
		position:absolute; top:10px; right:10px; display:flex; gap:6px; opacity:0; transform:translateY(-6px);
		transition:opacity .12s ease, transform .12s ease
	}
	.card:hover .hover-actions{ opacity:1; transform:none }

	/* 5) Peek panel (slide-in inspector on the right) */
	.peek-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.35); -webkit-backdrop-filter:saturate(140%) blur(2px); backdrop-filter:saturate(140%) blur(2px); z-index:90; opacity:0; pointer-events:none; transition:opacity .2s ease }
	.peek-overlay.show{ opacity:1; pointer-events:auto }
	.peek-panel{
		position:fixed; top:0; right:0; bottom:0; width:min(520px, 42vw); background:var(--bg-elev); border-left:1px solid var(--border);
		box-shadow: -12px 0 24px rgba(0,0,0,.16); transform:translateX(100%); transition: transform .24s ease; z-index:91;
		display:flex; flex-direction:column
	}
	.peek-panel.show{ transform:none }
	.peek-panel .peek-head{ padding:14px 16px; border-bottom:1px solid var(--border); font-weight:700; display:flex; align-items:center; justify-content:space-between }
	.peek-panel .peek-body{ padding:14px 16px; overflow:auto; flex:1 }

	/* Tooltip arrow upgrade on desktop */
	[data-tooltip]::before{
		content:""; position:absolute; bottom:100%; left:50%; transform:translateX(-50%) translateY(4px); border:6px solid transparent; border-top-color:#111; opacity:0;
		transition:opacity .12s ease, transform .12s ease
	}
	[data-tooltip]:hover::before{ opacity:1; transform:translateX(-50%) }
}


/* ======================================== ADMIN ERROR MODALS & FEEDBACK ======================================== */

/* Error Modal */
.admin-error-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }

.admin-error-modal.show { opacity: 1; pointer-events: auto; }

.admin-error-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

.admin-error-content { position: relative; background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 480px; width: calc(100% - 32px); max-height: calc(100vh - 64px); display: flex; flex-direction: column; transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

.admin-error-modal.show .admin-error-content { transform: scale(1); }

.admin-error-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

.admin-error-header h3 { margin: 0; font-size: 18px; font-weight: 600; }

.admin-error-close { background: none; border: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: all 0.2s ease; }

.admin-error-close:hover { background: var(--surface); color: var(--text); }

.admin-error-body { padding: 20px; overflow-y: auto; flex: 1; }

.admin-error-message { margin: 0 0 16px; font-size: 15px; color: var(--text); }

.admin-error-technical { margin: -8px 0 16px; color: var(--muted); font-size: 13px; }

.admin-error-steps { background: var(--surface); border-radius: var(--radius-sm); padding: 16px; margin-top: 16px; }

.admin-error-steps p { margin: 0 0 8px; font-weight: 600; font-size: 14px; }

.admin-error-steps ol { margin: 0; padding-left: 20px; }

.admin-error-steps li { margin: 6px 0; font-size: 14px; color: var(--muted); }

.admin-error-actions { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }

.admin-error-actions .btn { min-width: 80px; }

/* Toast Notifications */
.admin-toast { position: fixed; bottom: 24px; right: 24px; z-index: 9998; background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 16px 20px; min-width: 320px; max-width: 420px; transform: translateY(120%); opacity: 0; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease; border-left: 4px solid var(--primary); }

.admin-toast.success { border-left-color: var(--success); }

.admin-toast.info { border-left-color: var(--info); }

.admin-toast.show { transform: translateY(0); opacity: 1; }

.admin-toast-content { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 14px; }

.admin-toast-icon { flex-shrink: 0; color: var(--success); }

.admin-toast.info .admin-toast-icon { color: var(--info); }

/* Loading Indicator */
.admin-loading { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }

.admin-loading.show { opacity: 1; pointer-events: auto; }

.admin-loading-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

.admin-loading-content { position: relative; background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 32px 48px; display: flex; flex-direction: column; align-items: center; gap: 16px; }

.admin-loading-spinner { width: 40px; height: 40px; border: 4px solid var(--surface); border-top-color: var(--primary); border-radius: 50%; animation: admin-spin 0.8s linear infinite; }

@keyframes admin-spin { to { transform: rotate(360deg); } }

.admin-loading-content p { margin: 0; font-size: 14px; color: var(--muted); font-weight: 500; }

@media (max-width: 560px) { .admin-error-content { max-width: calc(100% - 16px); max-height: calc(100vh - 32px); } .admin-toast { right: 16px; left: 16px; bottom: 16px; min-width: auto; } .admin-error-actions { flex-direction: column; } .admin-error-actions .btn { width: 100%; } }


/* -- On Leave / Sleep Mode -- */
.leave-action-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.btn-leave {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(249, 115, 22, .35);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
}

.btn-leave:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249, 115, 22, .45);
}

.btn-leave:active {
  transform: scale(.95);
}

/* Sleep overlay */
.sleep-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #fff;
  animation: fadeIn .3s ease both;
}

.sleep-overlay.hidden {
  display: none;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.sleep-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 340px;
}

.sleep-icon {
  font-size: 72px;
  line-height: 1;
  animation: beachBob 3s ease-in-out infinite;
}

@keyframes beachBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.sleep-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: #f1f5f9;
}

.sleep-name {
  font-size: 18px;
  font-weight: 600;
  color: #94a3b8;
}

.sleep-since {
  font-size: 13px;
  color: #64748b;
}

.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 6px 20px rgba(34, 197, 94, .4);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: .02em;
}

.btn-resume:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(34, 197, 94, .5);
}

.btn-resume:active {
  transform: scale(.95);
}
/* Early clock-out confirmation shared by the staff PWA and public kiosk. */
.early-clockout-overlay{position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:20px;background:rgba(8,15,30,.72);backdrop-filter:blur(5px)}
.early-clockout-card{width:min(100%,430px);background:var(--bg-card,#fff);color:var(--text,#172033);border:1px solid var(--border,#dbe2ea);border-radius:8px;padding:24px;box-shadow:0 24px 70px rgba(0,0,0,.3)}
.early-clockout-card h3{margin:0 0 10px;font-size:22px}.early-clockout-card p{margin:0;color:var(--text-secondary,#586474);font-size:16px;line-height:1.55}
.early-clockout-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:22px}.early-clockout-actions button{min-height:48px;border-radius:8px;border:1px solid var(--border,#dbe2ea);font:inherit;font-weight:800;cursor:pointer}
.early-clockout-no{background:var(--bg-secondary,#f3f6f8);color:var(--text,#172033)}.early-clockout-yes{background:#b91c1c!important;border-color:#b91c1c!important;color:#fff!important}
@media(max-width:420px){.early-clockout-card{padding:20px}.early-clockout-actions{grid-template-columns:1fr}}
