/* ═══════════════════════════════════════════════════════════════
   HexaPay Design System — V-People HRMS Style
   Font: Inter + DM Sans
   Primary: #1A3A6B (dark navy) | Accent: #3B6FE8 (bright blue)
═══════════════════════════════════════════════════════════════ */

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

/* ── CSS VARIABLES ──────────────────────────────────────────── */
:root {
  /* Sidebar */
  --sb-bg:       #1A3060;
  --sb-bg2:      #152850;
  --sb-active:   #2D5BE3;
  --sb-text:     rgba(255,255,255,.75);
  --sb-text-hov: #fff;
  --sb-w:        240px;

  /* Brand */
  --p:           #2D5BE3;
  --p-dark:      #1E4ACC;
  --p-light:     #EBF0FD;
  --p-mid:       #C7D6FA;

  /* Status colors */
  --green:  #22C55E;
  --orange: #F59E0B;
  --red:    #EF4444;
  --teal:   #14B8A6;
  --violet: #8B5CF6;

  /* Surface */
  --bg:      #F4F6FA;
  --surface: #FFFFFF;
  --border:  #E8ECF2;
  --border2: #F0F3F8;

  /* Text */
  --text:    #111827;
  --text2:   #6B7280;
  --text3:   #9CA3AF;

  /* Layout */
  --top-h:    64px;
  --radius:   14px;
  --radius-sm:10px;
  --shadow:   0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --shadow-md:0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:0 8px 40px rgba(0,0,0,.14);

  --font:   'Inter', system-ui, sans-serif;
  --font-d: 'DM Sans', system-ui, sans-serif;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR — Dark navy with wave bottom
══════════════════════════════════════════════════════════════ */
#sb {
  position: fixed;
  top: 0; left: 0;
  width: var(--sb-w);
  height: 100vh;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 300;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  scrollbar-width: none;
}
#sb::-webkit-scrollbar { display: none; }

/* Wave decoration at bottom */
#sb::after {
  content: '';
  position: fixed;
  bottom: 0; left: 0;
  width: var(--sb-w);
  height: 200px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 200'%3E%3Cellipse cx='60' cy='200' rx='120' ry='80' fill='%2322C55E' opacity='.25'/%3E%3Cellipse cx='180' cy='180' rx='100' ry='60' fill='%23F59E0B' opacity='.2'/%3E%3Cellipse cx='20' cy='190' rx='80' ry='50' fill='%232D5BE3' opacity='.2'/%3E%3C/svg%3E") no-repeat bottom center;
  background-size: cover;
  pointer-events: none;
  z-index: 0;
}

/* Brand */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.sb-brand img { height: 36px; filter: brightness(0) invert(1); }
.sb-brand-name {
  font-family: var(--font-d);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
  line-height: 1;
}
.sb-brand-sub {
  font-size: .62rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* Section label */
.sb-section {
  padding: 18px 20px 5px;
  font-size: .61rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Nav link */
.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 16px;
  margin: 1px 10px;
  border-radius: 9px;
  color: var(--sb-text);
  font-size: .84rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
  position: relative;
  z-index: 1;
}
.sb-link i {
  width: 18px;
  text-align: center;
  font-size: .82rem;
  flex-shrink: 0;
}
.sb-link:hover {
  background: rgba(255,255,255,.08);
  color: var(--sb-text-hov);
}
.sb-link.active {
  background: var(--sb-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(45,91,227,.35);
}

/* Sidebar footer */
.sb-footer {
  margin-top: auto;
  padding: 10px 10px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.sb-footer a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--sb-text);
  font-size: .82rem;
  text-decoration: none;
  transition: all .15s;
}
.sb-footer a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-footer i { width: 16px; text-align: center; font-size: .8rem; }

/* Sidebar overlay */
#sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 299;
}

