/* ===========================
   Ispectra HR — Main Stylesheet
   =========================== */

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --sidebar-bg: #1e1b4b;
  --sidebar-text: #c7d2fe;
  --sidebar-active: #4f46e5;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --sidebar-width: 240px;
  --header-height: 64px;
  --transition: all .2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }

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

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-height);
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.sidebar-logo .logo-text { color: #fff; }
.sidebar-logo .logo-text strong { font-size: 15px; font-weight: 700; display: block; }
.sidebar-logo .logo-text span { font-size: 11px; color: var(--sidebar-text); opacity: .7; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(199,210,254,.4);
  padding: 12px 20px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-radius: 0;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: rgba(79,70,229,.3);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary-light);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.sidebar-user-info strong { display: block; font-size: 12.5px; font-weight: 600; color: #fff; }
.sidebar-user-info span { font-size: 11px; color: var(--sidebar-text); opacity: .6; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-title h1 { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.topbar-title p { font-size: 12px; color: var(--text-muted); }
.topbar-spacer { flex: 1; }

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  gap: 8px;
  width: 240px;
  transition: var(--transition);
}
.search-box:focus-within { border-color: var(--primary); background: #fff; }
.search-box input { border: none; background: none; width: 100%; color: var(--text-primary); }
.search-box input::placeholder { color: var(--text-muted); }
.search-box .icon { color: var(--text-muted); font-size: 14px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  position: relative;
  transition: var(--transition);
}
.topbar-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.topbar-btn .dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1px solid #fff;
}
.topbar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: var(--transition);
  border: 1px solid transparent;
}
.topbar-profile:hover { background: var(--bg); border-color: var(--border); }
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.topbar-profile-info strong { display: block; font-size: 13px; font-weight: 600; }
.topbar-profile-info span { font-size: 11px; color: var(--text-muted); }

/* ===== PAGE CONTENT ===== */
.page-content { padding: 24px; flex: 1; }
.page { display: none; }
.page.active { display: block; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  cursor: default;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue { background: #eff6ff; color: var(--info); }
.stat-icon.green { background: #f0fdf4; color: var(--success); }
.stat-icon.yellow { background: #fffbeb; color: var(--warning); }
.stat-icon.purple { background: #f5f3ff; color: var(--primary); }
.stat-icon.red { background: #fef2f2; color: var(--danger); }
.stat-icon.cyan { background: #ecfeff; color: var(--secondary); }

.stat-info .value { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-info .label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stat-info .change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-info .change.up { color: var(--success); }
.stat-info .change.down { color: var(--danger); }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .icon { font-size: 16px; }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1200px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 2px solid var(--border); }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
tbody td { padding: 12px 14px; color: var(--text-primary); vertical-align: middle; }

/* ===== AVATARS ===== */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 72px; height: 72px; font-size: 26px; }
.avatar.a1 { background: linear-gradient(135deg, #4f46e5, #818cf8); }
.avatar.a2 { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.avatar.a3 { background: linear-gradient(135deg, #10b981, #34d399); }
.avatar.a4 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.avatar.a5 { background: linear-gradient(135deg, #ef4444, #f87171); }
.avatar.a6 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.avatar.a7 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.avatar.a8 { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }

/* ===== BADGES / CHIPS ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #f5f3ff; color: #5b21b6; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-secondary { background: #e0f2fe; color: #0c4a6e; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }

/* ===== FILTERS ===== */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.filter-tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  border: none;
}
.filter-tab.active, .filter-tab:hover {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform .2s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 720px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== EMPLOYEE CARD ===== */
.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.emp-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}
.emp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary); }
.emp-card .avatar { margin: 0 auto 12px; }
.emp-card .emp-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.emp-card .emp-role { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.emp-card .emp-dept { font-size: 11px; background: var(--bg); padding: 3px 10px; border-radius: 20px; display: inline-block; color: var(--text-secondary); }
.emp-card .emp-actions { margin-top: 14px; display: flex; gap: 6px; justify-content: center; }

/* ===== PROFILE PAGE ===== */
.profile-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius);
  padding: 28px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.profile-info h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.profile-info p { opacity: .85; font-size: 13px; }
.profile-badges { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.profile-badge { background: rgba(255,255,255,.2); padding: 3px 10px; border-radius: 20px; font-size: 12px; }

/* ===== ATTENDANCE ===== */
.attendance-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.att-day-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 0 8px;
}
.att-day {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid transparent;
  position: relative;
}
.att-day:hover { border-color: var(--primary); color: var(--primary); }
.att-day.present { background: #dcfce7; color: #166534; }
.att-day.absent { background: #fee2e2; color: #991b1b; }
.att-day.halfday { background: #fef3c7; color: #92400e; }
.att-day.weekend { background: transparent; color: var(--text-muted); opacity: .5; cursor: default; }
.att-day.today { border: 2px solid var(--primary); font-weight: 700; }
.att-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  position: absolute;
  bottom: 3px;
}
.att-dot.green { background: var(--success); }
.att-dot.red { background: var(--danger); }

/* ===== LEAVE ===== */
.leave-balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.leave-balance-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
}
.leave-balance-card .lb-icon { font-size: 22px; margin-bottom: 8px; }
.leave-balance-card .lb-count { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.leave-balance-card .lb-used { font-size: 11px; color: var(--text-muted); margin: 4px 0; }
.leave-balance-card .lb-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.lb-bar { height: 4px; background: var(--border); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.lb-bar-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }

/* ===== PAYROLL ===== */
.payslip {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.payslip-header {
  background: var(--primary);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.payslip-header h3 { font-size: 16px; font-weight: 700; }
.payslip-header p { font-size: 12px; opacity: .8; margin-top: 2px; }
.payslip-body { padding: 20px 24px; }
.payslip-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.payslip-row:last-child { border-bottom: none; }
.payslip-total { display: flex; justify-content: space-between; padding: 14px 0 0; font-size: 16px; font-weight: 700; color: var(--primary); }

/* ===== KANBAN (Recruitment) ===== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col { min-width: 200px; }
.kanban-col-header {
  padding: 10px 12px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-cards { background: var(--bg); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 8px; min-height: 200px; }
.kanban-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.kanban-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.kanban-card .kc-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.kanban-card .kc-role { font-size: 11.5px; color: var(--text-muted); margin-bottom: 8px; }
.kanban-card .kc-footer { display: flex; align-items: center; justify-content: space-between; }

/* ===== CHARTS ===== */
.chart-container { width: 100%; overflow: hidden; }
canvas { display: block; }

/* ===== PROGRESS ===== */
.progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; transition: width .6s ease; }

/* ===== TIMELINE ===== */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 14px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { display: flex; gap: 12px; margin-bottom: 16px; position: relative; }
.timeline-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.timeline-content { flex: 1; background: var(--bg); border-radius: 8px; padding: 10px 14px; }
.timeline-content strong { display: block; font-size: 13px; margin-bottom: 2px; }
.timeline-content span { font-size: 11.5px; color: var(--text-muted); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
  border-left: 4px solid var(--success);
}
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== TABS ===== */
.tabs { border-bottom: 2px solid var(--border); display: flex; gap: 0; margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-btn:hover { color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== DEPT CARD ===== */
.dept-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.dept-card:hover { box-shadow: var(--shadow-md); }
.dept-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.dept-info h4 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.dept-info p { font-size: 12px; color: var(--text-muted); }
.dept-meta { margin-left: auto; text-align: right; }
.dept-meta .count { font-size: 22px; font-weight: 800; color: var(--primary); }
.dept-meta span { font-size: 11px; color: var(--text-muted); }

/* ===== SETTINGS ===== */
.settings-menu { display: flex; flex-direction: column; gap: 2px; }
.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13.5px;
  color: var(--text-secondary);
}
.settings-menu-item:hover, .settings-menu-item.active {
  background: var(--bg);
  color: var(--primary);
  font-weight: 600;
}
.settings-menu-item .s-icon { font-size: 16px; width: 20px; text-align: center; }

/* ===== TOGGLE ===== */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  display: inline-block;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .kanban-board { grid-template-columns: repeat(3, 200px); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .topbar .search-box { display: none; }
}

/* ===== UTILITY ===== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-primary-c { color: var(--primary); }
.font-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.p-0 { padding: 0; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page.active { animation: fadeIn .25s ease; }

/* Loading spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ROLE-BASED ACCESS CONTROL STYLES ===== */

/* Role badge variants */
.role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700;
  border: 1.5px solid transparent;
}
.role-badge-admin   { background: #fef2f2; color: #ef4444; border-color: rgba(239,68,68,.25);  }
.role-badge-hr      { background: #eef2ff; color: #4f46e5; border-color: rgba(79,70,229,.25);  }
.role-badge-employee{ background: #f0fdf4; color: #10b981; border-color: rgba(16,185,129,.25); }

/* User switcher sidebar footer hover state */
#sidebar-footer:hover {
  background: rgba(255,255,255,.06);
  border-radius: 10px;
}
#sidebar-footer {
  transition: background .2s ease;
  border-radius: 10px;
  margin: 4px;
  padding: 10px 12px;
}

/* User switcher panel scrollable */
#user-switcher-list {
  max-height: 280px;
  overflow-y: auto;
  padding-bottom: 6px;
}
#user-switcher-list::-webkit-scrollbar { width: 4px; }
#user-switcher-list::-webkit-scrollbar-track { background: transparent; }
#user-switcher-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* Permission matrix table */
.perm-table th, .perm-table td { padding: 8px 12px; font-size: 12.5px; }
.perm-table thead th { background: var(--bg); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }

/* Access-denied lock icon in restricted fields */
.field-locked {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 12px;
  padding: 4px 8px; background: var(--bg); border-radius: 6px;
}

/* Settings tabs fix for users section */
#settings-content .tab-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: var(--transition);
}
#settings-content .tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
#settings-content .tab-btn:hover:not(.active) {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* Employee salary input disabled state */
input:disabled {
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
  border-style: dashed;
}

/* Payroll role banner */
.role-info-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 8px;
  font-size: 12.5px; margin-bottom: 12px;
  border: 1px solid transparent;
}
.role-info-banner.hr   { background: #eef2ff; border-color: rgba(79,70,229,.2); color: #4f46e5; }
.role-info-banner.emp  { background: #f0fdf4; border-color: rgba(16,185,129,.2); color: #059669; }
