:root{
  --bg:#f6f8ff;
  --bg2:#ffffff;
  --card:#ffffff;
  --muted:#5a647a;
  --text:#141a2a;
  --border:rgba(20,26,42,.12);
  --primary:#2f6bff;
  --primary2:#7c3aed;
  --danger:#e11d48;
  --success:#059669;
  --shadow:0 18px 50px rgba(16,24,40,.10);
  --shadow2:0 10px 24px rgba(16,24,40,.08);
  --radius:16px;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    radial-gradient(1200px 420px at 14% 0%, rgba(47,107,255,.18), transparent 60%),
    radial-gradient(900px 380px at 86% 8%, rgba(124,58,237,.16), transparent 55%),
    linear-gradient(180deg,var(--bg),var(--bg2));
  color:var(--text);
}
a{color:inherit}
.container{width:min(1100px,92vw);margin:0 auto}
.container{width:min(1180px,92vw);margin:0 auto}
.topbar{
  position:sticky;top:0;z-index:10;
  background:rgba(255,255,255,.75);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border)
}
.topbar__inner{display:flex;align-items:center;justify-content:space-between;padding:14px 0;gap:12px}
.brand{display:flex;flex-direction:column}
.brand__title{font-weight:900;letter-spacing:.2px}
.brand__subtitle{color:var(--muted);font-size:12px;margin-top:2px}
.chip{
  padding:7px 10px;border:1px solid var(--border);border-radius:999px;
  font-size:12px;color:var(--muted);background:rgba(255,255,255,.7)
}
.topbar__actions{display:flex;align-items:center;gap:10px}
.page{padding:18px 0 56px}

/* Admin (full screen, mobile-first) */
.admin-shell{
  min-height:calc(100vh - 64px);
  display:grid;
  grid-template-columns: 280px 1fr;
  gap:18px;
  width:min(1400px,96vw);
  margin:18px auto 56px;
}
.admin-nav{
  position:sticky; top:82px; align-self:start;
  background:rgba(255,255,255,.72);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
}
.admin-nav__title{font-weight:900;margin-bottom:10px}
.admin-nav__link{
  display:flex;align-items:center;gap:10px;
  padding:12px 12px;border-radius:14px;
  text-decoration:none;border:1px solid transparent;
  color:var(--text);
  transition:transform .18s ease, background .18s ease;
}
.admin-nav__link:hover{
  background:rgba(47,107,255,.08);
  transform:translateX(2px);
}
.admin-main{min-width:0}
.admin-content{animation:fadeUp .32s ease both}

/* Mobile nav drawer */
@media (max-width:900px){
  .admin-shell{
    grid-template-columns: 1fr;
    width:min(1100px,92vw);
  }
  .admin-nav{
    position:fixed;
    inset:64px 10px auto 10px;
    z-index:20;
    transform:translateY(-8px) scale(.98);
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease, transform .2s ease;
  }
  .admin-nav.is-open{
    opacity:1;
    pointer-events:auto;
    transform:translateY(0) scale(1);
  }
  .admin-main{margin-top:0}
}

.icon-btn{
  width:44px;height:44px;border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.8);
  cursor:pointer;
}
.icon-bars{
  display:block;width:18px;height:2px;background:var(--text);
  margin:0 auto;position:relative;border-radius:2px;
}
.icon-bars::before,.icon-bars::after{
  content:"";position:absolute;left:0;width:18px;height:2px;background:var(--text);border-radius:2px;
}
.icon-bars::before{top:-6px}
.icon-bars::after{top:6px}

@keyframes fadeUp{
  from{opacity:0; transform:translateY(10px)}
  to{opacity:1; transform:translateY(0)}
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}
.h1{margin:0 0 8px;font-size:22px}
.muted{color:var(--muted)}
.small{font-size:12px}
.mt-8{margin-top:8px}
.w-100{width:100%}
.hr{border:none;border-top:1px solid var(--border);margin:16px 0}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:12px 14px;border-radius:14px;border:1px solid transparent;
  background:linear-gradient(135deg,var(--primary),var(--primary2));
  color:white;font-weight:800;
  text-decoration:none;cursor:pointer;
  box-shadow:var(--shadow2);
}
.btn:hover{filter:saturate(1.05);transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn--ghost{
  background:rgba(255,255,255,.75);
  border-color:var(--border);
  color:var(--text);
  box-shadow:none;
}
.btn--ghost:hover{background:white}
.btn--danger{
  background:linear-gradient(135deg,var(--danger),#fb7185);
  color:white
}
.btn:disabled{opacity:.6;cursor:not-allowed}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}

.form{margin-top:10px}
.field{display:flex;flex-direction:column;gap:6px;margin:10px 0}
label{font-size:13px;color:var(--muted)}
input,select,textarea{
  width:100%;padding:12px 12px;border-radius:12px;
  background:white;border:1px solid var(--border);
  color:var(--text);outline:none;
  box-shadow:0 1px 0 rgba(16,24,40,.03);
}
textarea{min-height:90px;resize:vertical}
input:focus,select:focus,textarea:focus{
  border-color:rgba(47,107,255,.55);
  box-shadow:0 0 0 4px rgba(47,107,255,.12);
}

.grid{display:grid;gap:12px}
.grid--2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid--3{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:800px){
  .grid--2,.grid--3{grid-template-columns:1fr}
}

.alert{padding:12px 12px;border-radius:12px;border:1px solid var(--border);margin:10px 0}
.alert--danger{border-color:rgba(225,29,72,.35);background:rgba(225,29,72,.08)}
.alert--success{border-color:rgba(5,150,105,.30);background:rgba(5,150,105,.08)}

.auth{min-height:calc(100vh - 90px);display:grid;place-items:center;padding:14px 0}
.auth__card{width:min(460px,92vw)}

.kpi{display:flex;gap:12px;flex-wrap:wrap}
.kpi__item{flex:1;min-width:160px}
.kpi__value{font-size:26px;font-weight:900;margin-top:6px}
.kpi__label{color:var(--muted);font-size:12px}

.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:12px}
table{width:100%;border-collapse:collapse;min-width:680px;background:white}
th,td{padding:12px 12px;border-bottom:1px solid var(--border);text-align:left;font-size:14px}
th{color:var(--muted);font-weight:700}
tr:hover td{background:rgba(47,107,255,.04)}
.td-actions{display:flex;gap:8px;flex-wrap:wrap}

