/* FormHub — Dsignxt brand theme (https://www.dsignxt.com/) */
:root {
  --fc-navy: #02021e;
  --fc-navy-soft: #02031c;
  --fc-purple: #3827c7;
  --fc-purple-dark: #3330bf;
  --fc-purple-light: #5240e0;
  --fc-gold: #fdc448;
  --fc-orange: #ff8300;
  --fc-sidebar: #02021e;
  --fc-sidebar-hover: rgba(56, 39, 199, 0.18);
  --fc-accent: #3827c7;
  --fc-accent-dark: #3330bf;
  --fc-accent-light: rgba(56, 39, 199, 0.1);
  --fc-bg: #f4f3fb;
  --fc-card: #ffffff;
  --fc-text: #02021e;
  --fc-muted: #6b7280;
  --fc-border: #e8e6f5;
  --fc-sidebar-width: 260px;
  --fc-radius: 0.85rem;
  --fc-shadow: 0 4px 24px rgba(2, 2, 30, 0.06);
  --fc-shadow-lg: 0 12px 40px rgba(2, 2, 30, 0.12);
}

[data-theme="dark"] {
  --fc-sidebar: #02021e;
  --fc-sidebar-hover: rgba(56, 39, 199, 0.25);
  --fc-bg: #0a0a1a;
  --fc-card: #12122a;
  --fc-text: #f0f0f8;
  --fc-muted: #9ca3af;
  --fc-border: #1e1e3a;
  --fc-accent-light: rgba(56, 39, 199, 0.2);
  --fc-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --fc-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  background: var(--fc-bg);
  color: var(--fc-text);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--fc-purple); }
a:hover { color: var(--fc-purple-dark); }

.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--fc-sidebar-width);
  background: linear-gradient(180deg, var(--fc-navy) 0%, var(--fc-navy-soft) 100%);
  color: rgba(255, 255, 255, 0.85);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  overflow-y: auto;
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(56, 39, 199, 0.25);
}

.sidebar-brand {
  padding: 1.35rem 1.25rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  width: auto;
  height: auto;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
}

.sidebar-logo-img {max-height: 100px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.sidebar-brand h1 {
  margin: 0;
  font-size: 1.25rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-brand small {
  color: rgba(255, 255, 255, 0.5);
  font-size: .72rem;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  padding: .75rem 0 1rem;
  flex: 1;
}

.nav-section {
  padding: .85rem 1.25rem .35rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255, 255, 255, 0.72);
  padding: .62rem 1.25rem;
  border-left: 3px solid transparent;
  font-size: .9rem;
  font-weight: 500;
  transition: all .18s ease;
  margin: 1px 0;
}

.sidebar .nav-link i { font-size: 1.05rem; opacity: 0.85; }

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

.sidebar .nav-link.active {
  background: var(--fc-sidebar-hover);
  color: #fff;
  border-left-color: var(--fc-gold);
}

.sidebar .nav-link.active i { color: var(--fc-gold); }

.sidebar .nav-link .badge {
  font-size: .65rem;
  padding: .2em .45em;
  margin-left: auto;
  background: var(--fc-purple) !important;
}

.nav-group { margin-bottom: .15rem; }

.nav-group-toggle {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.nav-group-toggle:hover,
.nav-group.is-open > .nav-group-toggle {
  background: var(--fc-sidebar-hover);
  color: #fff;
}

.nav-group-chevron {
  font-size: .75rem;
  opacity: .75;
  transition: transform .2s ease;
}

.nav-group.is-open .nav-group-chevron,
.nav-group-toggle[aria-expanded="true"] .nav-group-chevron {
  transform: rotate(180deg);
}

.nav-submenu .nav-sublink {
  padding-left: 2.35rem;
  font-size: .92rem;
}

.nav-submenu .nav-sublink i {
  font-size: .45rem;
  opacity: .65;
}


.sidebar-footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  color: rgba(255, 255, 255, 0.45);
  transition: color .18s;
}

.sidebar-footer a:hover { color: var(--fc-gold); }
.sidebar-footer i { color: var(--fc-gold); font-size: .85rem; }

/* ── Main layout ── */
.main-content {
  margin-left: var(--fc-sidebar-width);
  flex: 1;
  min-width: 0;
}

.topbar {
  background: var(--fc-card);
  border-bottom: 1px solid var(--fc-border);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: var(--fc-shadow);
}

.topbar .form-control {
  border-color: var(--fc-border);
  background: var(--fc-bg);
  border-radius: 2rem;
  font-size: .88rem;
}

.topbar .form-control:focus {
  border-color: var(--fc-purple);
  box-shadow: 0 0 0 3px rgba(56, 39, 199, 0.15);
}

.topbar .input-group-text {
  border-color: var(--fc-border);
  background: var(--fc-bg);
  border-radius: 2rem 0 0 2rem;
  color: var(--fc-muted);
}

.topbar .btn-light {
  background: var(--fc-bg);
  border: 1px solid var(--fc-border);
  border-radius: 2rem;
  font-weight: 500;
  font-size: .88rem;
}

.topbar .btn-outline-secondary,
.topbar .btn-outline-primary {
  border-radius: 0.5rem;
}

.content-area { padding: 1.5rem; }

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 .25rem;
  letter-spacing: -0.02em;
  color: var(--fc-text);
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1rem;
  font-size: .85rem;
}

