/* ═══════════════════════════════════════════════════════════════
   HRNexus — Design System
   Palette: Alpine Frost  |  Font: Bricolage Grotesque + Plus Jakarta Sans
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Alpine Frost Palette */
  --c-bg:          #EEF3F9;
  --c-surface:     #FFFFFF;
  --c-surface-2:   #F4F7FB;
  --c-border:      #D8E3EF;
  --c-border-2:    #C4D4E6;
  --c-text:        #0A1929;
  --c-text-2:      #3A5068;
  --c-text-3:      #6B8BA4;
  --c-accent:      #2E5090;
  --c-accent-2:    #1A3A6E;
  --c-accent-light:#E3EDF7;
  --c-accent-mid:  #A8C4E0;

  /* Status Colors */
  --c-green:       #16A34A;
  --c-green-bg:    #DCFCE7;
  --c-amber:       #D97706;
  --c-amber-bg:    #FEF3C7;
  --c-red:         #DC2626;
  --c-red-bg:      #FEE2E2;
  --c-blue:        #2563EB;
  --c-blue-bg:     #DBEAFE;
  --c-purple:      #7C3AED;
  --c-purple-bg:   #EDE9FE;
  --c-teal:        #0D9488;
  --c-teal-bg:     #CCFBF1;

  /* Layout */
  --sidebar-w:     260px;
  --sidebar-w-col: 72px;
  --topbar-h:      64px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-sm:     6px;
  --shadow:        0 1px 3px rgba(10,25,41,0.08), 0 4px 16px rgba(10,25,41,0.06);
  --shadow-lg:     0 8px 32px rgba(10,25,41,0.12), 0 2px 8px rgba(10,25,41,0.08);
  --shadow-xl:     0 20px 60px rgba(10,25,41,0.18);

  /* Typography */
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'Plus Jakarta Sans', sans-serif;

  /* Transitions */
  --t-fast:  0.15s ease;
  --t-med:   0.25s ease;
  --t-slow:  0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; cursor: pointer; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
table { border-collapse: collapse; width: 100%; }
.hidden { display: none !important; }
.mt-4 { margin-top: 1.5rem; }
.flex-1 { flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   AUTH SCREEN
   ═══════════════════════════════════════════════════════════════ */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0A1929 0%, #1A3A6E 40%, #2E5090 100%);
  position: relative;
  overflow: hidden;
}

.auth-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(168,196,224,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(46,80,144,0.3) 0%, transparent 50%),
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(255,255,255,0.02) 40px, rgba(255,255,255,0.02) 41px);
  pointer-events: none;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.auth-logo {
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.auth-brand-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}

.auth-brand-tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.auth-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255,255,255,0.2);
  animation: slideUp 0.5s cubic-bezier(0.4,0,0.2,1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.auth-subtitle {
  color: var(--c-text-3);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.auth-demo-accounts {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}

.demo-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.demo-btns { display: flex; flex-direction: column; gap: 0.5rem; }

.demo-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface-2);
  color: var(--c-text-2);
  font-size: 0.85rem;
  transition: all var(--t-fast);
  text-align: left;
}

.demo-btn:hover {
  border-color: var(--c-accent-mid);
  background: var(--c-accent-light);
  color: var(--c-accent);
}

.demo-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-badge.admin { background: var(--c-accent); color: white; }
.demo-badge.emp   { background: var(--c-green-bg); color: var(--c-green); }

