/* ============================================================
   Swiss Attendance Admin Dashboard — Minimalist Design System
   ============================================================ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --red:         #dc2626;
  --red-dark:    #b91c1c;
  --red-soft:    #fef2f2;
  --red-border:  #fecaca;
  --orange:      #ea580c;
  --bg:          #f4f5f7;
  --white:       #ffffff;
  --text:        #111827;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;
  --border:      #e5e7eb;
  --border-dark: #d1d5db;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(0,0,0,.08);
  --shadow-md:   0 8px 32px rgba(0,0,0,.10);
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --sidebar-w:   240px;
  --header-h:    64px;
  --transition:  0.2s ease;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   LOGIN — split panel + sliding K60 sync
   ============================================================ */
.login-container {
  display: flex; justify-content: center; align-items: center;
  min-height: 100vh; background: var(--bg);
  position: relative; overflow: hidden;
  padding: 24px 16px;
}
.login-container::before {
  content: ''; position: absolute;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(220,38,38,.07) 0%, transparent 70%);
  border-radius: 50%; top: -200px; right: -150px; pointer-events: none;
}
.login-container::after {
  content: ''; position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(220,38,38,.04) 0%, transparent 70%);
  border-radius: 50%; bottom: -120px; left: -100px; pointer-events: none;
}

.login-theme-toggle {
  position: absolute; top: 20px; right: 20px; z-index: 5;
  width: 42px; height: 42px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--white);
  color: var(--text-muted); cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.login-theme-toggle:hover { color: var(--red); transform: scale(1.04); }

.auth-shell {
  width: 100%; max-width: 920px;
  position: relative; z-index: 1;
  perspective: 1200px;
}

.auth-view {
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform .55s cubic-bezier(.22,.9,.3,1), opacity .4s ease;
}

.auth-view-home {
  transform: translateX(0);
  opacity: 1;
  position: relative;
  z-index: 1;
}
.auth-shell.is-sync .auth-view-home {
  transform: translateX(-24px) scale(.985);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.auth-view-sync {
  transform: translateX(36px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  position: absolute;
  left: 0; right: 0; top: 0;
  max-width: 480px;
  margin: 0 auto;
  z-index: 2;
}
.auth-shell.is-sync .auth-view-sync {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  position: relative;
}

.sync-service-line {
  font-size: 12px; font-weight: 600; margin: -6px 0 8px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg); color: var(--text-muted); border: 1px solid var(--border);
}
.sync-service-line.ok { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.sync-service-line.warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.sync-service-line.err { background: var(--red-soft); color: var(--red); border-color: var(--red-border); }
.sync-meta-line {
  font-size: 12px; color: var(--text-muted); margin-bottom: 14px;
}
.sync-meta-line strong { color: var(--text); font-weight: 600; }
.k60-site-prompt {
  font-size: 12px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.4;
}
.k60-site-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px;
}
.btn-k60-office {
  background: #0891B2; color: #fff; width: 100%;
  border: 2px solid transparent;
}
.btn-k60-office:hover { background: #0e7490; }
.btn-k60-office.is-active {
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.25);
  border-color: #155e75;
}
.btn-k60-factory {
  background: #7C3AED; color: #fff; width: 100%;
  border: 2px solid transparent;
}
.btn-k60-factory:hover { background: #6D28D9; }
.btn-k60-factory.is-active {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
  border-color: #5B21B6;
}
.k60-sync-form { margin: 0; }

.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 520px;
}

.auth-promo {
  background: linear-gradient(160deg, #dc2626 0%, #991b1b 55%, #7f1d1d 100%);
  color: #fff;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.auth-promo::after {
  content: '';
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  top: -60px; right: -40px;
}
.auth-promo-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  padding: 6px 12px; border-radius: 99px;
  width: fit-content;
  position: relative; z-index: 1;
}
.auth-promo h2 {
  font-size: 28px; font-weight: 700; letter-spacing: -.4px;
  line-height: 1.2; position: relative; z-index: 1;
}
.auth-promo > p {
  font-size: 14px; line-height: 1.55; opacity: .92;
  max-width: 34ch; position: relative; z-index: 1;
}
.auth-promo-points {
  list-style: none; display: flex; flex-direction: column; gap: 8px;
  margin: 4px 0 8px; position: relative; z-index: 1;
}
.auth-promo-points li {
  font-size: 13px; display: flex; align-items: center; gap: 8px; opacity: .95;
}
.auth-promo-points i { opacity: .9; }
.btn-promo {
  margin-top: 8px; width: fit-content;
  padding: 12px 18px; border: none; border-radius: 10px;
  background: #fff; color: #b91c1c;
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative; z-index: 1;
}
.btn-promo:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0,0,0,.22); }

