:root{
  --wm-pine:#0F3D3A; --wm-pine-2:#174B47; --wm-teal:#1B6B62; --wm-amber:#E2A33B;
  --wm-paper:#F5F6F3; --wm-ink:#1B2B2A; --wm-line:#E2E6E1;
  --bs-primary:#1B6B62; --bs-primary-rgb:27,107,98; --bs-link-color:#1B6B62; --bs-link-hover-color:#124D46;
  --bs-body-font-family:'Hanken Grotesk',system-ui,-apple-system,'Segoe UI',sans-serif;
  --sidebar-w:252px;
}
[data-bs-theme=dark]{
  --wm-paper:#0D1514; --wm-line:#25322F; --bs-body-bg:#0D1514; --bs-body-color:#DCE5E2;
  --bs-link-color:#5CC2B3; --bs-link-hover-color:#8BD8CC;
}
body{background:var(--wm-paper);color:var(--wm-ink);font-size:.94rem}
[data-bs-theme=dark] body{color:#DCE5E2}
.btn-primary{--bs-btn-bg:#1B6B62;--bs-btn-border-color:#1B6B62;--bs-btn-hover-bg:#155A52;--bs-btn-hover-border-color:#155A52;--bs-btn-active-bg:#124D46;--bs-btn-active-border-color:#124D46}
.form-control:focus,.form-select:focus,.form-check-input:focus{border-color:#1B6B62;box-shadow:0 0 0 .2rem rgba(27,107,98,.18)}
.form-check-input:checked{background-color:#1B6B62;border-color:#1B6B62}
:focus-visible{outline:2px solid var(--wm-amber);outline-offset:2px}

/* Sidebar */
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-w);background:var(--wm-pine);color:#C9DAD6;display:flex;flex-direction:column;z-index:1040;transition:transform .2s}
.sidebar .brand{padding:1.25rem 1.25rem 1rem;color:#fff;display:flex;gap:.7rem;align-items:center;text-decoration:none}
.brand-mark{width:36px;height:36px;border-radius:9px;background:var(--wm-amber);color:var(--wm-pine);display:grid;place-items:center;font-weight:800;font-size:1.05rem;overflow:hidden}
.brand-mark img{width:100%;height:100%;object-fit:cover}
.brand-name{font-weight:700;line-height:1.1}.brand-name small{display:block;font-weight:400;color:#8FB0AA;font-size:.74rem}
.sidebar nav{flex:1;overflow-y:auto;padding:.25rem .75rem 1rem}
.nav-group{margin:1.1rem .5rem .35rem;font-size:.76rem;color:#7FA19B;letter-spacing:.02em}
.sidebar .nav-link{color:#C9DAD6;border-radius:8px;padding:.55rem .75rem;display:flex;align-items:center;gap:.7rem;border-left:3px solid transparent}
.sidebar .nav-link i{font-size:1.05rem;opacity:.9}
.sidebar .nav-link:hover{background:var(--wm-pine-2);color:#fff}
.sidebar .nav-link.active{background:var(--wm-pine-2);color:#fff;border-left-color:var(--wm-amber)}
.sidebar-foot{padding:.9rem 1.25rem;font-size:.76rem;color:#7FA19B;border-top:1px solid rgba(255,255,255,.08)}

/* Main */
.main{margin-left:var(--sidebar-w);min-height:100vh}
.topbar{position:sticky;top:0;z-index:1030;background:var(--bs-body-bg);border-bottom:1px solid var(--wm-line);padding:.7rem 1.5rem;display:flex;align-items:center;gap:1rem}
[data-bs-theme=light] .topbar{background:#fff}
.topbar h1{font-size:1.15rem;font-weight:700;margin:0;flex:1}
.content{padding:1.5rem}
.card{border:1px solid var(--wm-line);border-radius:10px;box-shadow:none}
.card-header{background:transparent;border-bottom:1px solid var(--wm-line);font-weight:600}
.table>:not(caption)>*>*{padding:.7rem .9rem}
.table thead th{font-weight:600;font-size:.82rem;color:#5E7370;background:transparent;border-bottom:1px solid var(--wm-line)}
.stat{padding:1.1rem 1.25rem}
.stat .label{color:#5E7370;font-size:.85rem}
.stat .value{font-size:1.7rem;font-weight:700;line-height:1.2;margin-top:.15rem}
.stat-accent{border-left:4px solid var(--wm-amber)}
.perm-matrix th,.perm-matrix td{text-align:center;vertical-align:middle}
.perm-matrix th:first-child,.perm-matrix td:first-child{text-align:left}
.avatar{width:34px;height:34px;border-radius:50%;background:var(--wm-pine);color:#fff;display:grid;place-items:center;font-size:.85rem;font-weight:700}
.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:.4rem}
.status-dot.on{background:#2E9E6B}.status-dot.off{background:#B7BFBC}

/* Auth screens */
.auth-wrap{min-height:100vh;display:grid;grid-template-columns:minmax(320px,5fr) 7fr}
.auth-side{background:var(--wm-pine);color:#fff;padding:3rem;display:flex;flex-direction:column;justify-content:space-between}
.auth-side h2{font-size:2rem;font-weight:700;max-width:16ch;line-height:1.2}
.auth-side p{color:#A9C4BF;max-width:38ch}
.auth-form{display:grid;place-items:center;padding:2rem}
.auth-form .box{width:100%;max-width:380px}
@media (max-width:991.98px){
  .sidebar{transform:translateX(-100%)}.sidebar.open{transform:none}
  .main{margin-left:0}.content{padding:1rem}.topbar{padding:.6rem 1rem}
  .auth-wrap{grid-template-columns:1fr}.auth-side{display:none}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* Attendance sheet & print */
.sheet td,.sheet th{text-align:center;padding:.35rem .3rem!important;font-size:.78rem;white-space:nowrap}
.sheet td:first-child,.sheet th:first-child{text-align:left;position:sticky;left:0;background:var(--bs-body-bg);z-index:1;min-width:170px}
.c-P{color:#1F8A5B;font-weight:700}.c-A{color:#C0392B;font-weight:700}.c-HD{color:#B9770E;font-weight:700}
.c-L{color:#2E6DB4;font-weight:700}.c-H,.c-WO{color:#8A9692}
@media print{.sidebar,.topbar,.no-print{display:none!important}.main{margin:0}.content{padding:0}.card{border:0}}
