/* ═══════════════════════════════════════════════════
   ATTENDFLOW — Redesigned
   Slate/indigo dark theme. Sharp, deliberate, premium.
═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Base surfaces — cool slate, not pure black */
  --bg:       #080b12;
  --s0:       #0d1117;
  --s1:       #131923;
  --s2:       #1a2130;
  --s3:       #1f2a3d;

  /* Borders */
  --line:     #1e2d42;
  --line2:    #253752;

  /* Accent — indigo, not generic blue */
  --blue:     #6366f1;
  --blue-d:   #1e1b4b;
  --blue-m:   rgba(99,102,241,.1);
  --blue-glow:rgba(99,102,241,.2);

  /* Status colors */
  --green:    #10b981;
  --green-m:  rgba(16,185,129,.1);
  --yellow:   #f59e0b;
  --yellow-m: rgba(245,158,11,.1);
  --red:      #f43f5e;
  --red-m:    rgba(244,63,94,.1);
  --orange:   #fb923c;
  --orange-m: rgba(251,146,60,.1);
  --purple:   #a78bfa;
  --purple-m: rgba(167,139,250,.1);
  --cyan:     #22d3ee;

  /* Text */
  --t0:  #e2e8f2;
  --t1:  #7a8ba8;
  --t2:  #3d5068;

  /* Shape */
  --r:   8px;
  --rs:  6px;
  --bnav: 60px;
}

*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html { height: 100%; overflow-x: hidden; font-size: 14px; }
body {
  height: 100%; background: var(--bg); color: var(--t0);
  font-family: 'Inter', system-ui, sans-serif; line-height: 1.5;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 99px; }
button { cursor: pointer; font-family: inherit; border: none; }
a { text-decoration: none; color: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: var(--t0); }
input::placeholder, textarea::placeholder { color: var(--t2); }

/* ─── LOGIN ─── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background:
    radial-gradient(ellipse 50% 70% at 20% 60%, rgba(99,102,241,.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 80% 30%, rgba(16,185,129,.04) 0%, transparent 60%),
    var(--bg);
}
.login-box {
  width: 100%; max-width: 360px;
  background: var(--s0);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 36px 28px;
  box-shadow: 0 0 0 1px rgba(99,102,241,.06), 0 24px 64px rgba(0,0,0,.6);
}
.login-logo {
  font-size: 20px; font-weight: 700; letter-spacing: -.4px;
  margin-bottom: 4px; display: flex; align-items: center; gap: 10px;
}
.login-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.login-logo-icon svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.login-sub { color: var(--t2); font-size: 12.5px; margin-bottom: 28px; }
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11.5px; font-weight: 500;
  color: var(--t1); margin-bottom: 6px; letter-spacing: .01em;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px;
  background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--rs); color: var(--t0); font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233d5068' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.field textarea { resize: vertical; min-height: 80px; font-size: 13.5px; }
.field select option { background: var(--s1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-login {
  width: 100%; padding: 10px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: var(--rs); color: #fff; font-size: 13.5px; font-weight: 600;
  border: none; cursor: pointer; margin-top: 6px;
  box-shadow: 0 4px 16px rgba(99,102,241,.25);
  transition: opacity .15s, transform .1s, box-shadow .15s;
}
.btn-login:hover { opacity: .92; box-shadow: 0 6px 20px rgba(99,102,241,.35); }
.btn-login:active { transform: scale(.98); }
.login-error { color: var(--red); font-size: 12px; margin-top: 10px; text-align: center; min-height: 18px; }

/* ─── APP SHELL ─── */
#app { display: flex; height: 100vh; overflow: hidden; max-width: 100vw; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: 220px; min-width: 220px; flex-shrink: 0;
  background: var(--s0); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
}
.sidebar-logo-icon svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.sidebar-brand { font-size: 15px; font-weight: 700; letter-spacing: -.3px; color: var(--t0); }
.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.nav-section {
  font-size: 10px; font-weight: 600; color: var(--t2);
  letter-spacing: .1em; padding: 10px 8px 5px; margin-top: 4px;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  border-radius: var(--rs); color: var(--t1); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .12s; user-select: none; position: relative;
}
.nav-item svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { color: var(--t0); background: var(--s1); }
.nav-item.active { color: var(--blue); background: var(--blue-m); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 55%; background: var(--blue); border-radius: 0 2px 2px 0;
}
.sidebar-footer {
  border-top: 1px solid var(--line); padding: 12px 12px;
  display: flex; align-items: center; gap: 9px;
}
.user-av {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--blue-d); border: 1px solid rgba(99,102,241,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--blue); flex-shrink: 0; text-transform: uppercase;
}
.user-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10.5px; color: var(--t2); }
.logout-btn {
  background: none; border: none; color: var(--t2); padding: 5px; border-radius: 5px;
  display: flex; align-items: center; transition: color .12s;
}
.logout-btn:hover { color: var(--red); }
.logout-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ─── MOBILE TOPBAR ─── */
.mobile-topbar {
  display: none; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px;
  background: var(--s0); border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.m-brand { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.m-logo-icon {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.m-logo-icon svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }

/* ─── MOBILE BOTTOM NAV ─── */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--s0); border-top: 1px solid var(--line);
  height: var(--bnav); padding: 0 4px;
  align-items: center; justify-content: space-around;
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 8px; border-radius: 8px; color: var(--t2);
  font-size: 9.5px; font-weight: 500; cursor: pointer; flex: 1; max-width: 68px;
  transition: all .12s; user-select: none;
}
.bn-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bn-item.active { color: var(--blue); }

