/* ============================================================
   KAIZEN HOSPITAL HRMS — MAIN STYLESHEET
   Design System: Enterprise Healthcare SaaS
   ============================================================ */

/* ── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-primary:   #1a6fd4;
  --brand-secondary: #0d4f9e;
  --brand-accent:    #00b4d8;

  /* Sidebar */
  --sidebar-bg:      #0f1623;
  --sidebar-hover:   #1a2540;
  --sidebar-active:  #1e3a6e;
  --sidebar-border:  #1e2d45;
  --sidebar-text:    #8ea3c3;
  --sidebar-text-active: #ffffff;
  --sidebar-label:   #4a6080;
  --sidebar-width:   240px;
  --sidebar-collapsed: 64px;

  /* Surface */
  --bg-page:         #f0f4f8;
  --bg-card:         #ffffff;
  --bg-card-hover:   #f8fafd;
  --bg-input:        #f5f7fa;
  --bg-thead:        #f8fafd;

  /* Header */
  --header-bg:       #ffffff;
  --header-height:   60px;
  --header-border:   #e8edf3;

  /* Text */
  --text-primary:    #0f1623;
  --text-secondary:  #4a5568;
  --text-muted:      #8896a7;
  --text-light:      #b0bec5;

  /* Status */
  --green:           #10b981;
  --green-bg:        #ecfdf5;
  --green-border:    #6ee7b7;
  --amber:           #f59e0b;
  --amber-bg:        #fffbeb;
  --amber-border:    #fcd34d;
  --red:             #ef4444;
  --red-bg:          #fef2f2;
  --red-border:      #fca5a5;
  --blue:            #3b82f6;
  --blue-bg:         #eff6ff;
  --blue-border:     #93c5fd;
  --purple:          #8b5cf6;
  --purple-bg:       #f5f3ff;

  /* Border */
  --border:          #e2e8f0;
  --border-light:    #f1f5f9;

  /* Shadow */
  --shadow-xs:       0 1px 3px rgba(0,0,0,.06);
  --shadow-sm:       0 2px 8px rgba(0,0,0,.08);
  --shadow-md:       0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:       0 8px 32px rgba(0,0,0,.12);
  --shadow-xl:       0 16px 48px rgba(0,0,0,.15);

  /* Radius */
  --radius-sm:       6px;
  --radius-md:       10px;
  --radius-lg:       14px;
  --radius-xl:       18px;
  --radius-full:     9999px;

  /* Transition */
  --transition:      150ms ease;
  --transition-md:   250ms ease;

  /* Font */
  --font:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
ul, ol { list-style: none; }
img { max-width: 100%; }

/* ── SCROLLBARS ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d3e0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

/* ── DEMO BADGE ─────────────────────────────────────────────── */
.demo-badge {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: linear-gradient(90deg, #1a3a5c, #1a6fd4);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-align: center;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 26px;
}
.btn-reset-demo {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-reset-demo:hover { background: rgba(255,255,255,.28); }

/* ── APP SHELL ──────────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  padding-top: 26px; /* demo badge */
  overflow: hidden;
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition-md), min-width var(--transition-md);
  position: relative;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-item span {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

/* Sidebar Header */
.sidebar-header {
  padding: 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 64px;
}
.logo-block {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #1a6fd4, #00b4d8);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;
  transition: opacity var(--transition-md);
  white-space: nowrap;
}
.logo-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
  line-height: 1.1;
}
.logo-sub {
  font-size: 10px;
  color: var(--sidebar-text);
  letter-spacing: .3px;
  font-weight: 400;
}
.sidebar-toggle {
  color: var(--sidebar-text);
  font-size: 14px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--sidebar-hover); color: #fff; }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 16px;
}
.nav-group-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sidebar-label);
  padding: 14px 16px 4px;
  white-space: nowrap;
  transition: opacity var(--transition-md);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
}
.nav-item i {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.nav-item span {
  transition: opacity var(--transition-md);
  overflow: hidden;
  white-space: nowrap;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #d0e4ff;
}
.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}
.nav-item.active i { color: #60a5fa; }

/* ── MAIN CONTENT ───────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── TOP HEADER ─────────────────────────────────────────────── */
.top-header {
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}
.header-left { flex-shrink: 0; }
.header-center { flex: 1; max-width: 520px; }
.header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Hospital Selector */
.hospital-selector {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}
.hospital-selector i:first-child { color: var(--brand-primary); font-size: 12px; }
.hospital-selector i:last-child { font-size: 10px; color: var(--text-muted); }
.hospital-selector select {
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  padding-right: 4px;
}

/* Global Search */
.global-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.global-search-wrap > i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}
.global-search-wrap input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
}
.global-search-wrap input:focus {
  border-color: var(--brand-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,111,212,.1);
}
.global-search-wrap input::placeholder { color: var(--text-muted); }

