/* ─────────────────────────────────────────────────────────────────────
   Morroni Household — Hub stylesheet

   The visual language pulls from a "homestead at dusk" palette: a deep
   forest green for chrome, warm terracotta for accents, cream for the
   page surface. Type-pairing is a workhorse sans (Inter) for UI and a
   serif display (Fraunces) for headlines, to give the household app
   a personal, hand-built feel without veering twee.
   ───────────────────────────────────────────────────────────────────── */

:root {
  --hub-evergreen: #2D4A3E;
  --hub-evergreen-dark: #1F352C;
  --hub-evergreen-light: #3D5E50;
  --hub-amber: #D97A3F;
  --hub-amber-hover: #BF6731;
  --hub-amber-soft: #F2D5BE;
  --hub-cream: #F7F2E8;
  --hub-cream-soft: #FBF7EE;
  --hub-stone: #4A4641;
  --hub-mist: #8D8881;
  --hub-paper: #FFFDF8;
  --hub-line: #E5DFD2;
  --hub-success: #4A7A52;
  --hub-warn: #C68837;
  --hub-danger: #B0463A;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 15px;
  color: var(--hub-stone);
  background: var(--hub-cream);
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  color: var(--hub-evergreen-dark);
  letter-spacing: -0.01em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }

a { color: var(--hub-amber-hover); text-decoration: none; }
a:hover { color: var(--hub-amber); text-decoration: underline; }

code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* ── Navigation ─────────────────────────────────────────────────────── */
.hub-nav {
  background: linear-gradient(135deg,
    var(--hub-evergreen-dark), var(--hub-evergreen));
  color: white;
  padding: 0;
  position: sticky; top: 0; z-index: 1030;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08), 0 8px 24px -16px rgba(31,53,44,0.3);
}
.hub-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.hub-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700; font-size: 1.15rem;
  color: white; text-decoration: none;
  flex-shrink: 0;
}
.hub-brand:hover { color: white; text-decoration: none; }
.hub-brand img { width: 36px; height: 36px; }

.hub-nav-links {
  display: flex; gap: 4px;
  list-style: none; margin: 0; padding: 0;
  flex: 1; overflow-x: auto;
  scrollbar-width: none;
}
.hub-nav-links::-webkit-scrollbar { display: none; }
.hub-nav-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  color: rgba(255,255,255,0.78);
  font-size: 0.92rem; font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.hub-nav-links a:hover { background: rgba(255,255,255,0.08); color: white; text-decoration: none; }
.hub-nav-links a.active {
  background: var(--hub-amber);
  color: white;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15) inset;
}
.hub-nav-links i { font-size: 0.95rem; }

.hub-nav-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.hub-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  color: rgba(255,255,255,0.78);
  border-radius: 8px;
  transition: background 0.12s;
}
.hub-icon-btn:hover { background: rgba(255,255,255,0.08); color: white; text-decoration: none; }

.hub-user-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: rgba(255,255,255,0.08);
  border: 0;
  border-radius: 999px;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.12s;
}
.hub-user-btn:hover { background: rgba(255,255,255,0.14); }
.hub-avatar {
  width: 28px; height: 28px;
  background: var(--hub-amber);
  color: white; font-weight: 700;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.hub-main { padding: 32px 24px 64px; }
.hub-container {
  max-width: 1280px;
  margin: 0 auto;
}

.page-header {
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 16px;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--hub-line);
}
.page-header h1 { margin: 0; }
.page-header .subtitle { color: var(--hub-mist); margin-top: 4px; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.hub-card {
  background: var(--hub-paper);
  border: 1px solid var(--hub-line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 0 rgba(31,53,44,0.04);
}
.hub-card-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--hub-evergreen-dark);
  margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.hub-card-title .accent { color: var(--hub-amber); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.metric-card {
  background: linear-gradient(135deg, var(--hub-paper), var(--hub-cream-soft));
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--hub-amber);
  border-radius: 14px 0 0 14px;
}
.metric-card .metric-label {
  font-size: 0.8rem; font-weight: 500;
  color: var(--hub-mist);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.metric-card .metric-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2rem; font-weight: 700;
  color: var(--hub-evergreen-dark);
  line-height: 1.1;
}
.metric-card .metric-meta {
  font-size: 0.85rem;
  color: var(--hub-mist);
  margin-top: 4px;
}
.metric-card.green::before { background: var(--hub-success); }
.metric-card.amber::before { background: var(--hub-amber); }
.metric-card.evergreen::before { background: var(--hub-evergreen); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  border-radius: 8px;
  padding: 7px 16px;
  transition: all 0.12s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--hub-evergreen);
  border-color: var(--hub-evergreen);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--hub-evergreen-dark);
  border-color: var(--hub-evergreen-dark);
}
.btn-accent {
  background: var(--hub-amber);
  color: white;
  border-color: var(--hub-amber);
}
.btn-accent:hover, .btn-accent:focus {
  background: var(--hub-amber-hover);
  border-color: var(--hub-amber-hover);
  color: white;
}
.btn-outline-secondary {
  color: var(--hub-stone);
  border-color: var(--hub-line);
  background: var(--hub-paper);
}
.btn-outline-secondary:hover {
  background: var(--hub-cream);
  border-color: var(--hub-mist);
  color: var(--hub-stone);
}
.btn-ghost {
  background: transparent;
  color: var(--hub-stone);
  padding: 6px 12px;
}
.btn-ghost:hover { background: var(--hub-cream); }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-control, .form-select {
  border: 1px solid var(--hub-line);
  background: var(--hub-paper);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.95rem;
  color: var(--hub-stone);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--hub-amber);
  box-shadow: 0 0 0 3px rgba(217,122,63,0.15);
  outline: none;
}
.form-label {
  font-weight: 500; font-size: 0.88rem;
  color: var(--hub-evergreen-dark);
  margin-bottom: 4px;
}