/* ─── MAIN CONTENT ─── */
.app-body { display: flex; flex: 1; overflow: hidden; min-width: 0; }
.main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 26px 28px; background: var(--bg); min-width: 0;
}
.page { display: none; animation: fadeIn .15s ease; min-width: 0; max-width: 100%; }
.page.active { display: block; }

/* ─── PAGE HEADER ─── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 12px; flex-wrap: wrap;
}
.page-title { font-size: 19px; font-weight: 700; letter-spacing: -.4px; color: var(--t0); }
.page-sub { color: var(--t2); font-size: 12px; margin-top: 3px; }
.header-actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: var(--rs); font-size: 12.5px; font-weight: 500;
  border: 1px solid transparent; transition: all .12s; white-space: nowrap; cursor: pointer;
}
.btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.btn-primary   { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,.2); }
.btn-primary:hover { background: #5558e8; box-shadow: 0 4px 14px rgba(99,102,241,.3); }
.btn-secondary { background: var(--s1); color: var(--t0); border-color: var(--line); }
.btn-secondary:hover { background: var(--s2); border-color: var(--line2); }
.btn-danger    { background: var(--red-m); color: var(--red); border-color: rgba(244,63,94,.15); }
.btn-danger:hover { background: rgba(244,63,94,.18); }
.btn-success   { background: var(--green-m); color: var(--green); border-color: rgba(16,185,129,.15); }
.btn-success:hover { background: rgba(16,185,129,.18); }
.btn-ghost     { background: transparent; color: var(--t1); }
.btn-ghost:hover { color: var(--t0); background: var(--s1); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ─── CARDS ─── */
.card {
  background: var(--s0); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px;
}
.card-title {
  font-size: 11px; font-weight: 600; color: var(--t2);
  letter-spacing: .08em; margin-bottom: 14px;
  text-transform: uppercase;
}