/* ═══════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--c-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--t-slow), transform var(--t-slow);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-col); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: var(--topbar-h);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
  transition: opacity var(--t-med);
}

.sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; }

.sidebar-toggle {
  color: rgba(255,255,255,0.5);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.sidebar-toggle:hover { color: white; background: rgba(255,255,255,0.1); }

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
}

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

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 0.75rem 0.5rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-med);
}

.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--t-fast);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  margin-bottom: 2px;
}

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

.nav-item.active {
  color: white;
  background: var(--c-accent);
  box-shadow: 0 2px 8px rgba(46,80,144,0.4);
}

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

.nav-label {
  transition: opacity var(--t-med);
  overflow: hidden;
}

.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--c-amber);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  transition: opacity var(--t-med);
}

.nav-badge:empty { display: none; }
.sidebar.collapsed .nav-badge { opacity: 0; }

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  cursor: pointer;
  overflow: hidden;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}

.user-chip:hover { background: rgba(255,255,255,0.08); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c-accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity var(--t-med);
}

.sidebar.collapsed .user-info { opacity: 0; width: 0; }

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
}

.logout-btn {
  color: rgba(255,255,255,0.4);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.logout-btn:hover { color: var(--c-red); background: rgba(220,38,38,0.15); }

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--t-slow);
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-w-col); }

/* ─── Topbar ─── */
.topbar {
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 var(--c-border);
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }

.mobile-menu-btn {
  display: none;
  color: var(--c-text-2);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

.page-breadcrumb {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-time {
  font-size: 0.8rem;
  color: var(--c-text-3);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.notif-btn {
  position: relative;
  color: var(--c-text-2);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}

.notif-btn:hover { background: var(--c-surface-2); color: var(--c-accent); }

.notif-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--c-red);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--c-surface);
}

.notif-count:empty, .notif-count[data-count="0"] { display: none; }

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--t-fast);
  letter-spacing: 0.05em;
}

.topbar-avatar:hover { transform: scale(1.05); }

/* ─── Notification Panel ─── */
.notif-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 1.5rem;
  width: 360px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: fadeDown 0.2s ease;
  max-height: 480px;
  display: flex;
  flex-direction: column;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
}

.notif-panel-header h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.clear-notifs-btn {
  font-size: 0.8rem;
  color: var(--c-text-3);
  transition: color var(--t-fast);
}

.clear-notifs-btn:hover { color: var(--c-red); }

.notif-list {
  overflow-y: auto;
  flex: 1;
}

.notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  transition: background var(--t-fast);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.notif-item:hover { background: var(--c-surface-2); }
.notif-item.unread { background: var(--c-accent-light); }

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

.notif-item-text {
  font-size: 0.83rem;
  color: var(--c-text-2);
  line-height: 1.5;
}

.notif-item-time {
  font-size: 0.72rem;
  color: var(--c-text-3);
  margin-top: 2px;
}

.notif-empty {
  padding: 2rem;
  text-align: center;
  color: var(--c-text-3);
  font-size: 0.875rem;
}

/* ─── Notification Bar ─── */
.notification-bar {
  background: var(--c-accent);
  color: white;
  padding: 0.6rem 1.5rem;
  position: sticky;
  top: var(--topbar-h);
  z-index: 49;
}

.notif-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 900px;
  margin: 0 auto;
}

.notif-bar-inner svg { flex-shrink: 0; opacity: 0.8; }

#notif-bar-text {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
}

.notif-bar-close {
  color: rgba(255,255,255,0.7);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 0.25rem;
  transition: color var(--t-fast);
}

.notif-bar-close:hover { color: white; }

/* ═══════════════════════════════════════════════════════════════
   PAGES
   ═══════════════════════════════════════════════════════════════ */
.page {
  display: none;
  padding: 2rem 1.5rem;
  flex: 1;
  animation: pageFade 0.3s ease;
}

.page.active { display: block; }

@keyframes pageFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-subheading {
  color: var(--c-text-3);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-green);
  background: var(--c-green-bg);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ─── Metrics Grid ─── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--c-border);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

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

.metric-card.blue  .metric-icon { background: var(--c-blue-bg);   color: var(--c-blue); }
.metric-card.amber .metric-icon { background: var(--c-amber-bg);  color: var(--c-amber); }
.metric-card.green .metric-icon { background: var(--c-green-bg);  color: var(--c-green); }
.metric-card.red   .metric-icon { background: var(--c-red-bg);    color: var(--c-red); }

.metric-data { display: flex; flex-direction: column; }

.metric-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--c-text-3);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* ─── Dashboard Grid ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
}

.dash-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
}

.dash-card-header h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text);
}

.link-btn {
  font-size: 0.8rem;
  color: var(--c-accent);
  font-weight: 600;
  transition: color var(--t-fast);
}

