:root {
  --surface-1: #fcfcfb;
  --page-plane: #f5f6f8;
  --sidebar-bg: #1c2333;
  --sidebar-hover: #262f45;
  --sidebar-active: #2a3550;
  --sidebar-ink: #e6e8ec;
  --sidebar-muted: #9aa4b8;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --gridline: #eef0f3;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-hover: #1c5cab;
  --status-good: #0ca30c;
  --status-warning: #c98500;
  --status-critical: #d03b3b;
  --status-critical-tint: rgba(208, 59, 59, 0.06);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-1: #232323;
    --page-plane: #0d0d0d;
    --sidebar-bg: #161b28;
    --sidebar-hover: #212a3d;
    --sidebar-active: #263252;
    --sidebar-ink: #e6e8ec;
    --sidebar-muted: #8b93a8;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --muted: #8b8a84;
    --gridline: #2c2c2a;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-critical: #e66767;
    --status-critical-tint: rgba(230, 103, 103, 0.10);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--page-plane);
  color: var(--text-primary);
}

.layout { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------------------- */
/* Sidebar                                                                 */
/* ---------------------------------------------------------------------- */
.sidebar {
  width: 230px;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 16px 16px 20px;
  container-type: inline-size;
}
.sidebar h1 {
  font-family: 'Times New Roman', Times, serif;
  font-size: clamp(13px, 9cqw, 18px);
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  margin: 0 0 2px;
}
.wordmark-en { font-size: 1em; font-weight: 700; }
.wordmark-dot { font-size: 0.87em; color: var(--sidebar-muted); }
.wordmark-hi { font-size: 0.767em; }
.sidebar .subtitle { margin: 0; font-size: 12px; color: var(--sidebar-muted); }
.btn-help {
  color: var(--sidebar-muted);
  border: 1px solid var(--sidebar-muted);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.btn-help:hover { color: #fff; border-color: #fff; background: transparent; }

.nav-scroll { flex: 1; overflow-y: auto; padding-bottom: 16px; }

.nav-section { margin-top: 14px; }
.nav-section:first-child { margin-top: 0; }
.nav-section-title {
  padding: 0 20px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-muted);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar li:hover { background: var(--sidebar-hover); }
.sidebar li.active { background: var(--sidebar-active); border-left-color: var(--accent); color: #fff; }
.nav-icon {
  flex: 0 0 auto;
  font-size: 13px;
  width: 18px;
  text-align: center;
  opacity: 0.85;
  filter: grayscale(0.25);
}
.sidebar li.active .nav-icon { opacity: 1; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
}

.menu-toggle { display: none; font-size: 18px; }

/* ---------------------------------------------------------------------- */
/* Content                                                                 */
/* ---------------------------------------------------------------------- */
.content { flex: 1; padding: 24px 32px; min-width: 0; }
.content-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 10px; }
.content-header h2 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-help { color: var(--muted); font-size: 15px; }

.last-updated { font-size: 12px; color: var(--muted); white-space: nowrap; }

.view-help-banner {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.cards { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  flex: 1 1 160px;
  min-width: 150px;
  box-shadow: var(--shadow);
}
.card h4 { margin: 0 0 10px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.card-value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.card-value.good { color: var(--status-good); }
.card-value.warn { color: var(--status-warning); }
.card-value.bad { color: var(--status-critical); }
.card-sub { margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.4; }

.section-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-tagline { font-size: 12px; font-style: italic; color: var(--accent); white-space: nowrap; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.tag-complaint { background: var(--status-critical-tint); color: var(--status-critical); }
.tag-decision { background: rgba(42, 120, 214, 0.10); color: var(--accent); }
.tag-expense { background: rgba(201, 133, 0, 0.12); color: var(--status-warning); }
.tag-repair { background: rgba(12, 163, 12, 0.10); color: var(--status-good); }
.tag-compliance { background: rgba(201, 133, 0, 0.12); color: var(--status-warning); }
.tag-meeting { background: var(--gridline); color: var(--text-secondary); }
.tag-default { background: var(--gridline); color: var(--text-secondary); }

.tag-status-good { background: rgba(12, 163, 12, 0.10); color: var(--status-good); }
.tag-status-warn { background: var(--status-critical-tint); color: var(--status-critical); }
.tag-status-progress { background: rgba(201, 133, 0, 0.12); color: var(--status-warning); }
.tag-status-neutral { background: var(--gridline); color: var(--text-secondary); }
.tag-utility { background: rgba(42, 120, 214, 0.10); color: var(--accent); }
.tag-staff { background: var(--gridline); color: var(--text-secondary); }

.table-wrap { overflow-x: auto; border-radius: 8px; box-shadow: var(--shadow); margin-bottom: 24px; }
.data-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  background: var(--surface-1);
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gridline);
  font-size: 14px;
  white-space: nowrap;
}
.data-table th { background: var(--page-plane); font-weight: 600; text-transform: capitalize; color: var(--text-secondary); }
.data-table tr:last-child td { border-bottom: none; }
.data-table td.cell-wrap { white-space: normal; max-width: 420px; min-width: 220px; }

.row-actions { display: flex; gap: 4px; }

.empty, .loading { color: var(--muted); font-size: 14px; }
.error { color: var(--status-critical); font-size: 14px; }

.skeleton-row { display: flex; gap: 12px; padding: 12px 14px; background: var(--surface-1); border-radius: 8px; margin-bottom: 8px; box-shadow: var(--shadow); }
.skeleton-bar {
  height: 14px;
  border-radius: 4px;
  flex: 1;
  background: linear-gradient(90deg, var(--gridline) 25%, var(--border) 50%, var(--gridline) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar label { font-size: 14px; }
.toolbar select { margin-left: 6px; padding: 6px 8px; }

.payment-table th.sortable { cursor: pointer; user-select: none; }
.payment-table th.sortable:hover { color: var(--text-primary); }
.payment-table tr.row-overdue { background: var(--status-critical-tint); }
.payment-table .group-header-row td {
  background: var(--page-plane);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding-top: 12px;
}
.payment-table .subtotal-row td {
  background: var(--page-plane);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
.payment-table .total-row td {
  background: var(--surface-1);
  font-weight: 700;
  border-top: 2px solid var(--border);
  border-bottom: none;
}
.amount-bad { color: var(--status-critical); font-weight: 600; }
.amount-good { color: var(--status-good); }
.muted-inline { color: var(--muted); font-size: 12px; }

.alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
}
.alert-warning {
  background: var(--status-critical-tint);
  border: 1px solid var(--status-warning);
  border-left: 3px solid var(--status-warning);
  color: var(--text-primary);
}
.modal-help {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 14px;
}

.btn-primary, .btn-secondary {
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--gridline); color: var(--text-primary); }
.btn-secondary:hover { filter: brightness(0.95); }
.btn-danger { background: #dc2626; color: #fff; border: none; border-radius: 6px; padding: 9px 16px; font-size: 14px; cursor: pointer; white-space: nowrap; font-weight: 600; }
.btn-danger:hover { background: #b91c1c; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.confirm-details { background: var(--page-plane); border: 1px solid var(--border); padding: 10px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; margin-top: 10px; color: var(--text-primary); }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--text-primary);
  min-width: 30px;
  min-height: 30px;
}
.btn-icon:hover { background: var(--gridline); }

/* ---------------------------------------------------------------------- */
/* Modals                                                                  */
/* ---------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  background: var(--surface-1);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 20px 24px;
  width: 420px;
  max-width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-header h3 { margin: 0; }
.modal-error { color: var(--status-critical); font-size: 13px; margin-top: 10px; }
.help-body p { font-size: 14px; line-height: 1.5; color: var(--text-secondary); }

#modal-form, .inline-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#modal-form label, .inline-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}
#modal-form input, #modal-form select, #modal-form textarea,
.inline-form input, .inline-form select, .inline-form textarea {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--page-plane);
  color: var(--text-primary);
}
#modal-form textarea, .inline-form textarea { min-height: 70px; resize: vertical; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }

.thread-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.thread-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--status-warning);
  color: #fff;
}
.thread-status-open, .thread-status-in-progress { background: var(--status-warning); }
.thread-status-on-hold { background: var(--muted); }
.thread-status-resolved { background: var(--status-good); }
.thread-notes { font-size: 13px; color: var(--text-secondary); margin: 8px 0 0; }
.timeline-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-item {
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 10px;
  font-size: 13px;
}
.timeline-item.timeline-job { border-left-color: var(--status-good); }
.timeline-date { font-variant-numeric: tabular-nums; color: var(--text-secondary); margin-right: 8px; }
.timeline-badge {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  margin-right: 6px;
}
.timeline-detail { color: var(--text-secondary); margin-top: 2px; }

.inline-form { max-width: 480px; background: var(--surface-1); padding: 20px; border-radius: 8px; box-shadow: var(--shadow); }

/* Inline source citation — under a table row, not its own column */
.cite {
  font-style: italic;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  white-space: normal;
}

/* Reconciliation chain: opening -> +receipts -> -expenses -> =closing */
.chain { display: flex; align-items: stretch; gap: 0; margin-bottom: 24px; flex-wrap: wrap; }
.chain-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  flex: 1 1 150px;
  min-width: 140px;
}
.chain-box h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.chain-box.chain-closing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.chain-op {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 14px;
  flex: 0 0 auto;
}

/* Compliance timeline: colored dot per item, sorted by urgency */
.compliance-timeline { list-style: none; margin: 0 0 24px; padding: 0; }
.compliance-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--gridline);
  background: var(--surface-1);
}
.compliance-row:first-child { border-radius: 8px 8px 0 0; }
.compliance-row:last-child { border-bottom: none; border-radius: 0 0 8px 8px; }
.compliance-timeline { box-shadow: var(--shadow); border-radius: 8px; overflow: hidden; }
.compliance-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.compliance-dot.dot-good { background: var(--status-good); }
.compliance-dot.dot-warning { background: var(--status-warning); }
.compliance-dot.dot-critical { background: var(--status-critical); }
.compliance-main { flex: 1; min-width: 0; }
.compliance-name { font-size: 14px; font-weight: 600; }
.compliance-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.compliance-days { font-size: 12px; font-weight: 600; white-space: nowrap; flex: 0 0 auto; padding-top: 2px; }
.compliance-days.tone-good { color: var(--status-good); }
.compliance-days.tone-warning { color: var(--status-warning); }
.compliance-days.tone-critical { color: var(--status-critical); }

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */
@media (max-width: 900px) {
  .menu-toggle { display: inline-block; }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 95;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 260px;
    max-width: 82vw;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }

  .content { padding: 16px; }
  .content-header h2 { font-size: 18px; }
  .cards { gap: 10px; }
  .card { flex: 1 1 calc(50% - 10px); min-width: 130px; padding: 12px 14px; }
  .card-value { font-size: 20px; }
}

@media (max-width: 480px) {
  .card { flex: 1 1 100%; }
  .header-right { width: 100%; justify-content: space-between; }
}

/* ---------------------------------------------------------------------- */
/* Authentication & Security Styles                                       */
/* ---------------------------------------------------------------------- */
.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  position: relative;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-logo span {
  color: var(--accent);
  margin: 0 4px;
}

.auth-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 4px 0;
  color: var(--text-primary);
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.auth-form .form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2, #1e293b);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 40px;
}

.toggle-password-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
  cursor: pointer;
}