/* ─── STAT CARDS ─── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px; margin-bottom: 20px; width: 100%; min-width: 0;
}
.stat-card {
  background: var(--s0); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 16px 14px; position: relative; overflow: hidden; min-width: 0;
  transition: border-color .15s, transform .12s;
}
.stat-card:hover { border-color: var(--line2); transform: translateY(-1px); }

/* Colored left-edge stripe instead of top border */
.stat-accent::after  { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--blue); border-radius:var(--r) 0 0 var(--r); }
.stat-green::after   { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--green); border-radius:var(--r) 0 0 var(--r); }
.stat-yellow::after  { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--yellow); border-radius:var(--r) 0 0 var(--r); }
.stat-red::after     { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--red); border-radius:var(--r) 0 0 var(--r); }
.stat-orange::after  { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--orange); border-radius:var(--r) 0 0 var(--r); }
.stat-purple::after  { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--purple); border-radius:var(--r) 0 0 var(--r); }

.stat-label {
  font-size: 10.5px; font-weight: 500; color: var(--t2);
  letter-spacing: .04em; margin-bottom: 9px; padding-left: 8px;
}
.stat-value {
  font-family: 'DM Mono', 'Inter', monospace !important;
  font-size: 28px !important; font-weight: 500 !important;
  line-height: 1 !important; color: var(--t0) !important;
  letter-spacing: -1px !important; display: block !important;
  padding-left: 8px !important;
  font-variant-numeric: tabular-nums !important;
}
.stat-desc { font-size: 10.5px; color: var(--t2); margin-top: 5px; padding-left: 8px; }
.stat-trend { position: absolute; top: 14px; right: 14px; }
.stat-trend svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; opacity: .1; }

/* ─── GRID LAYOUTS ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; min-width: 0; }
.grid-2 > *, .grid-3 > * { min-width: 0; }

/* ─── TABLE ─── */
.table-wrap {
  overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 480px; }
thead th {
  background: var(--s1); padding: 9px 14px; text-align: left;
  font-size: 10.5px; font-weight: 600; color: var(--t2);
  letter-spacing: .06em; border-bottom: 1px solid var(--line);
  white-space: nowrap; text-transform: uppercase;
}
tbody tr { border-bottom: 1px solid var(--line); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--s1); }
tbody td { padding: 10px 14px; font-size: 13px; vertical-align: middle; }
.empty-row td { text-align: center; color: var(--t2); padding: 40px; font-size: 13px; }

/* ─── BADGES ─── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
  font-family: inherit; letter-spacing: .01em;
}
.badge-green  { background: var(--green-m);  color: var(--green); }
.badge-red    { background: var(--red-m);    color: var(--red); }
.badge-yellow { background: var(--yellow-m); color: var(--yellow); }
.badge-blue   { background: var(--blue-m);   color: var(--blue); }
.badge-gray   { background: var(--s2);        color: var(--t1); }
.badge-orange { background: var(--orange-m); color: var(--orange); }
.badge-purple { background: var(--purple-m); color: var(--purple); }

/* ─── STATUS DOT ─── */
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ─── FILTER BAR ─── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select {
  padding: 7px 12px; background: var(--s0); border: 1px solid var(--line);
  border-radius: var(--rs); color: var(--t0); font-size: 13px; min-width: 0;
  -webkit-appearance: none; transition: border-color .12s;
}
.filter-bar input { flex: 1; min-width: 120px; }
.filter-bar select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233d5068' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--blue); }

/* ─── TABS ─── */
.tabs {
  display: flex; gap: 0; margin-bottom: 16px;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.tab {
  padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--t2);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: all .12s; white-space: nowrap; margin-bottom: -1px;
}
.tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tab:hover:not(.active) { color: var(--t1); }

/* ─── MODAL ─── */
#modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 1000; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
}
#modal-overlay.open { display: flex; }
.modal {
  background: var(--s0); border: 1px solid var(--line2);
  border-radius: 12px 12px 0 0; width: 100%; max-width: 540px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 -16px 48px rgba(0,0,0,.6), 0 0 0 1px rgba(99,102,241,.05);
  animation: slideUp .24s cubic-bezier(.16,1,.3,1);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 0; margin-bottom: 16px; position: sticky; top: 0;
  background: var(--s0); z-index: 1; border-radius: 12px 12px 0 0;
}
.modal-title { font-size: 14.5px; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--t2); font-size: 16px;
  line-height: 1; padding: 5px 8px; border-radius: 5px; transition: all .12s;
}
.modal-close:hover { color: var(--t0); background: var(--s2); }
#modal-body { padding: 0 20px 28px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
  padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.modal-actions .btn { flex: 1; justify-content: center; }

