/* SmartAttend — Premium Dark Emerald + White UI */
:root {
  --g1: #166534; --g2: #15803D; --g3: #16A34A; --g4: #22C55E; --g5: #86EFAC;
  --gl: #DCFCE7; --gll: #F0FDF4;
  --dark: #0A1628; --dark2: #0D1F35; --dark3: #112240;
  --white: #FFFFFF; --gray50: #F9FAFB; --gray100: #F3F4F6;
  --gray200: #E5E7EB; --gray300: #D1D5DB; --gray400: #9CA3AF;
  --gray500: #6B7280; --gray600: #4B5563; --gray700: #374151; --gray800: #1F2937;
  --red: #DC2626; --redl: #FEE2E2;
  --amber: #D97706; --amberl: #FEF3C7;
  --blue: #2563EB; --bluel: #DBEAFE;
  --purple: #7C3AED; --purplel: #EDE9FE;
  --sh: 0 4px 20px rgba(0,0,0,.08);
  --sh-lg: 0 12px 40px rgba(0,0,0,.12);
  --sh-xl: 0 24px 60px rgba(0,0,0,.18);
  --sh-green: 0 8px 30px rgba(22,163,74,.35);
  --r: 12px; --rl: 16px; --rxl: 22px;
  --sb: 256px; --tb: 62px;
  --font: 'Inter', sans-serif; --mono: 'JetBrains Mono', monospace;
  --company-color: #16A34A;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14.5px; }
body { font-family: var(--font); background: var(--gray50); color: var(--gray800); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
.spin-anim { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ LOGIN ══ */
#login-page { display: flex; min-height: 100vh; }

.login-left {
  flex: 1.1;
  background: linear-gradient(145deg, #071320 0%, #0D2137 30%, #0F3D20 65%, #166534 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: 50px 60px;
}
.ll-inner { position: relative; z-index: 2; color: white; max-width: 480px; }

.ll-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 52px; }
.brand-shield { width: 46px; height: 46px; flex-shrink: 0; }
.brand-shield svg { width: 100%; height: 100%; }
.brand-name { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; }
.brand-name span { color: var(--g4); }
.brand-sub { font-size: .72rem; color: rgba(255,255,255,.45); margin-top: 2px; letter-spacing: .3px; }

.ll-hero { margin-bottom: 36px; }
.ll-hero h1 { font-size: 2.4rem; font-weight: 800; line-height: 1.18; margin-bottom: 14px; letter-spacing: -.8px; }
.hero-accent { color: var(--g4); }
.ll-hero p { font-size: .9rem; color: rgba(255,255,255,.6); line-height: 1.65; }

.ll-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 32px; }
.lf-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r); padding: 12px 16px; font-size: .83rem;
  font-weight: 500; color: rgba(255,255,255,.85);
  backdrop-filter: blur(10px); transition: background .2s;
}
.lf-card:hover { background: rgba(255,255,255,.12); }
.lf-card i { font-size: 1.1rem; }

.ll-stats { display: flex; align-items: center; gap: 0; margin-bottom: 28px;
  background: rgba(255,255,255,.06); border-radius: var(--r); padding: 16px 20px; }
.ls-item { flex: 1; text-align: center; }
.ls-num { font-size: 1.6rem; font-weight: 800; color: var(--g4); }
.ls-lbl { font-size: .72rem; color: rgba(255,255,255,.5); margin-top: 2px; }
.ls-div { width: 1px; height: 36px; background: rgba(255,255,255,.12); }

.ll-quote {
  font-size: .82rem; color: rgba(255,255,255,.45); font-style: italic;
  border-left: 3px solid var(--g3); padding-left: 16px; line-height: 1.6;
}

