:root {
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --sidebar-bg: #111827;
  --sidebar-bg-active: #1f2937;
  --sidebar-text: #cbd5e1;
  --sidebar-text-muted: #64748b;
  --brand-gold: #eab308;

  /* Status colors — fixed, reserved for task status; same hex in both themes */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;

  /* Chart chrome */
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;
  --chart-tick: #898781;
  --chart-surface: var(--bs-card-bg, var(--bs-body-bg));
  --chart-shadow: rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] {
  --chart-grid: #2c2c2a;
  --chart-axis: #383835;
  --chart-tick: #898781;
  --chart-shadow: rgba(0, 0, 0, 0.45);
}

body {
  background-color: var(--bs-tertiary-bg);
  min-height: 100vh;
}

/* ---------- Theme transition ---------- */

body,
.card,
.app-topbar,
.table,
.dropdown-menu,
.form-control,
.form-select {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* ---------- Auth pages (login / password reset) ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, var(--brand) 0%, var(--brand-dark) 45%, #1e1b4b 100%);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: 1rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.auth-brand {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
}

/* ---------- App shell ---------- */

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  overflow-y: auto;
  z-index: 1040;
  transition: transform 0.2s ease-in-out;
}

.app-sidebar .brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.25rem;
  color: #fff;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar .brand i {
  color: var(--brand-gold);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-profile-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.25;
}

.sidebar-profile-role {
  color: var(--sidebar-text-muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.sidebar-profile-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--status-good);
  margin-top: 0.2rem;
}

.status-dot-inline {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--status-good);
  display: inline-block;
  flex-shrink: 0;
}

.app-sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 0.5rem;
  padding: 0.55rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.925rem;
}

.app-sidebar .nav-link:hover {
  background: var(--sidebar-bg-active);
  color: #fff;
}

.app-sidebar .nav-link.active {
  background: var(--brand);
  color: #fff;
}

.app-sidebar .nav-section-title {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--sidebar-text-muted);
  padding: 1rem 1.1rem 0.35rem;
}

.app-sidebar .submenu .nav-link {
  padding-left: 2.4rem;
  font-size: 0.875rem;
}

.app-sidebar .nav-toggle::after {
  content: "\F282";
  font-family: "bootstrap-icons";
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.15s ease-in-out;
}

.app-sidebar .nav-toggle[aria-expanded="true"]::after {
  transform: rotate(90deg);
}

.app-sidebar .nav-link.disabled {
  opacity: 0.45;
}

.app-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
}

.app-content {
  padding: 1.75rem;
  flex: 1;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .sidebar-backdrop.show {
    display: block;
  }
}

/* ---------- Stat cards ---------- */

.stat-card {
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 0.9rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.15s ease, transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  flex-shrink: 0;
}

.stat-card .stat-icon.stat-icon-success { background: var(--status-good); }
.stat-card .stat-icon.stat-icon-info { background: var(--brand); }
.stat-card .stat-icon.stat-icon-warning { background: var(--status-warning); }
.stat-card .stat-icon.stat-icon-danger { background: var(--status-critical); }

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

/* ---------- Leads: KPI cards (icon badge + value + label + subtext) ---------- */

.kpi-card-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.kpi-card-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0.5rem;
}

.kpi-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.kpi-card-sub {
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
  margin-top: 0.1rem;
}

.stat-card.kpi-card .card-body {
  padding: 1rem 1.1rem;
}

