:root {
  --primary-green: #008C8C;
  --dark-green: #006666;
  --light-bg: #e9edee;        /* page background */
  --border-color: #D9E5E5;
  --bg-surface: #ffffff;      /* card/panel background */
  --bg-hover: #f4f6f6;        /* subtle hover/tint background */
  --bg-table-head: #f4f7f7;   /* table header background */
  --text-primary: #1f2a2a;
  --text-muted: #8a9a9a;
  --accent-teal: #0e6f6b;      /* "active pool"/success text accent - a dark teal, distinct from --primary-green/--dark-green */
}

/* Dark mode: only the neutrals flip - --primary-green/--dark-green (the
   brand teal) and the saturated status-badge/funnel-segment colors stay
   the same in both modes, since they're already white-text-on-saturated-
   color and read fine on a dark surface too. --accent-teal is the
   exception: it's used as plain text on the page/card surface (not paired
   with its own background like a badge), and its light-mode value is too
   dark to read against a near-black page, so it gets a brightened dark-mode
   value here instead. Toggled by templates/hr_base.html's script, which
   sets data-theme on <html> before first paint (from localStorage, falling
   back to prefers-color-scheme) so there's no flash of the wrong theme on
   load. */
:root[data-theme="dark"] {
  --light-bg: #14181a;
  --border-color: #33393c;
  --bg-surface: #1e2427;
  --bg-hover: #262d30;
  --bg-table-head: #232a2d;
  --text-primary: #e7ebec;
  --text-muted: #8fa0a3;
  --accent-teal: #4fd6d1;
}

html {
  font-size: 14px;               /* global scale-down for a denser, professional feel */
}
body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-primary);
  font-weight: 400;
  letter-spacing: 0.1px;
}

/* Checkboxes/switches: brand teal instead of Bootstrap's default blue. */
.form-check-input:checked {
  background-color: var(--primary-green);
  border-color: var(--primary-green);
}
.form-check-input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 .2rem rgba(0, 140, 140, .25);
}

/* Headings: tighter, less shouty */
h1, .h1 { font-size: 24px; font-weight: 700; }
h2, .h2 { font-size: 20px; font-weight: 700; }
h3, .h3 { font-size: 17px; font-weight: 600; }
h4, .h4 { font-size: 15px; font-weight: 600; }
h5, .h5 { font-size: 16px; font-weight: 600; }
.small, small { font-size: 12px; }

main.container-fluid { max-width: 1600px; }

/* Navbar */
.app-navbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
}
.app-navbar .navbar-brand {
  color: var(--dark-green);
  font-size: 17px;
  font-weight: 700;
}
.app-navbar .nav-link {
  color: #495057;
  font-size: 13px;
  font-weight: 500;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
  color: var(--primary-green);
}

/* Buttons */
.btn {
  border-radius: 6px;
  font-weight: 500;
}
.btn-sm {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
}
/* keep row action buttons tidy */
td .btn-sm { margin: 1px 0; }
.btn-primary-app,
.btn-outline-app {
  background-color: var(--bg-surface);
  color: var(--primary-green);
  border: 1.5px solid var(--primary-green);
  border-radius: 8px;
}
.btn-primary-app:hover,
.btn-outline-app:hover {
  background-color: var(--dark-green);
  border-color: var(--dark-green);
  color: #ffffff;
}
.btn-fill-app {
  background-color: var(--primary-green);
  border: 1.5px solid var(--primary-green);
  color: #ffffff;
  border-radius: 8px;
}
.btn-fill-app:hover {
  background-color: var(--dark-green);
  border-color: var(--dark-green);
  color: #ffffff;
}

/* Cards */
.app-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
}

/* Navbar refinements */
.app-navbar { padding: 0.5rem 1rem; box-shadow: 0 1px 3px rgba(16,24,40,0.05); }
.app-navbar .nav-link { padding: 0.4rem 0.7rem; }

/* Nav tabs (dashboard) */
.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: 0;
}
.nav-tabs .nav-link.active {
  color: var(--dark-green);
  border-bottom-color: var(--primary-green);
  background: transparent;
}
.nav-tabs {
  border-bottom: 1px solid var(--border-color);
}

/* Tables */
table.dataTable,
.table {
  border-collapse: collapse !important;
  font-size: 0.82rem;
}
.table thead th,
table.dataTable thead th {
  background-color: var(--bg-table-head);
  border-bottom: 1.5px solid var(--border-color) !important;
  color: var(--dark-green);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  padding: 0.55rem 0.6rem;
}
.table tbody td,
table.dataTable tbody td {
  vertical-align: middle;
  border-color: var(--border-color) !important;
  padding: 0.5rem 0.6rem;
}
.table-hover tbody tr:hover { background-color: var(--bg-hover); }
.table, table.dataTable { color: var(--text-primary); }