.auth-form-panel {
  display: flex; flex-direction: column;
  background: var(--white);
}
.auth-form-header {
  padding: 36px 36px 20px; text-align: center; border-bottom: none;
}
.login-icon {
  width: 56px; height: 56px; background: var(--red-soft);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.login-icon i { font-size: 24px; color: var(--red); }
.login-header h1 {
  font-size: 22px; font-weight: 700; color: var(--text);
  letter-spacing: -.3px; margin-bottom: 4px;
}
.login-subtitle { font-size: 13px; color: var(--text-muted); }
#loginForm { padding: 8px 36px 24px; }
.forgot-section { padding: 8px 36px 24px; }
.forgot-back { text-align: center; margin-top: 16px; }
.input-group { position: relative; margin-bottom: 16px; }
.input-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text-light);
  font-size: 15px; pointer-events: none; z-index: 1;
}
.input-group input {
  width: 100%; padding: 12px 44px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit;
  background: var(--bg); color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input-group input:focus {
  outline: none; border-color: var(--red);
  background: var(--white); box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}
.input-group input::placeholder { color: var(--text-light); }
.toggle-password {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 15px; padding: 6px; transition: color var(--transition);
}
.toggle-password:hover { color: var(--red); }
.btn-login {
  width: 100%; padding: 12px; background: var(--red); color: white;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px;
}
.btn-login:hover { background: var(--red-dark); box-shadow: 0 4px 12px rgba(220,38,38,.25); }
.btn-login:active { transform: translateY(1px); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }
.error-message {
  margin-top: 14px; padding: 10px 14px;
  background: var(--red-soft); border-left: 3px solid var(--red);
  color: var(--red); border-radius: var(--radius-sm); font-size: 13px; display: none;
}
.login-footer {
  margin-top: auto;
  padding: 16px 36px; text-align: center;
  background: var(--bg); border-top: 1px solid var(--border);
}
.login-footer p {
  font-size: 12px; color: var(--text-light);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.login-footer i { color: var(--red); }
.forgot-password-wrap { text-align: right; margin-bottom: 4px; margin-top: -8px; }
.forgot-link { font-size: 12px; color: var(--red); text-decoration: none; font-weight: 500; transition: opacity var(--transition); }
.forgot-link:hover { opacity: .75; text-decoration: underline; }
.forgot-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.success-message {
  margin-top: 14px; padding: 10px 14px;
  background: #f0fdf4; border-left: 3px solid #16a34a;
  color: #15803d; border-radius: var(--radius-sm); font-size: 13px;
}

/* Sync card */
.sync-card {
  padding: 28px 28px 24px;
}
.sync-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 22px;
}
.sync-card-head h2 {
  font-size: 20px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px; letter-spacing: -.3px;
}
.sync-card-head h2 i { color: var(--red); }
.sync-card-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.k60-sync-pill {
  font-size: 11px; font-weight: 600; padding: 5px 12px;
  border-radius: 99px; white-space: nowrap;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
}
.k60-sync-pill.on { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.k60-sync-pill.wait { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.k60-sync-pill.off { background: var(--red-soft); border-color: var(--red-border); color: var(--red); }
.k60-field { margin-bottom: 14px; }
.k60-field label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 6px;
}
.k60-field input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: ui-monospace, monospace;
  background: var(--bg); color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.k60-field input:focus {
  outline: none; border-color: var(--red); background: var(--white);
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}
.k60-actions { display: grid; gap: 10px; margin-top: 6px; }
.k60-actions-stack { grid-template-columns: 1fr; }
.k60-actions-row { grid-template-columns: 1.4fr 1fr; align-items: stretch; }
.btn-k60 {
  padding: 12px 10px; border-radius: 10px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-k60-primary { background: var(--red); color: #fff; width: 100%; }
.btn-k60-primary:hover { background: var(--red-dark); box-shadow: 0 4px 14px rgba(220,38,38,.28); }
.btn-k60-enter {
  min-height: 48px;
  font-size: 15px;
  letter-spacing: .02em;
}
.btn-k60-enter #k60SyncIcon { font-size: 16px; }
.btn-k60-secondary {
  background: var(--white); color: var(--text);
  border: 1.5px solid var(--border); width: 100%;
}
.btn-k60-secondary:hover { background: var(--bg); }
.btn-k60:disabled { opacity: .55; cursor: not-allowed; }
.btn-k60 .fa-spin { animation: fa-spin 1s linear infinite; }
.k60-status {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.45; display: none;
}
.k60-status.show { display: block; }
.k60-status.ok { background: #f0fdf4; color: #15803d; border-left: 3px solid #16a34a; }
.k60-status.err { background: var(--red-soft); color: var(--red); border-left: 3px solid var(--red); }
.k60-status.info { background: #eff6ff; color: #1d4ed8; border-left: 3px solid #3b82f6; }
.k60-hint {
  font-size: 12px; color: var(--text-light); margin-top: 16px;
  line-height: 1.55; padding-top: 14px; border-top: 1px solid var(--border);
}
.k60-hint.k60-hint-warn {
  color: #b45309;
}

/* Toast notifications */
.auth-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px);
  width: min(440px, calc(100vw - 32px));
  background: var(--white); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-md);
  padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
  z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.auth-toast.show {
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.auth-toast-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--red-soft); color: var(--red);
}
.auth-toast.ok .auth-toast-icon { background: #f0fdf4; color: #15803d; }
.auth-toast.err .auth-toast-icon { background: var(--red-soft); color: var(--red); }
.auth-toast.info .auth-toast-icon { background: #eff6ff; color: #1d4ed8; }
.auth-toast-body { flex: 1; min-width: 0; }
.auth-toast-body strong { display: block; font-size: 13px; margin-bottom: 2px; color: var(--text); }
.auth-toast-body p { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin: 0; }
.auth-toast-close {
  border: none; background: transparent; color: var(--text-light);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.auth-toast-close:hover { color: var(--text); }

/* Dark mode (login) */
html[data-theme="dark"] {
  --bg: #0f1218;
  --white: #171b24;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-light: #6b7280;
  --border: #2a3140;
  --border-dark: #3b4455;
  --red-soft: rgba(220,38,38,.16);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
  --shadow: 0 4px 16px rgba(0,0,0,.35);
  --shadow-md: 0 10px 36px rgba(0,0,0,.45);
}
html[data-theme="dark"] .auth-promo {
  background: linear-gradient(160deg, #ef4444 0%, #b91c1c 55%, #7f1d1d 100%);
}
html[data-theme="dark"] .btn-promo { color: #991b1b; }
html[data-theme="dark"] .input-group input,
html[data-theme="dark"] .k60-field input { background: #10141c; }
html[data-theme="dark"] .input-group input:focus,
html[data-theme="dark"] .k60-field input:focus { background: #171b24; }

@media (max-width: 820px) {
  .auth-split { grid-template-columns: 1fr; min-height: 0; }
  .auth-promo { padding: 28px 24px; min-height: 240px; }
  .auth-promo h2 { font-size: 24px; }
  #loginForm, .forgot-section { padding-left: 24px; padding-right: 24px; }
  .auth-form-header { padding: 28px 24px 12px; }
  .login-footer { padding: 14px 24px; }
  .sync-card { padding: 24px 20px; }
  .auth-view-sync { max-width: 100%; }
  .k60-actions-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .login-container { padding: 16px 12px; align-items: flex-start; padding-top: 64px; }
  .login-theme-toggle { top: 14px; right: 14px; }
}

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-container { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--white);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; height: 100vh; overflow-y: auto; z-index: 100;
}
.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sidebar-close-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  transition: background var(--transition), color var(--transition);
}
.sidebar-close-btn:hover {
  background: var(--red-soft);
  color: var(--red);
}
.logo-mark {
  width: 36px; height: 36px; background: var(--red);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-mark i { font-size: 16px; color: white; }
.logo-text { display: flex; flex-direction: column; gap: 1px; }
.logo-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.logo-sub   { font-size: 11px; color: var(--text-muted); }
.sidebar-nav { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  color: var(--text-muted); text-decoration: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; transition: background var(--transition), color var(--transition);
}
.nav-item i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }
.nav-item:hover { background: var(--red-soft); color: var(--red); }
.nav-item.active { background: var(--red-soft); color: var(--red); font-weight: 600; }
.nav-pending-badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #dc2626; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
}
.approval-tab-count {
  min-width: 16px; height: auto; padding: 2px 6px;
  background: #dc2626; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 1.2; text-align: center;
  white-space: nowrap;
}
.approval-tab-active .approval-tab-count { background: #fff; color: #dc2626; }

.header-notify-btn {
  position: relative; width: 36px; height: 36px; border: none; background: var(--red-soft);
  color: var(--red); border-radius: 50%; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; font-size: 14px;
}
.header-notify-btn.has-pending { background: #fee2e2; color: #dc2626; }
.header-notify-count {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: #dc2626; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 16px;
}
.header-notify-wrap { position: relative; }
.admin-notify-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 10060;
  width: min(360px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.16);
  overflow: hidden;
}
.admin-notify-panel[hidden] { display: none !important; }
.admin-notify-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: #f9fafb;
}
.admin-notify-panel-head strong { font-size: 13px; color: var(--text); }
.admin-notify-panel-refresh {
  width: 28px; height: 28px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
.admin-notify-panel-refresh:hover { background: var(--red-soft); color: var(--red); }
.admin-notify-panel-body { max-height: 360px; overflow-y: auto; padding: 6px; }
.admin-notify-empty {
  padding: 22px 14px; text-align: center; color: var(--text-muted); font-size: 13px;
}
.admin-notify-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 10px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; text-align: left;
}
.admin-notify-item:hover { background: var(--red-soft); }
.admin-notify-item-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: #fef2f2; color: var(--red);
  display: inline-flex; align-items: center; justify-content: center;
}
.admin-notify-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-notify-item-text strong { font-size: 13px; color: var(--text); }
.admin-notify-item-text small { font-size: 11px; color: var(--text-muted); }
.admin-notify-item-count {
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: #dc2626; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 22px; text-align: center;
}
.admin-notify-toast {
  position: fixed; top: 18px; right: 18px; z-index: 10050;
  display: flex; align-items: flex-start; gap: 12px;
  max-width: 380px; width: calc(100% - 36px);
  background: #111827; color: #fff; padding: 14px 16px;
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.28);
  cursor: pointer;
}
.admin-notify-toast[hidden] { display: none !important; }
.admin-notify-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: #059669; display: flex; align-items: center; justify-content: center;
}
.admin-notify-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.admin-notify-body strong { font-size: 13.5px; }
.admin-notify-body span { font-size: 12.5px; color: #d1d5db; line-height: 1.4; }
.admin-notify-close {
  background: none; border: none; color: #9ca3af; font-size: 20px; cursor: pointer;
  line-height: 1; padding: 0 2px;
}
.sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--border); }

/* ── Main Content ────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

/* ── Header ──────────────────────────────────────────────── */
.header {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: var(--header-h);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 50;
}
.header h1 { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-datetime { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.header-datetime i { font-size: 11px; }
.header-user { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 28px; height: 28px; background: var(--red-soft);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.user-avatar i { font-size: 12px; color: var(--red); }
.user-info { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

/* ── Content ─────────────────────────────────────────────── */
.content { padding: 22px; flex: 1; min-width: 0; overflow-x: hidden; }
.page { display: none; }
.page.active { display: block; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-dark); box-shadow: 0 4px 10px rgba(220,38,38,.2); }
.btn-secondary { background: var(--white); color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-dark); color: var(--text); }
.btn-success { background: #f97316; color: white; }
.btn-success:hover { background: #ea580c; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: var(--red); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--red); color: var(--red);
  padding: 7px 16px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-weight: 600; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-outline:hover { background: var(--red); color: white; }
#logoutBtn { width: 100%; justify-content: center; font-size: 13px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--white); padding: 18px 20px;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 14px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card-clickable { cursor: pointer; }
.stat-card-clickable:active { transform: translateY(0); }
.stat-card-clickable::after {
  content: '\f054'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  font-size: 10px; color: var(--text-light); margin-left: auto; opacity: 0;
  transition: opacity var(--transition);
}
.stat-card-clickable:hover::after { opacity: 1; }

.dashboard-drilldown-box { max-width: 1100px; width: 95%; }
.dashboard-drilldown-filters {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: #f8fafc;
}
.dashboard-filter-group { display: flex; flex-direction: column; gap: 4px; }
.dashboard-filter-group label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px;
}
.dashboard-filter-group label i { margin-right: 4px; }
.dashboard-filter-group input[type="date"],
.dashboard-filter-group input[type="month"] { min-width: 160px; }
.dashboard-drilldown-body { padding: 0 20px 20px; max-height: calc(100vh - 200px); overflow: auto; }
.dashboard-drilldown-body table { font-size: 13px; }
.dashboard-drilldown-body th { white-space: nowrap; }
.dashboard-drilldown-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; }

.dash-date-list, .dash-late-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; }
.dash-date-chip {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #fef2f2; color: #b91c1c; font-size: 11px; font-weight: 600;
  border: 1px solid #fecaca;
}
.dash-late-chip {
  width: 100%; padding: 6px 8px; border-radius: 6px; font-size: 11px;
  background: #fff7ed; border: 1px solid #fed7aa; margin-bottom: 2px;
}
.dash-late-chip-today { background: #ffedd5; border-color: #fb923c; }
.dash-late-date { font-weight: 700; color: #c2410c; margin-right: 6px; }
.dash-late-mins { color: #ea580c; font-weight: 600; margin-right: 6px; }
.dash-late-time { color: #6b7280; font-size: 10px; display: block; margin-top: 2px; }
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon.green  { background: #f0fdf4; color: #16a34a; }
.stat-icon.red    { background: var(--red-soft); color: var(--red); }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-info h3 { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -.5px; margin-bottom: 2px; }
.stat-info p  { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   CHARTS
   ============================================================ */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; margin-bottom: 20px; }
.charts-grid-single { grid-template-columns: 1fr; max-width: 920px; }
.chart-card {
  background: var(--white); padding: 20px;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.chart-card h3 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.chart-card-compact { padding: 16px 18px 12px; }
.chart-card-compact h3 { margin-bottom: 10px; }
.chart-canvas-wrap { position: relative; height: 220px; width: 100%; }
.chart-canvas-wrap canvas { width: 100% !important; height: 100% !important; }

/* ============================================================
   RECENT ACTIVITY
   ============================================================ */
.recent-activity {
  background: var(--white); padding: 20px;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.recent-activity h3 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.activity-list { max-height: 360px; overflow-y: auto; }
.activity-item {
  padding: 11px 0; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; transition: padding-left var(--transition);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { padding-left: 6px; }

/* ============================================================
   PAGE HEADER & FILTERS
   ============================================================ */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.filter-container {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 14px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ============================================================
   FORM CONTROLS (shared)
   ============================================================ */
.form-control, .search-input {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--white); color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .search-input:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.07);
}
.form-control::placeholder, .search-input::placeholder { color: var(--text-light); }
select.form-control { cursor: pointer; }

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow-x: auto;
  overflow-y: auto; max-height: 75vh;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: #f9fafb; }
thead tr { border-bottom: 2px solid var(--border); }
th {
  position: sticky; top: 0; z-index: 10;
  background: #f9fafb;
  padding: 11px 14px; font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px;
  text-align: left; white-space: nowrap;
}
td { padding: 12px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--red-soft); }

.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600;
}
.status-present { background: #f0fdf4; color: #16a34a; }
.status-late    { background: #fff7ed; color: #ea580c; }
.status-absent  { background: var(--red-soft); color: var(--red); }
.status-leave   { background: #eff6ff; color: #3b82f6; }

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  display: none; position: fixed;
  z-index: 1000; inset: 0;
  background: rgba(0,0,0,.4); backdrop-filter: blur(3px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: var(--white); margin: 36px auto;
  border-radius: var(--radius-lg); width: 90%; max-width: 720px;
  max-height: calc(100vh - 72px); overflow-y: auto;
  box-shadow: var(--shadow-md); animation: slideDown .25s ease;
}
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-header {
  padding: 24px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; position: relative;
}
.modal-icon {
  width: 40px; height: 40px; background: var(--red-soft); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-icon i { font-size: 18px; color: var(--red); }
.modal-header h2 { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.modal-subtitle  { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.close {
  position: absolute; right: 18px; top: 18px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); line-height: 1;
}
.close:hover { background: var(--red-soft); color: var(--red); border-color: var(--red-border); }
#employeeForm { padding: 24px 28px; }
.form-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.section-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 14px; display: flex; align-items: center; gap: 7px;
}
.section-title i { color: var(--red); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.form-row:last-child { margin-bottom: 0; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .4px; display: flex; align-items: center; gap: 5px;
}
.form-group label i { color: var(--red); }
.form-group input, .form-group select {
  padding: 9px 11px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--bg); color: var(--text);
  transition: all var(--transition);
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--red); background: var(--white);
  box-shadow: 0 0 0 3px rgba(220,38,38,.07);
}
.form-group input::placeholder { color: var(--text-light); }
.form-group.highlight { grid-column: 1/-1; }
.form-group.highlight input { background: var(--white); border-color: var(--red-border); font-size: 15px; font-weight: 600; }

.face-upload-section { background: var(--bg); border-radius: var(--radius); border: 1.5px dashed var(--border-dark); padding: 16px; }
.upload-area { text-align: center; padding: 24px 16px; background: var(--white); border-radius: var(--radius-sm); margin-bottom: 14px; }
.upload-icon {
  width: 52px; height: 52px; background: var(--red-soft); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.upload-icon i { font-size: 22px; color: var(--red); }
.upload-text { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.photo-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 12px; }
.photo-preview img {
  width: 100%; height: 100px; object-fit: cover;
  border-radius: var(--radius-sm); border: 2px solid var(--border); transition: all var(--transition);
}
.photo-preview img:hover { border-color: var(--red); box-shadow: 0 4px 10px rgba(220,38,38,.15); }
.form-actions { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   REPORTS
   ============================================================ */
.reports-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.report-card {
  background: var(--white); padding: 24px 20px;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  text-align: center; transition: box-shadow var(--transition), transform var(--transition);
}
.report-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.report-card i {
  font-size: 28px; color: var(--red); background: var(--red-soft);
  width: 64px; height: 64px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.report-card h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.report-card p  { font-size: 12.5px; color: var(--text-muted); margin-bottom: 16px; }

/* ============================================================
   EMPLOYEE CARD VIEW
   ============================================================ */

/* Toggle button group */
.emp-view-toggle {
  display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.emp-view-btn {
  padding: 7px 12px; background: var(--white); border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px; transition: background var(--transition), color var(--transition);
}
.emp-view-btn:hover { background: var(--bg); color: var(--text); }
.emp-view-active { background: var(--red) !important; color: #fff !important; }

/* Card grid */
.emp-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  padding: 4px 2px;
}

/* Individual card */
.emp-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: box-shadow var(--transition), transform var(--transition);
}
.emp-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

/* Coloured top banner */
.emp-card-banner {
  height: 64px;
  background: linear-gradient(135deg, var(--red) 0%, #b91c1c 100%);
}

/* Avatar circle */
.emp-card-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--red-soft); border: 3px solid var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--red);
  margin: -34px auto 0; position: relative; z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  text-transform: uppercase; letter-spacing: 1px;
}

/* Card body */
.emp-card-body { padding: 10px 16px 16px; }
.emp-card-name {
  text-align: center; font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 2px;
}
.emp-card-id {
  text-align: center; font-size: 11px; color: var(--text-muted);
  margin-bottom: 12px;
}

/* Info rows */
.emp-card-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid #f3f4f6; font-size: 12px;
}
.emp-card-row:last-child { border-bottom: none; }
.emp-card-label { color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.emp-card-label i { width: 12px; text-align: center; color: var(--text-light); }
.emp-card-value { font-weight: 600; color: var(--text); }

/* Designation / category badge */
.emp-card-badge {
  font-size: 10.5px; font-weight: 600; padding: 2px 9px;
  border-radius: 99px; display: inline-block;
}
.emp-badge-blue     { background: #eff6ff; color: #1d4ed8; }
.emp-badge-green    { background: #f0fdf4; color: #15803d; }
.emp-badge-orange   { background: #fff7ed; color: #c2410c; }
.emp-badge-purple   { background: #f5f3ff; color: #6d28d9; }
.emp-badge-default  { background: var(--bg); color: var(--text-muted); }

/* Action buttons at bottom */
.emp-card-actions {
  display: flex; gap: 8px; margin-top: 12px;
}
.emp-card-actions .btn { flex: 1; justify-content: center; font-size: 12px; padding: 6px 0; }
.settings-container {
  background: var(--white); padding: 24px 28px;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); max-width: 680px;
}
.settings-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.settings-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.settings-section h3 {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 16px;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.75); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: center; z-index: 9999;
}
.spinner-border {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--red);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PAYROLL STATUS BAR
   ============================================================ */
#payrollStatusBar {
  font-size: 11.5px; color: var(--text-muted); text-align: right;
  margin-top: 10px; padding: 6px 10px; background: var(--bg);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  display: inline-block; float: right;
}

/* ============================================================
   PAGE HEADINGS
   ============================================================ */
.page > h2, .page-header > h2 {
  font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -.2px; margin-bottom: 14px;
}

/* ============================================================
   HAMBURGER BUTTON
   ============================================================ */
.hamburger {
  display: none; /* shown only when sidebar is closed / collapsed */
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 36px; height: 36px; background: none; border: none;
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  transition: background var(--transition); flex-shrink: 0;
}
.hamburger:hover { background: var(--red-soft); }
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-muted); border-radius: 2px;
  transition: all 0.3s ease;
}
/* Keep hamburger as 3 bars — close is the × next to Swiss Attendance */
body.sidebar-collapsed .hamburger {
  display: flex;
}

/* Desktop: collapse sidebar for more screen space */
.sidebar {
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  pointer-events: none;
}
body.sidebar-collapsed .main-content {
  margin-left: 0;
}
body.sidebar-collapsed .sidebar-overlay { display: none !important; }

/* Expandable reason fields */
.reason-textarea {
  width: 100%;
  margin-top: 5px;
  min-height: 110px;
  resize: both;
  max-width: 100%;
  line-height: 1.45;
}
.reason-expandable { max-width: 320px; }
.reason-cell {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted);
  font-size: 12px;
}
.reason-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 2.8em;
}
.reason-expanded {
  max-height: none;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.reason-expand-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.reason-expand-btn:hover { text-decoration: underline; }
.reason-tap-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #f9fafb;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.reason-tap-btn:hover,
.reason-tap-btn:focus {
  border-color: #fca5a5;
  background: var(--red-soft);
  outline: none;
}
.reason-tap-preview {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.reason-tap-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
}
.reason-viewer-box { max-width: 560px; width: min(560px, 94vw); }
.reason-viewer-body {
  padding: 20px 28px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  max-height: min(60vh, 420px);
  overflow-y: auto;
}
.le-month-dates-cell { min-width: 150px; vertical-align: top; }
.le-month-label { font-weight: 700; margin-bottom: 6px; color: var(--text); }
.le-table-dates {
  margin: 0;
  padding-left: 16px;
  color: #92400e;
  font-size: 12px;
  line-height: 1.45;
}
.le-table-dates li { margin-bottom: 2px; }
.le-status-filters .le-filter-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  padding: 4px 10px;
}
.le-status-filters .le-filter-btn.active {
  background: var(--red-soft);
  border-color: #fca5a5;
  color: var(--red);
}
.le-late-dates {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #78350f;
  max-height: 140px;
  overflow-y: auto;
}
.le-late-dates li { margin-bottom: 2px; }
.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
#attendancePage .att-consolidated-table th,
#attendancePage .att-consolidated-table td {
  white-space: nowrap;
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 99; backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ============================================================
   RESPONSIVE — TABLET  (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 210px; }
  .content { padding: 18px; }
  .stats-grid { gap: 12px; }
  .charts-grid { gap: 12px; }
  .header { padding: 0 20px; }
}

/* ============================================================
   RESPONSIVE — MOBILE  (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Sidebar becomes a slide-in drawer — closed by default, hamburger opens it */
  .hamburger { display: flex; }
  body.sidebar-drawer-open .hamburger { display: none; }

  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh;
    width: 240px; z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
    pointer-events: auto;
  }
  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
    pointer-events: auto;
  }

  /* Main content fills full width */
  .main-content { margin-left: 0; }
  body.sidebar-collapsed .main-content { margin-left: 0; }

  /* Header */
  .header { padding: 0 14px; gap: 10px; }
  .header-left { gap: 10px; }
  .header-left h1 { font-size: 14px; }
  .header-datetime { display: none; } /* hide on mobile — saves space */
  .header-user { display: none; }

  /* Content */
  .content { padding: 14px; }

  /* Stat cards — 2 columns */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card { padding: 14px; }
  .stat-info h3 { font-size: 20px; }
  .stat-icon { width: 38px; height: 38px; font-size: 15px; }

  /* Charts — 1 column */
  .charts-grid { grid-template-columns: 1fr; }

  /* Page header — stack */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .page-header .btn { width: 100%; justify-content: center; }
  .page-header .search-input,
  .page-header .form-control { width: 100% !important; }

  /* Filter container — stack all groups */
  .filter-container { flex-direction: column; gap: 10px; padding: 12px; }
  .filter-group { width: 100%; }
  .filter-group .form-control,
  .filter-group input,
  .filter-group select { width: 100% !important; }
  .filter-group[style*="display: flex"] {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 8px;
  }
  .filter-group[style*="display: flex"] .btn { flex: 1; justify-content: center; }

  /* Reports grid — 2 columns */
  .reports-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .report-card { padding: 18px 12px; }
  .report-card i { width: 52px; height: 52px; font-size: 22px; }

  /* Modal — full screen on mobile */
  .modal-content {
    margin: 0 !important; width: 100% !important; max-width: 100% !important;
    min-height: 100vh; border-radius: 0;
    max-height: 100vh;
  }
  .modal { overflow-y: auto; align-items: flex-start; }

  /* Form rows — single column */
  .form-row { grid-template-columns: 1fr; }

  /* Payroll action buttons */
  #payrollPage .page-header > div[style*="display: flex"] {
    flex-direction: column;
    gap: 8px;
  }
  #payrollPage .page-header .btn { width: 100%; justify-content: center; }

  /* Settings */
  .settings-container { padding: 16px; max-width: 100%; }

  /* Tables — horizontal scroll already handled */
  .table-container { border-radius: var(--radius-sm); }

  /* Login shell */
  .auth-shell { margin: 0; }
  .auth-form-header { padding: 28px 22px 12px; }
  #loginForm, .forgot-section { padding: 8px 22px 18px; }
  .login-footer { padding: 14px 22px; }

  /* Payroll status bar */
  #payrollStatusBar { float: none; display: block; text-align: center; }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE  (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  /* Stat cards — 2 columns but more compact */
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-info h3 { font-size: 18px; }
  .stat-info p { font-size: 11px; }
  .stat-icon { width: 34px; height: 34px; font-size: 14px; }

  /* Charts remove padding */
  .chart-card { padding: 14px; }
  .chart-canvas-wrap { height: 200px; }
  .charts-grid-single { max-width: none; }

  /* Reports grid — 1 column on very small screens */
  .reports-grid { grid-template-columns: 1fr; }
  .report-card { padding: 20px 16px; }

  /* Content padding */
  .content { padding: 10px; }

  /* Header */
  .header { padding: 0 10px; }

  /* Table font size */
  table { font-size: 12px; }
  th, td { padding: 9px 10px; }

  /* Buttons compact */
  .btn { padding: 7px 12px; font-size: 12.5px; }
}

/* ============================================================
   LEAVE APPROVALS
   ============================================================ */

/* Status badge variant for leave table */
.leave-status-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 99px; display: inline-block;
}

/* Photo thumbnail in table */
.leave-photo-thumb {
  width: 52px; height: 52px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition);
  display: block;
}
.leave-photo-thumb:hover { border-color: var(--red); box-shadow: 0 2px 8px rgba(220,38,38,.2); }

.leave-pdf-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface, #111);
  color: #ef4444; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.leave-pdf-chip:hover { border-color: #ef4444; box-shadow: 0 2px 8px rgba(239,68,68,.2); }

.leave-no-photo {
  font-size: 11px; color: var(--text-light);
  display: flex; align-items: center; gap: 4px;
}

/* Employee ID sub-label */
.leave-emp-id { font-size: 11px; color: var(--text-muted); }

/* Actions cell inline flex */
.leave-actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Vertically center all leave table cells */
#leaveTableBody tr td {
  vertical-align: middle;
  padding: 12px 10px;
}

/* Small buttons in leave table */
.btn-sm {
  padding: 5px 11px; font-size: 11.5px; gap: 5px;
}

/* Done state label */
.leave-action-done {
  font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  border-radius: 99px;
}
.done-approved { color: #15803d; background: #f0fdf4; }

/* ============================================================
   EMPLOYEE DETAIL MODAL
   ============================================================ */
.emp-detail-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  z-index: 1200; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
.emp-detail-modal {
  position: relative; display: flex; width: 92%; max-width: 740px;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,.35);
  animation: slideDown .25s ease;
  max-height: 88vh;
}

/* ── Close button ── */
.emp-detail-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition), transform var(--transition); z-index: 20;
}
.emp-detail-close:hover { background: rgba(255,255,255,.35); transform: scale(1.12); }