.kpi-delta-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.kpi-delta-up { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.kpi-delta-down { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }

.kpi-card-chart {
  height: 38px;
  margin-top: 0.5rem;
}

.kpi-card-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ---------- KPI cards: icon + text in one row (compact variant) ---------- */

.kpi-card-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.kpi-card-row .kpi-card-icon {
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.kpi-card-row .kpi-card-text {
  min-width: 0;
}

.kpi-card-row .kpi-card-value {
  font-size: 1.05rem;
  margin-top: 0;
  line-height: 1.15;
}

.kpi-card-row .kpi-card-label {
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-card-row .kpi-card-sub {
  font-size: 0.62rem;
}

/* ---------- Tables & misc ---------- */

.table-card {
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 0.9rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.07);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* ---------- KPI & Targets ---------- */

.kpi-tab-strip {
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.kpi-tab-strip .nav-link {
  color: var(--bs-secondary-color);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid transparent;
}

.kpi-tab-strip .nav-link.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.kpi-tab-strip .nav-link.disabled {
  color: var(--bs-tertiary-color);
  cursor: default;
}

.kpi-card-row .kpi-card-label-wrap {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.15;
}

.kpi-month-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.kpi-ring-card {
  text-align: center;
  padding: 0.9rem 0.5rem;
}

.kpi-ring-card .kpi-ring-canvas-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 0.6rem;
  position: relative;
}

.kpi-ring-card .kpi-ring-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.kpi-ring-card .kpi-ring-sub {
  font-size: 0.7rem;
  color: var(--bs-tertiary-color);
}

.kpi-gauge-wrap {
  width: 150px;
  height: 150px;
  margin: 0 auto;
  position: relative;
}

.kpi-gauge-label {
  text-align: center;
  font-weight: 700;
  margin-top: 0.5rem;
}

.achievement-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.achievement-badge:last-child {
  border-bottom: none;
}

.achievement-badge-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-gold), var(--status-warning));
  flex-shrink: 0;
}

.achievement-badge-title {
  font-size: 0.82rem;
  font-weight: 600;
}

.achievement-badge-desc {
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
}

.achievement-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.achievement-badge-grid .achievement-badge {
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 0.6rem;
  padding: 0.75rem;
}

.avatar-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
  object-fit: cover;
}

.theme-toggle-btn {
  border: none;
  background: transparent;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-body-color);
}

.theme-toggle-btn:hover {
  background: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .icon-sun,
.icon-moon {
  display: none;
}

[data-bs-theme="dark"] .icon-moon,
.icon-sun {
  display: inline-block;
}

/* ---------- Chart tooltip (Chart.js external tooltip) ---------- */

.chart-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  min-width: 150px;
  pointer-events: none;
  background: var(--chart-surface);
  border: 1px solid var(--chart-grid);
  border-radius: 0.6rem;
  box-shadow: 0 10px 28px var(--chart-shadow);
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.chart-tooltip-title {
  font-weight: 600;
  color: var(--bs-body-color);
  margin-bottom: 0.4rem;
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
}

.chart-tooltip-row + .chart-tooltip-row {
  margin-top: 0.1rem;
}

.chart-tooltip-key {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-tooltip-label {
  color: var(--bs-secondary-color);
  flex: 1 1 auto;
}

.chart-tooltip-value {
  font-weight: 600;
  color: var(--bs-body-color);
  margin-left: 0.75rem;
}

/* ---------- Worklog: mini calendar & donut legends ---------- */

.calendar-table td {
  position: relative;
  padding: 0.15rem 0;
}

.calendar-day {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  text-decoration: none;
  color: var(--bs-body-color);
  font-size: 0.72rem;
}

.calendar-day:hover {
  background: var(--bs-tertiary-bg);
}

.calendar-day-today {
  border: 1px solid var(--brand);
  font-weight: 600;
}

.calendar-day-selected {
  background: var(--brand);
  color: #fff;
}

.calendar-day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
  margin: 1px auto 0;
}

.chart-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

/* ---------- Topbar: notification dots + online status ---------- */

.topbar-date-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.6rem;
  font-size: 0.85rem;
  color: var(--bs-body-color);
  background: var(--bs-tertiary-bg);
  white-space: nowrap;
}

.topbar-date-pill .bi-calendar3 {
  color: var(--brand);
}

.topbar-date-pill .bi-chevron-down {
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
}

.topbar-badge {
  position: absolute;
  top: 0;
  right: -0.1rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--status-critical);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.05rem;
  text-align: center;
  border: 1.5px solid var(--bs-body-bg);
}

.online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--status-good);
  border: 2px solid var(--bs-body-bg);
}

/* ---------- Worklog: dense table rows + pill status/priority badges ---------- */

.worklog-table thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.55rem 0.9rem;
}

.worklog-table tbody td {
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  vertical-align: middle;
}