/* ── Tables ─────────────────────────────────────────────────────────── */
.hub-table {
  width: 100%;
  background: var(--hub-paper);
  border: 1px solid var(--hub-line);
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.hub-table th {
  background: var(--hub-cream-soft);
  color: var(--hub-evergreen-dark);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--hub-line);
}
.hub-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hub-line);
  font-size: 0.94rem;
}
.hub-table tr:last-child td { border-bottom: 0; }
.hub-table tr:hover td { background: var(--hub-cream-soft); }
.hub-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.hub-table .pos { color: var(--hub-success); }
.hub-table .neg { color: var(--hub-danger); }

/* ── Auth pages ─────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(at 30% 20%, rgba(217,122,63,0.16), transparent 50%),
    radial-gradient(at 75% 70%, rgba(45,74,62,0.20), transparent 50%),
    linear-gradient(135deg, var(--hub-evergreen-dark), var(--hub-evergreen));
  padding: 48px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--hub-paper);
  border-radius: 16px;
  padding: 40px;
  box-shadow:
    0 20px 60px -20px rgba(0,0,0,0.4),
    0 1px 0 rgba(255,255,255,0.06) inset;
}
.auth-card .auth-mark {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  margin-bottom: 28px;
}
.auth-card .auth-mark img { width: 64px; height: 64px; margin-bottom: 12px; }
.auth-card .auth-mark .name {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--hub-evergreen-dark);
  letter-spacing: -0.01em;
}
.auth-card .auth-mark .tagline {
  font-size: 0.85rem;
  color: var(--hub-mist);
  margin-top: 2px;
}

/* ── Pills / badges ─────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill.pill-evergreen { background: rgba(45,74,62,0.10); color: var(--hub-evergreen-dark); }
.pill.pill-amber { background: rgba(217,122,63,0.16); color: var(--hub-amber-hover); }
.pill.pill-success { background: rgba(74,122,82,0.14); color: var(--hub-success); }
.pill.pill-warn { background: rgba(198,136,55,0.16); color: var(--hub-warn); }
.pill.pill-danger { background: rgba(176,70,58,0.14); color: var(--hub-danger); }
.pill.pill-mist { background: var(--hub-cream); color: var(--hub-mist); }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert {
  border: 0; border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.92rem;
}
.alert-success { background: rgba(74,122,82,0.10); color: var(--hub-success); }
.alert-info { background: rgba(45,74,62,0.10); color: var(--hub-evergreen-dark); }
.alert-warning { background: rgba(198,136,55,0.14); color: var(--hub-warn); }
.alert-danger { background: rgba(176,70,58,0.10); color: var(--hub-danger); }

/* ── Lists ──────────────────────────────────────────────────────────── */
.row-list { list-style: none; padding: 0; margin: 0; }
.row-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--hub-line);
}
.row-list li:last-child { border-bottom: 0; }
.row-list .row-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--hub-cream);
  color: var(--hub-evergreen);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.row-list .row-body { flex: 1; min-width: 0; }
.row-list .row-meta { font-size: 0.85rem; color: var(--hub-mist); }
.row-list .row-meta a { color: var(--hub-amber-hover); }

/* ── Two-column section helper ──────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }

/* ── Empty state ────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--hub-mist);
  background: var(--hub-cream-soft);
  border: 1px dashed var(--hub-line);
  border-radius: 12px;
}
.empty i { font-size: 1.8rem; color: var(--hub-amber); }
.empty .empty-title {
  margin-top: 8px;
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--hub-evergreen-dark);
}

/* ── Utility ────────────────────────────────────────────────────────── */
.text-mist { color: var(--hub-mist); }
.text-amber { color: var(--hub-amber); }
.text-evergreen { color: var(--hub-evergreen-dark); }
.bg-cream { background: var(--hub-cream); }
.font-display { font-family: 'Fraunces', Georgia, serif; }
.tabular { font-variant-numeric: tabular-nums; }
.cap { text-transform: capitalize; }

.dropdown-menu {
  border: 1px solid var(--hub-line);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 30px rgba(31,53,44,0.12);
}
.dropdown-item {
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 0.92rem;
}
.dropdown-item:hover { background: var(--hub-cream); }