.auth-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* User Header Pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name-text {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

.user-role-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 700;
}

.btn-logout {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Bank Account Masking & Reveal */
.bank-acc-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bank-acc-number {
  font-family: monospace;
  letter-spacing: 0.05em;
  font-size: 13px;
}

.btn-reveal-bank {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-reveal-bank:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.reveal-timer {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

/* Stack plain resource tables (events, vendor-jobs, action-items, etc.) into
   cards on narrow screens instead of forcing horizontal scroll. The dense
   payment/reconciliation grid keeps its table layout — a card view doesn't
   suit grouped/subtotal rows, and it already scrolls inside .table-wrap. */
@media (max-width: 640px) {
  .data-table:not(.payment-table) { min-width: 0; }
  .data-table:not(.payment-table) thead { display: none; }
  .data-table:not(.payment-table),
  .data-table:not(.payment-table) tbody,
  .data-table:not(.payment-table) tr,
  .data-table:not(.payment-table) td {
    display: block;
    width: 100%;
  }
  .data-table:not(.payment-table) tr {
    background: var(--surface-1);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 10px 14px;
    margin-bottom: 10px;
  }
  .data-table:not(.payment-table) td {
    border-bottom: none;
    padding: 4px 0;
    white-space: normal;
    max-width: none;
    min-width: 0;
  }
  .data-table:not(.payment-table) td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--text-secondary);
    margin-bottom: 2px;
  }
  .data-table:not(.payment-table) td.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gridline);
    margin-top: 6px;
  }
}