/* ── Left panel ── */
.emp-detail-left {
  width: 220px; flex-shrink: 0; position: relative;
  background: linear-gradient(160deg, #dc2626 0%, #7f1d1d 100%);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 20px 36px;
  text-align: center;
}
.emp-detail-avatar {
  width: 112px; height: 112px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 4px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 800; color: #fff;
  margin-bottom: 16px; box-shadow: 0 8px 28px rgba(0,0,0,.3);
  text-transform: uppercase; letter-spacing: 2px;
  overflow: hidden;
}
.emp-detail-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.emp-detail-left-name {
  font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; line-height: 1.3;
}
.emp-detail-left-id {
  font-size: 11px; color: rgba(255,255,255,.65); margin-bottom: 14px; letter-spacing: .5px;
}
.emp-detail-left-badge {
  font-size: 11px; font-weight: 600; padding: 4px 14px;
  border-radius: 99px; background: rgba(255,255,255,.2);
  color: #fff; letter-spacing: .3px;
}

/* ── Right panel ── */
.emp-detail-right {
  flex: 1; background: var(--white); overflow-y: auto;
  padding: 24px 26px 24px;
  display: flex; flex-direction: column; gap: 0;
}
.emp-detail-right-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 22px; padding-bottom: 16px;
  border-bottom: 1.5px solid var(--border);
}
.emp-detail-right-title {
  font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.3px; margin-bottom: 3px;
}
.emp-detail-right-sub {
  font-size: 12px; color: var(--text-muted);
}
.emp-detail-edit-btn { font-size: 12px; padding: 7px 16px; }