.link-btn:hover { color: var(--c-accent-2); }

.dash-table-wrap { overflow-x: auto; }

.dash-table {
  width: 100%;
  font-size: 0.83rem;
}

.dash-table th {
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}

.dash-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-2);
}

.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--c-surface-2); }

/* ─── Status Chart ─── */
.status-chart {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chart-bar-item { display: flex; flex-direction: column; gap: 0.3rem; }

.chart-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--c-text-2);
  font-weight: 500;
}

.chart-bar-track {
  height: 8px;
  background: var(--c-border);
  border-radius: 4px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* ─── Employee Chips ─── */
.employee-chips {
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.emp-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--c-accent-light);
  border: 1px solid var(--c-accent-mid);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--c-accent);
  font-weight: 500;
}

.emp-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-accent);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text-2);
  letter-spacing: 0.01em;
}

.form-input {
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 0.875rem;
  transition: all var(--t-fast);
  outline: none;
  width: 100%;
}

.form-input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(46,80,144,0.12);
}

.form-input:read-only {
  background: var(--c-surface-2);
  color: var(--c-text-3);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-error {
  background: var(--c-red-bg);
  color: var(--c-red);
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  border: 1px solid rgba(220,38,38,0.2);
}

.form-success {
  background: var(--c-green-bg);
  color: var(--c-green);
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  border: 1px solid rgba(22,163,74,0.2);
}

.form-divider {
  height: 1px;
  background: var(--c-border);
  margin: 0.5rem 0;
}

.form-section-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 0.25rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.input-with-icon { position: relative; }

.input-with-icon .form-input { padding-right: 2.5rem; }

.input-icon-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-3);
  padding: 0.2rem;
  transition: color var(--t-fast);
}

.input-icon-btn:hover { color: var(--c-accent); }

/* ─── File Upload ─── */
.file-upload-wrap { position: relative; }

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-ui {
  border: 2px dashed var(--c-border-2);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--c-text-3);
  transition: all var(--t-fast);
  background: var(--c-surface-2);
  cursor: pointer;
}

.file-upload-ui:hover {
  border-color: var(--c-accent);
  background: var(--c-accent-light);
  color: var(--c-accent);
}

.file-upload-ui svg { opacity: 0.6; }

.file-upload-ui span:first-of-type {
  font-size: 0.85rem;
  font-weight: 500;
}

.file-hint {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all var(--t-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--c-accent);
  color: white;
  border: 1.5px solid var(--c-accent);
}

.btn-primary:hover {
  background: var(--c-accent-2);
  border-color: var(--c-accent-2);
  box-shadow: 0 4px 12px rgba(46,80,144,0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--c-text-2);
  border: 1.5px solid var(--c-border);
}

.btn-ghost:hover {
  background: var(--c-surface-2);
  border-color: var(--c-border-2);
}

.btn-danger {
  background: var(--c-red);
  color: white;
  border: 1.5px solid var(--c-red);
}