.worklog-table .btn-sm {
  padding: 0.2rem 0.4rem;
  font-size: 0.78rem;
}

.badge.rounded-pill {
  padding: 0.4em 0.75em;
  font-weight: 600;
}

/* ---------- Worklog: compact stat cards (4-up in the primary column) ---------- */

.stat-card-compact .card-body {
  padding: 0.65rem 0.85rem;
}

.stat-card-compact .stat-icon {
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0.8rem;
}

.stat-card-compact .stat-value {
  font-size: 1.1rem;
  line-height: 1.2;
}

.stat-card-compact .stat-label {
  font-size: 0.68rem;
  line-height: 1.2;
}

.stat-card-compact .stat-subtext {
  font-size: 0.65rem;
  line-height: 1.25;
  white-space: nowrap;
}

.stat-subtext-good { color: var(--status-good); font-weight: 700; }
.stat-subtext-warning { color: var(--status-warning); font-weight: 700; }
.stat-subtext-critical { color: var(--status-critical); font-weight: 700; }

/* ---------- Worklog: filter toolbar ---------- */

.filter-bar-compact .form-select,
.filter-bar-compact .form-control {
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
}

.filter-bar-compact .btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
}

/* ---------- Worklog: status summary cards (replaces nav-tabs) ---------- */

.nav-card-compact .card-body {
  padding: 0.55rem 0.85rem;
}

.nav-card-icon {
  font-size: 0.95rem;
  color: var(--brand);
}

.nav-card-label {
  font-size: 0.8rem;
  font-weight: 500;
}

.nav-card-badge {
  font-size: 0.68rem;
  padding: 0.3em 0.6em;
}

.nav-card-active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.nav-card-compact.disabled {
  opacity: 0.75;
}

/* ---------- Worklog: sidebar widgets (calendar / status / summary) ---------- */

.sidebar-widget-title {
  font-size: 0.8rem;
}

/* ---------- Dashboard: professional card-section headings ---------- */

.card-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
}

.text-2xs {
  font-size: 0.7rem;
}

/* ---------- Topbar: profile name/role ---------- */

.topbar-profile-name {
  font-size: 0.82rem;
  font-weight: 500;
}

.topbar-profile-role {
  font-size: 0.68rem;
}

/* ---------- Worklog: professional modal chrome ---------- */

/* The <form> wraps modal-header/body/footer, one level below .modal-content's
   flex column — without this, .modal-body's flex/scroll never applies, the
   form renders at full content height, and .modal-content's overflow:hidden
   silently clips the footer (and its submit button) on short viewports. */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-professional .modal-content {
  border: none;
  border-radius: 0.9rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.modal-professional .modal-header {
  background: color-mix(in srgb, var(--brand) 6%, var(--bs-body-bg));
  border-bottom: 1px solid var(--bs-border-color-translucent);
  padding: 1rem 1.25rem;
}

.modal-professional .modal-title {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-professional .modal-title i {
  color: var(--brand);
}

.modal-professional .modal-body {
  padding: 1.25rem;
}

.modal-professional .modal-body label.form-label {
  font-weight: 600;
  font-size: 0.82rem;
}

.modal-professional .modal-body .form-control,
.modal-professional .modal-body .form-select {
  font-size: 0.875rem;
}

.modal-professional .modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--bs-border-color-translucent);
  background: var(--bs-tertiary-bg);
}

/* ---------- Accounts: user form (professional) ---------- */

.form-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.form-fieldset + .form-fieldset {
  margin-top: 2.25rem;
}

.form-fieldset legend {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  float: none;
  width: auto;
}

.form-fieldset legend i {
  color: var(--brand);
  font-size: 1rem;
}

.team-pills .form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  margin: 0 0.5rem 0.5rem 0;
}

.team-pills .form-check-input {
  margin-top: 0;
}

.team-pills .form-check-input:checked ~ .form-check-label {
  color: var(--brand);
  font-weight: 600;
}

.user-preview-card {
  position: sticky;
  top: calc(var(--topbar-height) + 1.75rem);
}

/* ---------- Leads: numbered fieldset step badge ---------- */