.breadcrumb-item a { color: var(--fc-purple); }
.breadcrumb-item.active { color: var(--fc-muted); }

/* ── Cards & stats ── */
.stat-card {
  background: var(--fc-card);
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-radius);
  padding: 1.15rem 1.25rem;
  height: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: var(--fc-shadow);
}

.stat-card:hover,
a.stat-card-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--fc-shadow-lg);
}

a.stat-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.stat-card-link:focus-visible {
  outline: 2px solid var(--fc-purple);
  outline-offset: 2px;
}

.dashboard-reminder-section {
  margin-bottom: 1rem;
}

.dashboard-reminder-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fc-muted);
  margin-bottom: 0.45rem;
}

.dashboard-reminder-item + .dashboard-reminder-item {
  margin-top: 0.35rem;
}

.dashboard-reminder-link {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dashboard-reminder-link:hover {
  background: rgba(var(--bs-primary-rgb, 56, 39, 199), 0.06);
  border-color: var(--fc-border);
  color: inherit;
}

.dashboard-reminder-time {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fc-purple);
}

.dashboard-reminder-by {
  display: block;
  font-weight: 500;
  margin-top: 0.1rem;
}

.dashboard-reminder-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
}

.dashboard-reminder-note {
  display: block;
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.dashboard-pipeline-row {
  display: grid;
  grid-template-columns: minmax(5rem, 28%) 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.4rem 0.35rem;
  margin: 0 -0.35rem;
  border-radius: 0.45rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.dashboard-pipeline-row + .dashboard-pipeline-row {
  margin-top: 0.15rem;
}

.dashboard-pipeline-row:hover {
  background: rgba(var(--bs-primary-rgb, 56, 39, 199), 0.06);
  color: inherit;
}

.dashboard-pipeline-label {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-pipeline-bar-wrap {
  height: 0.55rem;
  background: var(--fc-border);
  border-radius: 999px;
  overflow: hidden;
  min-width: 0;
}

.dashboard-pipeline-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--fc-purple) 0%, var(--fc-purple-light, #5b4cdb) 100%);
  border-radius: 999px;
  min-width: 0;
}

.dashboard-pipeline-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  min-width: 3.25rem;
}

.dashboard-pipeline-count {
  font-weight: 700;
  font-size: 0.9rem;
}

.dashboard-pipeline-pct {
  font-size: 0.72rem;
}

.dashboard-pipeline-scroll,
.dashboard-reminders-scroll {
  max-height: min(22rem, 55vh);
  min-height: 8rem;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.dashboard-reminders-scroll::-webkit-scrollbar,
.dashboard-pipeline-scroll::-webkit-scrollbar {
  width: 8px;
}

.dashboard-reminders-scroll::-webkit-scrollbar-thumb,
.dashboard-pipeline-scroll::-webkit-scrollbar-thumb {
  background: rgba(56, 39, 199, 0.35);
  border-radius: 999px;
}

.dashboard-reminders-scroll::-webkit-scrollbar-track,
.dashboard-pipeline-scroll::-webkit-scrollbar-track {
  background: transparent;
}

a.dashboard-top-project-row {
  padding: 0.55rem 0.65rem;
  margin-left: -0.65rem;
  margin-right: -0.65rem;
  border-radius: 0.45rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

a.dashboard-top-project-row:hover {
  background: rgba(var(--bs-primary-rgb, 56, 39, 199), 0.06);
  color: inherit;
}

a.dashboard-top-project-row:last-of-type {
  margin-bottom: 0 !important;
}

.stat-card .label {
  color: var(--fc-muted);
  font-size: .8rem;
  margin-bottom: .35rem;
  font-weight: 500;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--fc-accent-light);
  color: var(--fc-purple);
  font-size: 1.15rem;
}

.card-panel {
  background: var(--fc-card);
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-radius);
  margin-bottom: 1.25rem;
  box-shadow: var(--fc-shadow);
  overflow: hidden;
}

.row.g-3,
.row.g-4 {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 1.5rem;
}

.row > [class*="col-"] > .card-panel,
.row > [class*="col-"] > .stat-card {
  margin-bottom: 0;
}

.row > [class*="col-"] > .stat-card {
  height: 100%;
}

.row.row-panels-match > [class*="col-"] > .card-panel {
  height: 100%;
}

.dashboard-page .row {
  align-items: flex-start;
}

.dashboard-page .row > [class*="col-"] > .card-panel + .card-panel {
  margin-top: 1.25rem;
}

.card-panel .card-header {
  background: transparent;
  border-bottom: 1px solid var(--fc-border);
  padding: 1rem 1.35rem;
  font-weight: 600;
  font-size: .95rem;
}

.card-panel .card-body { padding: 1.35rem; }

.card-panel .card-body.p-0 .table td,
.card-panel .card-body.p-0 .table th {
  padding: 0.65rem 1.35rem;
}

.card-panel .card-body.p-0 .table.table-sm td,
.card-panel .card-body.p-0 .table.table-sm th {
  padding: 0.7rem 1.35rem;
}

.card-panel .table-card-summary td:first-child {
  word-break: break-word;
  white-space: normal;
}

.card-panel .list-group-item {
  padding: 0.85rem 1.35rem;
}

.card-panel .table.table-sm:not(.table-list) td,
.card-panel .table.table-sm:not(.table-list) th {
  padding: 0.7rem 1.35rem;
}

.list-page .bulk-actions.card-panel {
  overflow: visible;
  position: relative;
  z-index: 30;
}

.list-page .bulk-actions.card-panel .card-body {
  overflow: visible;
}

.list-page .bulk-actions .dropdown-menu {
  z-index: 1060;
}

.filter-bar {
  background: var(--fc-card);
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--fc-shadow);
}