/* ── Sections ── */
.emp-detail-section { margin-bottom: 18px; }
.emp-detail-section:last-child { margin-bottom: 0; }
.emp-detail-section-title {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px;
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 6px; padding-bottom: 7px;
  border-bottom: 1.5px solid var(--border);
}
.emp-detail-section-title i { color: var(--red); }

/* ── Info rows ── */
.emp-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 8px; border-radius: 7px; font-size: 13px;
  transition: background .15s;
}
.emp-detail-row:hover { background: var(--bg); }
.emp-detail-label {
  color: var(--text-muted); display: flex; align-items: center; gap: 8px;
}
.emp-detail-label i { width: 14px; text-align: center; color: var(--red); opacity: .6; font-size: 12px; }
.emp-detail-value { font-weight: 600; color: var(--text); }

/* Gross total highlight row */
.emp-detail-row-highlight {
  background: var(--red-soft) !important; margin-top: 6px;
}
.emp-detail-row-highlight .emp-detail-label { color: var(--red); font-weight: 700; }
.emp-detail-row-highlight .emp-detail-label i { opacity: 1; }
.emp-detail-row-highlight .emp-detail-value { color: var(--red); font-size: 14px; }

/* ── Responsive: stack on small screens ── */
@media (max-width: 580px) {
  .emp-detail-modal { flex-direction: column; max-height: 95vh; }
  .emp-detail-left { width: 100%; padding: 30px 20px 20px; flex-direction: row; gap: 16px; justify-content: flex-start; text-align: left; }
  .emp-detail-avatar { width: 72px; height: 72px; font-size: 24px; margin-bottom: 0; flex-shrink: 0; }
  .emp-detail-right { padding: 18px 18px; }
}
.done-rejected { color: #b91c1c; background: #fef2f2; }

/* ── Approval Tab Switcher ────────────────────────────────── */
.approval-tab {
  padding: 7px 18px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.approval-tab-active {
  background: var(--red); color: #fff !important;
  border-color: var(--red);
}

/* Empty state row */
.leave-empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted); font-size: 13px;
}

