/* ============================================================
   BlueBridge Bonaire CRM — style.css
   Primary: #022039   Secondary: #2E87C1   Accent: #FCC40C
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Open+Sans:wght@400;500;600&display=swap');

:root {
  /* Brand palette — BlueBridge Bonaire */
  --primary:      #022039;
  --primary-mid:  #0a3558;
  --primary-light:rgba(2,32,57,.10);
  --primary-faint:rgba(2,32,57,.05);
  --secondary:    #2E87C1;
  --secondary-dark:#1f6fa3;
  --accent:       #FCC40C;
  --accent-dark:  #d4a50a;
  --accent-light: rgba(252,196,12,.18);
  --accent-faint: rgba(252,196,12,.08);

  /* Aliases */
  --gold:         #FCC40C;
  --gold-dark:    #d4a50a;
  --gold-light:   rgba(252,196,12,.18);
  --gold-lighter: rgba(252,196,12,.08);
  --navy:         #022039;
  --navy-light:   rgba(2,32,57,.10);
  --surface:      #ffffff;

  /* Page backgrounds */
  --bg:           #f0f6fa;
  --bg2:          #ffffff;

  /* Borders */
  --border:       #d1e3ec;
  --border-focus: #FCC40C;

  /* Text */
  --text:         #022039;
  --text-muted:   #4a6678;
  --text-light:   #8aabb8;

  /* Semantic colours */
  --green:        #059669;
  --green-light:  rgba(5,150,105,.12);
  --red:          #DC2626;
  --red-light:    rgba(220,38,38,.12);
  --orange:       #D97706;
  --orange-light: rgba(217,119,6,.12);
  --blue:         #2563EB;
  --blue-light:   rgba(37,99,235,.12);
  --grey-light:   rgba(74,102,120,.12);

  /* Layout */
  --sidebar-w:    240px;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
  --shadow:       0 1px 3px rgba(2,32,57,.08), 0 1px 2px rgba(2,32,57,.04);
  --shadow-md:    0 4px 12px rgba(2,32,57,.10), 0 2px 4px rgba(2,32,57,.06);
  --shadow-lg:    0 12px 32px rgba(2,32,57,.14), 0 4px 10px rgba(2,32,57,.08);
  --transition:   .18s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-mid); }

img { max-width: 100%; }

ul, ol { list-style: none; }

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--primary);
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(2,32,57,.25);
}

.sidebar-logo {
  padding: 26px 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo .logo-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -.3px;
}

.sidebar-logo .logo-title span,
.sidebar-logo .logo-title .logo-lux {
  color: var(--accent);
}

.sidebar-admin-logo {
  max-height: 56px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.sidebar-logo .logo-tagline {
  font-size: .68rem;
  color: rgba(255,255,255,.45);
  margin-top: 3px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: .65rem;
  font-weight: 600;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 8px 4px;
  margin-top: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.6);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,.08);
  color: #ffffff;
}

.sidebar-nav a.active {
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
}

.sidebar-nav a.active .nav-icon { color: var(--primary); }

.sidebar-nav a .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer .user-name {
  font-size: .82rem;
  font-weight: 600;
  color: #ffffff;
}

.sidebar-footer .user-role {
  font-size: .72rem;
  color: rgba(255,255,255,.4);
}

.sidebar-footer .logout-link {
  display: inline-block;
  margin-top: 8px;
  font-size: .75rem;
  color: rgba(255,100,100,.8);
}

.sidebar-footer .logout-link:hover { color: #ff6b6b; }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 28px 32px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.4px;
}

.page-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
}

.card-subtitle {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card + .card { margin-top: 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--primary);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(255,240,0,.40);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
}

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

.btn-outline-gold {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--accent);
}

.btn-outline-gold:hover {
  background: var(--accent-light);
  color: var(--primary);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #DC2626;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-sm {
  padding: 5px 10px;
  font-size: .78rem;
}

.btn-lg {
  padding: 11px 22px;
  font-size: .95rem;
}

.btn-whatsapp {
  background: #25D366;
  color: #fff;
}

.btn-whatsapp:hover {
  background: #1da851;
  color: #fff;
}

/* ── Status Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2px;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge-prospect   { background: var(--blue-light);   color: #1D4ED8; }
.badge-active     { background: var(--green-light);  color: #065F46; }
.badge-passive    { background: var(--grey-light);   color: #4B5563; }
.badge-sold       { background: var(--navy-light);   color: var(--navy); }
.badge-under-offer{ background: var(--orange-light); color: #92400E; }
.badge-gold       { background: var(--gold-light);   color: var(--gold-dark); }
.badge-in         { background: var(--blue-light);   color: #1D4ED8; }
.badge-out        { background: var(--orange-light); color: #92400E; }

/* ── Source badges ── */
.source-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 500;
  background: var(--secondary);
  color: var(--primary);
  border: 1px solid var(--secondary-dark);
}