.ll-glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.ll-glow.g1 { width: 500px; height: 500px; background: rgba(22,163,74,.2); top: -200px; right: -100px; animation: gd1 14s ease-in-out infinite alternate; }
.ll-glow.g2 { width: 400px; height: 400px; background: rgba(37,99,235,.15); bottom: -150px; left: -80px; animation: gd2 16s ease-in-out infinite alternate; }
.ll-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
@keyframes gd1 { from{transform:translate(0,0)} to{transform:translate(30px,40px)} }
@keyframes gd2 { from{transform:translate(0,0)} to{transform:translate(-20px,-30px)} }

/* Login right */
.login-right {
  width: 520px; background: white;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 50px;
}
.lr-inner { width: 100%; max-width: 400px; }

.lang-sel {
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
  font-size: .78rem; color: var(--gray500); margin-bottom: 28px; cursor: pointer;
}

.lr-avatar { text-align: center; margin-bottom: 14px; }
.lr-avatar svg { width: 70px; height: 70px; }
.lr-title { font-size: 1.5rem; font-weight: 800; color: var(--gray800); text-align: center; margin-bottom: 5px; }
.lr-sub { font-size: .83rem; color: var(--gray500); text-align: center; margin-bottom: 22px; }

.login-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray200); margin-bottom: 20px; }
.ltab {
  flex: 1; padding: 9px; font-size: .83rem; font-weight: 600; color: var(--gray500);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s;
}
.ltab.active { color: var(--company-color); border-bottom-color: var(--company-color); }

.ltab-content { display: none; }
.ltab-content.active { display: block; }

.linput-wrap {
  position: relative; margin-bottom: 0;
  display: flex; align-items: center;
}
.linput-wrap input {
  width: 100%; padding: 12px 14px 12px 44px;
  border: 1.5px solid var(--gray200); border-radius: var(--r);
  font-size: .88rem; outline: none; background: var(--gray50);
  color: var(--gray800); transition: all .2s;
}
.linput-wrap input:focus { border-color: var(--company-color); background: white; box-shadow: 0 0 0 3px rgba(22,163,74,.1); }
.linput-ico { position: absolute; left: 14px; color: var(--gray400); width: 16px; height: 16px; display: flex; align-items: center; }
.linput-ico svg { width: 16px; height: 16px; }
.pw-eye { position: absolute; right: 12px; background: none; border: none; color: var(--gray400); padding: 0; width: 18px; height: 18px; }
.pw-eye svg { width: 18px; height: 18px; }

.login-opts { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 16px; font-size: .8rem; }
.rem-chk { display: flex; align-items: center; gap: 7px; color: var(--gray600); cursor: pointer; }
.rem-chk input { accent-color: var(--company-color); width: 14px; height: 14px; }
.forgot-btn { background: none; border: none; color: var(--company-color); font-size: .8rem; font-weight: 600; }

.login-err { background: var(--redl); color: var(--red); border: 1px solid rgba(220,38,38,.2); border-radius: var(--r); padding: 10px 14px; font-size: .82rem; margin-bottom: 14px; }

.login-submit {
  width: 100%; padding: 13px; background: var(--company-color); color: white;
  border: none; border-radius: var(--r); font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--sh-green); position: relative; overflow: hidden;
}
.login-submit:hover { background: var(--g2); transform: translateY(-1px); box-shadow: 0 12px 35px rgba(22,163,74,.45); }
.btn-spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }

.login-or { text-align: center; position: relative; margin: 18px 0 14px; }
.login-or::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--gray200); }
.login-or span { background: white; padding: 0 12px; position: relative; font-size: .78rem; color: var(--gray400); }

.social-row { display: flex; gap: 10px; margin-bottom: 16px; }
.social-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border: 1.5px solid var(--gray200); border-radius: var(--r);
  background: white; font-size: .82rem; font-weight: 500; color: var(--gray700);
  cursor: pointer; transition: all .15s;
}
.social-btn:hover { background: var(--gray50); border-color: var(--gray300); }

.sec-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .75rem; color: var(--gray400); margin-bottom: 18px; }