.filter-bar > [class*="col-"],
.filter-bar .col-auto {
  min-width: 0;
  position: relative;
}

.filter-bar .form-select {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-actions .col-md-2,
.bulk-actions .col-md-3 {
  position: relative;
}

/* Filter dropdowns — scrollable Tom Select panel */
.filter-bar .fh-filter-select.ts-wrapper,
.bulk-actions .fh-filter-select.ts-wrapper {
  width: 100%;
  min-width: 0;
}

.filter-bar .fh-filter-select .ts-control,
.bulk-actions .fh-filter-select .ts-control {
  height: calc(1.5em + 0.75rem + 2px);
  min-height: calc(1.5em + 0.75rem + 2px);
  max-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 2.75rem 0.375rem 0.75rem; /* extra right space for chevron */
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fc-text);
  background-color: var(--fc-card);
  border: 1px solid var(--fc-border);
  border-radius: 0.55rem;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow: hidden;
}

/* Long selected labels: one line with … — stop before the arrow */
.filter-bar .fh-filter-select .ts-control > .item,
.bulk-actions .fh-filter-select .ts-control > .item {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 1.75rem);
  margin-right: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-bar .fh-filter-select .ts-control > input,
.bulk-actions .fh-filter-select .ts-control > input {
  flex: 0 0 auto;
  min-width: 0;
}

