:root {
  --sidebar-width: 220px;

  /* DHR Solutions brand palette */
  --dhr-navy: #14395B;
  --dhr-navy-dark: #0f2c47;
  --dhr-red: #BE1E2D;
  --dhr-red-dark: #9c1824;

  /* Vibrant supporting palette */
  --c-blue:   #2563eb;
  --c-indigo: #4f46e5;
  --c-purple: #7c3aed;
  --c-pink:   #db2777;
  --c-orange: #f97316;
  --c-amber:  #f59e0b;
  --c-green:  #16a34a;
  --c-teal:   #0d9488;
  --c-cyan:   #06b6d4;

  /* Signature gradients */
  --grad-brand:  linear-gradient(135deg, #14395B 0%, #2563eb 100%);
  --grad-accent: linear-gradient(135deg, #BE1E2D 0%, #f97316 100%);
  --grad-sidebar: linear-gradient(180deg, #0f2c47 0%, #14395B 42%, #25286b 100%);
  --grad-rainbow: linear-gradient(90deg, #14395B, #2563eb, #7c3aed, #db2777, #BE1E2D, #f97316);

  /* Map Bootstrap primary -> brand navy */
  --bs-primary: #14395B;
  --bs-primary-rgb: 20, 57, 91;
  --bs-link-color: #14395B;
  --bs-link-color-rgb: 20, 57, 91;
  --bs-link-hover-color: #BE1E2D;
  --bs-link-hover-color-rgb: 190, 30, 45;
}

/* ---- Brand theme overrides (no Bootstrap recompile needed) ---- */
.btn-primary {
  --bs-btn-bg: var(--dhr-navy);
  --bs-btn-border-color: var(--dhr-navy);
  --bs-btn-hover-bg: var(--dhr-navy-dark);
  --bs-btn-hover-border-color: var(--dhr-navy-dark);
  --bs-btn-active-bg: var(--dhr-navy-dark);
  --bs-btn-active-border-color: var(--dhr-navy-dark);
  --bs-btn-disabled-bg: var(--dhr-navy);
  --bs-btn-disabled-border-color: var(--dhr-navy);
  background-image: var(--grad-brand);
  border: none;
  box-shadow: 0 4px 12px rgba(20, 57, 91, .28);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
.btn-primary:active { transform: translateY(0); }
.btn-outline-primary {
  --bs-btn-color: var(--dhr-navy);
  --bs-btn-border-color: var(--dhr-navy);
  --bs-btn-hover-bg: var(--dhr-navy);
  --bs-btn-hover-border-color: var(--dhr-navy);
  --bs-btn-active-bg: var(--dhr-navy);
  --bs-btn-active-border-color: var(--dhr-navy);
}
.bg-primary { background-color: var(--dhr-navy) !important; }
.text-primary { color: var(--dhr-navy) !important; }
.badge.bg-primary, .badge.text-bg-primary { background-color: var(--dhr-navy) !important; }

/* Brand accent button + gradient utilities */
.btn-accent {
  --bs-btn-color: #fff;
  color: #fff;
  background-image: var(--grad-accent);
  border: none;
  box-shadow: 0 4px 12px rgba(190, 30, 45, .28);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-accent:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(249, 115, 22, .35); }
.text-accent { color: var(--dhr-red) !important; }
.bg-accent { background-color: var(--dhr-red) !important; }
.bg-gradient-brand { background-image: var(--grad-brand) !important; color: #fff !important; }
.bg-gradient-accent { background-image: var(--grad-accent) !important; color: #fff !important; }

.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: #6b89a8;
  box-shadow: 0 0 0 .2rem rgba(20, 57, 91, .18);
}
.form-check-input:checked { background-color: var(--dhr-navy); border-color: var(--dhr-navy); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background-image: var(--grad-brand); }
.page-link { color: var(--dhr-navy); }
.active > .page-link, .page-link.active { background-image: var(--grad-brand); border-color: var(--dhr-navy); }

/* Vibrant badges */
.badge.bg-success { background-color: var(--c-green) !important; }
.badge.bg-info    { background-color: var(--c-cyan) !important; color: #fff !important; }
.badge.bg-warning { background-color: var(--c-amber) !important; color: #fff !important; }
.badge.bg-danger  { background-color: var(--dhr-red) !important; }
.badge.bg-secondary { background-color: var(--c-indigo) !important; }

body {
  background: linear-gradient(160deg, #eef2fb 0%, #f3eef7 100%);
  background-attachment: fixed;
  font-size: 14px;
}

.wrapper { min-height: 100vh; }

#sidebar {
  width: var(--sidebar-width);
  transition: width 0.25s ease;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--grad-sidebar) !important;
}
#sidebar.collapsed { width: 0; min-width: 0; }

#sidebar .nav-link {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
#sidebar .nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff !important;
  transform: translateX(2px);
}
#sidebar .nav-link.active {
  background: var(--grad-accent);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(190, 30, 45, .35);
}
#sidebar .nav-link.active i { color: #fff !important; }

.main-content { min-width: 0; }

.card { border: none; box-shadow: 0 4px 14px rgba(20,57,91,.08); border-radius: 14px; transition: box-shadow .18s ease, transform .18s ease; }
.card:hover { box-shadow: 0 8px 22px rgba(20,57,91,.12); }
.card-header { background: transparent; border-bottom: 1px solid #eef1f6; font-weight: 600; }
.card-header i { filter: saturate(1.2); }

/* Vibrant stat cards */
.stat-card { position: relative; border-radius: 16px; border: none; overflow: hidden; box-shadow: 0 6px 18px rgba(20,57,91,.10); transition: transform .18s ease, box-shadow .18s ease; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad-rainbow); }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(20,57,91,.16); }
.stat-card .icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff !important; box-shadow: 0 6px 14px rgba(0,0,0,.18); }
/* Override Bootstrap's faint bg-opacity icon tiles with solid vibrant gradients */
.stat-card .icon.text-primary   { background: linear-gradient(135deg, #14395B, #2563eb) !important; }
.stat-card .icon.text-success   { background: linear-gradient(135deg, #16a34a, #4ade80) !important; }
.stat-card .icon.text-info      { background: linear-gradient(135deg, #0891b2, #06b6d4) !important; }
.stat-card .icon.text-warning   { background: linear-gradient(135deg, #d97706, #f59e0b) !important; }
.stat-card .icon.text-danger    { background: linear-gradient(135deg, #BE1E2D, #f97316) !important; }
.stat-card .icon.text-secondary { background: linear-gradient(135deg, #4f46e5, #7c3aed) !important; }

.table { font-size: 13.5px; }
.table th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--dhr-navy); background: #eef3fa; }

/* Top navbar: rainbow accent strip + brand title pop */
.navbar.bg-white { border-bottom: none !important; box-shadow: 0 2px 10px rgba(20,57,91,.06); position: relative; }
.navbar.bg-white::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grad-rainbow); }
.navbar .navbar-brand { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent !important; letter-spacing: .3px; }

.badge { font-size: 11px; font-weight: 500; }

.stage-badge { font-size: 11px; padding: 4px 8px; border-radius: 20px; }

.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col { min-width: 220px; max-width: 220px; background: #f8f9fa; border-radius: 10px; padding: 10px; }
.kanban-col-header { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; color: #444; }
.kanban-card { background: #fff; border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: pointer; transition: box-shadow .15s; }
.kanban-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.kanban-card .name { font-weight: 600; font-size: 13px; }
.kanban-card .meta { font-size: 11px; color: #888; }

.form-label { font-weight: 500; font-size: 13px; }
.form-control, .form-select { font-size: 13.5px; }

.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4); z-index: 999; }

@media (max-width: 768px) {
  #sidebar { position: fixed; top: 0; left: 0; height: 100vh; z-index: 1000; width: var(--sidebar-width); transition: transform 0.25s ease; }
  #sidebar.collapsed { transform: translateX(-100%); width: var(--sidebar-width); }
  .sidebar-overlay.show { display: block; }
}

.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; }

.timeline { border-left: 2px solid #dee2e6; padding-left: 16px; }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--dhr-navy); border: 2px solid #fff; }

.empty-state { text-align: center; padding: 60px 20px; color: #aaa; }
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }
