/* =========================================================================
   HRMS design tokens
   One shared palette/type system every page pulls from. When restyling a
   new page, reuse these variables instead of hard-coding colors so the
   product stays visually consistent as pages are redone one at a time.
   ========================================================================= */
:root {
  /* ink = dark navy surfaces (sidebar, login hero panel, dark headers) */
  --ink-900: #0e1a2b;
  --ink-800: #16273d;
  --ink-700: #203a4f;
  --ink-line: rgba(255,255,255,0.08);

  /* accent = the one warm color used sparingly for emphasis/CTAs */
  --accent-500: #e3a008;
  --accent-600: #c98a00;
  --accent-100: rgba(227,160,8,0.14);

  /* light surfaces = everyday app background/cards */
  --surface-0: #ffffff;
  --surface-50: #faf7f2;
  --surface-100: #f3efe8;

  /* text */
  --text-on-dark: #e8ecf2;
  --text-muted-on-dark: #8ca0b8;
  --text-ink: #1c2a3a;
  --text-muted: #64748b;

  /* legacy aliases kept so existing rules below don't break */
  --hrms-primary: #1f4e79;
  --hrms-sidebar-bg: var(--ink-900);

  /* sidebar width, referenced by the collapse toggle */
  --sidebar-w: 250px;
  --sidebar-w-collapsed: 72px;
}

body {
  background: var(--surface-50);
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

.font-display { font-family: "Sora", "Inter", sans-serif; }
.font-mono { font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace; }

.hrms-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.hrms-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  background: var(--ink-900);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  transition: width .18s ease, min-width .18s ease;
}

.sidebar-brand {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  padding: 0 1.1rem 1rem 1.1rem;
  border-bottom: 1px solid var(--ink-line);
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-brand .bi { color: var(--accent-500); flex-shrink: 0; }
.sidebar-brand-img {
  height: 24px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-collapse-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted-on-dark);
  padding: .2rem .3rem;
  border-radius: 6px;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

.sidebar-user {
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--ink-line);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}

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

.sidebar-heading {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: .06em;
  color: var(--text-muted-on-dark);
  padding: 0.9rem 1.1rem 0.3rem 1.1rem;
  white-space: nowrap;
  overflow: hidden;
}

