/* Bartons Lens - Brand Styles */

:root {
  --bs-primary: #1e3a5f;
  --bs-primary-rgb: 30, 58, 95;
  --bs-secondary: #4a6fa5;
  --bs-secondary-rgb: 74, 111, 165;
  --bartons-accent: #d4a84b;
  --bartons-accent-rgb: 212, 168, 75;
}

/* Navbar */
#main-nav {
  background-color: var(--bs-primary) !important;
}

#main-nav .navbar-brand {
  color: #fff;
}

#main-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

#main-nav .nav-link:hover,
#main-nav .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 0.375rem;
}

/* Buttons */
.btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-primary:hover {
  background-color: #162d4a;
  border-color: #162d4a;
}

.btn-accent {
  background-color: var(--bartons-accent);
  border-color: var(--bartons-accent);
  color: #1e3a5f;
  font-weight: 600;
}

.btn-accent:hover {
  background-color: #c49a3e;
  border-color: #c49a3e;
  color: #1e3a5f;
}

/* Loading state */
.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

/* Landing page */
#landing .nav-link:hover {
  color: #fff !important;
}

#landing section {
  scroll-margin-top: 70px;
}

#landing .card {
  transition:
    transform 200ms ease,
    box-shadow 200ms ease;
}

#landing .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08) !important;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Dragula base (no separate CSS file bundled) */
.gu-mirror {
  position: fixed !important;
  margin: 0 !important;
  z-index: 9999 !important;
  opacity: 1;
  pointer-events: none;
}

.gu-hide {
  display: none !important;
}

.gu-unselectable {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

.gu-transit {
  opacity: 0.25;
}

/* Dragula RBAC overrides */
.rbac-item.gu-mirror {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  transform: rotate(1.5deg) scale(1.03);
  border: 1px solid var(--bs-primary) !important;
  background: #fff;
}

.rbac-drop {
  transition:
    background 150ms ease,
    box-shadow 150ms ease,
    min-height 150ms ease;
  border: 2px dashed transparent;
  border-radius: 8px;
}

.rbac-drop.drag-over {
  background: rgba(30, 58, 95, 0.05);
  border-color: rgba(30, 58, 95, 0.25);
  box-shadow: inset 0 0 0 1px rgba(30, 58, 95, 0.08);
}

body.gu-unselectable .rbac-drop {
  min-height: 280px !important;
}

.rbac-item {
  transition:
    box-shadow 150ms ease,
    transform 150ms ease;
}

.rbac-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Data profile editor - colour bar on each side to match RBAC */
.profile-side-danger {
  border-top: 3px solid #dc3545 !important;
}
.profile-side-success {
  border-top: 3px solid #198754 !important;
}

/* Profile editor - two-level dragula:
   - .profile-drop is the side container, draggables are .profile-group
   - .profile-group-items is the per-category container, draggables are .profile-item
   This lets the user drag one column, a whole category, or reorder either. */
.profile-drop {
  min-height: 320px;
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
  border: 2px dashed transparent;
  border-radius: 8px;
}
.profile-drop.drag-over {
  background: rgba(30, 58, 95, 0.05);
  border-color: rgba(30, 58, 95, 0.25);
}

.profile-group {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  margin-bottom: 0.5rem;
}
.profile-group-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  cursor: grab;
  user-select: none;
}
.profile-group-empty .profile-group-header {
  background: #fff;
  border-bottom-color: transparent;
  opacity: 0.55;
  cursor: default;
}
.profile-group-empty .profile-group-header .bi-grip-vertical {
  visibility: hidden;
}
.profile-group-items {
  min-height: 2.25rem;
  padding: 0.4rem;
}
.profile-group-items.drag-over {
  background: rgba(30, 58, 95, 0.04);
}
.profile-group-empty .profile-group-items {
  min-height: 1.5rem;
}
.profile-item {
  cursor: grab;
  margin-bottom: 0.25rem;
}
.profile-item:last-child {
  margin-bottom: 0;
}
.profile-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.profile-item.gu-mirror {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  transform: rotate(1.5deg) scale(1.03);
  border: 1px solid var(--bs-primary) !important;
  background: #fff;
}
.profile-group.gu-mirror {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  transform: rotate(1deg) scale(1.015);
  background: #fff;
}

/* Per-category accent on the data profile editor.
 * Left border + tinted header so related buckets are visually grouped.
 * All six Planning buckets share mustard; their sub-name differentiates them. */