/* ── Leave Modal ─────────────────────────────────────────── */
.leave-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}

.leave-modal-box {
  background: var(--white); border-radius: var(--radius-lg);
  width: 90%; max-width: 520px; max-height: calc(100vh - 60px);
  overflow-y: auto; box-shadow: var(--shadow-md);
  animation: slideDown .25s ease;
}

.leave-modal-header {
  padding: 20px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.leave-modal-title {
  display: flex; align-items: center; gap: 14px;
}

.leave-modal-title h3 {
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -.3px; margin-bottom: 2px;
}

/* Photo upload trigger */
.leave-upload-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 6px; padding: 8px 16px;
  border: 1.5px solid var(--red); border-radius: var(--radius-sm);
  color: var(--red); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.leave-upload-trigger:hover { background: var(--red); color: white; }

/* Preview image */
.leave-preview-img {
  max-width: 200px; max-height: 150px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); margin-top: 8px; display: block;
}

/* Toast notification */
.leave-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1f2937; color: white; padding: 11px 20px;
  border-radius: var(--radius); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-md); z-index: 9999;
  transition: transform .3s ease, opacity .3s ease; opacity: 0; pointer-events: none;
}
.leave-toast.show {
  transform: translateX(-50%) translateY(0); opacity: 1;
}

@media (max-width: 600px) {
  .leave-modal-box { width: 96%; }
  .leave-actions-cell { flex-direction: column; gap: 5px; }
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.loan-history-wrap { margin-top: 10px; }
.loan-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.loan-history-table th,
.loan-history-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.loan-history-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}
.loan-history-empty {
  font-size: 12px;
  color: var(--text-muted);
}