.fieldset-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ---------- Leads: sticky side panel (Follow-Up Settings) ---------- */

.sticky-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 1.75rem);
}

/* ---------- Leads: tag/label chip input (form) ---------- */

.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: var(--bs-body-bg);
}

.tag-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--brand) 25%, transparent);
}

.tag-input .tag-chip-editable {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bs-tertiary-bg);
  border-radius: 999px;
  padding: 0.2rem 0.4rem 0.2rem 0.7rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.tag-input .tag-chip-editable button {
  border: none;
  background: transparent;
  line-height: 1;
  color: var(--bs-secondary-color);
  padding: 0.1rem 0.3rem;
}

.tag-input .tag-chip-editable button:hover {
  color: var(--status-critical);
}

.tag-input .tag-input-text {
  border: none;
  outline: none;
  background: transparent;
  flex: 1 1 120px;
  min-width: 100px;
  font-size: 0.85rem;
  padding: 0.2rem 0;
  color: var(--bs-body-color);
}

/* ---------- Leads: table tag chips (list page) ---------- */

.tag-chip {
  display: inline-block;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  font-weight: 500;
  font-size: 0.7rem;
  margin: 0 0.25rem 0.25rem 0;
}

.tag-chip-more {
  display: inline-block;
  background: transparent;
  border: 1px dashed var(--bs-border-color);
  color: var(--bs-secondary-color);
  font-size: 0.7rem;
}

/* ---------- Leads: country flag cell ---------- */

.country-flag-cell {
  font-size: 1.2rem;
  line-height: 1;
}

/* ---------- Leads: follow-up plan radio cards ---------- */

.followup-plan-cards legend {
  display: none;
}

.followup-plan-cards fieldset > div {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.followup-plan-cards .form-check {
  margin: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem 0.6rem 2.2rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.followup-plan-cards .form-check-input {
  margin-left: -1.6rem;
}

.followup-plan-cards .form-check:has(.form-check-input:checked) {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.followup-plan-cards .form-check-input:checked ~ .form-check-label {
  color: var(--brand);
  font-weight: 600;
}

.next-followup-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--bs-border-color-translucent);
  background: var(--bs-tertiary-bg);
  border-radius: 0.6rem;
  padding: 0.65rem 0.85rem;
  margin: 0.75rem 0;
}

.next-followup-box i {
  color: var(--brand);
  font-size: 1.2rem;
}

/* ---------- Leads: document upload dropzone ---------- */

.upload-dropzone-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 2px dashed var(--bs-border-color);
  border-radius: 0.75rem;
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--bs-secondary-color);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone i {
  font-size: 1.75rem;
  color: var(--brand);
}

.upload-dropzone.dragover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, transparent);
}

.upload-file-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.upload-file-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--bs-secondary-color);
}

/* ---------- Leads: list-page status pill tabs ---------- */

.lead-status-tabs .nav-link {
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.76rem;
  color: var(--bs-body-color);
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

.lead-status-tabs .nav-link.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.lead-status-tabs .nav-link .badge {
  margin-left: 0.3rem;
  font-size: 0.65rem;
  padding: 0.25em 0.5em;
}

/* ---------- Leads: compact list table ---------- */

.leads-table thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.55rem 0.9rem;
}

.leads-table tbody td {
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  vertical-align: middle;
}

.leads-table .btn-sm {
  padding: 0.2rem 0.4rem;
  font-size: 0.78rem;
}

.leads-table .badge {
  font-size: 0.7rem;
}

/* ---------- Leads: donut chart legend dots ---------- */

.chart-legend-dot-0 { background: var(--bs-primary); }
.chart-legend-dot-1 { background: var(--bs-success); }
.chart-legend-dot-2 { background: var(--bs-warning); }
.chart-legend-dot-3 { background: var(--bs-info); }
.chart-legend-dot-4 { background: var(--bs-danger); }
.chart-legend-dot-5 { background: var(--bs-secondary); }
.chart-legend-dot-6 { background: var(--bs-dark); }

/* ---------- Leads: status distribution bars ---------- */

.status-bar-row + .status-bar-row {
  margin-top: 0.85rem;
}