/* ---------------------------------------------------------------------- */
/* Flat Payments — Board view (screenshot-friendly paid/unpaid blocks)     */
/* ---------------------------------------------------------------------- */
.board-toggle { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.board-toggle button { border-radius: 0; border: none; border-right: 1px solid var(--border); }
.board-toggle button:last-child { border-right: none; }
.board-toggle button.active { background: var(--accent); color: #fff; }

.board-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 20px; font-size: 13px; color: var(--text-secondary); }
.board-legend span { display: inline-flex; align-items: center; gap: 6px; }
.board-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------------------------------------------------------------------- */
/* Vendor Jobs — Kanban board view                                         */
/* ---------------------------------------------------------------------- */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { flex: 1 1 240px; min-width: 240px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.kanban-column-header { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.kanban-count { background: var(--border); color: var(--muted); border-radius: 10px; padding: 1px 8px; font-size: 11px; }
.kanban-column-body { display: flex; flex-direction: column; gap: 10px; }
.board-card { background: var(--page-plane); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow); }
.board-card-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.board-card-sub { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.board-card-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.board-card-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 6px; }
.board-legend i.paid { background: var(--status-good); }
.board-legend i.unpaid { background: var(--status-critical); }
.board-legend i.notbilled { background: var(--muted); }

.payment-board-group { margin-bottom: 28px; }
.payment-board-group h3 { margin: 0 0 4px; font-size: 15px; }
.payment-board-sub { margin: 0 0 12px; font-size: 12px; color: var(--muted); }

/* One row per floor, top floor first — grid-template-columns is set inline
   per group so the label column + block count line up like a lotto card. */
.board-floor-row {
  display: grid;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}
.board-floor-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.board-block {
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow);
}
.board-block .flat-no { font-size: 18px; font-weight: 700; line-height: 1.2; }
.board-block .flat-amt { font-size: 11px; opacity: 0.92; margin-top: 2px; }
.board-block.status-paid { background: var(--status-good); }
.board-block.status-unpaid { background: var(--status-critical); }
.board-block.status-notbilled { background: var(--muted); }

/* Screenshot Mode — strip chrome down to just the board */
.present-title { display: none; }
#present-exit-btn { display: none; position: fixed; top: 12px; right: 12px; z-index: 50; }

body.present-mode .sidebar,
body.present-mode .content-header,
body.present-mode .toolbar { display: none; }
body.present-mode .content { padding: 20px; }
body.present-mode .present-title { display: block; margin-bottom: 16px; }
body.present-mode #present-exit-btn { display: inline-flex; }

@media (max-width: 480px) {
  .board-floor-label { font-size: 11px; }
  .board-block .flat-no { font-size: 15px; }
  .board-block .flat-amt { font-size: 10px; }
}
