/* ── Tenant Portal — tenant.lucereventures.com ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #1e3a5f;
  --navy-dk: #15294a;
  --accent:  #2563eb;
  --surface: #f8fafc;
  --border:  #e2e8f0;
  --text:    #1e293b;
  --muted:   #64748b;
  --green:   #15803d;
  --red:     #dc2626;
  --amber:   #d97706;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
}

/* ── App shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--navy);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-brand {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.brand-name { display: block; font-weight: 700; font-size: 1rem; }
.brand-tag  { display: block; font-size: 0.7rem; opacity: 0.7; margin-top: 0.1rem; }
.tenant-info {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  opacity: 0.85;
}
.tenant-info strong { display: block; font-size: 0.9rem; opacity: 1; }
.tenant-info span   { font-size: 0.75rem; opacity: 0.7; }

.nav-list { list-style: none; padding: 0.5rem 0; flex: 1; }
.nav-list li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s;
}
.nav-list li a:hover,
.nav-list li a.active {
  background: rgba(255,255,255,0.12);
  color: white;
}
.nav-icon { font-size: 1rem; }

/* ── Main content ── */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  height: 52px;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-weight: 600; font-size: 1rem; flex: 1; }

.page-content {
  padding: 1.5rem;
  flex: 1;
}

/* ── Cards ── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.card h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.75rem; }

/* ── Stats row ── */
.stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.stat-card {
  flex: 1;
  min-width: 150px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.stat-card .label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }
.stat-card.balance-due .value { color: var(--red); }
.stat-card.balance-ok  .value { color: var(--green); }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
}
td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }

/* ── Direction badges ── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-charge  { background: #fee2e2; color: var(--red); }
.badge-payment { background: #dcfce7; color: var(--green); }

/* ── Document actions ── */
.doc-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: inline-block;
}
.doc-btn:hover { background: var(--surface); }

/* ── Empty / error states ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.error-banner {
  background: #fee2e2;
  color: var(--red);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* ── Loading ── */
.loading { color: var(--muted); padding: 2rem; text-align: center; }

/* ── Responsive: hide sidebar on narrow screens ── */
@media (max-width: 640px) {
  .sidebar { display: none; }
}