.status-bar-track {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--bs-tertiary-bg);
  overflow: hidden;
  margin-top: 0.3rem;
}

.status-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.status-bar-fill-new { background: var(--brand); }
.status-bar-fill-in_progress { background: var(--status-warning); }
.status-bar-fill-follow_up { background: var(--brand-gold); }
.status-bar-fill-converted { background: var(--status-good); }
.status-bar-fill-lost { background: var(--status-critical); }

/* ---------- Bookings: compact list table ---------- */

.bookings-table thead th {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.65rem;
  color: var(--bs-secondary-color);
}

.bookings-table tbody td {
  padding: 0.3rem 0.65rem;
  font-size: 0.58rem;
  vertical-align: middle;
}

.bookings-table tbody td small {
  font-size: 0.9em;
}

.bookings-table .btn-sm {
  padding: 0.1rem 0.3rem;
  font-size: 0.58rem;
}

.bookings-table .badge {
  font-size: 0.54rem;
}

.bookings-table .avatar-circle {
  width: 1.4rem;
  height: 1.4rem;
  font-size: 0.52rem;
}

/* Row actions ⋮ menu — detached to <body> on open (see bookings.js) so it
   renders as a top layer above .table-card instead of being clipped by it. */
.row-actions-menu {
  position: fixed;
  z-index: 3000;
  margin: 0;
  font-size: 0.66rem;
  min-width: 9rem;
}

.row-actions-menu .dropdown-item {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.table-row-actions form {
  margin: 0;
}

/* ---------- Bookings: quick actions grid ---------- */

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 0.6rem;
  font-size: 0.72rem;
  text-align: center;
  text-decoration: none;
  color: var(--bs-body-color);
  background: transparent;
}

.quick-action-btn i {
  font-size: 1.1rem;
  color: var(--brand);
}

.quick-action-btn:hover {
  border-color: var(--brand);
  color: var(--bs-body-color);
}

.quick-action-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Projects ---------- */

.projects-table thead th {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.65rem;
  color: var(--bs-secondary-color);
}

.projects-table tbody td {
  padding: 0.45rem 0.65rem;
  font-size: 0.62rem;
  vertical-align: middle;
}

.projects-table tbody td small {
  font-size: 0.9em;
}

.projects-table .btn-sm {
  padding: 0.1rem 0.3rem;
  font-size: 0.6rem;
}

.projects-table .badge {
  font-size: 0.56rem;
}

.projects-table .avatar-circle {
  width: 1.4rem;
  height: 1.4rem;
  font-size: 0.52rem;
}

/* Expand-toggle chevron — rotates via Bootstrap's own aria-expanded, no JS. */
.project-row-toggle {
  color: var(--bs-secondary-color);
  line-height: 1;
}

.project-row-toggle i {
  display: inline-block;
  transition: transform 0.15s ease;
}

.project-row-toggle[aria-expanded="true"] i {
  transform: rotate(90deg);
}

/* Inline detail panel — a sibling <tr> under the project row, hidden via
   d-none until Bootstrap's collapse actually opens it (see projects.js). */
.project-detail-row > td {
  background: var(--bs-tertiary-bg);
}

.project-detail-panel {
  border-left: 3px solid var(--brand);
}

.project-detail-panel .nav-tabs {
  font-size: 0.7rem;
  border-bottom-color: var(--bs-border-color-translucent);
}

.project-detail-panel .nav-tabs .nav-link {
  padding: 0.4rem 0.75rem;
  color: var(--bs-secondary-color);
}

.project-detail-panel .nav-tabs .nav-link.active {
  color: var(--brand);
  font-weight: 600;
}

.project-detail-panel .tab-content {
  padding-top: 1rem;
}

.coming-soon-tab i {
  font-size: 1.75rem;
  color: var(--bs-secondary-color);
  opacity: 0.5;
  display: block;
  margin-bottom: 0.5rem;
}

/* ---------- Leave approval stepper ---------- */

.approval-stepper {
  margin: 0;
  padding: 0;
}

.approval-step {
  display: flex;
  gap: 0.75rem;
  position: relative;
  padding-bottom: 1.25rem;
}

.approval-step:last-child {
  padding-bottom: 0;
}

