/* ============================================
   INDELIS Admin Portal
   Desktop-first staff interface
   ============================================ */

body.portal-body {
  margin: 0;
  background: #F5F7FA;
  font-family: 'Inter', sans-serif;
  color: #1F2937;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  padding-top: 0;
}

/* Reset the marketing-site fixed-nav padding for portal pages */
body.portal-body .site-header { padding-top: 0; }

/* ----- Sidebar ----- */
.portal-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 30;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.sidebar-brand img {
  height: 36px; width: auto;
  background: white;
  padding: 3px 8px;
  border-radius: 7px;
  flex-shrink: 0;
}
.sidebar-brand .brand-text {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 14px;
  color: white;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-collapse-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.16); color: white; }
.sidebar-collapse-btn svg { width: 14px; height: 14px; transition: transform .25s; }
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.07); color: white; }
.sidebar-nav a.active {
  background: rgba(123, 176, 105, 0.18);
  color: white;
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-user .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
  flex-shrink: 0;
}
.sidebar-user .who { line-height: 1.2; }
.sidebar-user .user-name { color: white; font-weight: 600; font-size: 13px; }
.sidebar-user .user-role { color: rgba(255,255,255,0.55); font-size: 11px; margin-top: 2px; }
.sidebar-user a {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  text-decoration: none;
  margin-left: auto;
}
.sidebar-user a:hover { color: white; }

/* ----- Collapsed sidebar (desktop) ----- */
@media (min-width: 901px) {
  .portal-sidebar.collapsed {
    width: 72px;
  }
  .portal-sidebar.collapsed .brand-text,
  .portal-sidebar.collapsed .sidebar-nav a span,
  .portal-sidebar.collapsed .sidebar-user .who,
  .portal-sidebar.collapsed .sidebar-user a {
    display: none;
  }
  .portal-sidebar.collapsed .sidebar-brand {
    padding: 16px 0;
    justify-content: center;
  }
  .portal-sidebar.collapsed .sidebar-brand img { display: none; }
  .portal-sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
  .portal-sidebar.collapsed .sidebar-nav { padding: 14px 8px; }
  .portal-sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    padding: 11px 10px;
    border-left-width: 0;
    border-left: none;
    position: relative;
  }
  .portal-sidebar.collapsed .sidebar-nav a.active {
    border-left: none;
    background: rgba(123, 176, 105, 0.22);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  /* Tooltip on hover when collapsed */
  .portal-sidebar.collapsed .sidebar-nav a::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-dark, #173a58);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }
  .portal-sidebar.collapsed .sidebar-nav a:hover::after { opacity: 1; }
  .portal-sidebar.collapsed .sidebar-user {
    padding: 14px 0;
    justify-content: center;
  }
}