.profile-group[data-group="Property"] {
  border-left: 3px solid #4a7fc9;
}
.profile-group[data-group="Property"] .profile-group-header {
  background: rgba(74, 127, 201, 0.1);
}
.profile-group[data-group="Sale"] {
  border-left: 3px solid #198754;
}
.profile-group[data-group="Sale"] .profile-group-header {
  background: rgba(25, 135, 84, 0.1);
}
.profile-group[data-group="HPI"] {
  border-left: 3px solid #0d9488;
}
.profile-group[data-group="HPI"] .profile-group-header {
  background: rgba(13, 148, 136, 0.1);
}
.profile-group[data-group="Area"] {
  border-left: 3px solid #7c3aed;
}
.profile-group[data-group="Area"] .profile-group-header {
  background: rgba(124, 58, 237, 0.1);
}
.profile-group[data-group="Safety"] {
  border-left: 3px solid #dc3545;
}
.profile-group[data-group="Safety"] .profile-group-header {
  background: rgba(220, 53, 69, 0.1);
}
.profile-group[data-group="Demographics"] {
  border-left: 3px solid #6366f1;
}
.profile-group[data-group="Demographics"] .profile-group-header {
  background: rgba(99, 102, 241, 0.1);
}
.profile-group[data-group="Amenities"] {
  border-left: 3px solid #0ea5e9;
}
.profile-group[data-group="Amenities"] .profile-group-header {
  background: rgba(14, 165, 233, 0.1);
}

.profile-group[data-group^="Planning"] {
  border-left: 3px solid #d4a017;
}
.profile-group[data-group^="Planning"] .profile-group-header {
  background: rgba(212, 160, 23, 0.1);
}

/* Planning meta-container - wraps the six Planning sub-buckets so they
   can be reordered as a unit but cannot leave the container. The meta
   is itself a top-level draggable; only its inner .profile-meta-children
   accepts sub-group drops. */
.profile-group-meta {
  border-left: 3px solid #d4a017;
}
.profile-group-meta > .profile-group-header {
  background: rgba(212, 160, 23, 0.18);
  font-weight: 600;
}
.profile-meta-children {
  padding: 0.5rem 0.5rem 0.25rem 0.75rem;
  background: rgba(212, 160, 23, 0.04);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  min-height: 2rem;
}
.profile-meta-children.drag-over {
  background: rgba(212, 160, 23, 0.1);
}
.profile-subgroup {
  margin-bottom: 0.4rem;
}
.profile-subgroup:last-child {
  margin-bottom: 0;
}

/* Flat (custom) layout - no groups, no meta. Each profile-item is a
   direct child of .profile-drop with a category tag for context. */
.profile-drop-flat .profile-item {
  margin-bottom: 0.35rem;
}
.profile-drop-flat .profile-item:last-child {
  margin-bottom: 0;
}
.profile-item-tag {
  font-size: 0.7rem;
}

/* LR-style (Original) search form - subtle grey banding on grouped sections
   and auto-uppercased text inputs since Land Registry data is stored that way. */
.lr-section {
  background: #f8f9fa;
}
.lr-uppercase {
  text-transform: uppercase;
}

/* Drip schedule on/off switch - red track when off, green when on. */
.drip-toggle .form-check-input {
  cursor: pointer;
  background-color: #dc3545;
  border-color: #dc3545;
}
.drip-toggle .form-check-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25);
  border-color: #dc3545;
}
.drip-toggle .form-check-input:checked {
  background-color: #198754;
  border-color: #198754;
}
.drip-toggle .form-check-input:checked:focus {
  box-shadow: 0 0 0 0.15rem rgba(25, 135, 84, 0.25);
}
/* Address cascade: broader fields dim when a narrower one is selected so it's
   clear they're implied by the tighter selection. */
.lr-locked {
  background: #eef0f2;
  color: #6c757d;
  cursor: not-allowed;
}

.nav-item {
  margin-right: 1em;
}

/* Admin nav */
.admin-nav {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  padding: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.admin-nav .nav-item {
  margin-right: 0;
}

.admin-nav .nav-link {
  color: #4a5568;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 7px;
  transition: all 0.15s;
  white-space: nowrap;
}

.admin-nav .nav-link:hover {
  background: rgba(30, 58, 95, 0.06);
  color: #1e3a5f;
}

.admin-nav .nav-link.active {
  background: #1e3a5f;
  color: #fff;
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.25);
}