/* HR — Today's Attendance page (responsive) */
.hr-today-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 140px);
}
.hr-today-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
}
.hr-today-page-title h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 650;
  color: var(--text);
}
.hr-today-page-title h2 i {
  color: #0EA5E9;
  margin-right: 8px;
}
.hr-today-card-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.hr-today-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 560px;
}
.hr-today-search {
  flex: 1 1 160px;
  min-width: 0;
}
.hr-today-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hr-today-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.hr-today-chip:hover { border-color: #94a3b8; }
.hr-today-chip strong {
  color: var(--text);
  font-weight: 700;
}
.hr-today-chip-in {
  background: rgba(8, 145, 178, 0.1);
  border-color: rgba(8, 145, 178, 0.25);
}
.hr-today-chip-out {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.25);
}
.hr-today-chip.is-active {
  background: #0EA5E9;
  border-color: #0EA5E9;
  color: #fff;
}
.hr-today-chip.is-active strong { color: #fff; }
.hr-today-chip-out.is-active {
  background: #7C3AED;
  border-color: #7C3AED;
}
.hr-today-table .hr-today-in,
.hr-today-table .hr-today-out {
  font-size: 1.05rem;
  font-weight: 700;
}
.hr-today-table th:nth-child(1),
.hr-today-table th:nth-child(2) {
  color: #0EA5E9;
}
.hr-today-table th:nth-child(2) { color: #7C3AED; }
.hr-today-table tr.is-in-only { background: rgba(8, 145, 178, 0.04); }
.hr-today-table tr.is-absent { opacity: 0.72; }

/* Full-screen / large board view for Today's Attendance */
body.hr-today-fullscreen .sidebar,
body.hr-today-fullscreen .sidebar-overlay,
body.hr-today-fullscreen .header {
  display: none !important;
}
body.hr-today-fullscreen .main-content {
  margin-left: 0 !important;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}
body.hr-today-fullscreen .content {
  padding: 8px 12px 10px;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.hr-today-fullscreen #todayAttendancePage.page {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body.hr-today-fullscreen .hr-today-page {
  max-width: none;
  flex: 1;
  min-height: 0;
  height: 100%;
  gap: 8px;
  overflow: hidden;
}
body.hr-today-fullscreen .hr-today-page-toolbar {
  flex-shrink: 0;
}
body.hr-today-fullscreen .hr-today-stats {
  flex-shrink: 0;
}
body.hr-today-fullscreen .hr-today-page-title h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
}
body.hr-today-fullscreen .hr-today-page-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.hr-today-fullscreen .hr-today-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body.hr-today-fullscreen .hr-today-table {
  font-size: var(--hr-today-font, 14px);
  min-width: 0;
  height: 100%;
}
body.hr-today-fullscreen .hr-today-table th,
body.hr-today-fullscreen .hr-today-table td {
  padding: var(--hr-today-cell-pad, 4px 10px);
  line-height: 1.2;
  white-space: nowrap;
}
body.hr-today-fullscreen .hr-today-table .hr-today-in,
body.hr-today-fullscreen .hr-today-table .hr-today-out {
  font-size: 1em;
}
body.hr-today-fullscreen .hr-today-chip {
  font-size: 13px;
  padding: 6px 12px;
}
body.hr-today-fullscreen .hr-today-mobile-list {
  display: none !important;
}

/* Global page responsiveness helpers */
.page.active {
  min-width: 0;
  max-width: 100%;
}
#dashboardPage,
#employeesPage,
#leavesPage,
#reportsPage,
#settingsPage,
#payrollPage,
#individualPayrollPage,
#loanHistoryPage {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 900px) {
  .content { overflow-x: hidden; }
  .table-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.hr-today-page-body {
  flex: 1;
  background: var(--card-bg, var(--white, #fff));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.hr-today-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.hr-today-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 420px;
}
.hr-today-table th,
.hr-today-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.hr-today-table th {
  position: sticky;
  top: 0;
  background: var(--card-bg, #fff);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  z-index: 1;
}
.hr-today-table tr:last-child td {
  border-bottom: none;
}
.hr-today-name {
  font-weight: 600;
  color: var(--text);
}
.hr-today-in {
  color: #0891B2;
  font-weight: 500;
  white-space: nowrap;
}
.hr-today-out {
  color: #7C3AED;
  font-weight: 500;
  white-space: nowrap;
}
.hr-today-mobile-list {
  display: none;
}
.hr-today-empty,
.hr-today-error {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}
.hr-today-error {
  color: #b91c1c;
}

@media (max-width: 720px) {
  .hr-today-page {
    min-height: auto;
    gap: 12px;
  }
  .hr-today-page-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .hr-today-page-actions {
    max-width: none;
  }
  .hr-today-page-actions .btn {
    flex: 0 0 auto;
  }
  .hr-today-table-wrap {
    display: none;
  }
  .hr-today-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .hr-today-mobile-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }
  .hr-today-mobile-item:last-child {
    border-bottom: none;
  }
  .hr-today-mobile-item.is-absent {
    opacity: 0.78;
  }
  .hr-today-mobile-name {
    font-weight: 650;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 8px;
  }
  .hr-today-mobile-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
  }
  .hr-today-mobile-times span {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .hr-today-mobile-times .fa-sign-in-alt { color: #0891B2; }
  .hr-today-mobile-times .fa-sign-out-alt { color: #7C3AED; }
}

@media (min-width: 721px) {
  .hr-today-page-body {
    max-height: calc(100vh - 220px);
    overflow: auto;
  }
}

/* Payroll — keep full table inside a scrollable box */
#payrollPage {
  min-width: 0;
  max-width: 100%;
}
#payrollPage #payrollTable.table-container {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(75vh, 720px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#payrollPage #payrollTable table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}
#payrollPage #payrollTable th,
#payrollPage #payrollTable td {
  white-space: nowrap;
}

/* Payroll — Consolidated view */
.payroll-consol-wrap {
  width: 100%;
}
.payroll-consol-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.payroll-consol-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg, #fff);
}
.payroll-consol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}
.payroll-consol-table th,
.payroll-consol-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.payroll-consol-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.03);
  font-weight: 650;
  white-space: nowrap;
}
.payroll-consol-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.payroll-consol-row:hover,
.payroll-consol-row.is-open {
  background: rgba(14, 165, 233, 0.06);
}
.payroll-consol-sno {
  text-align: center !important;
  color: var(--text-muted);
  width: 52px;
}
.payroll-consol-name {
  font-weight: 650;
  color: var(--text);
}
.payroll-consol-name i {
  margin-right: 8px;
  color: #0EA5E9;
  font-size: 11px;
}
.payroll-consol-total {
  font-weight: 600;
  color: #0f766e;
  white-space: nowrap;
}
.payroll-consol-ded {
  font-weight: 600;
  color: #b91c1c;
  white-space: nowrap;
}
.payroll-consol-final {
  font-weight: 700;
  color: #15803d;
  white-space: nowrap;
}
.payroll-consol-table > tfoot > tr > td {
  background: #ea580c;
  color: #fff;
  font-weight: 700;
  border-bottom: none;
}
.payroll-consol-detail-row > td {
  padding: 0;
  background: rgba(15, 23, 42, 0.02);
  color: inherit;
}
.payroll-consol-detail {
  padding: 14px 16px 18px;
  color: var(--text, #1e293b);
}
.payroll-consol-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  margin-bottom: 10px;
}
.payroll-consol-detail-head span {
  font-size: 12px;
  color: var(--text-muted);
}
.payroll-consol-breakdown {
  width: 100%;
  max-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  color: var(--text, #1e293b);
}
.payroll-consol-breakdown th,
.payroll-consol-breakdown td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text, #1e293b);
}
.payroll-consol-breakdown th {
  background: rgba(14, 165, 233, 0.08);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.payroll-consol-breakdown .pc-label {
  color: var(--text-muted);
  width: 28%;
}
.payroll-consol-breakdown .pc-amt {
  font-weight: 600;
  white-space: nowrap;
  width: 22%;
  color: #1e293b !important;
}
.payroll-consol-breakdown .pc-amt strong {
  color: #1e293b !important;
}
.payroll-consol-breakdown .pc-ded-label,
.payroll-consol-breakdown .pc-ded {
  color: #b91c1c !important;
}
.payroll-consol-breakdown .pc-ded strong {
  color: #b91c1c !important;
}
.payroll-consol-breakdown tfoot td {
  background: rgba(15, 23, 42, 0.04);
  color: #1e293b !important;
}
.payroll-consol-breakdown tfoot .pc-amt,
.payroll-consol-breakdown tfoot .pc-amt strong {
  color: #1e293b !important;
}
.payroll-consol-breakdown tfoot .pc-ded,
.payroll-consol-breakdown tfoot .pc-ded strong {
  color: #b91c1c !important;
}
.payroll-consol-breakdown .pc-final-row td,
.payroll-consol-breakdown .pc-final-row td strong {
  background: rgba(21, 128, 61, 0.08);
  color: #15803d !important;
  border-bottom: none;
}

@media (max-width: 720px) {
  .payroll-consol-table {
    min-width: 0;
    font-size: 12px;
  }
  .payroll-consol-table th:nth-child(4),
  .payroll-consol-table td:nth-child(4) {
    display: none; /* hide designation on small phones */
  }
  .payroll-consol-breakdown {
    max-width: none;
    font-size: 12px;
  }
}

/* Attendance — responsive layout */
#attendancePage {
  min-width: 0;
  max-width: 100%;
}
#attendancePage .att-page-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}
#attendancePage .att-page-header > h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
}
#attendancePage .att-filter-container {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 0;
}
#attendancePage .att-filter-search {
  grid-column: span 2;
  min-width: 0;
}
#attendancePage .att-filter-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
#attendancePage .att-filter-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
  white-space: nowrap;
}
#attendancePage .att-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#attendancePage .att-export-actions .btn {
  flex: 0 1 auto;
}
#attendancePage #attendanceTable.att-table-container {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  max-height: none;
}
#attendancePage .att-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(70vh, 680px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#attendancePage .att-data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#attendancePage .att-data-table th,
#attendancePage .att-data-table td {
  white-space: nowrap;
  padding: 10px 12px;
}
#attendancePage .att-col-id { font-weight: 700; }
#attendancePage .att-col-name { font-weight: 600; }
#attendancePage .att-col-site { font-weight: 600; }
#attendancePage .att-col-in { color: #0891B2; }
#attendancePage .att-col-out { color: #7C3AED; }
#attendancePage .att-col-status {
  font-weight: 700;
  text-transform: uppercase;
}
#attendancePage .att-col-hours { font-weight: 600; }
#attendancePage .att-row-absent { background: rgba(220, 38, 38, 0.04); }
#attendancePage .att-row-holiday { background: rgba(37, 99, 235, 0.05); }
#attendancePage .att-ot-pending {
  font-size: 10px;
  font-weight: 500;
  color: #D97706;
}
#attendancePage .att-mobile-list { display: none; }