.filter-bar .fh-filter-select.focus .ts-control,
.bulk-actions .fh-filter-select.focus .ts-control {
  border-color: var(--fc-purple);
  box-shadow: 0 0 0 0.2rem rgba(56, 39, 199, 0.15);
}

.filter-bar .fh-filter-select .ts-control input,
.bulk-actions .fh-filter-select .ts-control input {
  font-size: 1rem;
  color: var(--fc-text);
}

.fh-filter-select-dropdown.ts-dropdown {
  z-index: 1070;
  margin-top: 0.25rem;
  border: 1px solid var(--fc-border);
  border-radius: 0.65rem;
  background: var(--fc-card);
  box-shadow: var(--fc-shadow-lg);
  overflow: hidden;
  width: max-content;
  max-width: calc(100vw - 1.5rem);
}

.fh-filter-select-dropdown .dropdown-input-wrap {
  padding: 0.4rem 0.55rem 0.35rem;
  border-bottom: 1px solid var(--fc-border);
  background: var(--fc-card);
}

.fh-filter-select-dropdown .dropdown-input {
  font-size: 0.875rem;
  border-radius: 0.45rem;
  border-color: var(--fc-border);
}

.fh-filter-select-dropdown .ts-dropdown-content {
  max-height: 14rem;
  overflow-x: auto;
  overflow-y: auto;
  padding: 0.35rem 0;
  scroll-behavior: smooth;
}

.fh-filter-select-dropdown .ts-dropdown-content::-webkit-scrollbar {
  width: 8px;
}

.fh-filter-select-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb {
  background: rgba(56, 39, 199, 0.35);
  border-radius: 999px;
}

.fh-filter-select-dropdown .ts-dropdown-content::-webkit-scrollbar-track {
  background: transparent;
}

.fh-filter-select-dropdown .option,
.fh-filter-select-dropdown .ts-dropdown .create {
  padding: 0.45rem 0.85rem;
  font-size: 0.9375rem;
  color: var(--fc-text);
  white-space: nowrap;
}

.fh-filter-select-dropdown .option.active {
  background: rgba(56, 39, 199, 0.12);
  color: var(--fc-purple-dark);
}

.fh-filter-select-dropdown .option:hover,
.fh-filter-select-dropdown .option.active:hover {
  background: rgba(56, 39, 199, 0.18);
  color: var(--fc-purple-dark);
}

.fh-filter-select-dropdown .no-results {
  padding: 0.5rem 0.85rem;
  color: var(--fc-muted);
  font-size: 0.875rem;
}