.demo-creds-block { padding-top: 14px; border-top: 1px solid var(--gray100); text-align: center; }
.demo-creds-block p { font-size: .73rem; color: var(--gray400); margin-bottom: 8px; }
.demo-btns-row { display: flex; gap: 7px; justify-content: center; }
.dbtn { font-size: .73rem; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--gray200); background: var(--gray50); color: var(--gray600); cursor: pointer; transition: all .15s; }
.dbtn:hover { background: var(--gl); border-color: var(--g3); color: var(--g1); }

/* ══ APP SHELL ══ */
#app-page { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sb); position: fixed; left: 0; top: 0; bottom: 0; z-index: 300;
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
  background: linear-gradient(180deg, #0A1628 0%, #0D2137 40%, #0F2820 100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sb-shield { width: 36px; height: 36px; flex-shrink: 0; }
.sb-shield svg { width: 100%; height: 100%; }
.sb-coname { font-size: .9rem; font-weight: 700; color: white; }
.sb-cosub { font-size: .65rem; color: rgba(255,255,255,.35); margin-top: 1px; }
.sb-x { display: none; background: none; border: none; color: rgba(255,255,255,.4); margin-left: auto; font-size: .9rem; }

.sb-user { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.04); }
.sb-av { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; color: white; flex-shrink: 0; border: 2px solid rgba(255,255,255,.2); }
.sb-uname { font-size: .83rem; font-weight: 600; color: white; }
.sb-rtag { font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 9px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .5px; }
.sb-ctag { font-size: .62rem; padding: 2px 7px; border-radius: 9px; background: rgba(22,163,74,.2); color: var(--g4); font-weight: 600; }

.sb-nav { flex: 1; padding: 10px 10px; }
.nav-sec { font-size: .62rem; font-weight: 700; color: rgba(255,255,255,.25); letter-spacing: 1px; text-transform: uppercase; padding: 0 6px; margin: 12px 0 5px; }
.sbl {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: 10px; font-size: .84rem; font-weight: 500; color: rgba(255,255,255,.55);
  cursor: pointer; transition: all .15s; margin-bottom: 2px;
}
.sbl i { font-size: .95rem; width: 20px; text-align: center; }
.sbl:hover { background: rgba(255,255,255,.08); color: white; }
.sbl.active { background: linear-gradient(135deg, var(--g3), var(--g2)); color: white; box-shadow: 0 4px 15px rgba(22,163,74,.3); }
.sb-foot { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.07); }
.sb-logout { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px; border-radius: 10px; border: none; background: rgba(220,38,38,.12); color: #FCA5A5; font-size: .84rem; font-weight: 500; cursor: pointer; transition: all .15s; }
.sb-logout:hover { background: rgba(220,38,38,.22); }

/* ══ TOPBAR ══ */
.main-area { margin-left: var(--sb); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: var(--tb); background: white; border-bottom: 1px solid var(--gray100); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tb-left { display: flex; align-items: center; gap: 14px; }
.menu-btn { width: 36px; height: 36px; background: var(--gray100); border: none; border-radius: 10px; display: none; align-items: center; justify-content: center; color: var(--gray600); }
.menu-btn svg { width: 18px; height: 18px; }
.tb-search { display: flex; align-items: center; gap: 9px; background: var(--gray100); border-radius: 10px; padding: 8px 14px; min-width: 240px; }
.tb-search input { border: none; background: none; outline: none; font-size: .84rem; color: var(--gray700); width: 100%; }
.tb-right { display: flex; align-items: center; gap: 14px; }
.tb-clock { font-size: .78rem; color: var(--gray500); font-weight: 500; white-space: nowrap; }
.tb-notif { position: relative; width: 36px; height: 36px; background: var(--gray100); border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--gray600); }
.ndot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; border: 2px solid white; }
.tb-profile { display: flex; align-items: center; gap: 9px; padding: 5px 12px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.tb-profile:hover { background: var(--gray100); }
.tp-av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; color: white; background: var(--company-color); }
.tb-profile p { font-size: .83rem; font-weight: 600; color: var(--gray800); }
.tb-profile span { font-size: .72rem; color: var(--gray500); }
.page-content { flex: 1; padding: 22px 24px; }