.approval-step::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 1.9rem;
  bottom: 0;
  width: 2px;
  background: var(--bs-border-color);
}

.approval-step:last-child::before {
  display: none;
}

.approval-step-marker {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  background: var(--bs-secondary-color);
  z-index: 1;
}

.approval-step.is-completed .approval-step-marker { background: var(--status-good); }
.approval-step.is-pending .approval-step-marker { background: var(--status-warning); }
.approval-step.is-rejected .approval-step-marker { background: var(--status-critical); }
.approval-step.is-skipped .approval-step-marker { background: var(--bs-secondary-color); opacity: 0.6; }

.approval-step-body {
  flex: 1;
  min-width: 0;
  padding-top: 0.15rem;
}

.approval-step-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.approval-step-meta {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  margin-top: 0.15rem;
}

/* ---------- Leave calendar ---------- */

.leave-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--bs-border-color-translucent);
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 0.5rem;
  overflow: hidden;
}

.leave-calendar-weekday {
  background: var(--bs-tertiary-bg);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  padding: 0.5rem 0;
}

.leave-calendar-day {
  background: var(--bs-body-bg);
  min-height: 5.5rem;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.leave-calendar-day.is-outside {
  background: var(--bs-tertiary-bg);
  opacity: 0.55;
}

.leave-calendar-day.is-today .leave-calendar-day-number {
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
}

.leave-calendar-day-number {
  font-size: 0.75rem;
  font-weight: 600;
  width: 1.4rem;
  height: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leave-calendar-event {
  display: block;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Leaderboard ---------- */

.leaderboard-tab-strip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  background: var(--bs-tertiary-bg);
  border-radius: 0.75rem;
  padding: 0.25rem;
}

.leaderboard-tab-strip .nav-link {
  border-radius: 0.55rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.leaderboard-tab-strip .nav-link.active {
  background: var(--bs-body-bg);
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.podium-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: end;
}

@media (max-width: 767.98px) {
  .podium-row {
    grid-template-columns: 1fr;
  }
}

.podium-card {
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 0.9rem;
  padding: 1.5rem 1rem 1.25rem;
  text-align: center;
  position: relative;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  background: var(--bs-body-bg);
}

.podium-card-first {
  border-color: var(--brand-gold);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-gold) 14%, var(--bs-body-bg)) 0%, var(--bs-body-bg) 65%);
  transform: translateY(-0.9rem);
  box-shadow: 0 12px 26px rgba(234, 179, 8, 0.2);
}

.podium-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.podium-rank-badge-1 { background: linear-gradient(135deg, var(--brand-gold), #f59e0b); }
.podium-rank-badge-2 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.podium-rank-badge-3 { background: linear-gradient(135deg, #d18b53, #b56a34); }

.podium-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.podium-role {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

.podium-score {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-gold);
  margin: 0.5rem 0 0.25rem;
}

.podium-meta {
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
}

.leaderboard-table .rank-cell {
  font-weight: 700;
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
}

.leaderboard-score-bar {
  height: 6px;
  max-width: 60px;
  border-radius: 999px;
  background: var(--bs-tertiary-bg);
  overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td {
  white-space: nowrap;
}

.leaderboard-score-bar-fill {
  height: 100%;
  background: var(--status-good);
  border-radius: 999px;
}

.leaderboard-donut-wrap {
  width: 100%;
  max-width: 190px;
  height: 190px;
  margin: 0 auto;
  position: relative;
}

.scoring-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.scoring-breakdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 140px;
}

.scoring-breakdown-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  font-size: 1rem;
  flex-shrink: 0;
}

.scoring-breakdown-label {
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
  font-weight: 600;
}

.scoring-breakdown-value {
  font-size: 1rem;
  font-weight: 700;
}

.scoring-breakdown-total .scoring-breakdown-icon {
  background: color-mix(in srgb, var(--brand-gold) 18%, transparent);
  color: var(--brand-gold);
}

.reward-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
}

.reward-row:not(:last-child) {
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.reward-rank-icon {
  width: 1.75rem;
  text-align: center;
  color: var(--brand-gold);
  font-size: 1rem;
}