/* ══════════════════════════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════════════════════════ */
#topbar {
  position: sticky;
  top: 0; z-index: 200;
  height: var(--top-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.hamburger {
  display: none;
  background: none; border: none;
  padding: 8px; cursor: pointer;
  color: var(--text2); font-size: 1.1rem;
  border-radius: 8px; transition: background .15s;
}
.hamburger:hover { background: var(--bg); color: var(--p); }

.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar-greeting { font-size: .92rem; font-weight: 700; color: var(--text); }
.topbar-sub      { font-size: .75rem; color: var(--text3); }

/* Search bar */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 7px 16px;
  transition: border .15s, box-shadow .15s;
}
.topbar-search:focus-within {
  border-color: var(--p);
  box-shadow: 0 0 0 3px rgba(45,91,227,.12);
  background: #fff;
}
.topbar-search input {
  border: none; background: none; outline: none;
  font-size: .83rem; color: var(--text); width: 220px;
}
.topbar-search input::placeholder { color: var(--text3); }
.topbar-search i { color: var(--text3); font-size: .82rem; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Notification bell */
.notif-btn {
  position: relative;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
  color: var(--text2);
  font-size: .9rem;
}
.notif-btn:hover { background: var(--p-light); color: var(--p); border-color: var(--p-mid); }
.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--red);
  color: #fff;
  font-size: .58rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 99px;
  border: 2px solid #fff;
  min-width: 16px;
  text-align: center;
}