/* ══ CARDS ══ */
.page-hdr { margin-bottom: 20px; }
.page-hdr h2 { font-size: 1.35rem; font-weight: 800; color: var(--gray800); letter-spacing: -.3px; }
.page-hdr p { font-size: .83rem; color: var(--gray500); margin-top: 3px; }
.card { background: white; border-radius: var(--rl); padding: 20px 22px; box-shadow: var(--sh); border: 1px solid var(--gray100); }
.card-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.card-title { font-size: .95rem; font-weight: 700; color: var(--gray800); display: flex; align-items: center; gap: 8px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px,1fr)); gap: 14px; margin-bottom: 20px; }
.sc {
  background: white; border-radius: var(--rl); padding: 18px 20px;
  box-shadow: var(--sh); border: 1px solid var(--gray100);
  border-top: 3px solid; transition: transform .15s, box-shadow .15s; cursor: default;
}
.sc:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.sc.green { border-top-color: var(--g3); }
.sc.red { border-top-color: var(--red); }
.sc.amber { border-top-color: var(--amber); }
.sc.blue { border-top-color: var(--blue); }
.sc.purple { border-top-color: var(--purple); }
.si { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 12px; }
.si.green { background: var(--gl); } .si.red { background: var(--redl); }
.si.amber { background: var(--amberl); } .si.blue { background: var(--bluel); }
.si.purple { background: var(--purplel); }
.sl { font-size: .69rem; font-weight: 700; color: var(--gray400); text-transform: uppercase; letter-spacing: .4px; }
.sv { font-size: 1.8rem; font-weight: 800; color: var(--gray800); margin: 4px 0 2px; letter-spacing: -1px; }
.ss { font-size: .72rem; color: var(--gray400); }

/* ══ BUTTONS ══ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px;
  background: var(--g3); color: white; border: none; border-radius: var(--r);
  font-size: .84rem; font-weight: 600; cursor: pointer; transition: all .15s;
  font-family: var(--font);
}
.btn-primary:hover { background: var(--g2); box-shadow: var(--sh-green); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; background: var(--gray100); color: var(--gray700); border: none; border-radius: var(--r); font-size: .84rem; font-weight: 500; cursor: pointer; transition: all .15s; font-family: var(--font); }
.btn-secondary:hover { background: var(--gray200); }
.btn-success { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; background: var(--g3); color: white; border: none; border-radius: var(--r); font-size: .84rem; font-weight: 600; cursor: pointer; animation: pulse-g 1.5s ease-in-out infinite; font-family: var(--font); }
@keyframes pulse-g { 0%,100%{box-shadow:0 0 0 0 transparent} 50%{box-shadow:0 0 0 8px rgba(22,163,74,.2)} }
.btn-cancel { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; background: var(--gray100); color: var(--gray600); border: none; border-radius: var(--r); font-size: .84rem; font-weight: 500; cursor: pointer; transition: all .15s; font-family: var(--font); }
.btn-cancel:hover { background: var(--gray200); }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-xs { padding: 4px 10px; font-size: .72rem; border-radius: 7px; }

/* ══ TABLE ══ */
.tw { overflow-x: auto; border-radius: var(--rl); border: 1px solid var(--gray100); }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
thead tr { background: linear-gradient(135deg, var(--g1), var(--g2)); }
thead th { padding: 12px 15px; text-align: left; font-size: .69rem; font-weight: 700; color: white; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--gray100); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gll); }
tbody tr:nth-child(even) { background: var(--gray50); }
tbody tr:nth-child(even):hover { background: var(--gll); }
tbody td { padding: 10px 15px; color: var(--gray700); vertical-align: middle; }