.admin-nav .nav-link.active:hover {
  background: #162d4a;
  color: #fff;
}

.admin-nav-divider {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  margin: 0 6px;
  flex-shrink: 0;
}

/* Lifecycle flowchart */
.lc-wrap {
  max-width: 780px;
}

.lc-phase {
  position: relative;
  padding-left: 40px;
  margin-bottom: 0;
}
.lc-phase:last-child .lc-rail {
  display: none;
}

.lc-rail {
  position: absolute;
  left: 18px;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}

.lc-dot {
  position: absolute;
  left: 7px;
  top: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid #dee2e6;
  background: #fff;
  z-index: 1;
}
.phase-blue .lc-dot {
  border-color: #0d6efd;
  background: #e7f1ff;
}
.phase-amber .lc-dot {
  border-color: #ffc107;
  background: #fff8e1;
}
.phase-green .lc-dot {
  border-color: #198754;
  background: #e8f5e9;
}
.phase-red .lc-dot {
  border-color: #dc3545;
  background: #fdecea;
}
.phase-gray .lc-dot {
  border-color: #adb5bd;
  background: #f8f9fa;
}

.lc-phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
}
.lc-phase-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e3a5f;
}
.lc-phase-event {
  font-size: 0.8rem;
  color: #6c757d;
}
.lc-phase-event strong {
  color: #2c3e50;
}

.lc-nodes {
  padding: 8px 0 16px;
}

.lc-node {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 12px;
  margin: 2px 0;
  border-radius: 8px;
  position: relative;
  transition: background 0.15s;
}
.lc-node:hover {
  background: rgba(0, 0, 0, 0.02);
}

.lc-node-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.lc-sent .lc-node-icon {
  color: #198754;
}
.lc-pending .lc-node-icon {
  color: #ffc107;
}
.lc-overdue .lc-node-icon {
  color: #dc3545;
}
.lc-cancelled .lc-node-icon {
  color: #adb5bd;
}
.lc-upcoming .lc-node-icon {
  color: #dee2e6;
}

.lc-node-body {
  flex: 1;
  min-width: 0;
}
.lc-node-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2c3e50;
}
.lc-cancelled .lc-node-label {
  color: #adb5bd;
  text-decoration: line-through;
}
.lc-upcoming .lc-node-label {
  color: #adb5bd;
}
.lc-node-sub {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 1px;
}
.lc-cancelled .lc-node-sub {
  color: #ccc;
}

.lc-node-time {
  font-size: 0.75rem;
  color: #6c757d;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
}
.lc-sent .lc-node-time {
  color: #198754;
  font-weight: 600;
}
.lc-pending .lc-node-time {
  color: #b8860b;
}
.lc-overdue .lc-node-time {
  color: #dc3545;
  font-weight: 600;
}

.lc-next-badge {
  animation: lc-pulse 2s ease-in-out infinite;
}
@keyframes lc-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.lc-decision {
  padding: 10px 0;
}
.lc-decision-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6c757d;
}
.phase-green .lc-decision-box {
  border-color: #198754;
  color: #198754;
  background: #e8f5e9;
}
.phase-red .lc-decision-box {
  border-color: #dc3545;
  color: #dc3545;
  background: #fdecea;
}
.phase-gray .lc-decision-box {
  border-color: #adb5bd;
  color: #adb5bd;
}

.lc-future-box {
  padding: 12px 16px;
  border: 1px dashed #dee2e6;
  border-radius: 8px;
  color: #adb5bd;
  font-size: 0.85rem;
}
/* End Lifecycle flowchart */

/* Drip system overview flowchart */
.flow-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2c4d77 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(30, 58, 95, 0.18);
}
.flow-hero-text {
  flex: 1 1 auto;
  min-width: 0;
}
.flow-hero-text h5 {
  color: #fff;
  font-weight: 700;
}
.flow-hero-text p {
  color: rgba(255, 255, 255, 0.78);
}
.flow-hero-stats {
  display: flex;
  gap: 18px;
  flex-shrink: 0;
}
.flow-stat {
  text-align: center;
  min-width: 76px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.flow-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.flow-stat .text-success {
  color: #6ee7a8 !important;
}
.flow-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

.flow-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1px dashed #e2e8f0;
  border-radius: 8px;
  background: #fbfcfe;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 18px;
}

