/* 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);
}

.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 */

/* 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;
}

/* DataTable expand toggle */
td.dt-expand-toggle {
  cursor: pointer;
  text-align: center;
  width: 20px;
  color: #6c757d;
  user-select: none;
}

td.dt-expand-toggle:hover {
  color: #1e3a5f;
}

th.dt-expand-col {
  width: 20px;
}
