/* ============================================================
   HRMS Pro — Premium Enterprise Design System
   Font: DM Sans (body) + Space Grotesk (headings/numbers)
   Palette: Emerald green gradient, clean white, dark slate
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary:        #00c853;
  --primary-2:      #64dd17;
  --primary-3:      #00bfa5;
  --primary-dark:   #009624;
  --primary-light:  #e8f5e9;
  --grad-primary:   linear-gradient(135deg, #00c853 0%, #00bfa5 100%);
  --grad-card:      linear-gradient(135deg, #00c853 0%, #64dd17 100%);
  --grad-dark:      linear-gradient(135deg, #1a2332 0%, #0d1520 100%);

  --white:          #ffffff;
  --gray-50:        #f8fafb;
  --gray-100:       #f1f4f6;
  --gray-200:       #e4e9ed;
  --gray-300:       #cdd5dc;
  --gray-400:       #a0adb8;
  --gray-500:       #6b7a8d;
  --gray-600:       #4a5568;
  --gray-700:       #2d3748;
  --gray-800:       #1a2332;
  --gray-900:       #0d1520;

  --text-primary:   #1a2332;
  --text-secondary: #4a5568;
  --text-muted:     #6b7a8d;
  --text-light:     #a0adb8;

  --success:        #00c853;
  --warning:        #ffab00;
  --danger:         #f44336;
  --info:           #2196f3;

  --sidebar-w:      260px;
  --topbar-h:       64px;
  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  --shadow-xs:      0 1px 3px rgba(0,0,0,.06);
  --shadow-sm:      0 2px 8px rgba(0,0,0,.08);
  --shadow:         0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 40px rgba(0,0,0,.14);
  --shadow-green:   0 8px 32px rgba(0,200,83,.25);

  --transition:     all .2s cubic-bezier(.4,0,.2,1);
  --font-body:      'DM Sans', sans-serif;
  --font-heading:   'Space Grotesk', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;
}

/* Dark mode */
[data-theme="dark"] {
  --white:          #1a2332;
  --gray-50:        #1e2a3a;
  --gray-100:       #243044;
  --gray-200:       #2d3a50;
  --gray-300:       #3a4a62;
  --text-primary:   #e8edf2;
  --text-secondary: #a0adb8;
  --text-muted:     #6b7a8d;
  --shadow:         0 4px 20px rgba(0,0,0,.4);
  --shadow-lg:      0 8px 40px rgba(0,0,0,.5);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

code, kbd { font-family: var(--font-mono); }

/* ── Layout ────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--gray-900);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: var(--grad-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-green);
}

.sidebar-brand-icon svg { width: 20px; height: 20px; fill: white; }

.sidebar-brand-text { font-family: var(--font-heading); font-size: 16px; font-weight: 700; color: white; }
.sidebar-brand-sub  { font-size: 10px; color: rgba(255,255,255,.4); font-weight: 400; display: block; margin-top: -2px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: 16px 20px 6px;
}

.nav-item { list-style: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.55);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.nav-link:hover {
  color: white;
  background: rgba(255,255,255,.05);
}

.nav-link.active {
  color: white;
  background: rgba(0,200,83,.15);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--grad-primary);
  border-radius: 0 2px 2px 0;
}

.nav-link .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon { opacity: 1; }

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Sub-menu */
.nav-has-sub > .nav-link::after {
  content: '';
  margin-left: auto;
  width: 0; height: 0;
  border: 4px solid transparent;
  border-top-color: rgba(255,255,255,.4);
  margin-top: 2px;
  transition: transform .2s;
}

.nav-has-sub.open > .nav-link::after { transform: rotate(180deg); }

.nav-sub {
  display: none;
  background: rgba(0,0,0,.15);
  padding: 4px 0;
}

.nav-has-sub.open .nav-sub { display: block; }

.nav-sub .nav-link {
  padding: 7px 20px 7px 46px;
  font-size: 13px;
  color: rgba(255,255,255,.45);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name  { font-size: 12px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role  { font-size: 10px; color: rgba(255,255,255,.4); }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  z-index: 900;
  box-shadow: var(--shadow-xs);
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.topbar-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  height: 38px;
  background: var(--gray-100);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 12px 0 36px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

.topbar-search input:focus {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,200,83,.12);
}

.topbar-search .search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px; height: 16px;
  pointer-events: none;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.topbar-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.topbar-btn:hover { background: var(--gray-100); color: var(--text-primary); }

.topbar-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--white);
}

.topbar-divider { width: 1px; height: 24px; background: var(--gray-200); margin: 0 4px; }

.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.topbar-user:hover { background: var(--gray-100); }

.topbar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  color: white;
  overflow: hidden;
}

.topbar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar-user-info { display: none; }