/* ─── TOAST ─── */
#toast-container {
  position: fixed; bottom: calc(var(--bnav) + 10px); right: 14px;
  z-index: 2000; display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.toast {
  padding: 10px 15px; border-radius: var(--rs); font-size: 12.5px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: slideInR .2s ease;
  display: flex; align-items: center; gap: 8px; max-width: 280px;
  border: 1px solid; backdrop-filter: blur(8px);
}
.toast-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.2); color: var(--green); }
.toast-error   { background: rgba(244,63,94,.1);  border-color: rgba(244,63,94,.2);  color: var(--red); }
.toast-info    { background: rgba(99,102,241,.1); border-color: rgba(99,102,241,.2); color: var(--blue); }

/* ─── EMPLOYEE AVATAR ─── */
.emp-initials {
  width: 32px; height: 32px; border-radius: 7px; background: var(--s2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--blue); flex-shrink: 0;
  border: 1px solid var(--line);
}

/* ─── ATTENDANCE ─── */
.att-grid-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.att-row {
  display: grid; grid-template-columns: 190px 110px 135px 120px 120px 1fr;
  border-bottom: 1px solid var(--line); align-items: center;
}
.att-row:last-child { border-bottom: none; }
.att-row.header { background: var(--s1); }
.att-row:not(.header):hover { background: var(--s1); }
.att-cell { padding: 8px 12px; font-size: 12.5px; }
.att-row.header .att-cell { font-size: 10px; font-weight: 600; color: var(--t2); text-transform: uppercase; letter-spacing: .06em; }
.status-select, .time-input {
  width: 100%; padding: 5px 8px; background: var(--s2);
  border: 1px solid var(--line); border-radius: 4px;
  color: var(--t0); font-size: 12.5px; -webkit-appearance: none;
  transition: border-color .12s;
}
.status-select:focus, .time-input:focus { outline: none; border-color: var(--blue); }
.att-desktop { display: block; }
.att-mobile  { display: none; }