/* ----- Main column ----- */
.portal-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.portal-topbar {
  background: white;
  border-bottom: 1px solid #E5E7EB;
  padding: 12px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.portal-topbar .titles { display: flex; flex-direction: column; }
.portal-topbar .page-title {
  font-size: 17px; font-weight: 700; color: var(--primary);
  line-height: 1.2;
}
.portal-topbar .breadcrumb { color: #9CA3AF; font-size: 12px; }
.topbar-search {
  flex: 1;
  max-width: 380px;
  margin-left: auto;
  padding: 8px 14px 8px 38px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 13px;
  background: #F9FAFB url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%239CA3AF" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-4.35-4.35M11 19a8 8 0 100-16 8 8 0 000 16z"/></svg>') 12px center / 16px no-repeat;
  font-family: inherit;
}
.topbar-search:focus { outline: none; border-color: var(--primary-light); background-color: white; }
.topbar-icon-btn {
  position: relative;
  background: #F3F4F6;
  border: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: grid; place-items: center;
  color: #4B5563;
}
.topbar-icon-btn:hover { background: #E5E7EB; }
.topbar-icon-btn svg { width: 18px; height: 18px; }
.topbar-icon-btn .badge-dot {
  position: absolute; top: 4px; right: 6px;
  background: #DC2626;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid white;
}
.topbar-icon-btn .badge-count {
  position: absolute; top: -3px; right: -3px;
  background: #DC2626; color: #fff;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; border: 2px solid #fff;
  font-size: 10px; font-weight: 700; line-height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
a.topbar-icon-btn { text-decoration: none; }

/* ===== Sales → Send proposal toast ===== */
.prop-toast[hidden] { display: none !important; }
.prop-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  background: #fff; border: 1px solid #E5E7EB;
  border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 30px rgba(15,23,42,.12);
  max-width: 460px;
  animation: prop-toast-in .2s ease-out;
}
@keyframes prop-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.prop-toast-icon {
  background: var(--accent); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; flex-shrink: 0;
}
.prop-toast-body { flex: 1; }
.prop-toast-body strong { color: #111827; font-size: 14px; display: block; margin-bottom: 2px; }
.prop-toast-close {
  background: none; border: none; cursor: pointer;
  color: #9CA3AF; font-size: 20px; line-height: 1;
  padding: 0 0 0 4px;
}

/* ===== Sales → Inbox tab ===== */
.tab-count-pill[hidden] { display: none !important; }
.tab-count-pill {
  display: inline-block; min-width: 18px; padding: 0 6px;
  background: #DC2626; color: #fff;
  border-radius: 9px; font-size: 11px; font-weight: 700;
  line-height: 16px; margin-left: 4px; vertical-align: middle;
}
.inbox-list { display: flex; flex-direction: column; gap: 10px; }
.inbox-empty {
  border: 1px dashed #D1D5DB; border-radius: 10px;
  padding: 40px 24px; text-align: center; color: #6B7280;
  background: #F9FAFB; font-size: 13px;
}
.inbox-empty strong { display: block; color: #111827; font-size: 14px; margin-bottom: 4px; }
.inbox-card {
  border: 1px solid #E5E7EB; border-radius: 10px; background: #fff;
  padding: 14px 16px; display: grid; gap: 8px;
  border-left: 3px solid var(--accent);
  transition: box-shadow .12s;
}
.inbox-card.is-converted { border-left-color: #9CA3AF; opacity: .65; }
.inbox-card.is-spam { border-left-color: #DC2626; opacity: .55; }
.inbox-card:hover { box-shadow: 0 2px 6px rgba(15,23,42,.06); }
.inbox-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inbox-card-head .ref { font-size: 11px; color: #6B7280; font-weight: 600; letter-spacing: .04em; }
.inbox-card-head .name { font-weight: 700; color: #111827; font-size: 14px; }
.inbox-card-head .plot-pill {
  background: var(--primary); color: #fff;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.inbox-card-head .age { margin-left: auto; font-size: 11px; color: #6B7280; }
.inbox-card-head .status-pill {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
}
.status-pill.new { background: #DCFCE7; color: #166534; }
.status-pill.converted { background: #DBEAFE; color: #1E40AF; }
.status-pill.spam { background: #FEE2E2; color: #991B1B; }
.inbox-card-meta {
  font-size: 12px; color: #4B5563;
  display: flex; flex-wrap: wrap; gap: 14px;
}
.inbox-card-meta b { color: #111827; font-weight: 600; }
.inbox-card-msg {
  background: #F9FAFB; border-radius: 6px;
  padding: 8px 12px; font-size: 13px; color: #374151;
  white-space: pre-wrap;
}
.inbox-card-actions { display: flex; gap: 8px; justify-content: flex-end; }
.portal-content {
  flex: 1;
  padding: 24px 28px 40px;
  max-width: 1500px;
  width: 100%;
}
.page-head { margin-bottom: 22px; }
.page-head h1 {
  font-size: 24px; font-weight: 700; color: var(--primary);
  margin: 0 0 4px; letter-spacing: -0.01em;
}
.page-head .page-subtitle { color: #6B7280; font-size: 14px; margin: 0; }

/* ----- Cards ----- */
.card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-size: 14px; font-weight: 600; color: var(--primary); margin: 0;
}
.card-action {
  font-size: 12px; color: var(--primary-light);
  text-decoration: none; font-weight: 500;
}
.card-action:hover { color: var(--primary); }

/* ----- KPI cards ----- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.kpi-card[onclick]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(30, 74, 110, 0.18);
  border-color: #CBD5E1;
}
.kpi-card[onclick]:active { transform: translateY(0); }

.card[onclick] { transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.card[onclick]:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(30, 74, 110, 0.15);
  border-color: #CBD5E1;
}

.cal-event { transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease; }
.cal-event:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 4px 10px -4px rgba(0,0,0,.25);
}
.kpi-card::before {
  content:''; position: absolute; top:0; left:0; right:0; height: 3px;
  background: var(--primary);
}
.kpi-card.kpi-green::before { background: var(--accent); }
.kpi-card.kpi-blue::before { background: var(--water); }
.kpi-card.kpi-amber::before { background: #F59E0B; }
.kpi-label {
  font-size: 11px; color: #6B7280; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: 4px 0 8px;
}
.kpi-value {
  font-size: 26px; font-weight: 700; color: var(--primary);
  line-height: 1.1; letter-spacing: -0.02em;
}
.kpi-delta { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--accent-dark); }
.kpi-delta.down { color: #DC2626; }
.kpi-delta.neutral { color: #6B7280; }
.kpi-sparkline {
  position: absolute; right: 14px; bottom: 14px; opacity: 0.6;
  width: 70px; height: 28px;
}

/* ----- Grid layouts ----- */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-2-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 1100px) {
  .grid-2, .grid-2-equal { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) { .kpi-strip { grid-template-columns: 1fr; } }

/* ----- Calendar widget ----- */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day {
  background: #F9FAFB;
  border-radius: 8px;
  padding: 8px 6px;
  min-height: 130px;
}
.cal-day-head {
  font-size: 10px; color: #6B7280; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.cal-day-num { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.cal-day.today { background: var(--accent-soft); }
.cal-day.today .cal-day-num { color: var(--accent-dark); }
.cal-event {
  background: var(--primary); color: white;
  font-size: 10.5px;
  padding: 3px 6px; border-radius: 4px;
  margin-bottom: 3px;
  line-height: 1.3;
  cursor: pointer;
}
.cal-event.memorial { background: var(--water); }
.cal-event.foundation { background: #F59E0B; }
.cal-event.closure { background: #6B7280; }

/* ----- Activity feed ----- */
.activity-list { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow-y: auto; }
.activity-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F3F4F6;
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary);
  display: grid; place-items: center;
  font-weight: 600; font-size: 11px;
  flex-shrink: 0;
}
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: #1F2937; }
.activity-text strong { color: var(--primary); font-weight: 600; }
.activity-time { font-size: 11px; color: #9CA3AF; margin-top: 2px; }

/* ----- Donut + legend ----- */
.donut-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut {
  width: 140px; height: 140px; border-radius: 50%;
  background: conic-gradient(var(--primary) 0 62%, var(--water) 62% 78%, #E5E7EB 78% 100%);
  position: relative; flex-shrink: 0;
}
.donut::after {
  content:''; position: absolute; inset: 22px;
  background: white; border-radius: 50%;
}
.donut-center {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
  z-index: 1;
}
.donut-center .big { font-size: 20px; font-weight: 700; color: var(--primary); line-height: 1; }
.donut-center .sm { font-size: 11px; color: #6B7280; margin-top: 2px; }
.legend { font-size: 13px; flex: 1; min-width: 160px; }
.legend-item {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-value { margin-left: auto; font-weight: 600; color: #1F2937; }

/* Section breakdown table inside capacity card */
.section-bd { width: 100%; font-size: 12px; margin-top: 12px; }
.section-bd td { padding: 4px 0; }
.section-bd .bar { background: #E5E7EB; height: 6px; border-radius: 3px; overflow: hidden; width: 100%; }
.section-bd .bar-fill { background: var(--primary); height: 100%; }

/* ----- Tables ----- */
.data-table-wrap {
  background: white; border: 1px solid #E5E7EB; border-radius: 12px;
  overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 11px 14px;
  font-weight: 600; color: #6B7280;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid #E5E7EB; background: #F9FAFB;
  white-space: nowrap;
}
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #F3F4F6;
  color: #1F2937;
  vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; transition: background .1s; }
.data-table tbody tr:hover { background: #F9FAFB; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .col-name { font-weight: 600; color: #111827; }

/* ----- Status badges ----- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-available { background: var(--accent-soft); color: var(--accent-dark); }
.badge-reserved { background: var(--water-soft); color: var(--water-dark); }
.badge-interred { background: var(--primary-50); color: var(--primary); }
.badge-hold { background: #FEF3C7; color: #92400E; }
.badge-overdue { background: #FEE2E2; color: #991B1B; }
.badge-paid { background: var(--accent-soft); color: var(--accent-dark); }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-draft { background: #F3F4F6; color: #6B7280; }
.badge-active { background: var(--water-soft); color: var(--water-dark); }
.badge-ai { background: linear-gradient(135deg, #DBEAFE, #E0E7FF); color: #1E40AF; }

/* ----- Buttons ----- */
.btn-primary, .btn-accent, .btn-secondary, .btn-ghost, .btn-danger {
  font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px; font-weight: 600; font-size: 13px;
  border: none; padding: 9px 16px;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-secondary { background: white; color: var(--primary); border: 1px solid #E5E7EB; padding: 8px 15px; }
.btn-secondary:hover { border-color: var(--primary); }
.btn-ghost { background: transparent; color: #6B7280; padding: 6px 10px; }
.btn-ghost:hover { color: var(--primary); }
.btn-danger { background: #FEE2E2; color: #991B1B; }
.btn-danger:hover { background: #FECACA; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* styles.css defines element-qualified .btn-primary/.btn-secondary (pill, 14px, big
   padding, box-shadow) that out-specify portal.css and even defeat .btn-sm. Re-assert
   the portal look (scoped to .portal-body so it wins specificity) so all portal /
   site-admin buttons stay consistent with .btn-accent. */
.portal-body .btn-primary,
.portal-body .btn-secondary,
.portal-body .btn-accent {
  border-radius: 8px; font-size: 14px; line-height: 1; box-shadow: none; padding: 10px 18px;
}
.portal-body .btn-primary { border: none; background: var(--primary); color: #fff; }
.portal-body .btn-primary:hover { background: var(--primary-dark); transform: none; box-shadow: none; color: #fff; }
.portal-body .btn-secondary { border: 1px solid #E5E7EB; background: #fff; color: var(--primary); }
.portal-body .btn-secondary:hover { border-color: var(--primary); background: #fff; transform: none; }
.portal-body .btn-accent { background: var(--accent); color: #fff; }
.portal-body .btn-accent:hover { background: var(--accent-hover); }
/* Only resize the primary/secondary/accent btn-sm pair; leave .btn-ghost.btn-sm
   (compact tertiary table actions) at the portal.css default. */
.portal-body .btn-primary.btn-sm,
.portal-body .btn-secondary.btn-sm,
.portal-body .btn-accent.btn-sm { padding: 8px 15px; font-size: 13px; }

/* ----- Forms ----- */
.form-field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.form-field label {
  font-size: 12px; font-weight: 600; color: #4B5563;
}
.form-field input, .form-field select, .form-field textarea {
  padding: 9px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: #1F2937;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45,107,158,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ----- Toolbar ----- */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .search-input {
  flex: 1; min-width: 220px; max-width: 320px;
  padding: 8px 14px 8px 38px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 13px;
  background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%239CA3AF" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-4.35-4.35M11 19a8 8 0 100-16 8 8 0 000 16z"/></svg>') 12px center / 16px no-repeat;
  font-family: inherit;
}
.filter-select {
  padding: 8px 12px;
  padding-right: 30px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 13px;
  background-color: white;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%236B7280" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  font-family: inherit;
  color: #1F2937;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.filter-select:focus {
  outline: none;
  border-color: var(--primary-light, #4FA8D9);
  box-shadow: 0 0 0 3px rgba(79, 168, 217, 0.15);
}

/* ----- Memorial editor sidebar list ----- */
.memorial-pick-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}
.memorial-pick-list {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 6px;
  max-height: 580px;
  overflow-y: auto;
}
.memorial-pick-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 2px;
}
.memorial-pick-item:hover { background: #F3F4F6; }
.memorial-pick-item.active {
  background: rgba(79, 168, 217, 0.10);
  border-color: rgba(79, 168, 217, 0.35);
}
.memorial-pick-item .pi-name {
  font-size: 13px; font-weight: 600; color: #111827;
}
.memorial-pick-item .pi-meta {
  font-size: 11px; color: #6B7280; margin-top: 2px;
}
@media (max-width: 900px) {
  .memorial-pick-layout { grid-template-columns: 1fr; }
  .memorial-pick-list { max-height: 260px; }
}
.toolbar-spacer { flex: 1; }

/* ----- Drawer (sliding right panel) ----- */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 100vw;
  background: white;
  box-shadow: -8px 0 32px rgba(30,74,110,0.12);
  z-index: 60;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.35);
  z-index: 55;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid #E5E7EB;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.drawer-title { font-size: 16px; font-weight: 700; color: var(--primary); margin: 0; }
.drawer-sub { font-size: 12px; color: #6B7280; margin-top: 2px; }
.drawer-close {
  background: none; border: none; cursor: pointer;
  color: #6B7280; font-size: 22px;
  padding: 0; line-height: 1;
}
.drawer-tabs {
  display: flex; border-bottom: 1px solid #E5E7EB;
  padding: 0 22px; gap: 4px;
  overflow-x: auto;
}
.drawer-tab {
  padding: 12px 14px;
  font-size: 13px; font-weight: 500;
  color: #6B7280;
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.drawer-tab.active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-actions {
  padding: 14px 22px;
  border-top: 1px solid #E5E7EB;
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ----- Detail field rows (inside drawer) ----- */
.detail-grid { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; font-size: 13px; }
.detail-grid dt { color: #6B7280; font-weight: 500; }
.detail-grid dd { color: #1F2937; margin: 0; font-weight: 500; }

/* ----- Kanban ----- */
.kanban {
  display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: #F3F4F6; border-radius: 10px;
  padding: 12px; min-height: 320px;
}
.kanban-col-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.kanban-col-head h4 {
  font-size: 11px; font-weight: 700; color: #4B5563;
  margin: 0; text-transform: uppercase; letter-spacing: 0.06em;
}
.kanban-col-count {
  background: white; color: #6B7280;
  font-size: 11px; padding: 2px 8px;
  border-radius: 10px; font-weight: 600;
}
.kanban-card { cursor: pointer; }
.kanban-card {
  background: white; border-radius: 8px;
  padding: 11px 12px; margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  cursor: grab;
  border-left: 3px solid var(--primary);
}
.kanban-card .name { font-size: 13px; font-weight: 600; color: #111827; margin-bottom: 3px; }
.kanban-card .meta { font-size: 11px; color: #6B7280; }
.kanban-card .value { font-size: 13px; font-weight: 700; color: var(--accent-dark); margin-top: 8px; }
.kanban-card .days { font-size: 10px; color: #9CA3AF; margin-top: 4px; }

/* ----- Cemetery map ----- */
.map-wrap {
  position: relative;
  background: #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  height: 580px;
  border: 1px solid #E5E7EB;
  cursor: grab;
  user-select: none;
}
.map-wrap.is-panning { cursor: grabbing; }
.map-canvas {
  position: absolute; inset: 0;
  transform-origin: 0 0;
  will-change: transform;
  transition: transform 180ms ease;
}
.map-canvas.is-panning { transition: none; }
.map-image, .map-svg {
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
}
.map-svg { background: #EAF1E4; }

/* ----- Small generic modal (e.g. New opportunity) ----- */
.no-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 110;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.no-modal-overlay.open { display: flex; }
.no-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%; max-width: 600px;
  max-height: calc(100vh - 48px);
  box-shadow: 0 32px 80px rgba(15,23,42,0.3);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.no-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #E5E7EB;
}
.no-modal-head h3 {
  margin: 0; font-size: 17px; font-weight: 700; color: var(--primary);
}
.no-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 24px; color: #6B7280; padding: 0; line-height: 1;
}
.no-modal-body { padding: 20px 24px 8px; overflow-y: auto; }
.no-modal-body input[type="text"],
.no-modal-body input[type="number"],
.no-modal-body input:not([type]),
.no-modal-body select,
.no-modal-body textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  transition: border-color .12s, box-shadow .12s;
}
.no-modal-body select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'><path d='M5.5 7.5L10 12l4.5-4.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}
.no-modal-body input:focus,
.no-modal-body select:focus,
.no-modal-body textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123,176,105,0.18);
}
.no-modal-body textarea { resize: vertical; min-height: 80px; }
.no-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px; border-top: 1px solid #E5E7EB;
}
.map-pin {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.map-pin:hover { transform: translate(-50%, -50%) scale(1.45); z-index: 3; }
.map-pin.available { background: var(--accent); }
.map-pin.reserved { background: var(--water); }
.map-pin.interred { background: var(--primary); }
.map-pin.hold { background: #F59E0B; }
.map-pin.selected {
  width: 20px; height: 20px;
  box-shadow: 0 0 0 6px rgba(123,176,105,0.35), 0 1px 3px rgba(0,0,0,0.5);
  z-index: 4;
  animation: pin-pulse 1.6s ease-out infinite;
}
.map-pin.dimmed { opacity: 0.15; pointer-events: none; }

/* Add-plot click-to-place mode */
.map-wrap.add-mode { cursor: crosshair; }
.map-wrap.add-mode .map-pin { pointer-events: none; opacity: 0.55; }
.map-wrap.add-mode .map-pin.ghost { pointer-events: auto; opacity: 1; }
.map-pin.ghost {
  background: #F59E0B;
  border: 2px dashed white;
  width: 18px; height: 18px;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.25), 0 1px 3px rgba(0,0,0,0.4);
  animation: pin-pulse 1.4s ease-out infinite;
  z-index: 5;
}
.add-hint[hidden], .side-panel[hidden] { display: none !important; }
.add-hint {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, #FEF3C7, #FEF9C3);
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #78350F;
}
.add-hint .icon { font-size: 16px; }
.add-hint strong { color: #1E4A6E; margin-right: 4px; }
.add-hint .spacer { flex: 1; }
.side-panel.add-panel {
  background: #FFFBEB;
  border-color: #FDE68A;
}
.side-panel.add-panel .side-panel-head { background: #FEF3C7; border-bottom-color: #FDE68A; }
.side-panel-foot {
  padding: 12px 18px; border-top: 1px solid #E5E7EB;
  display: flex; gap: 8px; align-items: center;
  background: #F9FAFB;
}
.add-form .field-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.add-form .field-row.single { grid-template-columns: 1fr; }
.add-form .field-label {
  display: block; font-size: 11px; font-weight: 600; color: #374151;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px;
}
.add-form .field-input {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; border: 1px solid #D1D5DB; border-radius: 6px;
  font-size: 13px; font-family: inherit; background: white;
}
.add-form select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'><path d='M5.5 7.5L10 12l4.5-4.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 28px;
}
.add-form .field-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123,176,105,0.18);
}
.add-coords {
  font-size: 12px; color: #92400E; margin-top: 6px;
  background: rgba(253, 230, 138, 0.45);
  padding: 4px 8px; border-radius: 4px;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.add-coords.empty { color: #6B7280; background: #F3F4F6; }
@keyframes pin-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(123,176,105,0.55), 0 1px 3px rgba(0,0,0,0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(123,176,105,0),    0 1px 3px rgba(0,0,0,0.5); }
  100% { box-shadow: 0 0 0 0   rgba(123,176,105,0),    0 1px 3px rgba(0,0,0,0.5); }
}
.map-tooltip {
  position: absolute;
  background: rgba(17, 24, 39, 0.95);
  color: white;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  transition: opacity 120ms ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.map-tooltip::after {
  content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px; background: rgba(17, 24, 39, 0.95);
}
.map-tooltip.visible { opacity: 1; }
.map-tooltip-name { font-weight: 600; }
.map-tooltip-meta { font-size: 11px; opacity: .8; margin-top: 2px; }
.map-empty {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.95); border-radius: 8px; padding: 12px 18px;
  font-size: 13px; color: #4B5563; box-shadow: 0 4px 14px rgba(0,0,0,.12);
  pointer-events: none;
}
.map-legend {
  position: absolute; bottom: 14px; left: 14px;
  background: white;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  display: flex; gap: 16px;
  font-size: 12px;
  flex-wrap: wrap;
  max-width: calc(100% - 28px);
}
.map-legend-item { display: flex; align-items: center; gap: 6px; color: #4B5563; }
.map-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.map-zoom {
  position: absolute; top: 14px; right: 14px;
  display: flex; flex-direction: column;
  background: white; border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  overflow: hidden;
}
.map-zoom button {
  width: 36px; height: 36px;
  border: none; background: white;
  font-size: 18px; color: var(--primary);
  cursor: pointer;
  border-bottom: 1px solid #E5E7EB;
}
.map-zoom button:last-child { border-bottom: none; }
.map-zoom button:hover { background: #F9FAFB; }
.map-zoom button:active { background: #F3F4F6; }

/* ----- Layout with always-visible side panel (map page) ----- */
.layout-with-panel {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
}
.side-panel {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 580px;
}
.side-panel-head { padding: 16px 18px; border-bottom: 1px solid #E5E7EB; }
.side-panel-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
@media (max-width: 1100px) { .layout-with-panel { grid-template-columns: 1fr; } }

/* ----- Memorial moderation cards ----- */
.memorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.memorial-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 18px;
}
.memorial-card .submitter { font-size: 12px; color: #6B7280; }
.memorial-card .submitter strong { color: #111827; font-weight: 600; }
.memorial-card .plot-ref {
  font-size: 11px; color: var(--primary-light);
  margin-top: 4px; font-weight: 600;
}
.memorial-card .preview {
  margin: 12px 0;
  font-size: 13px; color: #4B5563;
  line-height: 1.5;
  max-height: 90px; overflow: hidden;
  position: relative;
}
.memorial-card .preview::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 30px;
  background: linear-gradient(to bottom, transparent, white);
}
.memorial-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ----- Reports library ----- */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.report-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.report-card h3 { margin: 0; font-size: 15px; color: var(--primary); font-weight: 700; }
.report-card .desc { font-size: 13px; color: #6B7280; flex: 1; line-height: 1.5; }
.report-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.report-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--primary-50);
  color: var(--primary);
  display: grid; place-items: center;
}
.report-icon svg { width: 20px; height: 20px; }

/* ----- AI banner ----- */
.ai-banner {
  background: linear-gradient(135deg, #EFF6FF, #F0FDF4);
  border: 1px solid #DBEAFE;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.ai-banner-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--water));
  display: grid; place-items: center;
  color: white; font-size: 16px;
  flex-shrink: 0;
}
.ai-banner-text { flex: 1; line-height: 1.4; }
.ai-banner-text strong { color: var(--primary); display: block; font-size: 13px; }
.ai-banner-text span { color: #4B5563; font-size: 12px; }

/* ----- Page-level tabs ----- */
.page-tabs {
  display: flex; border-bottom: 1px solid #E5E7EB;
  margin-bottom: 20px; gap: 4px;
  overflow-x: auto;
}
.page-tab {
  padding: 11px 16px;
  font-size: 14px; font-weight: 500;
  color: #6B7280;
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.page-tab.active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ----- Memorial editor (split pane for AI) ----- */
.split-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.split-editor .pane {
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px;
  background: #FAFAFB;
}
.split-editor .pane h4 {
  margin: 0 0 8px;
  font-size: 12px; color: #6B7280;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.split-editor .ai-output {
  background: #F0F9FF;
  border-color: #BAE6FD;
}
.split-editor textarea {
  width: 100%;
  min-height: 160px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: #1F2937;
  resize: vertical;
}
.split-editor textarea:focus { outline: none; }
@media (max-width: 800px) { .split-editor { grid-template-columns: 1fr; } }

/* ----- Mobile sidebar ----- */
.mobile-portal-toggle {
  display: none;
  background: none; border: 1px solid #E5E7EB;
  border-radius: 8px; padding: 7px 11px;
  cursor: pointer; font-size: 17px; color: var(--primary);
  font-family: inherit;
}
@media (max-width: 900px) {
  body.portal-body { display: block; }
  .portal-sidebar {
    position: fixed; top: 0; left: 0;
    height: 100vh; width: 260px;
    transform: translateX(-100%);
    transition: transform .25s;
    z-index: 70;
  }
  .portal-sidebar.open { transform: translateX(0); }
  .mobile-portal-toggle { display: inline-flex; }
  .portal-content { padding: 18px 16px 32px; }
  .portal-topbar { padding: 10px 14px; }
  .topbar-search { display: none; }
  .kanban { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; gap: 4px 0; }
  .detail-grid dt { margin-top: 8px; }
}

/* ----- Login page ----- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(ellipse 800px 600px at 80% 20%, rgba(79,168,217,0.12), transparent 60%),
    radial-gradient(ellipse 800px 600px at 20% 80%, rgba(123,176,105,0.14), transparent 60%),
    linear-gradient(180deg, #FBFAF5, #F5F8F1);
}
.login-card {
  width: 100%; max-width: 420px;
  background: white;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 16px 48px rgba(30,74,110,0.10), 0 2px 8px rgba(30,74,110,0.04);
  border: 1px solid rgba(30,74,110,0.06);
}
.login-brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin-bottom: 22px;
}
.login-brand img { height: 80px; }
.login-brand h1 {
  margin: 0; font-size: 22px; color: var(--primary); font-weight: 700;
  letter-spacing: -0.01em;
}
.login-brand p { margin: 0; color: #6B7280; font-size: 13px; }
.login-demo-notice {
  background: var(--water-soft); color: var(--water-dark);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 18px;
  text-align: center;
  border: 1px solid #BAE6FD;
}
.login-card .form-field input { padding: 11px 14px; font-size: 14px; }
.login-submit { width: 100%; padding: 12px; font-size: 14px; margin-top: 6px; justify-content: center; }
.login-back { text-align: center; margin-top: 18px; font-size: 13px; color: #6B7280; }
.login-back a { color: var(--primary-light); text-decoration: none; font-weight: 500; }
.login-back a:hover { color: var(--primary); }
.login-extra {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; font-size: 12px;
}
.login-extra label { display: inline-flex; align-items: center; gap: 6px; color: #4B5563; }
.login-extra a { color: var(--primary-light); text-decoration: none; }

/* Small helpers */
.muted { color: #6B7280; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.flex-1 { flex: 1; }
.no-mobile { }
@media (max-width: 700px) { .no-mobile { display: none; } }

/* ----- AI Biography Wizard ----- */
.aiw-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 100;
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 60px 20px 20px;
  overflow-y: auto;
}
.aiw-overlay.open { display: flex; }
.aiw {
  background: #fff;
  border-radius: 14px;
  width: 100%; max-width: 640px;
  box-shadow: 0 24px 64px rgba(15,23,42,0.25);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.aiw-head {
  padding: 20px 24px 16px;
  background: linear-gradient(135deg, #EFF6FF, #F0FDF4);
  border-bottom: 1px solid #DBEAFE;
  display: flex; align-items: flex-start; gap: 12px;
}
.aiw-head-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--water));
  color: #fff;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.aiw-head-text { flex: 1; }
.aiw-head-text h3 {
  margin: 0 0 4px;
  font-size: 16px; font-weight: 700;
  color: var(--primary);
}
.aiw-head-text p {
  margin: 0;
  font-size: 12px; color: #475569;
  line-height: 1.5;
}
.aiw-close {
  background: none; border: none; cursor: pointer;
  color: #6B7280; font-size: 22px;
  padding: 0; line-height: 1;
}
.aiw-body { padding: 20px 24px; max-height: 60vh; overflow-y: auto; }
.aiw-field { margin-bottom: 16px; }
.aiw-field:last-child { margin-bottom: 0; }
.aiw-field label {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.aiw-field-num {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0;
}
.aiw-field .hint {
  display: block;
  font-size: 12px; color: #6B7280;
  margin-bottom: 8px;
  font-weight: 400; text-transform: none; letter-spacing: 0;
}
.aiw-field textarea,
.aiw-field input {
  width: 100%;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #1F2937;
  background: #fff;
  resize: vertical;
}
.aiw-field textarea { min-height: 60px; }
.aiw-field textarea:focus,
.aiw-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123,176,105,0.15);
}
.aiw-actions {
  padding: 14px 24px;
  border-top: 1px solid #E5E7EB;
  background: #FAFAFB;
  display: flex; gap: 10px; align-items: center;
}
.aiw-actions .spacer { flex: 1; }
.aiw-actions .meta {
  font-size: 11px; color: #6B7280;
}
.aiw-loading {
  display: none;
  align-items: center; gap: 8px;
  font-size: 12px; color: var(--primary); font-weight: 600;
}
.aiw-loading.show { display: inline-flex; }
.aiw-spinner {
  width: 14px; height: 14px;
  border: 2px solid #DBEAFE;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: aiw-spin .8s linear infinite;
}
@keyframes aiw-spin { to { transform: rotate(360deg); } }

/* AI provenance strip above the split editor */
.ai-provenance {
  display: none;
  align-items: center; gap: 10px;
  padding: 8px 12px;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: 8px;
  margin-top: 10px;
  font-size: 12px; color: #075985;
}
.ai-provenance.show { display: flex; }
.ai-provenance .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.ai-provenance .spacer { flex: 1; }
.ai-provenance button {
  background: none; border: none; cursor: pointer;
  font: inherit; color: var(--primary);
  font-weight: 600; text-decoration: underline;
  padding: 0;
}

/* ===== Contract Wizard (7-step full-screen overlay) ===== */
.cw-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 110;
  display: none;
  align-items: stretch; justify-content: center;
  padding: 24px;
}
.cw-overlay.open { display: flex; }
.cw {
  background: #fff;
  border-radius: 14px;
  width: 100%; max-width: 1080px;
  box-shadow: 0 32px 80px rgba(15,23,42,0.3);
  display: grid;
  grid-template-columns: 280px 1fr;
  overflow: hidden;
}
.cw-rail {
  background: linear-gradient(180deg, #F8FAFC, #EFF6FF);
  padding: 24px 20px;
  border-right: 1px solid #E5E7EB;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.cw-rail h2 {
  margin: 0 0 4px;
  font-size: 16px; font-weight: 700;
  color: var(--primary);
}
.cw-rail .sub {
  font-size: 12px; color: #6B7280; line-height: 1.45;
  margin-bottom: 20px;
}
.cw-steps { list-style: none; padding: 0; margin: 0; flex: 1; }
.cw-steps li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: default;
  margin-bottom: 2px;
}
.cw-steps li.active { background: rgba(123,176,105,0.12); }
.cw-steps .n {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #CBD5E1;
  color: #64748B;
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.cw-steps li.active .n {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.cw-steps li.done .n {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.cw-steps li.done .n::before { content: "✓"; }
.cw-steps li.done .n-text { display: none; }
.cw-steps .label {
  font-size: 13px; color: #1E293B; font-weight: 500;
  line-height: 1.4; padding-top: 2px;
}
.cw-steps li.active .label { color: var(--primary); font-weight: 600; }
.cw-rail-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #E5E7EB;
  font-size: 11px; color: #64748B;
  line-height: 1.5;
}
.cw-body {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.cw-head {
  padding: 20px 28px 14px;
  border-bottom: 1px solid #E5E7EB;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.cw-head h3 {
  margin: 0;
  font-size: 17px; font-weight: 700;
  color: var(--primary);
}
.cw-head .meta {
  font-size: 11px; color: #6B7280;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.cw-close {
  background: none; border: none; cursor: pointer;
  font-size: 24px; color: #6B7280;
  padding: 0; line-height: 1;
}
.cw-content {
  flex: 1; overflow-y: auto;
  padding: 22px 28px;
}
.cw-pane { display: none; }
.cw-pane.active { display: block; }
.cw-pane h4 {
  margin: 0 0 6px;
  font-size: 13px; color: #475569;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
}
.cw-pane p.lead {
  margin: 0 0 16px;
  font-size: 13px; color: #475569; line-height: 1.55;
}

/* Pick-list cards used in steps 1, 2, 3, 4, 5 */
.cw-pick {
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff;
  transition: border-color .15s, background .15s;
  margin-bottom: 8px;
}
.cw-pick:hover { border-color: var(--accent); background: #FAFAFB; }
.cw-pick.selected {
  border-color: var(--accent);
  background: rgba(123,176,105,0.08);
  box-shadow: 0 0 0 3px rgba(123,176,105,0.12);
}
.cw-pick .cw-radio {
  width: 18px; height: 18px;
  border: 1.5px solid #CBD5E1; border-radius: 50%;
  flex-shrink: 0;
  display: grid; place-items: center;
  margin-top: 2px;
}
.cw-pick.selected .cw-radio { border-color: var(--accent); }
.cw-pick.selected .cw-radio::after {
  content: "";
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
}
.cw-pick .cw-pick-body { flex: 1; }
.cw-pick .cw-pick-title {
  font-size: 14px; font-weight: 600; color: var(--primary);
  margin-bottom: 2px;
}
.cw-pick .cw-pick-meta {
  font-size: 12px; color: #6B7280; line-height: 1.4;
}
.cw-pick .cw-pick-price {
  font-size: 14px; font-weight: 700; color: var(--primary);
  margin-left: auto;
  white-space: nowrap;
}

/* Services step uses checkbox-style cards */
.cw-pick.check .cw-radio { border-radius: 4px; }
.cw-pick.check.selected .cw-radio::after {
  content: "✓"; width: auto; height: auto; background: none;
  color: var(--accent); font-weight: 800; font-size: 13px;
}

/* Footer with nav buttons */
.cw-foot {
  padding: 14px 28px;
  border-top: 1px solid #E5E7EB;
  background: #FAFAFB;
  display: flex; align-items: center; gap: 10px;
}
.cw-foot .summary {
  font-size: 12px; color: #475569; line-height: 1.4;
}
.cw-foot .summary strong { color: var(--primary); font-weight: 700; }
.cw-foot .spacer { flex: 1; }

/* Inline review table for step 6 */
.cw-review {
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 0;
  background: #FAFAFB;
  margin-top: 8px;
}
.cw-review-row {
  display: flex;
  padding: 10px 14px;
  border-bottom: 1px solid #E5E7EB;
  font-size: 13px;
}
.cw-review-row:last-child { border-bottom: none; }
.cw-review-row .k {
  width: 160px;
  font-size: 11px; color: #6B7280;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
}
.cw-review-row .v { color: #1F2937; flex: 1; }
.cw-review-row .v strong { color: var(--primary); font-weight: 700; }
.cw-pdf {
  margin-top: 14px;
  border: 1px solid #E5E7EB; border-radius: 10px;
  padding: 16px 20px;
  background: #fff;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 13px; line-height: 1.6; color: #1F2937;
}
.cw-pdf .letterhead {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 12px;
  font-family: inherit;
}
.cw-pdf .letterhead .crest {
  display: inline-block;
  width: 28px; height: 28px;
  background: var(--primary); border-radius: 4px;
  color: #fff; font-weight: 800; font-size: 14px;
  display: inline-grid; place-items: center;
  margin-bottom: 6px;
}
.cw-pdf .letterhead h5 {
  margin: 0;
  font-size: 14px; font-weight: 700; color: var(--primary);
  letter-spacing: 0.05em; text-transform: uppercase;
}
.cw-pdf .letterhead .addr { font-size: 11px; color: #6B7280; }
.cw-signature {
  margin-top: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.cw-sig-pad {
  border: 1.5px dashed #CBD5E1;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  font-size: 13px; color: #6B7280;
  background: #fff;
  font-family: var(--font-serif, Georgia, serif);
  font-style: italic;
}
.cw-sig-pad.signed {
  border-style: solid;
  border-color: var(--accent);
  color: var(--primary);
  font-size: 22px;
  font-style: italic;
  background: #FBFCF9;
}
.cw-sig-cap {
  font-size: 10px; color: #6B7280;
  text-transform: uppercase; letter-spacing: 0.05em;
  text-align: center; margin-top: 4px;
}

/* Step 7 confirmation */
.cw-done {
  text-align: center;
  padding: 30px 20px;
}
.cw-done-check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 30px; font-weight: 800;
  display: inline-grid; place-items: center;
  margin-bottom: 14px;
}
.cw-done h3 {
  margin: 0 0 6px;
  font-size: 20px; font-weight: 700; color: var(--primary);
}
.cw-done p { margin: 0 0 18px; color: #475569; font-size: 14px; }
.cw-done-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}

@media (max-width: 800px) {
  .cw { grid-template-columns: 1fr; max-height: 100vh; }
  .cw-rail { padding: 14px; }
  .cw-steps { display: flex; gap: 4px; overflow-x: auto; }
  .cw-steps li { flex-shrink: 0; }
  .cw-rail-foot { display: none; }
}

/* ---- View toggle (Map / List) ----------------------------------------- */
.view-toggle {
  display: inline-flex;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 2px;
  margin-right: 4px;
}
.view-toggle-btn {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.view-toggle-btn:hover { color: #1E4A6E; }
.view-toggle-btn.is-active {
  background: white;
  color: #1E4A6E;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ---- List view -------------------------------------------------------- */
.list-view[hidden] { display: none !important; }
.list-view {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.list-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #E5E7EB;
  background: #FAFBFC;
}
.list-table-wrap {
  overflow-x: auto;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}
.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.list-table thead th {
  position: sticky;
  top: 0;
  background: #F9FAFB;
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6B7280;
  font-weight: 600;
  border-bottom: 1px solid #E5E7EB;
  z-index: 1;
}
.list-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
  color: #374151;
}
.list-table tbody tr:hover { background: #F9FAFB; }
.list-table tbody tr.editing-row { background: #FEF3C7; }
.list-table .plot-id-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #1E4A6E;
  font-size: 13px;
}
.list-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.list-status-dot.available { background: #7BB069; }
.list-status-dot.reserved  { background: #4FA8D9; }
.list-status-dot.interred  { background: #1E4A6E; }
.list-status-dot.hold      { background: #F59E0B; }
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pill.available { background: #DEF0D5; color: #3F6B30; }
.status-pill.reserved  { background: #D6ECF8; color: #1F6E96; }
.status-pill.interred  { background: #D6DEE9; color: #1E4A6E; }
.status-pill.hold      { background: #FEF3C7; color: #92400E; }
.list-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.list-row-actions button {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1E4A6E;
  cursor: pointer;
  transition: all 0.15s ease;
}
.list-row-actions button:hover { background: #F3F4F6; border-color: #D1D5DB; }
.list-row-actions button.danger { color: #B91C1C; }
.list-row-actions button.danger:hover { background: #FEE2E2; border-color: #FCA5A5; }
.list-empty {
  text-align: center;
  padding: 48px 20px;
  color: #9CA3AF;
  font-size: 14px;
}

/* ---- Branded modal (confirm / alert replacement) --------------------- */
.modal-overlay[hidden] { display: none !important; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: modal-fade 0.18s ease-out;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  padding: 28px 28px 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25), 0 2px 6px rgba(15, 23, 42, 0.08);
  text-align: center;
  animation: modal-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-pop {
  from { transform: translateY(8px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}
.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #FEE2E2;
  color: #B91C1C;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 14px;
}
.modal-icon.info   { background: #DBEAFE; color: #1E4A6E; }
.modal-icon.warn   { background: #FEF3C7; color: #92400E; }
.modal-icon.danger { background: #FEE2E2; color: #B91C1C; }
.modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #1E4A6E;
  margin: 0 0 8px;
  line-height: 1.2;
}
.modal-body {
  font-size: 14px;
  color: #4B5563;
  line-height: 1.55;
  margin: 0 0 22px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-btn {
  flex: 1;
  max-width: 160px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.modal-btn-cancel {
  background: white;
  border-color: #D1D5DB;
  color: #374151;
}
.modal-btn-cancel:hover { background: #F3F4F6; }
.modal-btn-confirm {
  background: #1E4A6E;
  color: white;
}
.modal-btn-confirm:hover { background: #163952; }
.modal-btn-confirm.danger {
  background: #B91C1C;
}
.modal-btn-confirm.danger:hover { background: #991717; }
.modal-btn:focus-visible { outline: 2px solid #4FA8D9; outline-offset: 2px; }

/* Force the map layout to actually hide when toggled to list view —
   `display: grid` from .layout-with-panel silently overrides the [hidden] attr. */
.layout-with-panel[hidden] { display: none !important; }

/* Scheduling week-view event blocks — match the dashboard .cal-event hover */
.sched-event {
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}
.sched-event:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 6px 14px -6px rgba(15, 23, 42, 0.35);
}

/* ===== Settings: split layout + templates + QR (Tier 1) ===== */
.settings-split { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .settings-split { grid-template-columns: 1fr; } }

.template-list { list-style: none; margin: 0; padding: 0; }
.template-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid #F3F4F6; cursor: pointer; }
.template-item:hover { background: #F9FAFB; }
.template-item.is-active { background: #EFF6F1; box-shadow: inset 3px 0 0 var(--accent); }
.template-item .ti-name { font-size: 13px; font-weight: 600; color: #111827; }
.template-item .ti-trigger { font-size: 11px; color: #6B7280; margin-top: 2px; }

.merge-chip { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--primary); background: #EEF4F8; border: 1px solid #DCE8F0; border-radius: 5px; padding: 3px 7px; }

.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.qr-card { display: flex; flex-direction: column; text-align: center; }
.qr-title { font-size: 14px; font-weight: 700; color: var(--primary); margin: 14px 0 4px; }
.qr-desc { font-size: 12px; color: #6B7280; line-height: 1.5; margin: 0 0 14px; flex: 1; }
.qr-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.qr-preview {
  width: 120px; height: 120px; margin: 0 auto; border-radius: 10px;
  background:
    linear-gradient(90deg, #1E293B 0 60%, transparent 60%) 0 0 / 14px 14px,
    linear-gradient(#1E293B 0 60%, transparent 60%) 0 0 / 14px 14px,
    #fff;
  border: 6px solid #fff; box-shadow: 0 0 0 1px #E5E7EB; position: relative;
}
.qr-preview::after {
  content: ""; position: absolute; inset: 30% 30%; background: #fff;
  box-shadow: 0 0 0 6px #1E293B; border-radius: 3px;
}

/* ===== CSV import wizard (Tier 1) ===== */
.wizard-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 22px; padding: 0; max-width: 920px; }
.wizard-step { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 13px; color: #9CA3AF; font-weight: 600; }
.wizard-step .ws-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #E5E7EB; color: #6B7280; font-size: 12px; flex: none; }
.wizard-step.is-active { color: var(--primary); }
.wizard-step.is-active .ws-num { background: var(--primary); color: #fff; }
.wizard-step.is-done { color: var(--accent); }
.wizard-step.is-done .ws-num { background: var(--accent); color: #fff; }
.wizard-step.is-done .ws-num::after { content: "✓"; }
.wizard-step.is-done .ws-num { font-size: 0; }
.wizard-step.is-done .ws-num::after { font-size: 13px; }

.wizard-pane { display: none; }
.wizard-pane.is-active { display: block; }
.wizard-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }

.dropzone { border: 2px dashed #CBD5E1; border-radius: 12px; padding: 38px 20px; text-align: center; background: #F8FAFC; cursor: pointer; }
.dropzone:hover { border-color: var(--accent); background: #F4F9F2; }
.dropzone-icon { font-size: 30px; color: var(--primary-light); }
.dropzone-title { font-size: 15px; font-weight: 600; color: var(--primary); margin-top: 8px; }
.dropzone-sub { font-size: 12px; color: #6B7280; margin-top: 4px; }

.file-chip { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid #E5E7EB; border-radius: 10px; background: #fff; }
.file-chip-icon { font-size: 22px; }

.validate-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.vs-stat { border-radius: 10px; padding: 16px; text-align: center; border: 1px solid #E5E7EB; }
.vs-stat .vs-num { font-size: 26px; font-weight: 700; line-height: 1; }
.vs-stat .vs-label { font-size: 12px; color: #6B7280; margin-top: 6px; }
.vs-ok { background: #F0F7EE; border-color: #D6E8CE; } .vs-ok .vs-num { color: #4B7B3A; }
.vs-warn { background: #FEF7E7; border-color: #F5E4B8; } .vs-warn .vs-num { color: #A87B1B; }
.vs-err { background: #FBEEEC; border-color: #F2D2CC; } .vs-err .vs-num { color: #B0413B; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }

.import-done { text-align: center; padding: 36px 24px; }
.import-done-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 28px; display: grid; place-items: center; margin: 0 auto 14px; }

/* ===== Map: ownership history + heat-map (Tier 1) ===== */
.ownership-history { list-style: none; margin: 0; padding: 0; }
.ownership-history li { display: flex; gap: 10px; padding: 8px 0; position: relative; }
.ownership-history .oh-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 4px; flex: none; box-shadow: 0 0 0 3px #EFF6F1; }
.ownership-history .oh-name { font-size: 13px; font-weight: 600; color: #111827; }
.ownership-history .oh-meta { font-size: 11px; color: #6B7280; }

#heat-toggle.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.map-canvas.heat-on .map-pin { opacity: 0.32; transition: opacity .2s; }
.map-canvas.heat-on .map-pin.selected { opacity: 1; }