/* Search Results */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}
.search-results.visible { display: block; }
.search-group-label {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  background: var(--bg-thead);
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-light);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--blue-bg); }
.search-result-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.search-result-icon.emp { background: var(--blue-bg); color: var(--blue); }
.search-result-icon.cred { background: var(--green-bg); color: var(--green); }
.search-result-icon.pos { background: var(--purple-bg); color: var(--purple); }
.search-result-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.search-result-sub { font-size: 11px; color: var(--text-muted); }

/* Header Buttons */
.header-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 15px;
  transition: all var(--transition);
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border);
}
.header-btn:hover { background: var(--border); color: var(--text-primary); }
.notif-count {
  position: absolute;
  top: -4px; right: -4px;
  width: 17px; height: 17px;
  background: var(--red);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
  border: 1px solid var(--border);
  background: var(--bg-input);
}
.user-menu:hover { background: var(--border); }
.user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #1a6fd4, #00b4d8);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-role { font-size: 10px; color: var(--text-muted); }
.user-menu > i { font-size: 10px; color: var(--text-muted); }

/* ── PAGE CONTAINER ─────────────────────────────────────────── */
.page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
}

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  margin-bottom: 22px;
}
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.4px;
  line-height: 1.2;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}
.page-date {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.page-date i { color: var(--brand-primary); }
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn i { font-size: 12px; }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-secondary); box-shadow: 0 4px 12px rgba(26,111,212,.3); }
.btn-secondary { background: #fff; color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-input); color: var(--text-primary); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--amber); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border-light); color: var(--text-primary); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; justify-content: center; }

/* ── GRID LAYOUTS ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* ── CARD ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-md);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i { color: var(--brand-primary); }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-thead);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── KPI CARDS ──────────────────────────────────────────────── */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-md);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--brand-primary));
}
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-bottom: 12px;
  background: var(--kpi-bg, var(--blue-bg));
  color: var(--kpi-color, var(--brand-primary));
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 3px;
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.kpi-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.kpi-meta-item {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.kpi-badge.up { color: var(--green); }
.kpi-badge.down { color: var(--red); }
.kpi-badge.warn { color: var(--amber); }

/* ── SECTION LAYOUT ─────────────────────────────────────────── */
.section { margin-bottom: 24px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i { color: var(--brand-primary); font-size: 13px; }
.section-actions { display: flex; align-items: center; gap: 8px; }

/* ── DASHBOARD LAYOUT ───────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.dashboard-main { min-width: 0; }
.dashboard-sidebar-panel { display: flex; flex-direction: column; gap: 16px; }

/* ── TABLE ──────────────────────────────────────────────────── */
.table-wrap {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
}
.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  flex-wrap: wrap;
}
.table-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap i {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 12px;
}
.search-input-wrap input {
  padding: 7px 10px 7px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  width: 200px;
  transition: all var(--transition);
}
.search-input-wrap input:focus {
  border-color: var(--brand-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,111,212,.08);
}
.filter-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  background: var(--bg-input);
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--brand-primary); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead {
  background: var(--bg-thead);
  position: sticky;
  top: 0;
  z-index: 1;
}
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }
tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  color: var(--text-secondary);
}
.td-primary {
  color: var(--text-primary) !important;
  font-weight: 600;
}
.td-link {
  color: var(--brand-primary) !important;
  font-weight: 600;
  cursor: pointer;
}
.td-link:hover { text-decoration: underline; }

/* Employee Cell */
.emp-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.emp-avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.emp-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.emp-id { font-size: 11px; color: var(--text-muted); }

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-thead);
  font-size: 12px;
  color: var(--text-muted);
}
.pagination-btns { display: flex; gap: 4px; }
.pagination-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.pagination-btn:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.pagination-btn.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); font-weight: 700; }