/* Form controls a touch smaller */
.form-control, .form-select {
  font-size: 0.85rem;
  border-color: var(--border-color);
}
.form-label { font-size: 0.8rem; margin-bottom: 0.15rem; }

/* Status badges */
.badge-status {
  padding: 0.3em 0.65em;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.2px;
  display: inline-block;
}
.badge-new { background-color: #0d6efd; color: #fff; }
.badge-open { background-color: #0d6efd; color: #fff; }
.badge-reapply { background-color: #fd7e14; color: #fff; }
.badge-under_review { background-color: #17a2b8; color: #fff; }
.badge-round1 { background-color: #6f42c1; color: #fff; }
.badge-interview { background-color: #17a2b8; color: #fff; }
.badge-final_selection { background-color: #6610f2; color: #fff; }
.badge-shortlisted { background-color: #198754; color: #fff; }
.badge-rejected { background-color: #dc3545; color: #fff; }
.badge-blacklisted { background-color: #212529; color: #fff; }
.badge-screening_hold { background-color: #f6e6a8; color: #6b5200; }
.btn-hold { background-color: #fbf1c9; color: #7a5c00; border: 1.5px solid #ecd9a0; }
.btn-hold:hover { background-color: #f4e5a0; color: #5f4700; border-color: #e0c97e; }
.badge-hired { background-color: var(--dark-green); color: #fff; }
.badge-draft { background-color: #6c757d; color: #fff; }
.badge-sent { background-color: #0d6efd; color: #fff; }
.badge-accepted { background-color: #198754; color: #fff; }
.badge-declined { background-color: #dc3545; color: #fff; }

.badge-dup {
  background-color: #fff3cd;
  color: #7a5b00;
  border-radius: 20px;
  padding: 0.35em 0.7em;
  font-size: 0.75rem;
}

/* Reapplied for a *different* role than the one this candidate is currently
   mapped to - see .badge-dup, whose amber tone is reserved for reapplying to
   the same role (already seen/decided on once), which deserves a second look
   in a way a different-role reapplication routinely doesn't. */
.badge-dup-other {
  background-color: #e3eefc;
  color: #2d5f96;
  border-radius: 20px;
  padding: 0.35em 0.7em;
  font-size: 0.75rem;
}

.stat-card h2 {
  color: var(--dark-green);
  font-size: 26px;
  font-weight: 700;
}
.stat-card .text-primary-app { color: var(--primary-green); font-weight: 500; }
.dash-clickable { transition: box-shadow .12s ease, transform .12s ease; }
.dash-clickable:hover {
  box-shadow: 0 4px 14px rgba(0, 140, 140, 0.18);
  transform: translateY(-2px);
  border-color: var(--primary-green);
}

/* ---- Recruitment funnel (dashboard Overview) ---- */
.funnel-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.funnel-col {
  flex: 1 1 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.funnel-stage-name {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-green);
  margin-bottom: 8px;
}
.funnel-pending {
  background: #eef6f6;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.funnel-connector {
  width: 2px;
  height: 16px;
  background: var(--border-color);
  margin: 0 auto;
}
.funnel-big {
  border: 1.5px solid var(--primary-green);
  border-radius: 10px;
  padding: 16px 12px 10px;
  text-align: center;
  position: relative;
  min-height: 130px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.funnel-big-num { font-size: 2rem; font-weight: 600; color: #2b3238; }
.funnel-total {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 0.85rem;
  color: #9aa5a5;
}
.funnel-total::before {
  content: '';
  position: absolute;
  right: 2px; bottom: 18px;
  width: 26px; height: 1px;
  background: #cfdada;
  transform: rotate(-45deg);
}
.funnel-label { font-size: 0.7rem; text-transform: uppercase; color: #7a8686; letter-spacing: .3px; }
.funnel-num { font-size: 1.4rem; font-weight: 600; color: #2b3238; }
.funnel-drops { display: flex; gap: 8px; margin-top: 10px; }
.funnel-drop {
  flex: 1;
  background: #f4f7f7;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
}
.funnel-num-sm { font-size: 1.1rem; font-weight: 600; }
.funnel-label-sm { font-size: 0.62rem; text-transform: uppercase; color: #7a8686; }

.timeline-item {
  border-left: 2px solid var(--border-color);
  padding-left: 1rem;
  margin-left: 0.5rem;
  padding-bottom: 1.25rem;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -6.5px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: var(--primary-green);
}