/* ── Buttons ── */
.btn-accent {
  background: linear-gradient(135deg, var(--fc-purple) 0%, var(--fc-purple-dark) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 0.55rem;
  padding: .5rem 1.1rem;
  transition: all .18s ease;
  box-shadow: 0 4px 14px rgba(56, 39, 199, 0.3);
}

.btn-accent:hover,
.btn-accent:focus {
  background: linear-gradient(135deg, var(--fc-purple-light) 0%, var(--fc-purple) 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 39, 199, 0.4);
}

.btn-primary {
  background: var(--fc-purple);
  border-color: var(--fc-purple);
}

.btn-primary:hover {
  background: var(--fc-purple-dark);
  border-color: var(--fc-purple-dark);
}

.btn-outline-primary {
  color: var(--fc-purple);
  border-color: var(--fc-purple);
}

.btn-outline-primary:hover {
  background: var(--fc-purple);
  border-color: var(--fc-purple);
}

/* ── Forms ── */
.form-control {
  border-color: var(--fc-border);
  border-radius: 0.55rem;
  font-size: .92rem;
  padding: .5rem .85rem;
}

.form-select {
  border-color: var(--fc-border);
  border-radius: 0.55rem;
  font-size: .92rem;
  padding: .5rem 2.35rem .5rem .85rem;
  background-position: right 0.75rem center;
  text-overflow: ellipsis;
  overflow: hidden;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--fc-purple);
  box-shadow: 0 0 0 3px rgba(56, 39, 199, 0.12);
}

.form-label {
  font-weight: 500;
  font-size: .88rem;
  color: var(--fc-text);
}

.form-check-input:checked {
  background-color: var(--fc-purple);
  border-color: var(--fc-purple);
}

/* ── Tables ── */
.table thead th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fc-muted);
  border-bottom-width: 1px;
  white-space: nowrap;
  font-weight: 600;
  background: var(--fc-bg);
}

.table td { vertical-align: middle; font-size: .9rem; }
.table td:not(:first-child) {
  min-width: 130px;
}

.card-panel .table-card-summary td:not(:first-child) {
  min-width: 4rem;
  white-space: nowrap;
}
.table-hover tbody tr:hover { background: var(--fc-accent-light); }

.badge.bg-primary,
.badge.bg-success { font-weight: 500; }

/* ── Alerts & toasts ── */
.alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.fc-toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: min(480px, calc(100% - 2rem));
  pointer-events: none;
}

.fc-toast {
  pointer-events: auto;
  width: 100%;
  margin: 0;
  border-radius: var(--fc-radius);
  box-shadow: var(--fc-shadow-lg);
  transform: translateY(calc(100% + 2rem));
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.fc-toast.show { transform: translateY(0); opacity: 1; }
.fc-toast.hiding { transform: translateY(calc(100% + 2rem)); opacity: 0; }

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fc-navy);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--fc-radius);
  padding: 2rem;
  box-shadow: var(--fc-shadow-lg);
}

.auth-brand-logo {
  text-align: center;
  margin-bottom: 1rem;
}

.auth-brand-logo img {
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.auth-card h2 {text-align: center;
  font-weight: 700;
  margin-bottom: .25rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--fc-navy);
}

.auth-card .subtitle {text-align: center;
  color: var(--fc-muted);
  margin-bottom: 1.5rem;
  font-size: .92rem;
}

.auth-card .form-control {
  padding: .6rem .9rem;
}

.auth-link {
  color: var(--fc-purple);
  font-weight: 500;
  font-size: .88rem;
}

.auth-link:hover { color: var(--fc-purple-dark); }

.password-toggle-wrap {
  position: relative;
}

.password-toggle-wrap .form-control {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  line-height: 0;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
  opacity: 1;
  outline: none;
}

.password-toggle-btn img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ── Dark mode overrides ── */
[data-theme="dark"] .topbar,
[data-theme="dark"] .auth-card { background: var(--fc-card); }

[data-theme="dark"] .auth-card h2 { color: var(--fc-text); }

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: var(--fc-bg);
  color: var(--fc-text);
  border-color: var(--fc-border);
}

[data-theme="dark"] .table thead th { background: var(--fc-bg); }

[data-theme="dark"] .alert-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

[data-theme="dark"] .alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

#sidebarToggle { display: none; }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 30, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.loading-overlay.show { display: flex; }

.loading-overlay .spinner-border { color: var(--fc-gold) !important; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  #sidebarToggle { display: inline-flex; }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 30, 0.45);
  z-index: 1035;
}

.sidebar-backdrop.show { display: block; }

.page-header-stacked .page-header-actions .btn {
  flex: 0 0 auto;
}