/* ── TABS ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  flex-shrink: 0;
}
.tab-btn {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-btn:hover { color: var(--brand-primary); }
.tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: 700;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── FILTER TABS (pill style) ───────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-secondary);
  background: #fff;
  transition: all var(--transition);
}
.filter-tab:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.filter-tab.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* ── STATUS BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}
.badge-green  { background: var(--green-bg);  color: #065f46; }
.badge-amber  { background: var(--amber-bg);  color: #92400e; }
.badge-red    { background: var(--red-bg);    color: #991b1b; }
.badge-blue   { background: var(--blue-bg);   color: #1e40af; }
.badge-purple { background: var(--purple-bg); color: #5b21b6; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* ── CHARTS ─────────────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  width: 100%;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* ── TIMELINE ───────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--brand-primary);
  z-index: 1;
}
.timeline-dot.green { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.timeline-dot.amber { background: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.timeline-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.timeline-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.progress-bar-wrap { background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar-fill {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  transition: width .6s ease;
}
.progress-bar-fill.green { background: var(--green); }
.progress-bar-fill.amber { background: var(--amber); }
.progress-bar-fill.red   { background: var(--red); }

/* ── STAFFING HEALTH TABLE ──────────────────────────────────── */
.staffing-table tr.critical-row { background: #fff5f5; }
.staffing-table tr.critical-row td { color: #7f1d1d; }
.staffing-table tr.warning-row { background: #fffdf0; }

/* ── PROCESS STEPS ──────────────────────────────────────────── */
.process-steps {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.process-step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.process-step-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}
.process-step-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: #fff;
  color: var(--text-muted);
  transition: all var(--transition-md);
}
.process-step-icon.done { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.process-step-icon.active { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
.process-step-icon.pending { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.process-step-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-align: center; }
.process-step-connector {
  flex: 1;
  min-width: 24px;
  height: 2px;
  background: var(--border);
  margin: 0 2px;
  margin-bottom: 20px;
}
.process-step-connector.done { background: var(--green); }

/* ── PIPELINE / KANBAN ──────────────────────────────────────── */
.pipeline-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: flex-start;
}
.pipeline-col {
  min-width: 190px;
  max-width: 190px;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 12px;
  flex-shrink: 0;
}
.pipeline-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pipeline-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.pipeline-col-count {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pipeline-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.pipeline-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pipeline-card-title { font-size: 12px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.pipeline-card-meta { font-size: 11px; color: var(--text-muted); }

/* ── HR HEALTH SCORE ────────────────────────────────────────── */
.health-score-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 16px;
}
.health-score-ring svg { transform: rotate(-90deg); }
.health-score-text {
  position: absolute;
  text-align: center;
}
.health-score-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.health-score-max { font-size: 11px; color: var(--text-muted); }
.health-indicators { display: flex; flex-direction: column; gap: 8px; }
.health-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.health-indicator-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 80px;
}
.health-indicator-bar { flex: 1; }
.health-indicator-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 34px;
  text-align: right;
}

/* ── ROSTER GRID ────────────────────────────────────────────── */
.roster-grid {
  overflow-x: auto;
}
.roster-table {
  min-width: 700px;
}
.roster-table td, .roster-table th {
  min-width: 90px;
  text-align: center;
}
.roster-table td:first-child, .roster-table th:first-child {
  text-align: left;
  min-width: 160px;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
}
thead .roster-table th:first-child { background: var(--bg-thead); }
.shift-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.shift-morning { background: #fef9c3; color: #854d0e; }
.shift-evening { background: #fce7f3; color: #9d174d; }
.shift-night   { background: #ede9fe; color: #5b21b6; }
.shift-off     { background: #f1f5f9; color: #94a3b8; }

/* ── CREDENTIAL TIMELINE ────────────────────────────────────── */
.expiry-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 12px 0;
}
.expiry-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
  cursor: pointer;
}
.expiry-step::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.expiry-step:last-child::before { display: none; }
.expiry-step-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #fff;
  color: var(--text-muted);
  z-index: 1;
  transition: all var(--transition-md);
}
.expiry-step-icon.done { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.expiry-step-icon.active { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); animation: pulse 1.5s infinite; }
.expiry-step-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-align: center; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,.4); }
  50% { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}

/* ── ONBOARDING CHECKLIST ───────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: 6px; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition);
}
.checklist-item:hover { background: var(--bg-card-hover); }
.checklist-item.done { background: var(--green-bg); border-color: var(--green-border); }
.checklist-item.done .checklist-label { color: #065f46; text-decoration: line-through; opacity: .7; }
.checklist-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  font-size: 10px;
  color: transparent;
}
.checklist-item.done .checklist-check {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.checklist-label { font-size: 13px; font-weight: 500; color: var(--text-primary); }

/* ── ALERT PANEL ────────────────────────────────────────────── */
.alert-item {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #fff;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition);
}
.alert-item:hover { box-shadow: var(--shadow-sm); }
.alert-item-header { display: flex; align-items: flex-start; gap: 8px; }
.alert-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.alert-text { font-size: 12px; color: var(--text-secondary); line-height: 1.4; font-weight: 500; }
.alert-item.critical { border-left: 3px solid var(--red); background: #fff8f8; }
.alert-item.warning  { border-left: 3px solid var(--amber); background: #fffdf5; }
.alert-item.info     { border-left: 3px solid var(--blue); background: #f0f7ff; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .grid-6 { grid-template-columns: repeat(4, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr 280px; }
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-sidebar-panel { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 200px; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .page-container { padding: 16px; }
}

@media (max-width: 768px) {
  .sidebar { position: fixed; left: -240px; height: 100%; z-index: 500; transition: left var(--transition-md); }
  .sidebar.mobile-open { left: 0; }
  .user-info { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .header-center { display: none; }
}

/* ── UTILITY ────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-primary-color { color: var(--brand-primary); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-danger { color: var(--red) !important; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border-light); margin: 12px 0; }
.hidden { display: none !important; }