/* ─── ATT CARD (mobile) ─── */
.att-card {
  background: var(--s0); border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 14px; margin-bottom: 8px;
}
.att-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; gap: 10px; }
.att-card-name { font-weight: 600; font-size: 13.5px; }
.att-card-dept { font-size: 11px; color: var(--t2); margin-top: 1px; }
.att-card-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.att-field-label { font-size: 9px; font-weight: 600; color: var(--t2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.att-note-row { margin-top: 7px; }

/* ─── EMPLOYEE CARDS (mobile) ─── */
.emp-card {
  background: var(--s0); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 14px; margin-bottom: 8px;
}
.emp-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.emp-card-name { font-weight: 600; font-size: 13.5px; }
.emp-card-sub { font-size: 11.5px; color: var(--t1); margin-top: 1px; }
.emp-card-stats { display: flex; gap: 7px; }
.emp-stat { flex: 1; background: var(--s1); border-radius: 6px; padding: 9px 10px; text-align: center; }
.emp-stat-val { font-family: 'DM Mono', monospace; font-size: 16px; font-weight: 500; color: var(--t0); }
.emp-stat-lbl { font-size: 9px; color: var(--t2); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.emp-card-actions { display: flex; gap: 6px; margin-top: 10px; }
.emp-card-actions .btn { flex: 1; justify-content: center; }

/* ─── LEAVE CARD ─── */
.leave-card {
  background: var(--s0); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 8px; transition: border-color .12s;
}
.leave-card:hover { border-color: var(--line2); }
.leave-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.leave-name { font-weight: 600; font-size: 13.5px; }
.leave-meta { color: var(--t1); font-size: 12px; margin-top: 3px; line-height: 1.6; }
.leave-reason { color: var(--t2); font-size: 12px; margin-top: 5px; font-style: italic; }
.leave-actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* ─── CASH OUT CARD ─── */
.cashout-card {
  background: linear-gradient(135deg, rgba(167,139,250,.07) 0%, rgba(99,102,241,.04) 100%);
  border: 1px solid rgba(167,139,250,.15); border-radius: var(--r); padding: 15px;
  margin-bottom: 14px;
}
.cashout-card .co-title { font-weight: 600; font-size: 13px; color: var(--purple); margin-bottom: 4px; }
.cashout-card .co-sub   { font-size: 12px; color: var(--t1); }

/* ─── PROGRESS BAR ─── */
.progress-bar { height: 3px; background: var(--s2); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.progress-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }

/* ─── CALENDAR ─── */
.calendar-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.calendar-nav { display: flex; gap: 2px; }
.calendar-nav button {
  background: var(--s1); border: 1px solid var(--line); color: var(--t1);
  border-radius: var(--rs); padding: 6px 12px; font-size: 13px; transition: all .12s; cursor: pointer;
}
.calendar-nav button:hover { color: var(--t0); border-color: var(--line2); }
.cal-month { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-day-label {
  text-align: center; padding: 6px 2px; font-size: 10px;
  font-weight: 600; color: var(--t2); text-transform: uppercase; letter-spacing: .04em;
}
.cal-day {
  background: var(--s0); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px; min-height: 68px; cursor: pointer; transition: all .12s;
}
.cal-day:hover { border-color: var(--line2); background: var(--s1); }
.cal-day.today { border-color: var(--blue); background: var(--blue-m); }
.cal-day.other-month { opacity: .2; }
.cal-day-num { font-size: 11px; font-weight: 600; color: var(--t2); margin-bottom: 3px; }
.cal-day.today .cal-day-num { color: var(--blue); }
.cal-events { display: flex; flex-direction: column; gap: 2px; }
.cal-event { font-size: 9px; padding: 2px 4px; border-radius: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── CHARTS ─── */
.chart-card { background: var(--s0); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.chart-card canvas { max-height: 220px; }

/* ─── SETTINGS ─── */
.settings-section { margin-bottom: 24px; }
.settings-section h3 {
  font-size: 12.5px; font-weight: 600; color: var(--t0);
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap;
}
.setting-row:last-child { border-bottom: none; }

/* ─── ZK STATUS BAR ─── */
/* Matches what renderZkStatusBar() renders in app.js */
.zk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--rs); margin-bottom: 18px;
  font-size: 12.5px;
}

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state svg { width: 36px; height: 36px; fill: none; stroke: var(--t2); stroke-width: 1.2; opacity: .4; margin-bottom: 12px; display: block; margin-left: auto; margin-right: auto; }
.empty-state p { font-size: 13.5px; color: var(--t1); }
.empty-state span { font-size: 12px; color: var(--t2); }

/* ─── DIVIDER ─── */
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp    { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes slideInR  { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes pulse     { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ═══════════════════════════════════════
   DESKTOP (≥ 700px)
═══════════════════════════════════════ */
@media (min-width: 700px) {
  #app { flex-direction: row; }
  .app-body { flex-direction: row; }
  .sidebar { display: flex; }
  .mobile-topbar { display: none !important; }
  .bottom-nav { display: none !important; }
  .main-content { padding: 24px 28px; }
  #toast-container { bottom: 20px; right: 20px; }
  .modal { border-radius: 10px; }
  #modal-overlay { align-items: center; }
  .modal-actions .btn { flex: none; }
  .att-desktop { display: block; }
  .att-mobile  { display: none; }
  .emp-card { display: none; }
  .table-wrap.emp-table { display: block; }
  .form-row { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════
   MOBILE (< 700px)
═══════════════════════════════════════ */
@media (max-width: 699px) {
  html, body, #app { overflow-x: hidden !important; max-width: 100vw !important; }
  #app { flex-direction: column; }
  .sidebar { display: none !important; }
  .mobile-topbar { display: flex; }
  .bottom-nav { display: flex; }
  .app-body { flex: 1; overflow: hidden; min-width: 0; max-width: 100vw; }
  .main-content {
    padding: 14px 13px calc(var(--bnav) + 14px) !important;
    overflow-x: hidden !important; overflow-y: auto;
    width: 100% !important; max-width: 100vw !important;
    -webkit-overflow-scrolling: touch;
  }
  .page, .page.active {
    width: 100% !important; max-width: 100% !important; overflow-x: hidden !important;
  }

  /* Stats: 2 col */
  .stats-grid {
    grid-template-columns: repeat(2,1fr) !important;
    gap: 8px !important; width: 100% !important;
  }
  .stat-card { padding: 12px 12px 10px !important; min-width: 0 !important; }
  .stat-trend { display: none !important; }
  .stat-value { font-size: 22px !important; letter-spacing: -.5px !important; }
  .stat-desc  { font-size: 10px !important; }

  /* Grids stack */
  .grid-2, .grid-3 {
    grid-template-columns: 1fr !important; gap: 8px !important; width: 100% !important;
  }

  /* Page header */
  .page-header { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  .header-actions { display: flex !important; gap: 6px !important; width: 100% !important; }
  .header-actions .btn { flex: 1 !important; justify-content: center !important; font-size: 12px !important; padding: 7px 6px !important; }

  /* Att, emp, leave */
  .att-desktop { display: none !important; }
  .att-mobile  { display: block !important; }
  .emp-card { display: block !important; }
  .table-wrap.emp-table { display: none !important; }

  /* Tables inside cards */
  .card .table-wrap { overflow-x: auto !important; }
  .card table { min-width: 340px; }

  /* Leave */
  .leave-card-top { flex-direction: column !important; }
  .leave-actions { width: 100% !important; }
  .leave-actions .btn { flex: 1 !important; justify-content: center !important; }

  /* Tabs */
  .tabs { overflow-x: auto; }
  .tab  { font-size: 12.5px; padding: 8px 12px; }

  /* Filter */
  .filter-bar { flex-wrap: wrap !important; }
  .filter-bar input, .filter-bar select { flex: 1 !important; min-width: 0 !important; }

  /* Modal */
  .modal { max-height: 88vh; }
  .form-row { grid-template-columns: 1fr !important; }
  .modal-actions .btn { flex: 1 !important; justify-content: center !important; }

  /* Calendar */
  .calendar-grid { gap: 2px; }
  .cal-day { min-height: 52px; padding: 4px; }
  .cal-day-num { font-size: 10px; }
  .cal-event { font-size: 8px; }
  .cal-day-label { font-size: 9px; }

  /* Settings */
  .settings-section .grid-2 { grid-template-columns: 1fr !important; }
}

/* ─── STATUS PILL (tap-to-cycle) ─── */
.status-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 12px; border-radius: 5px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: all .12s; white-space: nowrap; width: 100%;
  font-family: inherit;
}
.pill-unset   { background: var(--s2);        color: var(--t2);      border-color: var(--line); }
.pill-present { background: var(--green-m);   color: var(--green);   border-color: rgba(16,185,129,.2); }
.pill-late    { background: var(--yellow-m);  color: var(--yellow);  border-color: rgba(245,158,11,.2); }
.pill-absent  { background: var(--red-m);     color: var(--red);     border-color: rgba(244,63,94,.2); }
.pill-leave   { background: var(--blue-m);    color: var(--blue);    border-color: rgba(99,102,241,.2); }
.pill-holiday { background: var(--purple-m);  color: var(--purple);  border-color: rgba(167,139,250,.2); }
.status-pill:hover { filter: brightness(1.15); transform: scale(1.02); }
.status-pill:active { transform: scale(.97); }