/* ── Stat Cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.green  { background: var(--green-light); }
.stat-icon.blue   { background: var(--blue-light); }
.stat-icon.orange { background: var(--orange-light); }
.stat-icon.red    { background: var(--red-light); }

.stat-body {}

.stat-number {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -.5px;
}

.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-change {
  font-size: .72rem;
  font-weight: 500;
  margin-top: 4px;
}

.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ── Forms ── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: ' *';
  color: var(--red);
}

.form-control {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6,1,61,.12);
}

.form-control::placeholder { color: var(--text-light); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
  cursor: pointer;
}

.form-check-label {
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-section {
  margin-bottom: 28px;
}

.form-section-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--primary);
  padding-bottom: 10px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 12px;
}

.radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .855rem;
}

thead th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--secondary); }

tbody td {
  padding: 11px 14px;
  color: var(--text);
  vertical-align: middle;
}

.td-muted { color: var(--text-muted); font-size: .82rem; }

/* ── Kanban ── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-column {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 200px;
  padding: 12px;
}

.kanban-column.drag-over {
  border-color: var(--accent);
  background: var(--accent-faint);
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 12px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 10px;
}

.kanban-header h3 {
  font-size: .88rem;
  font-weight: 600;
  color: var(--navy);
}

.kanban-count {
  background: var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
}

.kanban-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: box-shadow var(--transition), transform var(--transition);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-card.dragging {
  opacity: .5;
  cursor: grabbing;
}

.kanban-card .card-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}

.kanban-card .card-phone {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kanban-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.kanban-card .card-date {
  font-size: .7rem;
  color: var(--text-light);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
  white-space: nowrap;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition);
  border-radius: 2px;
}

.tab-btn.active {
  color: var(--primary);
  font-weight: 700;
}

.tab-btn.active::after { transform: scaleX(1); }

.tab-btn:hover { color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── View Toggle ── */
.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.view-toggle button {
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  transition: all var(--transition);
}

.view-toggle button.active {
  background: var(--bg2);
  color: var(--navy);
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* ── Activity Timeline ── */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 18px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg2);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.timeline-dot.green  { background: var(--green); box-shadow: 0 0 0 2px var(--green-light); }
.timeline-dot.blue   { background: var(--blue);  box-shadow: 0 0 0 2px var(--blue-light); }
.timeline-dot.red    { background: var(--red);   box-shadow: 0 0 0 2px var(--red-light); }
.timeline-dot.orange { background: var(--orange); box-shadow: 0 0 0 2px var(--orange-light); }

.timeline-body {}

.timeline-text {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.5;
}