@media (max-width: 900px) {
  #attendancePage .att-filter-search {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  #attendancePage .att-filter-container {
    grid-template-columns: 1fr 1fr;
  }
  #attendancePage .att-filter-search,
  #attendancePage .att-filter-actions {
    grid-column: 1 / -1;
  }
  #attendancePage .att-export-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  #attendancePage .att-export-actions .btn {
    width: 100%;
    justify-content: center;
  }
  #attendancePage .att-export-actions #bulkCheckoutBtn {
    grid-column: 1 / -1;
  }
  #attendancePage .att-bulk-label {
    display: inline;
  }
  #attendancePage .att-table-wrap {
    display: none;
  }
  #attendancePage #attendanceTable.att-table-container {
    border: none;
    background: transparent;
    box-shadow: none;
  }
  #attendancePage .att-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  #attendancePage .att-mobile-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  #attendancePage .att-mobile-card.is-absent {
    background: rgba(220, 38, 38, 0.04);
  }
  #attendancePage .att-mobile-card.is-holiday {
    background: rgba(37, 99, 235, 0.05);
  }
  #attendancePage .att-mobile-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
  }
  #attendancePage .att-mobile-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
  }
  #attendancePage .att-mobile-meta {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-muted);
  }
  #attendancePage .att-mobile-status {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
  }
  #attendancePage .att-mobile-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 10px;
  }
  #attendancePage .att-mobile-in { color: #0891B2; font-weight: 600; }
  #attendancePage .att-mobile-out { color: #7C3AED; font-weight: 600; }
  #attendancePage .att-mobile-times i { margin-right: 5px; }
  #attendancePage .att-mobile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
  }
  #attendancePage .att-mobile-stats span {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-muted);
  }
  #attendancePage .att-mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  #attendancePage .att-mobile-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 12px;
    margin: 0;
  }
}

@media (max-width: 420px) {
  #attendancePage .att-filter-container {
    grid-template-columns: 1fr;
  }
}