.hrms-sidebar .nav-link {
  color: #cfdae3;
  padding: 0.55rem 1.1rem;
  border-left: 3px solid transparent;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.hrms-sidebar .nav-link .bi { flex-shrink: 0; width: 1.1em; text-align: center; }

.hrms-sidebar .nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.hrms-sidebar .nav-link.active {
  border-left-color: var(--accent-500);
  background: var(--accent-100);
  color: #fff;
}

.sidebar-footer {
  padding: 0.8rem 1.1rem;
  border-top: 1px solid var(--ink-line);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-footer-link {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted-on-dark);
  text-decoration: none;
  margin-bottom: 0.5rem;
}
.sidebar-footer-link:hover {
  color: #fff;
}

.hrms-content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

/* ---- collapsed state: icon rail only ---- */
.hrms-shell.sidebar-collapsed .hrms-sidebar {
  width: var(--sidebar-w-collapsed);
  min-width: var(--sidebar-w-collapsed);
}
.hrms-shell.sidebar-collapsed .sidebar-brand span,
.hrms-shell.sidebar-collapsed .sidebar-user,
.hrms-shell.sidebar-collapsed .sidebar-heading,
.hrms-shell.sidebar-collapsed .hrms-sidebar .nav-link span,
.hrms-shell.sidebar-collapsed .sidebar-footer .sidebar-footer-link span,
.hrms-shell.sidebar-collapsed .sidebar-footer .btn span {
  display: none;
}
.hrms-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0 0 1rem 0; }
.hrms-shell.sidebar-collapsed .sidebar-collapse-btn { margin-left: 0; }
.hrms-shell.sidebar-collapsed .sidebar-collapse-btn .bi-chevron-left { transform: rotate(180deg); }
.hrms-shell.sidebar-collapsed .hrms-sidebar .nav-link { justify-content: center; padding: .6rem; }
.hrms-shell.sidebar-collapsed .sidebar-footer { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.hrms-shell.sidebar-collapsed .sidebar-footer .btn { width: auto; padding: .4rem .55rem; }

.hrms-topbar {
  background: #edf4fc;
  border-bottom: 1px solid #d0e1fd;
  padding: 0.6rem 1.2rem;
  display: flex;
  align-items: center;
}

.card-stat {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-stat .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.table-sticky thead th {
  position: sticky;
  top: 0;
  background: #f8f9fb;
  z-index: 1;
}

.perm-matrix td, .perm-matrix th {
  vertical-align: middle;
  text-align: center;
}

.perm-matrix td.perm-label, .perm-matrix th.perm-label {
  text-align: left;
}

.slip-box {
  max-width: 780px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  overflow: hidden;
}

.slip-header {
  color: #fff;
  padding: 1.2rem 1.5rem;
}

.badge-status-active { background: #2e7d32; }
.badge-status-inactive { background: #9e9e9e; }
.badge-status-probation { background: #f9a825; color: #222; }
.badge-status-onprobation { background: #f9a825; color: #222; }
.badge-status-exited { background: #6c1d1d; }

/* Dashboard Stat Cards & Action Cards */
.card-stat-blue {
  background-color: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  border-radius: 12px;
}
.card-stat-blue .stat-value {
  color: #0369a1 !important;
}
.card-stat-purple {
  background-color: #faf5ff !important;
  border: 1px solid #e9d5ff !important;
  border-radius: 12px;
}
.card-stat-purple .stat-value {
  color: #6d28d9 !important;
}
.card-stat-orange {
  background-color: #fff7ed !important;
  border: 1px solid #fed7aa !important;
  border-radius: 12px;
}
.card-stat-orange .stat-value {
  color: #c2410c !important;
}
.card-stat-green {
  background-color: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  border-radius: 12px;
}
.card-stat-green .stat-value {
  color: #15803d !important;
}
.card-stat-rose {
  background-color: #fff1f2 !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 12px;
}
.card-stat-rose .stat-value {
  color: #be123c !important;
}
.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.bg-blue-100 { background-color: #e0f2fe; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-orange-100 { background-color: #ffedd5; }
.bg-green-100 { background-color: #dcfce7; }
.bg-rose-100 { background-color: #ffe4e6; }

.action-card-btn {
  background: #fff;
  border: 1px solid #e5e9ef;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}
.action-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--accent-500);
}

.action-btn-blue {
  background-color: #f0f9ff !important;
  border-color: #bae6fd !important;
}
.action-btn-blue:hover {
  border-color: #0284c7 !important;
  background-color: #e0f2fe !important;
}
.action-btn-teal {
  background-color: #f0fdfa !important;
  border-color: #ccfbf1 !important;
}
.action-btn-teal:hover {
  border-color: #0d9488 !important;
  background-color: #e6fffa !important;
}
.action-btn-green {
  background-color: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
}
.action-btn-green:hover {
  border-color: #16a34a !important;
  background-color: #dcfce7 !important;
}
.action-btn-purple {
  background-color: #faf5ff !important;
  border-color: #e9d5ff !important;
}
.action-btn-purple:hover {
  border-color: #7c3aed !important;
  background-color: #f3e8ff !important;
}

@media print {
  .d-print-none { display: none !important; }
  .hrms-shell { display: block; }
  .hrms-content { width: 100%; }
  body { background: #fff; }
}

@media (max-width: 991px) {
  .hrms-shell { height: auto; overflow: visible; }
  .hrms-sidebar { position: fixed; left: -260px; top: 0; bottom: 0; height: 100%; z-index: 1050; transition: left .2s; }
  .hrms-shell.sidebar-open .hrms-sidebar { left: 0; }
  .hrms-content { height: auto; overflow-y: visible; }
}