@media (min-width: 768px) {
  .topbar-user-info { display: block; }
  .topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1; }
  .topbar-user-role { font-size: 11px; color: var(--text-muted); }
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-h));
  transition: margin .3s;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title   { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-subtitle{ font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { color: var(--gray-300); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 24px; }

/* Stat Cards */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
}

.stat-card.green::before  { background: var(--primary); }
.stat-card.blue::before   { background: var(--info); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.teal::before   { background: var(--primary-3); }
.stat-card.purple::before { background: #7c3aed; }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon.green  { background: rgba(0,200,83,.1);  color: var(--primary); }
.stat-icon.blue   { background: rgba(33,150,243,.1); color: var(--info); }
.stat-icon.orange { background: rgba(255,171,0,.1);  color: var(--warning); }
.stat-icon.red    { background: rgba(244,67,54,.1);  color: var(--danger); }
.stat-icon.teal   { background: rgba(0,191,165,.1);  color: var(--primary-3); }
.stat-icon.purple { background: rgba(124,58,237,.1); color: #7c3aed; }

.stat-icon svg { width: 22px; height: 22px; }

.stat-body { flex: 1; min-width: 0; }
.stat-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.stat-change {
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  background: var(--gray-50);
  padding: 11px 16px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
  text-align: left;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

.table .actions { display: flex; gap: 4px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  outline: none;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--grad-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-green);
}

.btn-primary:hover {
  opacity: .9;
  box-shadow: 0 6px 20px rgba(0,200,83,.35);
  transform: translateY(-1px);
  color: white;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--text-primary);
  border-color: var(--gray-200);
}

.btn-secondary:hover { background: var(--gray-200); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover { background: var(--primary); color: white; }

.btn-danger  { background: var(--danger);  color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-info    { background: var(--info);    color: white; }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,200,83,.12);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; }

select.form-control { cursor: pointer; }

.form-text { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.form-error{ font-size: 11.5px; color: var(--danger); margin-top: 4px; }

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid   { border-color: var(--success); }

/* Input groups */
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-append .btn   { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; height: 40px; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-heading);
  white-space: nowrap;
  letter-spacing: .3px;
}

.badge.bg-success   { background: rgba(0,200,83,.12); color: #007a33; }
.badge.bg-danger    { background: rgba(244,67,54,.12); color: #c62828; }
.badge.bg-warning   { background: rgba(255,171,0,.12); color: #e65100; }
.badge.bg-info      { background: rgba(33,150,243,.12); color: #0d47a1; }
.badge.bg-secondary { background: var(--gray-100); color: var(--text-muted); }
.badge.bg-primary   { background: rgba(0,200,83,.15); color: #006c2a; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.alert-success { background: rgba(0,200,83,.08);  border-color: rgba(0,200,83,.2);  color: #1b5e20; }
.alert-danger  { background: rgba(244,67,54,.08); border-color: rgba(244,67,54,.2); color: #b71c1c; }
.alert-warning { background: rgba(255,171,0,.08); border-color: rgba(255,171,0,.2); color: #e65100; }
.alert-info    { background: rgba(33,150,243,.08);border-color: rgba(33,150,243,.2);color: #0d47a1; }

/* ── Modals ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(13,21,32,.6);
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .2s;
}

.modal-backdrop.show { opacity: 1; }

.modal-dialog {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(.98);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.modal-backdrop.show .modal-dialog { transform: translateY(0) scale(1); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title   { font-size: 17px; font-weight: 700; }
.modal-close   { background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-muted); border-radius: var(--radius-sm); transition: var(--transition); }
.modal-close:hover { background: var(--gray-100); color: var(--text-primary); }
.modal-body    { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer  { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  transform: translateX(110%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  border-left: 3px solid transparent;
}

.toast.show   { transform: translateX(0); }
.toast.hiding { transform: translateX(110%); }

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }

.toast-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.toast-icon.success { color: var(--success); }
.toast-icon.error   { color: var(--danger); }
.toast-icon.warning { color: var(--warning); }
.toast-icon.info    { color: var(--info); }

.toast-body { flex: 1; min-width: 0; }
.toast-title{ font-weight: 600; font-size: 13px; color: var(--text-primary); }
.toast-msg  { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }

.toast-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0; font-size: 16px; line-height: 1; }

/* ── Dropdowns ─────────────────────────────────────────────── */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all .15s cubic-bezier(.4,0,.2,1);
}

.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.dropdown-item:hover { background: var(--gray-50); color: var(--primary); }
.dropdown-item svg   { width: 15px; height: 15px; flex-shrink: 0; }

.dropdown-divider { height: 1px; background: var(--gray-200); margin: 4px 0; }
.dropdown-header  { padding: 8px 16px 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }

/* ── Tabs ──────────────────────────────────────────────────── */
.nav-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab:hover  { color: var(--text-primary); }
.nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; padding: 24px; }
.tab-content.active { display: block; }

/* ── Employee Avatar ───────────────────────────────────────── */
.emp-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.emp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.emp-avatar.lg  { width: 52px; height: 52px; font-size: 18px; }
.emp-avatar.xl  { width: 80px; height: 80px; font-size: 26px; }

/* ── Attendance Grid ───────────────────────────────────────── */
.att-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 11px;
}

.att-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 10px;
  cursor: default;
  transition: var(--transition);
}

.att-cell.present        { background: rgba(0,200,83,.15); color: #007a33; }
.att-cell.absent         { background: rgba(244,67,54,.12); color: #c62828; }
.att-cell.half_day       { background: rgba(255,171,0,.15); color: #e65100; }
.att-cell.late           { background: rgba(255,109,0,.15); color: #e65100; }
.att-cell.holiday        { background: rgba(156,39,176,.1); color: #6a1b9a; }
.att-cell.weekend        { background: var(--gray-100); color: var(--text-muted); }
.att-cell.on_leave,
.att-cell.paid_leave     { background: rgba(33,150,243,.12); color: #0d47a1; }
.att-cell.unpaid_leave   { background: rgba(121,85,72,.1); color: #4e342e; }
.att-cell.future         { background: var(--gray-50); color: var(--gray-300); }

/* ── Charts Wrapper ────────────────────────────────────────── */
.chart-wrap { position: relative; }

/* ── Loading ───────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  flex-shrink: 0;
}

.spinner.lg { width: 40px; height: 40px; border-width: 3px; }

.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Animated Counter ──────────────────────────────────────── */
.counter { font-variant-numeric: tabular-nums; }

/* ── Payslip ───────────────────────────────────────────────── */
.payslip-wrap {
  max-width: 780px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 13px;
}

.payslip-header {
  background: var(--grad-primary);
  color: white;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.payslip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.payslip-col  { padding: 20px 32px; }
.payslip-col:first-child { border-right: 1px solid var(--gray-200); }
.payslip-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.payslip-table td { padding: 6px 0; border-bottom: 1px solid var(--gray-100); }
.payslip-table .amount { text-align: right; font-family: var(--font-mono); font-weight: 600; }

/* ── Notifications Panel ───────────────────────────────────── */
.notif-panel {
  width: 360px;
  max-height: 480px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: rgba(0,200,83,.04); }

.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
  flex-shrink: 0;
}

.notif-body { flex: 1; min-width: 0; }
.notif-title{ font-size: 13px; font-weight: 600; color: var(--text-primary); }
.notif-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.empty-state-icon svg { width: 32px; height: 32px; }
.empty-state-title    { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.empty-state-desc     { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--gray-900);
  position: relative;
  overflow: hidden;
}

.login-art {
  flex: 0 0 50%;
  background: var(--grad-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-art::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  top: -200px; right: -200px;
}

.login-art::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  bottom: -150px; left: -100px;
}

.login-form-wrap {
  flex: 0 0 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-form-box {
  width: 100%;
  max-width: 400px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .topbar { left: 0; }
  .topbar-toggle { display: flex; }
  .main-content  { margin-left: 0; }

  .login-art { display: none; }
  .login-form-wrap { flex: 0 0 100%; }
}

@media (max-width: 576px) {
  .main-content { padding: 16px; }
  .card-body { padding: 16px; }
  .stat-card { padding: 16px; }
  .page-header { flex-direction: column; }
  .stat-value { font-size: 22px; }
}

/* ── Utilities ─────────────────────────────────────────────── */
.text-primary   { color: var(--primary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-danger    { color: var(--danger) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }
.fw-600         { font-weight: 600 !important; }
.fw-700         { font-weight: 700 !important; }
.font-mono      { font-family: var(--font-mono) !important; }
.font-heading   { font-family: var(--font-heading) !important; }
.d-flex         { display: flex; }
.align-center   { align-items: center; }
.gap-1          { gap: 4px; }
.gap-2          { gap: 8px; }
.gap-3          { gap: 12px; }
.ms-auto        { margin-left: auto; }
.mt-1           { margin-top: 4px; }
.mt-2           { margin-top: 8px; }
.mt-3           { margin-top: 16px; }
.mb-3           { margin-bottom: 16px; }
.p-0            { padding: 0 !important; }
.w-100          { width: 100%; }
.text-right     { text-align: right; }
.text-center    { text-align: center; }
.border-0       { border: none !important; }
.overflow-hidden{ overflow: hidden; }
.cursor-pointer { cursor: pointer; }

/* Print */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  body { background: white; }
}
