/* ============================================================
   Dream Big Property Management — Company KPI Dashboard
   dashboard.css  — Light Theme
   ============================================================ */

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

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

:root {
  --bg:          #F2F4F7;
  --card:        #FFFFFF;
  --border:      #E1E5EB;
  --border-2:    #CBD2DA;
  --text:        #1A1D23;
  --text-2:      #5B5C5E;
  --muted:       #8A9099;
  --orange:      #FF7417;
  --orange-bg:   #FFF3EB;
  --orange-dim:  #FFD9B8;
  --green:       #16A34A;
  --green-bg:    #DCFCE7;
  --amber:       #D97706;
  --amber-bg:    #FEF3C7;
  --red:         #DC2626;
  --red-bg:      #FEE2E2;
  --blue:        #2563EB;
  --blue-bg:     #EFF6FF;
  --font:        "Montserrat", "DM Sans", system-ui, -apple-system, sans-serif;
  --radius:      8px;
  --shadow:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08);
}

html {
  font-size: 15px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 48px;
}

/* ── HEADER ─────────────────────────────────────────────── */
#header {
  background: #FFFFFF;
  border-bottom: 1px solid #E1E5EB;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
#header-logo { height: 38px; }
.header-right { display: flex; align-items: center; gap: 12px; }
#sync-ts {
  font-size: 12px;
  color: #8A9099;
  white-space: nowrap;
  font-family: var(--font);
}
#btn-refresh {
  background: #FF7417;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
  white-space: nowrap;
}
#btn-refresh:hover { background: #e5650f; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { display: inline-block; }
#btn-refresh.loading .spin-icon { animation: spin .7s linear infinite; }
.header-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #FF7417;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  font-family: var(--font);
  flex-shrink: 0;
}

/* ── MAIN LAYOUT ────────────────────────────────────────── */
.main { max-width: 1440px; margin: 0 auto; padding: 20px 20px 0; }

/* ── OFFLINE BANNER ─────────────────────────────────────── */
#offline-banner {
  display: none;
  background: #FEE2E2;
  border: 1px solid #DC2626;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #DC2626;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font);
}

/* ── SECTION LABEL ─────────────────────────────────────── */
.section-label {
  font-size: 15px;
  font-weight: 700;
  color: #1A1D23;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #FF7417;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
}