/* ══ BADGE ══ */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 600; white-space: nowrap; }
.bg-green { background: var(--gl); color: var(--g1); }
.bg-red { background: var(--redl); color: var(--red); }
.bg-amber { background: var(--amberl); color: var(--amber); }
.bg-blue { background: var(--bluel); color: var(--blue); }
.bg-purple { background: var(--purplel); color: var(--purple); }
.bg-gray { background: var(--gray100); color: var(--gray600); }

/* ══ ALERTS ══ */
.alert { padding: 10px 14px; border-radius: var(--r); font-size: .82rem; font-weight: 500; }
.alert-success { background: var(--gl); color: var(--g1); border: 1px solid rgba(22,163,74,.2); }
.alert-error { background: var(--redl); color: var(--red); border: 1px solid rgba(220,38,38,.2); }
.alert-info { background: var(--bluel); color: var(--blue); border: 1px solid rgba(37,99,235,.2); }
.alert-warning { background: var(--amberl); color: var(--amber); border: 1px solid rgba(217,119,6,.2); }

/* ══ FORMS ══ */
.mform { padding: 20px 22px; }
.mfgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mfg { display: flex; flex-direction: column; gap: 5px; }
.mfg label { font-size: .78rem; font-weight: 600; color: var(--gray600); }
.mfg input, .mfg select, .mfg textarea { padding: 10px 13px; border: 1.5px solid var(--gray200); border-radius: var(--r); font-size: .85rem; outline: none; background: var(--gray50); color: var(--gray800); transition: border-color .2s; font-family: var(--font); }
.mfg input:focus, .mfg select:focus { border-color: var(--company-color); background: white; box-shadow: 0 0 0 3px rgba(22,163,74,.08); }
.opt { color: var(--gray400); font-weight: 400; }

/* ══ FILTER ROW ══ */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-row select, .filter-row input[type=date], .filter-row input[type=month], .filter-row input[type=text] { padding: 8px 13px; border: 1.5px solid var(--gray200); border-radius: var(--r); font-size: .83rem; background: white; outline: none; color: var(--gray700); font-family: var(--font); transition: border-color .2s; }
.filter-row select:focus, .filter-row input:focus { border-color: var(--company-color); }

/* ══ ATTENDANCE ══ */
.att-hero { max-width: 500px; margin: 0 auto; }
.att-card { background: white; border-radius: var(--rxl); padding: 28px; box-shadow: var(--sh-lg); border: 1px solid var(--gray100); margin-bottom: 16px; text-align: center; }
.att-welcome { display: flex; align-items: center; gap: 13px; background: var(--gll); border-radius: var(--r); padding: 13px 16px; margin-bottom: 18px; text-align: left; }
.att-av { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; color: white; background: var(--company-color); flex-shrink: 0; }
.att-av-info p { font-size: .72rem; color: var(--gray500); }
.att-av-info strong { font-size: .92rem; color: var(--gray800); }
.att-av-info span { font-size: .72rem; color: var(--company-color); font-weight: 600; }
.att-clock { font-size: 2.6rem; font-weight: 800; color: var(--gray800); letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.att-date { font-size: .83rem; color: var(--gray500); margin: 5px 0 16px; }
.checkin-info { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 18px; }
.ci-item { background: var(--gray50); border-radius: var(--r); padding: 11px; text-align: center; }
.ci-lbl { font-size: .65rem; font-weight: 700; color: var(--gray400); text-transform: uppercase; letter-spacing: .4px; }
.ci-val { font-size: .98rem; font-weight: 700; color: var(--gray800); margin-top: 3px; font-family: var(--mono); }
.geo-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 20px; font-size: .77rem; font-weight: 500; margin-bottom: 14px; }
.geo-pill.ready { background: var(--gl); color: var(--g1); }
.geo-pill.wait { background: var(--amberl); color: var(--amber); }
.geo-pill.err { background: var(--redl); color: var(--red); }
.gdot { width: 7px; height: 7px; border-radius: 50%; }
.gdot.green { background: var(--g3); animation: gdp 2s ease-in-out infinite; }
.gdot.amber { background: var(--amber); }
.gdot.red { background: var(--red); }
@keyframes gdp { 0%,100%{box-shadow:0 0 0 0 transparent} 50%{box-shadow:0 0 0 4px rgba(22,163,74,.2)} }
.big-btn { width: 100%; padding: 15px; border: none; border-radius: var(--rl); font-size: 1rem; font-weight: 700; cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font); }
.big-btn.checkin { background: var(--g3); color: white; box-shadow: var(--sh-green); }
.big-btn.checkin:hover { background: var(--g2); transform: translateY(-2px); box-shadow: 0 14px 35px rgba(22,163,74,.4); }
.big-btn.checkout { background: var(--red); color: white; box-shadow: 0 8px 25px rgba(220,38,38,.3); }
.big-btn.checkout:hover { background: #B91C1C; transform: translateY(-2px); }
.big-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.remote-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: .68rem; font-weight: 700; background: var(--bluel); color: var(--blue); }