.list-page--desktop-table .table-responsive {
  -webkit-overflow-scrolling: touch;
}

.list-page--desktop-table .table {
  min-width: 960px;
}

@media (max-width: 767.98px) {
  .page-header:not(.page-header-stacked) {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem;
  }

  .page-header .breadcrumb { margin-bottom: 0; }

  .page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  .page-header:not(.page-header-stacked) .page-header-actions .btn { flex: 1 1 auto; }

  .page-header-stacked {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem;
  }

  .page-header-stacked .page-header-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .list-page .filter-bar > [class*="col-"],
  .list-page .filter-bar .col-auto {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .list-page .bulk-actions .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .list-page .bulk-actions .col-auto {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .list-page .table-list thead,
  .dashboard-page .table-list thead { display: none; }

  .list-page .table-list tbody tr,
  .dashboard-page .table-list tbody tr {
    display: block;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--fc-border);
  }

  .list-page .table-list tbody tr.table-light,
  .dashboard-page .table-list tbody tr.table-light {
    background: var(--fc-accent-light) !important;
  }

  .list-page .table-list tbody td,
  .dashboard-page .table-list tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border: 0;
    text-align: right;
    white-space: normal;
    word-break: break-word;
  }

  .list-page .table-list tbody td::before,
  .dashboard-page .table-list tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--fc-muted);
    text-align: left;
    flex: 0 0 38%;
    max-width: 38%;
  }

  .list-page .table-list tbody td[data-label=""]::before,
  .list-page .table-list tbody td:not([data-label])::before,
  .dashboard-page .table-list tbody td[data-label=""]::before,
  .dashboard-page .table-list tbody td:not([data-label])::before {
    content: none;
  }

  .list-page .table-list tbody td:first-child:has(.form-check-input),
  .dashboard-page .table-list tbody td:first-child:has(.form-check-input) {
    justify-content: space-between;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px dashed var(--fc-border);
  }

  .list-page .table-list tbody td:first-child:has(.form-check-input)::before,
  .dashboard-page .table-list tbody td:first-child:has(.form-check-input)::before {
    content: "Select";
  }

  .list-page .table-list tbody td.text-nowrap,
  .dashboard-page .table-list tbody td.text-nowrap {
    white-space: normal;
  }

  .list-page .card-panel .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }

  .dashboard-page .stat-card .value { font-size: 1.45rem; }

  .dashboard-page .stat-card .icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .dashboard-page #submissionChart {
    max-height: 220px;
  }

  .dashboard-page .table-list tbody td::before {
    flex: 0 0 32%;
    max-width: 32%;
  }
}

@media (max-width: 575.98px) {
  .content-area { padding: 1rem; }
  .topbar { padding: .65rem 1rem; }
  .page-title { font-size: 1.25rem; }
  .filter-bar { padding: 0.85rem; }
  .dashboard-page .stat-card { padding: 0.95rem 1rem; }
}

.status-drag-handle {
  cursor: grab;
  font-size: 1.1rem;
  opacity: .55;
}

.status-drag-handle:active {
  cursor: grabbing;
}

.status-row-ghost {
  opacity: .45;
  background: rgba(124, 58, 237, 0.08) !important;
}

.status-row:hover .status-drag-handle {
  opacity: 1;
}

.submission-notes-list {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
}

.submission-notes-list .submission-note-item:last-child {
  border-bottom: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.submission-note-edit-icon {
  font-size: 0.7rem;
  vertical-align: -0.05em;
}

.submission-notes-form {
  margin-top: 0;
}

#leadNotificationSound {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.lead-sound-banner {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1030;
  max-width: min(360px, calc(100vw - 2rem));
}

/* Banner stays below Bootstrap modal stack (backdrop 1050, modal 1055) */
#leadAlertSetupModal {
  z-index: 1060;
}

.lead-sound-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--fc-card, #fff);
  border: 1px solid rgba(124, 58, 237, 0.25);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  font-size: 0.875rem;
}