.avatar{
  width:64px;height:64px;border-radius:14px;border:1px solid var(--border);
  object-fit:cover;background:white;
}
.avatar--sm{width:38px;height:38px;border-radius:12px}
.avatar--lg{width:72px;height:72px;border-radius:18px}
.avatar--ph{
  display:grid;place-items:center;
  font-weight:900;color:rgba(20,26,42,.55);
  background:linear-gradient(135deg, rgba(47,107,255,.10), rgba(124,58,237,.10));
}

/* Employees (admin split view like reference UI) */
.admin-split{
  display:grid;
  grid-template-columns: 1.35fr .85fr;
  gap:18px;
  align-items:start;
}
@media (max-width:1000px){
  .admin-split{grid-template-columns:1fr}
}
.admin-split__list{min-width:0}
.admin-split__profile{position:sticky; top:82px}
@media (max-width:1000px){
  .admin-split__profile{position:static}
}
.split-head{
  display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;
}
.emp-table tr{cursor:pointer}
.emp-row.is-active td{background:rgba(47,107,255,.10)}
.emp-cell{display:flex;align-items:center;gap:10px}
.emp-name{font-weight:900}
.profile-head{display:flex;gap:14px;align-items:center}
.profile-name{font-weight:1000;font-size:18px;letter-spacing:.2px}
.pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 10px;border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.75);
  font-weight:800;
}
.profile-grid{display:grid;gap:10px}
.profile-box{
  padding:12px;border-radius:14px;border:1px solid var(--border);
  background:rgba(255,255,255,.7);
}
.profile-text{margin-top:6px;line-height:1.35}
.profile-skel{padding:6px}

/* Attendance (simple + creative) */
/* Attendance Book */
.book-table th,.book-table td{vertical-align:middle}
.book-day{width:78px;text-align:center}
.book-today{width:120px}
.book-total{width:86px;text-align:center}
.book-mark{
  display:inline-grid;place-items:center;
  width:34px;height:34px;border-radius:12px;
  border:1px solid var(--border);
  font-weight:1000;
}
.book-mark--p{background:rgba(5,150,105,.10);border-color:rgba(5,150,105,.25);color:var(--success)}
.book-mark--a{background:rgba(225,29,72,.10);border-color:rgba(225,29,72,.22);color:var(--danger)}
.book-mark--n{background:rgba(20,26,42,.04);color:rgba(20,26,42,.55)}
.book-choice{display:flex;gap:8px;align-items:center;justify-content:flex-start}
.book-chip{
  display:inline-flex;align-items:center;justify-content:center;
  width:44px;height:36px;border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.8);
  font-weight:1000;
  cursor:pointer;
}
.book-chip input{display:none}
.book-chip--p{color:var(--success)}
.book-chip--a{color:var(--danger)}
.book-chip:has(input:checked){
  background:linear-gradient(135deg, rgba(47,107,255,.12), rgba(124,58,237,.12));
  border-color:rgba(47,107,255,.25);
}
.book-chip--p:has(input:checked){
  background:rgba(5,150,105,.14);
  border-color:rgba(5,150,105,.28);
}
.book-chip--a:has(input:checked){
  background:rgba(225,29,72,.12);
  border-color:rgba(225,29,72,.25);
}

.att-savebar{
  position:sticky;
  bottom:10px;
  z-index:5;
  margin-top:10px;
}
.att-savebar__inner{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:rgba(255,255,255,.85);
  backdrop-filter:blur(10px);
  box-shadow:var(--shadow);
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

@media (prefers-reduced-motion: reduce){
  .btn{transition:none}
  .btn:hover{transform:none}
  .admin-content{animation:none}
}