/* ══ CAMERA ══ */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(10px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease; }
@keyframes fade { from{opacity:0} to{opacity:1} }
.modal-box { background: white; border-radius: var(--rxl); width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,.25); animation: mup .25s cubic-bezier(.34,1.56,.64,1); }
@keyframes mup { from{opacity:0;transform:scale(.92)} to{opacity:1;transform:scale(1)} }
.cam-modal { max-width: 460px; overflow: hidden; }
.emp-modal { max-width: 660px; max-height: 90vh; overflow-y: auto; }
.modal-hdr { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--gray100); }
.modal-hdr h3 { font-size: .98rem; font-weight: 700; color: var(--gray800); }
.modal-hdr p { font-size: .75rem; color: var(--gray500); margin-top: 2px; }
.modal-x { background: var(--gray100); border: none; border-radius: 8px; width: 28px; height: 28px; font-size: .85rem; cursor: pointer; color: var(--gray500); flex-shrink: 0; }
.modal-x:hover { background: var(--gray200); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 22px; border-top: 1px solid var(--gray100); }

.cam-area { position: relative; background: #0A1628; aspect-ratio: 4/3; overflow: hidden; }
#cam-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
#cam-captured { width: 100%; height: 100%; object-fit: cover; }
.cam-ov { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.fframe { width: 190px; height: 230px; position: relative; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); border-radius: 8px; }
.fc { position: absolute; width: 22px; height: 22px; border-color: var(--g3); border-style: solid; }
.fc.tl { top:-2px;left:-2px;border-width:3px 0 0 3px;border-radius:5px 0 0 0; }
.fc.tr { top:-2px;right:-2px;border-width:3px 3px 0 0;border-radius:0 5px 0 0; }
.fc.bl { bottom:-2px;left:-2px;border-width:0 0 3px 3px;border-radius:0 0 0 5px; }
.fc.br { bottom:-2px;right:-2px;border-width:0 3px 3px 0;border-radius:0 0 5px 0; }
.scan-line { position: absolute; left:0;right:0;height:2px; background: linear-gradient(90deg,transparent,var(--g3),transparent); animation: scan 2s ease-in-out infinite; }
@keyframes scan { 0%{top:0;opacity:1}50%{top:100%;opacity:.5}100%{top:0;opacity:1} }
.cam-instr { position: absolute; bottom:0;left:0;right:0; background: linear-gradient(transparent,rgba(0,0,0,.85)); padding: 28px 16px 14px; text-align: center; }
.ci-ico { font-size: 1.6rem; animation: bounce .9s ease-in-out infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }
#ci-txt { color: white; font-size: .84rem; font-weight: 600; margin-top: 3px; }
.live-steps { display: flex; justify-content: space-around; padding: 12px 18px; background: var(--gray50); border-bottom: 1px solid var(--gray100); }
.lstep { display: flex; align-items: center; gap: 6px; font-size: .73rem; font-weight: 500; color: var(--gray500); }
.lstep-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray300); transition: background .3s; }
.lstep-dot.active { background: var(--amber); animation: gdp 1.5s ease-in-out infinite; }
.lstep-dot.done { background: var(--g3); }
.lstep-dot.fail { background: var(--red); }
.cam-prog { padding: 12px 22px; }
.cpbar { background: var(--gray200); border-radius: 10px; height: 6px; overflow: hidden; margin-bottom: 7px; }
.cpfill { height: 100%; background: linear-gradient(90deg, var(--g3), var(--g4)); border-radius: 10px; width: 0%; transition: width .35s ease; }
#cptext { text-align: center; font-size: .8rem; color: var(--gray600); font-weight: 500; }
.cam-ctrls { display: flex; gap: 10px; justify-content: center; padding: 14px 22px; flex-wrap: wrap; }