/* ── CARD ───────────────────────────────────────────────── */
.card {
  background: #FFFFFF;
  border: 1px solid #E1E5EB;
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

/* ── BRIEFING ───────────────────────────────────────────── */
.briefing-card {
  border-left: 4px solid #FF7417;
  border-color: #FFD9B8;
  background: #FFF3EB;
}
.briefing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.briefing-title {
  font-size: 13px;
  font-weight: 700;
  color: #FF7417;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
}
.briefing-badge { background: #FF7417; color: #fff; }
.chevron {
  color: #8A9099;
  font-size: 12px;
  transition: transform .2s;
  display: inline-block;
}
.chevron.open { transform: rotate(180deg); }
#briefing-body {
  display: none;
  margin-top: 12px;
  border-top: 1px solid #FFD9B8;
  padding-top: 14px;
}
#briefing-body.open { display: block; }

.briefing-placeholder {
  font-size: 13px;
  color: #8A9099;
}
.briefing-headline {
  font-size: 14px;
  font-weight: 600;
  color: #1A1D23;
  line-height: 1.5;
  margin-bottom: 10px;
  font-family: var(--font);
}
.briefing-bullet {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: #1A1D23;
  padding: 3px 0;
}
.briefing-dot {
  color: #FF7417;
  font-size: 16px;
  line-height: 1.3;
  flex-shrink: 0;
}
.briefing-num {
  color: #FF7417;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.briefing-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 270px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 2px;
}
.briefing-items::-webkit-scrollbar { width: 4px; }
.briefing-items::-webkit-scrollbar-track { background: transparent; }
.briefing-items::-webkit-scrollbar-thumb { background: #FFD9B8; border-radius: 2px; }
.briefing-item-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .2s, background .15s, border-color .15s;
  user-select: none;
}
.briefing-item-card:hover { border-color: #FFD9B8; background: #FFFAF7; }
.briefing-item-card.done { opacity: 0.38; }
.briefing-check-box {
  width: 16px;
  min-width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: transparent;
  transition: all .15s;
}
.briefing-check-box.done {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.briefing-item-content { flex: 1; min-width: 0; }
.briefing-item-header {
  font-size: 12px;
  font-weight: 700;
  color: #FF7417;
  line-height: 1.4;
  margin-bottom: 1px;
}
.briefing-item-card.done .briefing-item-header {
  text-decoration: line-through;
  color: #9ca3af;
}
.briefing-item-body {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.5;
}
.briefing-item-card.done .briefing-item-body { color: #9ca3af; }
.principle-callout {
  margin-top: 14px;
  padding: 14px 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid #F59E0B;
  border-radius: 8px;
}
.principle-callout-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: #B45309;
  margin-bottom: 3px;
}
.principle-callout-title {
  font-size: 14px;
  font-weight: 700;
  color: #92400E;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.principle-callout-body {
  font-size: 13px;
  color: #78350F;
  line-height: 1.65;
}

/* ── KPI SCORECARD GRID ─────────────────────────────────── */
#kpi-grid, .kpi-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
#qb-kpi-grid,
#fin-kpi-row {
  flex: 1 1 100%;
}
#qb-kpi-grid .kpi-value,
#fin-kpi-row .kpi-value {
  font-size: clamp(18px, 1.8vw, 28px);
}
.kpi-card {
  flex: 0 0 175px;
  background: #FFFFFF;
  border: 1px solid #E1E5EB;
  border-top: 3px solid #E1E5EB;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); border-color: #CBD2DA; }

/* Remove pseudo-element — use top border directly */
.kpi-card::before { display: none; }

.kpi-card.green  { border-top: 3px solid #16A34A; }
.kpi-card.yellow { border-top: 3px solid #D97706; }
.kpi-card.red    { border-top: 3px solid #DC2626; }
.kpi-card.gray   { border-top: 3px solid #E1E5EB; }
.kpi-card.none   { border-top: 3px solid #E1E5EB; }

.kpi-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #8A9099;
  min-height: 2.8em;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  font-family: var(--font);
}
.kpi-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: #1A1D23;
  font-variant-numeric: tabular-nums;
  font-family: var(--font);
}
/* Value is always dark — override any color classes */
.kpi-card.green  .kpi-value,
.kpi-card.yellow .kpi-value,
.kpi-card.red    .kpi-value,
.kpi-card.gray   .kpi-value { color: #1A1D23; }

.kpi-value .kpi-unit {
  font-size: 0.5em;
  font-weight: 600;
  vertical-align: middle;
  letter-spacing: 0;
}
.kpi-target { font-size: 11px; color: #8A9099; font-family: var(--font); }
.kpi-sub    { font-size: 11px; color: #8A9099; font-family: var(--font); }
.kpi-status {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
  font-family: var(--font);
}
.kpi-card.green  .kpi-status { color: #16A34A; }
.kpi-card.yellow .kpi-status { color: #D97706; }
.kpi-card.red    .kpi-status { color: #DC2626; }
.kpi-card.gray   .kpi-status { color: #8A9099; }

/* ── ZERO GOALS ─────────────────────────────────────────── */
#zero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.zero-card {
  background: #FFFFFF;
  border: 1px solid #E1E5EB;
  border-radius: 8px;
  padding: 20px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color .15s;
  position: relative;
}
.zero-card:hover { border-color: #FF7417; }
.zero-card.danger {
  border-color: rgba(220,38,38,.4);
  background: rgba(220,38,38,.03);
}
.zero-card.clear {
  border-color: rgba(22,163,74,.4);
  background: rgba(22,163,74,.03);
}
.zero-name {
  font-size: 11px;
  font-weight: 700;
  color: #8A9099;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-family: var(--font);
}
.zero-count {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--font);
}
.zero-card.danger .zero-count { color: #DC2626; }
.zero-card.clear  .zero-count { color: #16A34A; }
.zero-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 4px;
  width: fit-content;
}
.zero-card.danger .zero-badge {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid rgba(220,38,38,.3);
}
.zero-card.clear .zero-badge {
  background: #DCFCE7;
  color: #16A34A;
  border: 1px solid rgba(22,163,74,.3);
}
.zero-sub { font-size: 11px; color: #8A9099; margin-top: 2px; font-family: var(--font); }
.zero-sub.loss { color: #DC2626; font-weight: 600; }
.zero-chevron { position: absolute; top: 16px; right: 14px; color: #8A9099; font-size: 16px; }

/* ── TABLES ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #8A9099;
  padding: 8px 10px;
  border-bottom: 1px solid #E1E5EB;
  white-space: nowrap;
  font-family: var(--font);
}
td {
  padding: 9px 10px;
  border-bottom: 1px solid #E1E5EB;
  vertical-align: middle;
  font-family: var(--font);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F7F8FA; }
tr:hover td { background: #F7F8FA; }
.tr-overdue td  { background: #FFFBEB; }
.tr-critical td { background: #FFF5F5; }
.tbl-link { color: #FF7417; font-weight: 600; cursor: pointer; text-decoration: underline; }
.tbl-link:hover { color: #e5650f; }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  font-family: var(--font);
}
.badge-red    { background: #FEE2E2; color: #DC2626; border: 1px solid rgba(220,38,38,.3); }
.badge-yellow { background: #FEF3C7; color: #D97706; border: 1px solid rgba(217,119,6,.3); }
.badge-green  { background: #DCFCE7; color: #16A34A; border: 1px solid rgba(22,163,74,.3); }
.badge-blue   { background: #EFF6FF; color: #2563EB; border: 1px solid rgba(37,99,235,.3); }
.badge-gray   { background: #F3F4F6; color: #6B7280; border: 1px solid rgba(107,114,128,.2); }

/* ── RENEWAL DROPDOWN ───────────────────────────────────── */
.renewal-select {
  background: #F7F8FA;
  color: #1A1D23;
  border: 1px solid #E1E5EB;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
  width: 100%;
  max-width: 160px;
  font-family: var(--font);
}
.renewal-select:focus { border-color: #FF7417; }
.renewal-select option { background: #FFFFFF; color: #1A1D23; }

/* ── ALERTS ─────────────────────────────────────────────── */
.alerts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.alerts-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; font-family: var(--font); }
.alert-count-badge {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid rgba(220,38,38,.3);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  font-family: var(--font);
}
#alerts-list { display: none; margin-top: 12px; border-top: 1px solid #E1E5EB; padding-top: 4px; }
#alerts-list.open { display: block; }
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #E1E5EB;
}
.alert-item:last-child { border-bottom: none; }
.alert-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.alert-dot.CRITICAL { background: #DC2626; box-shadow: 0 0 5px rgba(220,38,38,.5); }
.alert-dot.WARN     { background: #D97706; }
.alert-msg { flex: 1; font-size: 12px; line-height: 1.5; font-family: var(--font); }
.alert-sev { font-size: 10px; font-weight: 800; margin-bottom: 2px; font-family: var(--font); }
.alert-sev.CRITICAL { color: #DC2626; }
.alert-sev.WARN     { color: #D97706; }
.alert-time { font-size: 11px; color: #8A9099; margin-top: 2px; }
.alert-clear {
  background: none;
  border: 1px solid #E1E5EB;
  color: #8A9099;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
  font-family: var(--font);
}
.alert-clear:hover { border-color: #DC2626; color: #DC2626; }

/* ── VACANCY COST CLOCK CARDS ────────────────────────────── */
#vacancy-clock-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.vac-card {
  width: 190px;
  flex: 0 0 190px;
  background: #FFFFFF;
  border: 1px solid #E1E5EB;
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.vac-address { font-size: 13px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; color: #1A1D23; font-family: var(--font); }
.vac-property { font-size: 11px; color: #8A9099; margin-bottom: 10px; font-family: var(--font); }
.vac-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; font-family: var(--font); }
.vac-row .lbl { color: #8A9099; }
.vac-loss { font-size: 20px; font-weight: 800; color: #DC2626; margin-top: 8px; font-family: var(--font); }

/* ── TOGGLE BUTTON ───────────────────────────────────────── */
.toggle-btn {
  background: none;
  border: 1px solid #E1E5EB;
  color: #8A9099;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-family: var(--font);
}
.toggle-btn:hover { border-color: #FF7417; color: #FF7417; }

/* ── EMPTY / LOADING ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 28px;
  color: #8A9099;
  font-size: 13px;
  font-family: var(--font);
}

/* ── DRILL-DOWN DRAWER ───────────────────────────────────── */
#drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
}
#drawer-overlay.open { display: block; }

#drill-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 520px;
  max-width: 100vw;
  background: #FFFFFF;
  border-left: 1px solid #E1E5EB;
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
#drill-drawer.open { transform: translateX(0); }

#drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #E1E5EB;
  flex-shrink: 0;
  background: #FFFFFF;
  gap: 10px;
}
#drawer-title { font-size: 15px; font-weight: 700; color: #1A1D23; font-family: var(--font); flex: 1; }
#drawer-back {
  background: none;
  border: 1px solid #E1E5EB;
  color: #4B5563;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all .15s;
  white-space: nowrap;
}
#drawer-back:hover { border-color: #6366F1; color: #6366F1; }
#drawer-close {
  background: none;
  border: 1px solid #E1E5EB;
  color: #8A9099;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
#drawer-close:hover { border-color: #DC2626; color: #DC2626; }
#drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
#drawer-body table { min-width: 0; }
#drawer-body th, #drawer-body td { padding: 8px 8px; }
.fin-detail-table { width:100%; border-collapse:collapse; font-size:13px; min-width:0; }
.fin-detail-table td { padding:3px 0; border-bottom:none; background:none !important; }
.fin-detail-table tr.fin-total td { padding:5px 0; border-top:1px solid #e5e7eb; }
.drawer-loading { text-align: center; padding: 40px; color: #8A9099; font-size: 13px; font-family: var(--font); }
.drawer-empty   { text-align: center; padding: 40px; color: #16A34A; font-size: 13px; font-family: var(--font); }
/* ── DRAWER STAT BOXES ───────────────────────────────────── */
.drawer-stats { display:flex; gap:10px; margin-bottom:20px; flex-wrap:wrap; }
.dstat {
  flex: 1;
  min-width: 130px;
  padding: 16px 14px 12px;
  background: var(--card-2, #F8F9FA);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 8px;
  overflow: hidden;
}
.dstat-val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono, monospace);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dstat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-family: var(--font);
}
.dstat.accent-red    { border-color: rgba(220,38,38,.35); background: rgba(220,38,38,.04); }
.dstat.accent-green  { border-color: rgba(22,163,74,.35);  background: rgba(22,163,74,.04); }
.dstat.accent-yellow { border-color: rgba(217,119,6,.35);  background: rgba(217,119,6,.04); }
.dstat-val.c-red     { color: #DC2626; }
.dstat-val.c-green   { color: #16A34A; }
.dstat-val.c-yellow  { color: #D97706; }
.drawer-note {
  font-size: 12px;
  font-family: var(--font);
  color: #92400e;
  background: rgba(217,119,6,.08);
  border: 1px solid rgba(217,119,6,.3);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.6;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-sm {
  background: #FF7417;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: var(--font);
}
.btn-sm:hover { background: #e5650f; }
.btn-sm.disabled { background: #9ca3af; cursor: default; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #FFFFFF; border-radius: 10px;
  width: 520px; max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  overflow: hidden;
  border: 1px solid #E1E5EB;
}
.modal-header {
  background: #FF7417;
  color: #fff;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 700; font-family: var(--font); }
.modal-close {
  background: transparent; border: none; color: #fff;
  font-size: 20px; cursor: pointer; line-height: 1; opacity: .85;
}
.modal-close:hover { opacity: 1; }
.modal-body { padding: 20px; }
.modal-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid #E1E5EB; font-size: 13px;
  font-family: var(--font);
}
.modal-row:last-child { border-bottom: none; }
.modal-row .lbl { color: #8A9099; }
.modal-row .val { font-weight: 700; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1A1D23; color: #fff;
  padding: 12px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  transform: translateY(80px); opacity: 0;
  transition: transform .3s, opacity .3s;
  z-index: 300;
  font-family: var(--font);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── AT-RISK TABLE ───────────────────────────────────────── */
.risk-factors { font-size: 11px; color: #D97706; margin-top: 2px; font-family: var(--font); }

/* ── COMPACT LIST ────────────────────────────────────────── */
.compact-list {
  background: #FFFFFF;
  border: 1px solid #E1E5EB;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.compact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #E1E5EB;
  cursor: pointer;
  transition: background .1s;
  font-size: 13px;
  font-family: var(--font);
}
.compact-item:last-child { border-bottom: none; }
.compact-item:hover { background: #F7F8FA; }
.ci-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ci-dot.red    { background: #DC2626; }
.ci-dot.yellow { background: #D97706; }
.ci-dot.green  { background: #16A34A; }
.ci-dot.gray   { background: #8A9099; }
.ci-body { flex: 1; min-width: 0; }
.ci-name {
  font-weight: 600;
  color: #1A1D23;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font);
}
.ci-sub {
  font-size: 11px;
  color: #8A9099;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font);
}
.ci-val {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font);
}
.ci-arrow { color: #CBD2DA; font-size: 16px; flex-shrink: 0; margin-left: 2px; }
.compact-empty {
  padding: 20px;
  text-align: center;
  color: #16A34A;
  font-size: 13px;
  font-family: var(--font);
}

/* ── UTIL ────────────────────────────────────────────────── */
.text-red    { color: #DC2626 !important; }
.text-yellow { color: #D97706 !important; }
.text-green  { color: #16A34A !important; }
.text-muted  { color: #8A9099; }
.font-mono   { font-family: "SF Mono", "Fira Code", Consolas, monospace; font-size: 12px; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── LEASE EXPIRATION CALENDAR ──────────────────────────── */
.expiry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  font-family: var(--font);
  border-bottom: 1px solid #F0F2F5;
}
.expiry-row:last-child { border-bottom: none; }
.expiry-month {
  width: 68px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}
.expiry-bar-wrap {
  flex: 1;
  background: #F0F2F5;
  border-radius: 4px;
  height: 16px;
  overflow: hidden;
}
.expiry-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .3s ease;
}
.expiry-bar.red    { background: #DC2626; }
.expiry-bar.yellow { background: #D97706; }
.expiry-bar.green  { background: #16A34A; }
.expiry-count {
  width: 24px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono, monospace);
  color: var(--text);
  flex-shrink: 0;
}

/* ── DETAIL CARD GRID ────────────────────────────────────── */
.detail-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 420px));
  gap: 14px;
  margin-bottom: 8px;
  justify-content: center;
}
.detail-card {
  background: #FFFFFF;
  border: 1px solid #E1E5EB;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.detail-card-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #E1E5EB;
  background: #FAFBFC;
  cursor: pointer;
  user-select: none;
}
.detail-card-hd:hover { background: #F3F5F7; }
.dch-title {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #4B5563;
  font-family: var(--font);
}
.dch-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.dch-badge.danger { background: #FEE2E2; color: #DC2626; border: 1px solid rgba(220,38,38,.2); }
.dch-badge.warn   { background: #FEF3C7; color: #D97706; border: 1px solid rgba(217,119,6,.2); }
.dch-badge.clear  { background: #DCFCE7; color: #16A34A; border: 1px solid rgba(22,163,74,.2); }
.dch-badge.gray   { background: #F3F4F6; color: #6B7280; border: 1px solid rgba(107,114,128,.2); }
.dch-arrow { color: #CBD2DA; font-size: 15px; flex-shrink: 0; }
.dc-body {
  flex: 1;
  overflow: hidden;
}
.dc-body .compact-list {
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.dc-body .compact-item { padding: 7px 14px; }
.dc-footer {
  padding: 6px 14px;
  border-top: 1px solid #E1E5EB;
  background: #FAFBFC;
}
.dc-see-all {
  font-size: 11px;
  font-weight: 700;
  color: #FF7417;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
  letter-spacing: .02em;
}
.dc-see-all:hover { color: #e5650f; }

/* Vacancy grid inside detail card */
.dc-vac-list { padding: 8px 14px; }
.dc-vac-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #F0F2F5;
  font-size: 12px;
  font-family: var(--font);
}
.dc-vac-row:last-child { border-bottom: none; }
.dc-vac-addr { font-weight: 600; color: #1A1D23; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-vac-days { color: #D97706; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; margin-left: 8px; }
.dc-vac-loss { color: #DC2626; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; margin-left: 8px; }

/* Compact-list inside detail card loses its standalone border/shadow */
.detail-card .compact-list { border: none; border-radius: 0; box-shadow: none; }
.detail-card .compact-item { border-bottom: 1px solid #F0F2F5; }
.detail-card .compact-item:last-child { border-bottom: none; }
.detail-card .compact-empty { padding: 14px 16px; }

/* Expiry rows inside detail card */
.detail-card .expiry-row { padding: 5px 14px; }

/* Alerts inside detail card — remove standalone card spacing */
.detail-card #alerts-list { display: block; margin-top: 0; border-top: none; padding-top: 0; max-height: 260px; overflow-y: auto; }
.detail-card .alert-item { padding: 8px 14px; }
.detail-card .alert-item:last-child { border-bottom: none; }

/* Vacancy grid inside detail card */
.detail-card #vacancy-clock-grid { flex-direction: column; justify-content: flex-start; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .main { padding: 12px 12px 0; }
  #header { padding: 0 16px; }
  #header-logo { height: 28px; }
  #kpi-grid { grid-template-columns: repeat(2, 1fr); }
  #zero-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 24px; }
  .zero-count { font-size: 36px; }
  #sync-ts { display: none; }
}

@media (max-width: 560px) {
  #drill-drawer { width: 100vw; }
}