.timeline-time {
  font-size: .72rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Tasks ── */
.task-list {}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.task-item input[type="checkbox"] {
  margin-top: 3px;
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}

.task-body { flex: 1; min-width: 0; }

.task-title {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
}

.task-title.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-desc {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.task-due {
  font-size: .72rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-due.overdue { color: var(--red); font-weight: 600; }
.task-due.soon    { color: var(--orange); font-weight: 600; }

.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  background: var(--navy-light);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 500;
  color: var(--navy);
}

/* ── Email Log ── */
.email-list {}

.email-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.email-entry:last-child { border-bottom: none; }

.email-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.email-subject {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.email-date {
  font-size: .72rem;
  color: var(--text-light);
}

.email-preview {
  font-size: .8rem;
  color: var(--text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── P&L ── */
.pnl-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.pnl-cell {
  background: var(--bg2);
  padding: 16px 18px;
  text-align: center;
}

.pnl-cell-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}

.pnl-cell-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.pnl-cell-value.revenue { color: var(--green); }
.pnl-cell-value.cost    { color: var(--red); }
.pnl-cell-value.net     { color: var(--primary); font-size: 1.25rem; font-weight: 800; }

.pnl-net-card {
  background: linear-gradient(135deg, var(--accent-light) 0%, rgba(255,240,0,.04) 100%);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cost-table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.recurring-tag {
  display: inline-block;
  padding: 1px 6px;
  background: var(--orange-light);
  color: #92400E;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 600;
}

/* ── Checklist ── */
.checklist {}

.checklist-group {
  margin-bottom: 8px;
}
.checklist-group:last-child { margin-bottom: 0; }
.checklist-group-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.checklist-group:first-child .checklist-group-title {
  padding-top: 4px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

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

.checklist-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-label {
  font-size: .875rem;
  color: var(--text);
  flex: 1;
}

.checklist-label.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-category {
  font-size: .7rem;
  color: var(--text-light);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Photo Gallery ── */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 4px 0;
}
.photo-card {
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color .15s;
}
.photo-card:hover { border-color: var(--accent, #FCC40C); }
.photo-card.photo-primary { border-color: var(--accent, #FCC40C); }
.photo-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0f0f0;
}
.photo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-primary-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent, #FCC40C);
  color: var(--primary, #06013d);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .3px;
}
.photo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  gap: 6px;
}
.photo-name {
  font-size: .72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.photo-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .photo-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .photo-gallery { grid-template-columns: 1fr; }
}

/* ── Flash Messages ── */
.flash-messages {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  width: 100%;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
  font-size: .85rem;
  font-weight: 500;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.flash-success {
  background: var(--bg2);
  border-left: 4px solid var(--green);
  color: var(--text);
}

.flash-error {
  background: var(--bg2);
  border-left: 4px solid var(--red);
  color: var(--text);
}

.flash-info {
  background: var(--bg2);
  border-left: 4px solid var(--blue);
  color: var(--text);
}

.flash-warning {
  background: var(--bg2);
  border-left: 4px solid var(--orange);
  color: var(--text);
}

.flash-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1;
  margin-left: auto;
  padding: 0;
  flex-shrink: 0;
}

/* ── Search & Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: .9rem;
}

.search-input-wrap input {
  padding-left: 32px;
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: var(--bg2);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-pill:hover, .filter-pill.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--accent-light);
}

/* ── Detail Layout ── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.detail-main {}

.detail-sidebar {}

/* ── Lead Header ── */
.lead-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.lead-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}

.lead-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.4px;
}

.lead-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.lead-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

/* ── Info Grid ── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}

.info-item {}

.info-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
}

.info-value {
  font-size: .88rem;
  color: var(--text);
  font-weight: 500;
}

.info-value.empty { color: var(--text-light); font-style: italic; }

/* ── Quick Note ── */
.quick-note-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-note-form textarea {
  min-height: 70px;
  resize: none;
}

/* ── GDPR Card ── */
.gdpr-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.gdpr-icon {
  font-size: 1.4rem;
}

.gdpr-status { font-size: .82rem; font-weight: 600; }
.gdpr-status.yes { color: var(--green); }
.gdpr-status.no  { color: var(--red); }

/* ── Placeholder Card ── */
.placeholder-card {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-muted);
}

.placeholder-card .placeholder-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: .5;
}

.placeholder-card p {
  font-size: .82rem;
  line-height: 1.5;
}

/* ── Days-on-market badge ── */
.days-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--blue-light);
  color: #1D4ED8;
}

.days-badge.long  { background: var(--orange-light); color: #92400E; }
.days-badge.very-long { background: var(--red-light); color: #991B1B; }

/* ── Viewing item ── */
.viewing-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.viewing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.viewing-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}

.viewing-date {
  font-size: .75rem;
  color: var(--text-muted);
}

.viewing-feedback {
  font-size: .82rem;
  color: var(--text-muted);
}

.viewing-by {
  font-size: .72rem;
  color: var(--text-light);
  margin-top: 3px;
}

/* ── Dividers and spacing ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-gold   { color: var(--accent-dark); }
.text-navy   { color: var(--navy); }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.fs-sm       { font-size: .8rem; }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }

/* ── Login / Standalone pages ── */
.auth-page {
  min-height: 100vh;
  background: var(--primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(252,196,12,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(46,135,193,.08) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.2);
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  font-size: 2.8rem;
  margin-bottom: 10px;
}

.auth-logo .logo-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.auth-logo .logo-name span { color: var(--accent-dark); }

.auth-logo .logo-tag {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: .3px;
}

.auth-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .pnl-summary { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { order: -1; }
}

@media (max-width: 900px) {
  .kanban-board { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
    transition: transform .25s ease;
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--primary);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 99;
  }

  .hamburger {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--accent);
  }

  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 150;
  }

  .overlay.show { display: block; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lead-header { flex-direction: column; align-items: flex-start; }
  .lead-actions { margin-left: 0; }
}

@media (min-width: 769px) {
  .mobile-header { display: none; }
  .overlay { display: none !important; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .pnl-summary { grid-template-columns: 1fr 1fr; }
}

/* ── Additional classes for lead/listing templates ── */

/* Status badges used by our templates */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-prospect   { background: var(--blue-light);   color: #1D4ED8; }
.status-active     { background: var(--green-light);  color: #065F46; }
.status-passive    { background: var(--grey-light);   color: #4B5563; }
.status-sold       { background: var(--navy-light);   color: var(--navy); }
.status-pending    { background: var(--orange-light); color: #92400E; }
.status-withdrawn  { background: var(--red-light);    color: #991B1B; }

/* Table styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--secondary); }
.table-link { color: var(--primary); font-weight: 600; }
.table-link:hover { color: var(--primary-mid); text-decoration: underline; }
.table-card { padding: 0; overflow: hidden; }
.empty-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.kpi-value { font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1; }
.kpi-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 6px; }
.kpi-accent .kpi-value { color: var(--primary); }
.kpi-green  .kpi-value { color: var(--green); }
.kpi-danger .kpi-value { color: var(--red); }

/* Form layout helpers */
.form-layout  { max-width: 900px; }
.form-grid-2  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field-group  { display: flex; flex-direction: column; gap: 5px; }
.field-group label { font-size: .8rem; font-weight: 600; color: var(--navy); }
.form-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.form-section h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.form-actions { display: flex; gap: 10px; padding-top: 16px; }
.checkbox-field label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .875rem; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.checkbox-label {
  display: flex; align-items: center; gap: 5px;
  font-size: .82rem; cursor: pointer;
  background: var(--bg); padding: 4px 10px;
  border-radius: 20px; border: 1px solid var(--border);
}
.inline-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 16px;
}

/* Quick Links */
.quick-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* Info Grid — dt/dd variant (lead detail) */
.info-grid-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: .875rem; }
.info-grid-dl dt { color: var(--text-muted); font-weight: 500; }
.info-grid-dl dd { color: var(--text); }

/* Notes Block */
.notes-block {
  margin-top: 12px; padding: 12px; background: var(--bg);
  border-radius: var(--radius-sm); font-size: .875rem;
}
.notes-block p { margin-top: 4px; white-space: pre-wrap; }

/* Filter panel */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-row-secondary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.filter-input { flex: 1; min-width: 120px; max-width: 360px; }
.filter-wide  { min-width: 220px; max-width: 400px; }
.filter-med   { min-width: 100px; max-width: 140px; flex: none; }
.filter-narrow{ min-width: 64px;  max-width: 80px;  flex: none; }
.filter-select { min-width: 130px; flex: none; }
/* Multi-select checkbox dropdown */
.multi-select-wrap { position: relative; flex: none; }
.multi-select-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg);
  color: var(--text); font-size: .875rem; cursor: pointer;
  min-width: 160px; max-width: 260px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.multi-select-btn:hover { border-color: var(--primary); }
.multi-select-caret { margin-left: auto; font-size: .7rem; color: var(--text-muted); flex-shrink: 0; }
.multi-select-panel {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  z-index: 200; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 200px; max-height: 260px; overflow-y: auto; padding: 6px 0;
}
.multi-select-panel.open { display: block; }
.multi-select-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; font-size: .875rem; cursor: pointer;
  color: var(--text); white-space: nowrap;
}
.multi-select-item:hover { background: var(--bg); }
.multi-select-item input[type=checkbox] { accent-color: var(--primary); width: 14px; height: 14px; }
.multi-select-category {
  padding: 8px 14px 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); border-top: 1px solid var(--border);
  margin-top: 4px;
}
.multi-select-category:first-child { border-top: none; margin-top: 0; }

/* Legacy .filter-bar still usable elsewhere */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* Viewing list */
.viewing-list { list-style: none; }
.viewing-info { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; font-size: .875rem; }

/* Document list */
.doc-list { list-style: none; }
.doc-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.doc-item:last-child { border-bottom: none; }
.doc-link { color: var(--navy); font-weight: 500; }
.doc-link:hover { color: var(--gold); }

/* Activity list inline */
.activity-list { list-style: none; }
.activity-item { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.activity-item:last-child { border-bottom: none; }
.activity-type { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 4px; background: var(--bg); color: var(--text-muted); white-space: nowrap; }
.activity-type-note { background: var(--blue-light); color: #1e40af; }
.activity-type-lead_created, .activity-type-listing_created, .activity-type-task_completed { background: var(--green-light); color: #065f46; }
.activity-desc { flex: 1; color: var(--text); }
.activity-link { color: var(--gold); font-size: .78rem; }
.activity-time { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }

/* P&L simple */
.pl-summary { margin-bottom: 16px; }
.pl-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .875rem; border-bottom: 1px solid var(--border); }
.pl-row:last-child { border-bottom: none; }
.pl-net { font-size: 1rem; padding-top: 12px; }
.pl-value { font-weight: 600; }
.pl-value.green { color: var(--green); }
.pl-value.red   { color: var(--red); }

/* Checklist toggle buttons */
.checklist-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.progress-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width .3s ease; }
.progress-text { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.check-btn {
  width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 4px;
  background: var(--bg2); cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; font-size: .8rem; font-weight: 700; transition: all var(--transition);
  flex-shrink: 0;
}
.check-btn.checked { background: var(--green); border-color: var(--green); color: #fff; }
.checklist-item.done .checklist-label { text-decoration: line-through; color: var(--text-muted); }

/* Kanban column (our templates use .kanban-col) */
.kanban-col {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 300px;
  transition: all var(--transition);
}
.kanban-col.drag-over { border-color: var(--gold); background: var(--gold-lighter); }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.kanban-count { font-size: .78rem; color: var(--text-muted); background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1px 8px; }
.kanban-cards { display: flex; flex-direction: column; gap: 8px; }
.kanban-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; cursor: grab; box-shadow: var(--shadow); transition: all var(--transition); }
.kanban-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .5; }
.kanban-name { font-size: .875rem; font-weight: 600; color: var(--navy); display: block; }
.kanban-meta { font-size: .75rem; color: var(--text-muted); margin-top: 3px; }

/* Two-column layout */
.two-col-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* Detail layout */
.detail-main  { min-width: 0; }
.detail-sidebar { min-width: 0; }

/* Header actions */
.header-actions { display: flex; gap: 8px; align-items: center; }

/* Task list extra */
.task-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.task-title { font-size: .875rem; font-weight: 500; color: var(--text); }
.task-due.overdue { color: var(--red); font-weight: 600; }
.task-due.soon    { color: var(--orange); font-weight: 600; }
.task-desc  { font-size: .78rem; color: var(--text-muted); }
.task-assigned { font-size: .72rem; color: var(--text-muted); }
.task-done .task-info { opacity: .6; }
.strikethrough { text-decoration: line-through; }

/* Email list extras */
.email-list { list-style: none; }
.email-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.email-item:last-child { border-bottom: none; }
.email-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: .875rem; }
.email-dir  { font-size: 1rem; color: var(--text-muted); }
.email-outbound .email-dir { color: var(--green); }
.email-inbound  .email-dir { color: var(--blue); }
.email-body { font-size: .82rem; color: var(--text-muted); padding-left: 24px; white-space: pre-wrap; }

/* Utility */
.muted   { color: var(--text-muted); }
.small   { font-size: .78rem; }
.full-width { width: 100%; }
.empty-state { color: var(--text-muted); font-size: .875rem; padding: 12px 0; }
.subtitle { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }

/* Error pages */
.error-page { text-align: center; padding: 80px 20px; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--gold); line-height: 1; margin-bottom: 12px; }
.error-page h2 { font-size: 1.6rem; color: var(--navy); margin-bottom: 8px; }
.error-page p  { color: var(--text-muted); margin-bottom: 24px; }

/* btn-success and btn-outline shorthand */
.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #059669; }
.btn-outline { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }

/* ── Tag chips ── */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2px;
  color: #fff;
  background: var(--tag-color, #022039);
  white-space: nowrap;
  line-height: 1.6;
}
.tag-chip-sm {
  padding: 1px 7px;
  font-size: .65rem;
}
.tag-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  padding: 0 0 0 2px;
  font-weight: 700;
}
.tag-remove:hover { color: #fff; }

.tag-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Tags section on detail page */
.tags-section {
  margin-bottom: 20px;
  padding: 14px 20px;
}
.tags-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tags-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
}
.tags-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag-add-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.kanban-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 4px 0;
}