.btn-danger:hover { background: #b91c1c; }

.btn-success {
  background: var(--c-green);
  color: white;
  border: 1.5px solid var(--c-green);
}

.btn-success:hover { background: #15803d; }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-full { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   SEARCH & FILTERS
   ═══════════════════════════════════════════════════════════════ */
.search-bar-wrap {
  position: relative;
  margin-bottom: 1rem;
}

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

.search-input {
  width: 100%;
  padding: 0.65rem 0.875rem 0.65rem 2.5rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 0.875rem;
  font-family: var(--font-body);
  transition: all var(--t-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(46,80,144,0.1);
}

.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 0.875rem;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  transition: border-color var(--t-fast);
}

.filter-select:focus { border-color: var(--c-accent); }

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */
.table-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-table {
  width: 100%;
  font-size: 0.83rem;
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-2);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background var(--t-fast);
}

.data-table tbody tr:hover td { background: var(--c-surface-2); }

.table-empty {
  padding: 3rem;
  text-align: center;
  color: var(--c-text-3);
  font-size: 0.875rem;
}

/* ─── Employee Name Cell ─── */
.emp-name-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.emp-table-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c-accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.emp-name-text { font-weight: 600; color: var(--c-text); }
.emp-email-text { font-size: 0.75rem; color: var(--c-text-3); }

/* ─── Action Buttons ─── */
.action-btns {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.action-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  color: var(--c-text-3);
}

.action-btn:hover { background: var(--c-surface-2); }
.action-btn.edit:hover  { color: var(--c-accent); background: var(--c-accent-light); }
.action-btn.delete:hover { color: var(--c-red); background: var(--c-red-bg); }
.action-btn.view:hover  { color: var(--c-green); background: var(--c-green-bg); }
.action-btn.approve:hover { color: var(--c-green); background: var(--c-green-bg); }
.action-btn.reject:hover  { color: var(--c-red); background: var(--c-red-bg); }

.action-btn svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-applied    { background: var(--c-blue-bg);   color: var(--c-blue); }
.badge-approved   { background: var(--c-green-bg);  color: var(--c-green); }
.badge-vacation   { background: var(--c-purple-bg); color: var(--c-purple); }
.badge-ontime     { background: var(--c-teal-bg);   color: var(--c-teal); }
.badge-expire     { background: var(--c-red-bg);    color: var(--c-red); }
.badge-active     { background: var(--c-green-bg);  color: var(--c-green); }
.badge-inactive   { background: var(--c-border);    color: var(--c-text-3); }
.badge-onleave    { background: var(--c-amber-bg);  color: var(--c-amber); }
.badge-annual     { background: var(--c-blue-bg);   color: var(--c-blue); }
.badge-emergency  { background: var(--c-red-bg);    color: var(--c-red); }
.badge-admin      { background: var(--c-accent);    color: white; }
.badge-employee   { background: var(--c-surface-2); color: var(--c-text-2); border: 1px solid var(--c-border); }

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,25,41,0.5);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: overlayFade 0.2s ease;
}

@keyframes overlayFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.3s cubic-bezier(0.4,0,0.2,1);
}

.modal-lg { max-width: 720px; }

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--c-border);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-3);
  font-size: 1.2rem;
  transition: all var(--t-fast);
}

.modal-close:hover { background: var(--c-red-bg); color: var(--c-red); }

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ─── View Modal ─── */
.view-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.view-detail-item { display: flex; flex-direction: column; gap: 0.2rem; }

.view-detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
}

.view-detail-value {
  font-size: 0.875rem;
  color: var(--c-text);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════════════ */
.profile-layout { max-width: 700px; }

.profile-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem 1.75rem 1.25rem;
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: white;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.profile-avatar-info h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
}

.role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  color: white;
  margin-top: 0.25rem;
}

.profile-form {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PAGE
   ═══════════════════════════════════════════════════════════════ */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
}

.admin-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-card h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-2);
}

.pending-list {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
}

.pending-item {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pending-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pending-item-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--c-text);
}

.pending-item-meta {
  font-size: 0.78rem;
  color: var(--c-text-3);
}

.pending-item-actions {
  display: flex;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--c-text);
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast.toast-success { background: var(--c-green); }
.toast.toast-error   { background: var(--c-red); }
.toast.toast-info    { background: var(--c-accent); }
.toast.toast-warning { background: var(--c-amber); }

.toast-icon { flex-shrink: 0; }
.toast-icon svg { width: 18px; height: 18px; }

.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
  }

  .mobile-menu-btn { display: flex; }

  .topbar-time { display: none; }

  .form-row { grid-template-columns: 1fr; }

  .page { padding: 1.25rem 1rem; }

  .notif-panel { right: 0.5rem; width: calc(100vw - 1rem); }
}

@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { flex-direction: column; }
  .filter-bar .search-bar-wrap { width: 100%; }
  .modal { max-height: 95vh; }
  .view-detail-grid { grid-template-columns: 1fr; }
}

/* ─── Sidebar overlay for mobile ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,25,41,0.5);
  z-index: 99;
}

.sidebar-overlay.active { display: block; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-accent-mid); }

/* ─── Selection ─── */
::selection { background: var(--c-accent-light); color: var(--c-accent-2); }