/* ============================================================
   Lucere Ventures — Management Portal Styles
   ============================================================ */

:root {
  --brand:      #7A6248;
  --brand-dark: #5C4A36;
  --bg:         #F8F6F2;
  --surface:    #FFFFFF;
  --border:     #E2DDD8;
  --text:       #1A1714;
  --text-muted: #6B6560;
  --danger:     #C0392B;
  --success:    #27AE60;
  --warning:    #E67E22;
  --info:       #2980B9;

  --sidebar-w:  240px;
  --topbar-h:   56px;
  --radius:     6px;
  --shadow:     0 1px 3px rgba(0,0,0,.10);
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

/* ── APP SHELL ─────────────────────────────────────────────── */

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

/* ── SIDEBAR ───────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-brand .brand-name {
  display: block;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
}
.sidebar-brand .brand-tag {
  display: block;
  font-size: 11px;
  opacity: .65;
  margin-top: 2px;
}

.nav-list {
  list-style: none;
  padding: 8px 0 24px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .5;
  padding: 16px 16px 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  color: rgba(255,255,255,.80);
  text-decoration: none;
  border-radius: 0;
  transition: background .12s, color .12s;
  font-size: 13.5px;
}
.nav-link:hover        { background: rgba(255,255,255,.10); color: #fff; }
.nav-link.active       { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.nav-icon              { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

/* ── MAIN WRAP ─────────────────────────────────────────────── */

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── TOPBAR ────────────────────────────────────────────────── */

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.property-switcher {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

/* ── PAGE CONTENT ──────────────────────────────────────────── */

.page-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
}

.loading-spinner {
  color: var(--text-muted);
  padding: 48px;
  text-align: center;
}

/* ── PAGE HEADER ───────────────────────────────────────────── */

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

/* ── CARDS ─────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 18px; }

/* ── STAT CARDS (dashboard) ────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase;
              letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--brand); }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── TABLES ────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

/* ── BADGES ────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-active    { background: #D4EDDA; color: #155724; }
.badge-expired   { background: #F8D7DA; color: #721C24; }
.badge-open      { background: #FFF3CD; color: #856404; }
.badge-resolved  { background: #D4EDDA; color: #155724; }
.badge-closed    { background: #E2E3E5; color: #383D41; }
.badge-urgent    { background: #F8D7DA; color: #721C24; }
.badge-normal    { background: #E2E3E5; color: #383D41; }
.badge-low       { background: #D4EDDA; color: #155724; }

/* ── FORMS ─────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.form-group textarea { min-height: 80px; resize: vertical; }

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

/* ── BUTTONS ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .85; }

.btn-primary   { background: var(--brand);   color: #fff; }
.btn-danger    { background: var(--danger);  color: #fff; }
.btn-outline   { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-sm        { padding: 5px 10px; font-size: 12px; }

/* ── MODAL ─────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.20);
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
}
.modal-close {
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: var(--text-muted); line-height: 1;
}
.modal-body   { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border);
                display: flex; gap: 10px; justify-content: flex-end; }

/* ── EMPTY STATE ───────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3   { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.empty-state p    { font-size: 13px; }

/* ── RESPONSIVE ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-w));
    z-index: 50;
    transition: left .2s;
  }
  .sidebar.open { left: 0; }
  .sidebar-toggle { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
}