/* ── Action bar ── */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.action-bar-count {
  font-size: .85rem;
  font-weight: 600;
}
.action-bar-buttons {
  display: flex;
  gap: 8px;
}
.action-bar .btn-outline {
  color: #fff;
  border-color: rgba(255,255,255,.3);
}
.action-bar .btn-outline:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Tags management page ── */
.tag-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tag-manage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tag-manage-item .tag-chip { font-size: .8rem; padding: 3px 14px; }
.tag-manage-info {
  flex: 1;
  font-size: .82rem;
  color: var(--text-muted);
}
.tag-manage-default {
  font-size: .7rem;
  color: var(--text-light);
  font-style: italic;
}
.tag-create-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.tag-color-input {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
}

/* ============================================================
   Task Categories, Overdue, Privacy
   ============================================================ */

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.category-appointment { background: var(--blue-light);   color: #1d4ed8; }
.category-callback    { background: var(--orange-light);  color: #92400e; }
.category-viewing     { background: var(--green-light);   color: #065f46; }
.category-general     { background: var(--primary-light); color: var(--primary); }
.category-note        { background: var(--grey-light);    color: #374151; }

.private-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: .65rem;
  background: var(--red-light);
  color: #991b1b;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}

.overdue-badge {
  display: inline-flex;
  align-items: center;
  font-size: .65rem;
  background: var(--red);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .03em;
}

.overdue-text { color: var(--red) !important; font-weight: 600; }

.task-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-item--done { opacity: .55; }

.task-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.btn-xs {
  padding: 2px 8px;
  font-size: .68rem;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Agenda / Calendar Week View
   ============================================================ */

.agenda-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
}

.agenda-day {
  border-right: 1px solid var(--border);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
.agenda-day:last-child { border-right: none; }

.agenda-day--today { background: var(--accent-faint); }

.agenda-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--primary-faint);
  gap: 2px;
}
.agenda-weekday {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.agenda-date {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.today-badge {
  background: var(--accent);
  color: var(--primary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agenda-events {
  flex: 1;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.agenda-event {
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  border-left: 3px solid currentColor;
  font-size: .78rem;
  transition: opacity .15s ease;
}
.agenda-event:hover { opacity: .85; }

.agenda-event.category-appointment { background: rgba(37,99,235,.06);  border-color: #2563eb; }
.agenda-event.category-callback    { background: rgba(217,119,6,.06);  border-color: #d97706; }
.agenda-event.category-viewing     { background: rgba(5,150,105,.06);  border-color: #059669; }
.agenda-event.category-general     { background: var(--primary-faint); border-color: var(--primary); }
.agenda-event.category-note        { background: rgba(107,114,128,.06);border-color: #6b7280; }

.agenda-event--private { opacity: .6; }

.agenda-event-time  { font-size: .65rem; font-weight: 700; color: var(--text-muted); margin-bottom: 2px; }
.agenda-event-title { font-weight: 600; color: var(--text); }
.agenda-event-title a { color: inherit; text-decoration: none; }
.agenda-event-title a:hover { color: var(--primary-mid); }
.agenda-event-lead  { font-size: .7rem; color: var(--text-muted); margin-top: 1px; }
.agenda-event-lead a { color: inherit; text-decoration: none; }
.agenda-event-lead a:hover { text-decoration: underline; }
.agenda-event-agent { font-size: .68rem; color: var(--text-light); }
.agenda-event-actions { margin-top: 5px; }
.private-placeholder { color: var(--text-muted); font-style: italic; }

.agenda-empty {
  font-size: .72rem;
  color: var(--text-light);
  text-align: center;
  padding: 12px 4px;
}

/* Overdue list in agenda */
.overdue-list { display: flex; flex-direction: column; gap: 6px; }
.overdue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  flex-wrap: wrap;
}
.overdue-item:last-child { border-bottom: none; }
.overdue-title {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.overdue-title:hover { color: var(--primary-mid); }
.overdue-lead { font-size: .78rem; color: var(--text-muted); }

/* Responsive: collapse agenda to 1-column on mobile */
@media (max-width: 900px) {
  .agenda-grid {
    grid-template-columns: 1fr;
  }
  .agenda-day {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: auto;
  }
}

/* ===================================================================
   ADMIN PANEL
   =================================================================== */

/* Stats row */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.admin-stat-card--active { border-left: 4px solid #10b981; }
.admin-stat-card--trial { border-left: 4px solid #f59e0b; }
.admin-stat-card--revenue { border-left: 4px solid var(--primary); }
.admin-stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}
.admin-stat-label {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Broker list cards */
.admin-broker-list {
  display: grid;
  gap: 12px;
}
.admin-broker-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.admin-broker-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(2,32,57,.08);
}
.admin-broker-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.admin-broker-card__logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.admin-broker-card__name {
  font-weight: 600;
  font-size: 1.05rem;
}
.admin-broker-card__plan {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.admin-broker-card__details {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.admin-broker-card__detail {
  display: flex;
  flex-direction: column;
}
.detail-label {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.detail-value {
  font-weight: 600;
  font-size: .95rem;
}

/* Plan badges */
.plan-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.plan-badge--starter { background: #e0f2fe; color: #0369a1; }
.plan-badge--professional { background: #ede9fe; color: #6d28d9; }
.plan-badge--elite { background: #fef3c7; color: #92400e; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.status-badge--active { background: #d1fae5; color: #065f46; }
.status-badge--trial { background: #fef3c7; color: #92400e; }
.status-badge--suspended { background: #fee2e2; color: #991b1b; }
.status-badge--cancelled { background: #f3f4f6; color: #6b7280; }

/* Billing status in list */
.billing-active { color: #059669; }
.billing-trial { color: #d97706; }
.billing-pending { color: var(--text-muted); }

/* Detail page grid */
.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .admin-detail-grid { grid-template-columns: 1fr; }
}
.admin-detail-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Admin card */
.admin-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.admin-card__title {
  padding: 16px 20px 12px;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card__body {
  padding: 16px 20px;
}

/* Info rows */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}
.info-row:last-child { border-bottom: none; }
.info-row--highlight {
  background: #f0fdf4;
  margin: 8px -20px -16px;
  padding: 12px 20px;
  border-radius: 0 0 12px 12px;
  font-weight: 600;
}
/* info-label / info-value overrides removed — use rules at line ~1240 */
.info-value a { color: var(--primary); }

/* Billing badges */
.paid-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  background: #d1fae5;
  color: #065f46;
  margin-left: 6px;
}
.unpaid-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  background: #fee2e2;
  color: #991b1b;
  margin-left: 6px;
}
.discount-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  margin-left: 4px;
}
.trial-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
  margin-left: 6px;
}

/* Brand swatches */
.brand-colors {
  display: flex;
  gap: 8px;
}
.brand-swatch {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--border);
}

/* User list */
.user-count-badge {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.admin-user-item:last-child { border-bottom: none; }
.admin-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.admin-user-name {
  font-weight: 600;
  font-size: .95rem;
}
.admin-user-meta {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Role badges */
.role-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
}
.role-badge--admin { background: #ede9fe; color: #6d28d9; }
.role-badge--agent { background: #e0f2fe; color: #0369a1; }
.role-badge--superadmin { background: #fef3c7; color: #92400e; }

.pw-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  margin-left: 4px;
}

/* Admin actions */
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Add user section */
.admin-add-user {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
}

/* Page actions (multiple buttons) */
.page-actions {
  display: flex;
  gap: 8px;
}

/* Form sections */
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.form-section-title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}
.form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-row--3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 700px) {
  .form-row--2col,
  .form-row--3col { grid-template-columns: 1fr; }
}

.form-hint {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* Color input */
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-input-wrap input[type="color"] {
  width: 48px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.color-hex {
  font-size: .8rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Plan summary in form */
.plan-summary {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 12px;
  font-size: .9rem;
}

/* Warning / Danger buttons */
.btn-warning {
  background: #f59e0b;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  font-size: .85rem;
}
.btn-warning:hover { background: #d97706; }
.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  font-size: .85rem;
}
.btn-danger:hover { background: #dc2626; }
.btn-xs {
  padding: 2px 10px;
  font-size: .75rem;
}
.btn-sm {
  padding: 6px 14px;
  font-size: .85rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.empty-state-text {
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Sidebar broker logo */
.sidebar-broker-logo {
  max-height: 48px;
  border-radius: 6px;
  margin-bottom: 6px;
}

/* ===================================================================
   SETUP INSTRUCTIONS
   =================================================================== */
.setup-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
.setup-card__title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
}
.setup-dns-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
}
.dns-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #e5e7eb;
}
.dns-row:last-child { border-bottom: none; }
.dns-label {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.dns-value {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  font-size: .9rem;
}
.setup-alt {
  background: #fef3c7;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: .85rem;
}
.setup-alt code {
  background: rgba(0,0,0,.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.setup-note {
  background: #e0f2fe;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: .85rem;
}
.setup-users {
  margin: 12px 0;
}
.setup-user-row {
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.setup-user-row:last-child { border-bottom: none; }
.setup-user-name { font-weight: 600; }
.setup-user-detail {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.setup-user-detail code {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--primary);
}
.setup-features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}
.setup-feature {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: .9rem;
}
.setup-feature--included {
  background: #f0fdf4;
  color: #065f46;
}
.setup-feature--locked {
  background: #f9fafb;
  color: #9ca3af;
}
.setup-check {
  color: #10b981;
  font-weight: 700;
  margin-right: 8px;
}
.setup-lock {
  margin-right: 8px;
}
.setup-billing {
  margin: 12px 0;
}
.billing-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: .95rem;
}
.billing-line:last-child { border-bottom: none; }
.billing-line--highlight {
  background: #f0fdf4;
  margin: 4px -24px;
  padding: 10px 24px;
  border-radius: 0 0 12px 12px;
  font-weight: 500;
}
.setup-steps {
  margin: 12px 0;
  padding-left: 20px;
}
.setup-steps li {
  padding: 6px 0;
  font-size: .95rem;
}
.setup-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: .85rem;
}

/* ---------------------------------------------------------------------------
   WhatsApp Bots page
--------------------------------------------------------------------------- */

.wa-feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wa-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.wa-feature-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.wa-feature p {
  margin: 2px 0 0;
  font-size: .85rem;
  color: var(--text-muted);
}
.wa-feature strong {
  font-size: .95rem;
}
.wa-roadmap {
  position: relative;
  padding-left: 24px;
}
.wa-roadmap::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e5e7eb;
}
.wa-roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.wa-roadmap-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 3px solid #fff;
  flex-shrink: 0;
  margin-left: -24px;
  margin-top: 3px;
  z-index: 1;
}
.wa-roadmap-item--current .wa-roadmap-dot {
  background: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, .2);
}
.wa-roadmap-item p {
  margin: 2px 0 0;
  font-size: .85rem;
  color: var(--text-muted);
}
.wa-roadmap-item strong {
  font-size: .9rem;
}

/* ── Listings Overview / Pie Chart ── */
.listings-overview {
  display: flex;
  align-items: center;
  gap: 32px;
  background: #fff;
  border-radius: 12px;
  padding: 24px 32px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(2,32,57,.08);
}
.chart-card {
  flex-shrink: 0;
}
.chart-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  flex: 1;
}
.chart-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}
.chart-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chart-stat-label {
  font-size: .85rem;
  color: var(--text-muted);
}
.chart-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-left: auto;
}
.chart-stat-total {
  width: 100%;
  border-top: 1px solid var(--grey-light);
  padding-top: 10px;
  margin-top: 4px;
}
.chart-stat-total .chart-stat-label {
  font-weight: 600;
  color: var(--navy);
}

@media (max-width: 768px) {
  .listings-overview {
    flex-direction: column;
    padding: 16px;
  }
  .chart-stats { gap: 8px 16px; }
  .chart-stat-item { min-width: 120px; }
}

/* ── Revenue Summary Bar ── */
.revenue-summary-bar {
  display: flex;
  gap: 24px;
  background: #fff;
  border-radius: 12px;
  padding: 18px 28px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(2,32,57,.08);
  flex-wrap: wrap;
}
.revenue-stat {
  flex: 1;
  min-width: 140px;
}
.revenue-stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
}
.revenue-stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}
.revenue-stat-value.revenue { color: var(--green); }
.revenue-stat-value.cost { color: #EF4444; }
.revenue-stat-value.net { color: var(--navy); }
.revenue-stat-value.text-red { color: #EF4444; }

@media (max-width: 600px) {
  .revenue-summary-bar { padding: 14px 16px; gap: 16px; }
  .revenue-stat { min-width: 100px; }
  .revenue-stat-value { font-size: 1rem; }
}

/* ── Role Badges ── */
.badge-role-seller {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #F59E0B;
}
.badge-role-both {
  background: #E0E7FF;
  color: #3730A3;
  border: 1px solid #818CF8;
}

/* ── Confirmed Badge ── */
.badge-confirmed {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #10B981;
}

/* ── Document List ── */
.doc-list {
  padding: 0;
}
.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.doc-item:last-child { border-bottom: none; }
.doc-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.doc-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.doc-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-meta {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.doc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ============================================================
   Command Center — Kanban, Service Status, Pipeline
   ============================================================ */

/* Kanban board */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.kanban-column {
  min-width: 220px;
  flex: 1;
  background: var(--bg);
  border-radius: 10px;
  padding: 12px;
}
.kanban-column-header {
  font-size: .82rem;
  font-weight: 700;
  font-family: 'Montserrat', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-count {
  background: var(--border);
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.kanban-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.kanban-card-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}
.kanban-card-meta {
  font-size: .72rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.kanban-card-value {
  font-weight: 700;
  color: var(--green);
}

/* Stage chips */
.stage-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: capitalize;
}
.stage-lead        { background: var(--navy-light); color: var(--navy); }
.stage-contacted   { background: rgba(37,99,235,.12); color: #2563EB; }
.stage-demo        { background: rgba(139,92,246,.12); color: #8B5CF6; }
.stage-proposal    { background: var(--orange-light); color: var(--orange); }
.stage-negotiation { background: var(--gold-light); color: var(--gold-dark); }
.stage-won         { background: var(--green-light); color: var(--green); }
.stage-lost        { background: var(--red-light); color: var(--red); }

/* Service status chips */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.service-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .82rem;
}
.service-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.service-dot.green { background: var(--green); }
.service-dot.red   { background: var(--red); }
.service-dot.grey  { background: var(--text-light); }
.service-name {
  font-weight: 600;
  color: var(--navy);
  flex: 1;
}
.service-port {
  font-size: .72rem;
  color: var(--text-muted);
}

/* Detail rows (deal/project detail pages) */
.detail-rows {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 12px;
  font-size: .85rem;
}
.detail-label {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .04em;
  padding-top: 2px;
}
.detail-value {
  color: var(--navy);
}

/* Stage progression buttons */
.stage-progression {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.stage-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.stage-btn:hover {
  border-color: var(--gold);
  background: var(--gold-lighter);
}
.stage-btn.current {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold-dark);
}

/* Quick links grid */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  font-size: .85rem;
  transition: border-color .15s, box-shadow .15s;
}
.quick-link:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.quick-link-icon {
  font-size: 1.3rem;
}

/* Pipeline summary row */
.pipeline-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pipeline-summary .stat-mini {
  text-align: center;
}
.pipeline-summary .stat-mini-value {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--navy);
}
.pipeline-summary .stat-mini-label {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* Project cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.project-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.project-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.project-icon {
  font-size: 1.4rem;
}
.project-card-title {
  font-weight: 700;
  color: var(--navy);
  font-size: .92rem;
}
.project-card-desc {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.project-card-stats {
  display: flex;
  gap: 14px;
  font-size: .75rem;
  color: var(--text-muted);
}
.project-card-stats strong {
  color: var(--navy);
}

/* Command center widget cards */
.widget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .widget-grid { grid-template-columns: 1fr; }
  .kanban-board { flex-direction: column; }
  .kanban-column { min-width: unset; }
}

/* Bot cards */
.bot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.bot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: border-color .15s;
}
.bot-card:hover { border-color: var(--gold); }
.bot-card-title {
  font-weight: 700;
  font-size: .92rem;
  color: var(--navy);
  margin-bottom: 6px;
}

/* Mini icon button (delete, etc.) */
.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  transition: all .15s;
}
.btn-icon:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

/* Completed task styles */
.task-done { opacity: 0.5; }
.task-title.completed { text-decoration: line-through; }