/* ══ TABS ══ */
.tabs-row { display: flex; gap: 4px; border-bottom: 2px solid var(--gray100); margin-bottom: 18px; }
.tab-btn { padding: 9px 18px; font-size: .84rem; font-weight: 600; color: var(--gray500); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; font-family: var(--font); }
.tab-btn.active { color: var(--company-color); border-bottom-color: var(--company-color); }

/* ══ LOADING ══ */
.loading-box { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: var(--gray500); font-size: .85rem; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--gl); border-top-color: var(--g3); border-radius: 50%; animation: spin .7s linear infinite; }

/* ══ TOAST ══ */
#toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 290px; max-width: 360px; padding: 13px 16px; background: white; border-radius: var(--rl); box-shadow: var(--sh-lg); display: flex; align-items: flex-start; gap: 11px; animation: tin .3s cubic-bezier(.34,1.56,.64,1); cursor: pointer; border-left: 4px solid; }
@keyframes tin { from{opacity:0;transform:translateX(60px)} to{opacity:1;transform:translateX(0)} }
.toast.success { border-left-color: var(--g3); }
.toast.error { border-left-color: var(--red); }
.toast.info { border-left-color: var(--blue); }
.toast.warning { border-left-color: var(--amber); }
.toast-ic { font-size: .95rem; flex-shrink: 0; }
.toast-ttl { font-size: .84rem; font-weight: 700; color: var(--gray800); }
.toast-msg { font-size: .78rem; color: var(--gray500); margin-top: 2px; }

/* ══ EMPTY ══ */
.empty-state { text-align: center; padding: 55px 20px; color: var(--gray400); }
.empty-state .ei { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: .86rem; }

/* ══ PHOTO ══ */
.photo-thumb { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; cursor: pointer; border: 1px solid var(--gray200); transition: transform .15s; }
.photo-thumb:hover { transform: scale(1.1); box-shadow: var(--sh); }

/* ══ RESPONSIVE ══ */
#sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 299; }
#sb-backdrop.show { display: block; }
@media(max-width:768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sb-x { display: block !important; }
  .main-area { margin-left: 0; }
  .menu-btn { display: flex; }
  .page-content { padding: 14px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .tb-search { display: none; }
  .tb-clock { display: none; }
  #toast-wrap { left: 14px; right: 14px; }
  .toast { min-width: unset; max-width: 100%; }
  .login-left { display: none; }
  .login-right { width: 100%; padding: 30px 24px; }
  .mfgrid { grid-template-columns: 1fr; }
}

/* ══ v5 ENHANCEMENTS ══ */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--red); color: white; border-radius: 9px;
  font-size: .62rem; font-weight: 700; margin-left: auto;
}

/* Regularisation status colors */
.reg-pending { background: var(--amberl); color: var(--amber); }
.reg-approved { background: var(--gl); color: var(--g1); }
.reg-rejected { background: var(--redl); color: var(--red); }