.flow-lane {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8eef5;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}
.flow-lane::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #cbd5e1;
}
.flow-tone-blue::before {
  background: linear-gradient(180deg, #0d6efd, #4d8af5);
}
.flow-tone-amber::before {
  background: linear-gradient(180deg, #d4a84b, #f1c062);
}
.flow-tone-green::before {
  background: linear-gradient(180deg, #198754, #34c97a);
}
.flow-tone-red::before {
  background: linear-gradient(180deg, #dc3545, #f06672);
}
.flow-tone-gray::before {
  background: linear-gradient(180deg, #6c757d, #94a3b8);
}

.flow-lane-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 12px 22px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #fafcff 0%, #fff 100%);
}
.flow-lane-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  color: #fff;
}
.flow-tone-blue .flow-lane-icon {
  background: linear-gradient(135deg, #0d6efd, #4d8af5);
}
.flow-tone-amber .flow-lane-icon {
  background: linear-gradient(135deg, #d4a84b, #e6b95a);
  color: #4a3208;
}
.flow-tone-green .flow-lane-icon {
  background: linear-gradient(135deg, #198754, #34c97a);
}
.flow-tone-red .flow-lane-icon {
  background: linear-gradient(135deg, #dc3545, #f06672);
}
.flow-tone-gray .flow-lane-icon {
  background: linear-gradient(135deg, #6c757d, #94a3b8);
}

.flow-lane-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
.flow-lane-anchor code {
  font-size: 0.72rem;
  color: #6c757d;
  background: transparent;
  padding: 0;
}
.flow-lane-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.2;
  margin-top: 1px;
}
.flow-lane-desc {
  font-size: 0.78rem;
  color: #6c757d;
  margin-top: 4px;
  line-height: 1.4;
}

.flow-lane-count {
  flex-shrink: 0;
  text-align: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  min-width: 64px;
}
.flow-lane-count-num {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1;
}
.flow-lane-count-lbl {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin-top: 2px;
}

.flow-lane-body {
  position: relative;
  padding: 12px 18px 16px 22px;
}
.flow-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 60px;
  width: 2px;
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 50%, #e2e8f0 100%);
}

.flow-email {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px 8px 0;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.flow-email:hover {
  background: #f8fafc;
}

.flow-time {
  position: relative;
  z-index: 1;
  width: 115px;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #475569;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 8px;
  text-align: center;
  margin-top: 2px;
}
.flow-time-pre {
  color: #b8860b;
  border-color: #f1c062;
  background: #fffbf0;
}
.flow-time-anchor {
  color: #1e3a5f;
  border-color: #1e3a5f;
  background: #e7f1ff;
  font-weight: 800;
}

.flow-email-body {
  flex: 1 1 auto;
  min-width: 0;
}
.flow-email-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.flow-email-key {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  background: transparent;
  padding: 0;
}
.flow-seq-badge {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.flow-cond-badge {
  font-size: 0.65rem;
  font-weight: 500;
}
.flow-off-badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.flow-email-subject {
  font-size: 0.82rem;
  color: #334155;
  font-weight: 500;
  line-height: 1.35;
  margin-top: 2px;
}
.flow-email-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.3;
}

.flow-email-off {
  opacity: 0.55;
}
.flow-email-off .flow-email-subject {
  text-decoration: line-through;
}

.flow-preview-btn {
  flex-shrink: 0;
  margin-top: 2px;
}

.flow-empty {
  padding: 16px 22px 20px;
  font-size: 0.85rem;
  color: #94a3b8;
}

@media (max-width: 575.98px) {
  .flow-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .flow-hero-stats {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .flow-stat {
    min-width: 0;
    flex: 1 1 0;
  }
  .flow-rail {
    left: 48px;
  }
  .flow-time {
    width: 64px;
  }
}
/* End Drip system overview flowchart */

/* Price heatmap */
.leaflet-heatmap-canvas {
  mix-blend-mode: multiply;
}

#price-heatmap {
  z-index: 0;
}

/* Address autocomplete dropdown */
.autocomplete-dropdown {
  position: absolute;
  z-index: 1050;
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  display: none;
}

.autocomplete-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f5f5f5;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: #f0f4f8;
}

.autocomplete-item .autocomplete-value {
  font-weight: 500;
  color: #1e3a5f;
}

.autocomplete-item .autocomplete-count {
  font-size: 11px;
  color: #999;
  margin-left: 12px;
  white-space: nowrap;
}

/* Ensure parent of autocomplete inputs is positioned for dropdown */
#refine-search .col-md-4 {
  position: relative;
}

/* DataTables Responsive: replace unicode geometric triangles with
   Bootstrap Icons chevrons so the glyph renders proportionally
   regardless of the system font. */
table.dataTable.dtr-column > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-column > tbody > tr > th.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
  font-family: "bootstrap-icons" !important;
  content: "\f285";
  font-size: 1em;
  line-height: 1;
  vertical-align: -0.125em;
}

table.dataTable.dtr-column > tbody > tr.parent > td.dtr-control::before,
table.dataTable.dtr-column > tbody > tr.parent > th.dtr-control::before,
table.dataTable.dtr-inline.collapsed
  > tbody
  > tr.parent
  > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed
  > tbody
  > tr.parent
  > th.dtr-control::before {
  content: "\f282";
}

/* ── Onboarding tour "Skip all" button ──────────────────────────
   Injected by onboarding.js into every driver.js popover footer,
   sitting beside the "1 of N" progress pager. Styled as a subtle
   text link so it reads as an opt-out rather than a primary action. */
.driver-popover .tour-skip-all-btn {
  margin-left: 10px;
  padding: 0;
  background: none;
  border: none;
  color: rgba(30, 58, 95, 0.55);
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  transition: color 150ms;
}

.driver-popover {
  max-width: 500px;
}

.driver-popover .tour-skip-all-btn:hover,
.driver-popover .tour-skip-all-btn:focus-visible {
  color: #1e3a5f;
  outline: none;
}

/* Per-tour skip button, injected at the left of the Back / Next
   navigation group. Deliberately tinted a muted red so it reads as
   "abandon this tour" without looking like a destructive primary. */
.driver-popover .tour-skip-this-btn {
  margin-right: 8px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: #dc3545;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background 150ms,
    color 150ms,
    border-color 150ms;
}

.driver-popover .tour-skip-this-btn:hover,
.driver-popover .tour-skip-this-btn:focus-visible {
  background: #dc3545;
  border-color: #dc3545;
  color: #ffffff;
  outline: none;
}

/* Account page - data profiles action column reserves space for Edit / Delete buttons */
.profile-actions-col {
  width: 220px;
}

/* Required-field marker. app.markRequiredLabels tags any <label> (or
 * .form-label) whose target input is [required] and not [disabled];
 * disabled-required fields therefore get no asterisk. */
.form-label.required::after,
label.required::after {
  content: " *";
  color: var(--bs-danger);
  font-weight: 600;
  margin-left: 2px;
}

/* Planning constraints dataset catalog (Data Sources card) - cherry-pick
 * dropdown on the Update button. Shared layout with the map picker. */
.planning-catalog-body {
  max-height: 480px;
  overflow-y: auto;
  padding-bottom: 12px;
}
.planning-cat {
  border-top: 1px solid #f0f0f0;
}
.planning-cat:first-child {
  border-top: 0;
}
.planning-cat-header {
  background: #f8f9fa;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #495057;
}
.planning-cat-caret {
  transition: transform 120ms;
  font-size: 10px;
}
.planning-cat.collapsed .planning-cat-caret {
  transform: rotate(-90deg);
}
.planning-cat.collapsed .planning-cat-items {
  display: none;
}
.planning-cat-item {
  margin-bottom: 0;
  cursor: pointer;
}
.planning-cat-item.hidden-by-filter {
  display: none !important;
}
.planning-cat-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Categorised planning-layer picker (split-dropdown next to the Planning
 * overlay button). Populated client-side from data_sources_planning_registry. */
.planning-layers-body {
  max-height: 420px;
  overflow-y: auto;
}
.planning-category {
  border-bottom: 1px solid #eee;
}
.planning-category:last-child {
  border-bottom: 0;
}
.planning-category-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8f9fa;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #495057;
}
.planning-category-header .planning-caret {
  width: 12px;
  transition: transform 120ms;
}
.planning-category.collapsed .planning-caret {
  transform: rotate(-90deg);
}
.planning-category-counter {
  margin-left: auto;
  font-size: 11px;
  color: #6c757d;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.planning-category-items {
  padding: 4px 12px 8px;
}
.planning-category.collapsed .planning-category-items {
  display: none;
}
.planning-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 13px;
  cursor: pointer;
}
.planning-item-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.planning-item.hidden-by-filter {
  display: none;
}