/* User chip */
.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--p-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-d);
  font-weight: 700;
  color: var(--p);
  font-size: .85rem;
  flex-shrink: 0;
  border: 2px solid var(--p-mid);
}
.user-name { font-size: .84rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-role { font-size: .68rem; color: var(--text3); }

/* ══════════════════════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════════════════════ */
#main { margin-left: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column; }
.content { padding: 24px 28px; flex: 1; }

/* ══════════════════════════════════════════════════════════════
   KPI CARDS — V-People style (icon right, big number)
══════════════════════════════════════════════════════════════ */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-label { font-size: .78rem; font-weight: 500; color: var(--text3); margin-bottom: 6px; white-space: nowrap; }
.kpi-value { font-size: 2rem; font-weight: 800; color: var(--text); font-family: var(--font-d); line-height: 1; letter-spacing: -.02em; }
.kpi-sub { font-size: .72rem; color: var(--text3); margin-top: 5px; }
.kpi-sub .up   { color: var(--green); font-weight: 600; }
.kpi-sub .down { color: var(--red); font-weight: 600; }
.kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
/* Icon variants */
.kpi-icon.blue   { background: #EBF2FF; color: var(--p); }
.kpi-icon.green  { background: #DCFCE7; color: #16A34A; }
.kpi-icon.orange { background: #FEF3C7; color: #D97706; }
.kpi-icon.red    { background: #FEE2E2; color: #DC2626; }
.kpi-icon.violet { background: #F3E8FF; color: #7C3AED; }
.kpi-icon.teal   { background: #CCFBF1; color: #0D9488; }

/* ══════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border2);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.card-header-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 22px; }
.card-footer { background: var(--border2); border-top: 1px solid var(--border); padding: 12px 22px; }

/* View All link */
.view-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--p);
  text-decoration: none;
}
.view-all:hover { color: var(--p-dark); text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.table { font-size: .84rem; width: 100%; border-collapse: collapse; }
.table th {
  background: #F8FAFD;
  color: var(--text2);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1.5px solid var(--border);
  padding: 11px 16px;
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border2);
  color: var(--text);
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover td { background: #F8FAFD; }

/* ══════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════ */
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.form-control, .form-select {
  font-size: .84rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  transition: border .15s, box-shadow .15s;
  padding: 9px 13px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--p);
  box-shadow: 0 0 0 3px rgba(45,91,227,.12);
  outline: none;
}
.form-control::placeholder { color: var(--text3); }
.input-group-text {
  background: #F8FAFD;
  border: 1.5px solid var(--border);
  color: var(--text2);
  font-size: .84rem;
  font-weight: 500;
}
.form-control-sm, .form-select-sm { font-size: .8rem; padding: 6px 10px; }
.form-text { font-size: .74rem; color: var(--text3); margin-top: 4px; }
.form-check-input:checked { background-color: var(--p); border-color: var(--p); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
  font-family: var(--font);
  font-size: .84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .15s;
}
.btn-sm { font-size: .78rem; padding: 6px 13px; }
.btn-lg { font-size: .9rem; padding: 11px 24px; }

.btn-primary { background: var(--p); border-color: var(--p); color: #fff; }
.btn-primary:hover { background: var(--p-dark); border-color: var(--p-dark); color: #fff; box-shadow: 0 4px 14px rgba(45,91,227,.35); transform: translateY(-1px); }
.btn-success { background: #16A34A; border-color: #16A34A; color: #fff; }
.btn-success:hover { filter: brightness(1.08); color: #fff; transform: translateY(-1px); }
.btn-danger  { background: #DC2626; border-color: #DC2626; color: #fff; }
.btn-danger:hover  { filter: brightness(1.08); color: #fff; }
.btn-warning { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-warning:hover { filter: brightness(1.05); color: #fff; }

.btn-outline-primary { color: var(--p); border-color: var(--p-mid); background: transparent; }
.btn-outline-primary:hover { background: var(--p-light); color: var(--p-dark); border-color: var(--p); }
.btn-outline-success { color: #16A34A; border-color: #BBF7D0; background: transparent; }
.btn-outline-success:hover { background: #DCFCE7; color: #15803D; }
.btn-outline-danger  { color: #DC2626; border-color: #FECACA; background: transparent; }
.btn-outline-danger:hover  { background: #FEE2E2; color: #991B1B; }
.btn-outline-info    { color: #0284C7; border-color: #BAE6FD; background: transparent; }
.btn-outline-info:hover    { background: #E0F2FE; }
.btn-outline-secondary { color: var(--text2); border-color: var(--border); background: transparent; }
.btn-outline-secondary:hover { background: var(--bg); color: var(--text); }
.btn-outline-warning { color: #D97706; border-color: #FDE68A; background: transparent; }
.btn-outline-warning:hover { background: #FEF3C7; }

/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */
.badge {
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  letter-spacing: .01em;
}
.b-active    { background: #DCFCE7; color: #15803D; }
.b-inactive  { background: #FEF3C7; color: #92400E; }
.b-locked    { background: #FCE7F3; color: #9D174D; }
.b-generated { background: #EBF2FF; color: #1D4ED8; }
.b-draft     { background: #F3F4F6; color: #4B5563; }
.b-approved  { background: #DCFCE7; color: #15803D; }
.b-pending   { background: #FEF9C3; color: #854D0E; }
.b-rejected  { background: #FEE2E2; color: #991B1B; }
.b-earning   { background: #DCFCE7; color: #166534; }
.b-deduction { background: #FEE2E2; color: #991B1B; }
.b-taxable   { background: #FEF9C3; color: #713F12; }

/* ══════════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════════ */
.alert {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .84rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-danger  { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-light   { background: #F9FAFB; color: var(--text); border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════
   MISC
══════════════════════════════════════════════════════════════ */
.progress { background: #E5E7EB; border-radius: 99px; overflow: hidden; }
.progress-bar { background: var(--p); border-radius: 99px; transition: width .6s; }

.filter-bar {
  background: #F8FAFD;
  border-bottom: 1px solid var(--border2);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-state {
  padding: 52px 20px;
  text-align: center;
  color: var(--text3);
}
.empty-state i { font-size: 2.5rem; opacity: .2; margin-bottom: 12px; display: block; }
.empty-state p { margin: 0; font-size: .9rem; }

.emp-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--p-light);
  color: var(--p);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
  border: 2px solid var(--p-mid);
}

/* ── PAYSLIP ──────────────────────────────────────────────── */
.payslip-header {
  background: linear-gradient(135deg, #1A3060 0%, #2D5BE3 100%);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 28px;
}
.net-pay-box {
  background: linear-gradient(135deg, #1A3060, #2D5BE3);
  color: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 22px 28px;
}
.net-pay-box .amount {
  font-family: var(--font-d);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* ── TIMELINE ─────────────────────────────────────────────── */
.timeline-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px 20px; background: var(--surface); flex: 1; transition: box-shadow .2s; }
.timeline-card:hover { box-shadow: var(--shadow-md); }
.timeline-card.current { border-color: var(--p); }

/* ── DEPT CHART ───────────────────────────────────────────── */
.dept-chart-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.dept-name  { width: 130px; font-size: .83rem; font-weight: 600; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dept-amount{ width: 110px; text-align: right; font-size: .83rem; font-weight: 700; color: var(--p); flex-shrink: 0; }
.dept-emp   { width: 52px; text-align: center; font-size: .72rem; color: var(--text3); flex-shrink: 0; }

/* ── TOAST ────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; }
.hx-toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  border-radius: 10px;
  background: #1C2B45;
  color: #fff;
  font-size: .84rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  margin-top: 8px;
  animation: slideUp .25s ease;
  max-width: 360px;
  border-left: 4px solid var(--p);
}
.hx-toast.toast-success { border-left-color: var(--green); }
.hx-toast.toast-error   { border-left-color: var(--red); }
@keyframes slideUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── LOGIN ────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; }
.login-left {
  width: 480px; flex-shrink: 0;
  background: var(--sb-bg);
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 60px 50px;
  position: relative;
  overflow: hidden;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 220px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 220'%3E%3Cellipse cx='80' cy='220' rx='160' ry='100' fill='%2322C55E' opacity='.2'/%3E%3Cellipse cx='380' cy='200' rx='150' ry='80' fill='%23F59E0B' opacity='.18'/%3E%3C/svg%3E") no-repeat bottom;
  background-size: cover;
  pointer-events: none;
}
.login-right {
  flex: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  #sb { transform: translateX(-100%); }
  #sb.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  #sb-overlay.open { display: block; }
  #main { margin-left: 0; }
  .hamburger { display: flex; }
  .content { padding: 14px; }
  .topbar-search { display: none; }
  .login-left { display: none; }
  .login-right { padding: 20px; }
}
@media (max-width: 480px) {
  .content { padding: 12px; }
  .card-body { padding: 14px; }
}

/* ── UTILITIES ────────────────────────────────────────────── */
.text-primary { color: var(--p) !important; }
.text-success { color: var(--green) !important; }
.text-danger  { color: var(--red) !important; }
.text-warning { color: var(--orange) !important; }
.text-muted   { color: var(--text3) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.font-display { font-family: var(--font-d); }

/* Bootstrap overrides */
.rounded-3 { border-radius: var(--radius-sm) !important; }
.table th  { border-color: var(--border) !important; }

@media print {
  #sb, #topbar, .d-print-none { display: none !important; }
  #main { margin: 0 !important; }
  .content { padding: 0 !important; }
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL VIEW FIXES — ensures all pages match design
══════════════════════════════════════════════════════════════ */

/* Stat card (used in some views) */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* Page header pattern used in views */
.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px;
}

/* Section group headers in tables (dept rows) */
tr.section-header td, tr[style*="background:#F0F4FA"] td,
tr[style*="background:#F8FAFD"] td {
  background: #F8FAFD;
  color: var(--p);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 8px 16px;
}

/* Ensure cards inside rows have consistent border */
.row .card { height: 100%; }

/* Fix old Bootstrap card-header overrides */
.card > .card-header:first-child {
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* Inline badge fixes */
.badge.b-earning, .badge.b-deduction,
.badge.b-active, .badge.b-inactive,
.badge.b-locked, .badge.b-generated,
.badge.b-pending, .badge.b-approved { font-size: .68rem; }

/* Form section headings used in employee create/edit */
.form-section-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--p);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 14px 0 8px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 16px;
}
.form-section-title i { font-size: .85rem; }

/* Override / salary grid sticky column fix */
table th:first-child,
table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
}
table thead th:first-child { background: #F8FAFD; z-index: 3; }

/* Payslip specific */
.payslip-wrap { max-width: 820px; margin: 0 auto; }

/* Timeline dots */
.timeline-dot {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem; flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: var(--shadow-md);
  z-index: 1;
}

/* Progress bar color variants */
.progress-bar.bg-success { background: var(--green) !important; }
.progress-bar.bg-warning { background: var(--orange) !important; }
.progress-bar.bg-danger  { background: var(--red) !important; }

/* Input group fix with new border */
.input-group .form-control,
.input-group .form-select {
  border-radius: 0;
}
.input-group > *:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group > *:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Tab nav (used in some pages) */
.nav-tabs .nav-link {
  color: var(--text2);
  font-size: .84rem;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  border-radius: 0;
}
.nav-tabs .nav-link:hover  { color: var(--p); border-bottom-color: var(--p-mid); }
.nav-tabs .nav-link.active { color: var(--p); font-weight: 700; border-bottom-color: var(--p); background: none; }
.nav-tabs { border-bottom: 1px solid var(--border); }

/* Breadcrumb */
.breadcrumb { font-size: .8rem; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text3); }
.breadcrumb-item a { color: var(--p); text-decoration: none; }
.breadcrumb-item.active { color: var(--text2); }

/* Modal overrides */
.modal-header { border-color: var(--border); }
.modal-footer { border-color: var(--border); background: var(--bg); }
.modal-content { border: 1px solid var(--border); border-radius: var(--radius); }

/* Spin modal overlay */
#spinModalOverlay {
  position: fixed; inset: 0;
  background: rgba(26,48,96,.45);
  backdrop-filter: blur(3px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
}
.spin-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 48px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.spin-box .spinner-border { color: var(--p); width: 2.5rem; height: 2.5rem; }
.spin-box p { margin: 14px 0 0; color: var(--text2); font-size: .9rem; font-weight: 500; }

/* Select fix — no double arrows */
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 14px 14px;
}