/* Exception severity */
.sev-high { background: var(--redl); color: var(--red); }
.sev-medium { background: var(--amberl); color: var(--amber); }
.sev-low { background: var(--bluel); color: var(--blue); }

/* Timeline */
.att-timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--gray100); position: relative;
}
.tl-item:last-child { border-bottom: none; }
.tl-dot {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; border: 2px solid;
}
.tl-dot.green { background: var(--gl); border-color: var(--g3); }
.tl-dot.amber { background: var(--amberl); border-color: var(--amber); }
.tl-dot.red { background: var(--redl); border-color: var(--red); }
.tl-dot.blue { background: var(--bluel); border-color: var(--blue); }
.tl-content { flex: 1; }
.tl-title { font-size: .87rem; font-weight: 600; color: var(--gray800); }
.tl-sub { font-size: .76rem; color: var(--gray500); margin-top: 2px; }
.tl-time { font-size: .72rem; color: var(--gray400); margin-left: auto; white-space: nowrap; }

/* Notification item */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--gray100);
  cursor: pointer; transition: background .1s;
}
.notif-item:hover { background: var(--gll); margin: 0 -22px; padding: 13px 22px; }
.notif-item.unread { background: var(--gll); margin: 0 -22px; padding: 13px 22px; }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.notif-title { font-size: .85rem; font-weight: 600; color: var(--gray800); }
.notif-msg { font-size: .78rem; color: var(--gray500); margin-top: 2px; line-height: 1.4; }
.notif-time { font-size: .7rem; color: var(--gray400); margin-top: 4px; }
.notif-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--g3); margin-left: auto; flex-shrink: 0; margin-top: 6px; }

/* Department analytics bar */
.dept-bar-wrap { display: flex; flex-direction: column; gap: 12px; }
.dept-bar-item {}
.dept-bar-label { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 600; color: var(--gray700); margin-bottom: 5px; }
.dept-bar-track { height: 8px; background: var(--gray100); border-radius: 10px; overflow: hidden; }
.dept-bar-fill { height: 100%; background: linear-gradient(90deg, var(--g3), var(--g4)); border-radius: 10px; transition: width .8s cubic-bezier(.4,0,.2,1); }

/* Proof upload area */
.proof-drop {
  border: 2px dashed var(--gray300); border-radius: var(--rl); padding: 24px;
  text-align: center; cursor: pointer; transition: all .2s; background: var(--gray50);
}
.proof-drop:hover { border-color: var(--g3); background: var(--gll); }
.proof-drop.has-proof { border-color: var(--g3); background: var(--gll); }

/* Summary cards in admin */
.summary-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px; font-size: .76rem; font-weight: 600;
  margin: 3px;
}

/* Audit log items */
.audit-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--gray100); font-size: .82rem;
}
.audit-action { font-weight: 700; color: var(--gray800); font-family: var(--mono); font-size: .76rem; }
.audit-details { color: var(--gray500); font-size: .76rem; margin-top: 1px; }
.audit-time { font-size: .7rem; color: var(--gray400); margin-left: auto; white-space: nowrap; }
.audit-emp { font-weight: 600; color: var(--g1); }

/* Exception type colors */
.exc-badge {
  display: inline-flex; padding: 3px 9px; border-radius: 20px;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.exc-late_arrival { background: var(--amberl); color: var(--amber); }
.exc-missing_checkout { background: var(--redl); color: var(--red); }
.exc-missing_checkin { background: var(--redl); color: var(--red); }
.exc-face_mismatch { background: var(--redl); color: var(--red); }
.exc-outside_geofence { background: var(--purplel); color: var(--purple); }
.exc-early_exit { background: var(--amberl); color: var(--amber); }
.exc-short_hours { background: var(--bluel); color: var(--blue); }
.exc-auto_checkout { background: var(--gray100); color: var(--gray600); }
.exc-duplicate_attempt { background: var(--redl); color: var(--red); }

/* Co-tab content */
.co-tab-content { display: block; }
