/* ============================================================
   FAMILY INTRANET - Main Stylesheet
   Palette: Warm terracotta, amber, cream, deep forest
   Font: Playfair Display (headers) + Nunito (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Nunito:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  /* Warm family palette */
  --color-primary:     #C8724A;   /* terracotta */
  --color-primary-dk:  #A85A35;
  --color-primary-lt:  #E8A07A;
  --color-secondary:   #D4A853;   /* amber gold */
  --color-secondary-lt:#F0CC82;
  --color-accent:      #7A9E7E;   /* sage green */
  --color-accent-dk:   #5A7A5E;
  --color-deep:        #2C3E2D;   /* deep forest */

  /* Neutrals */
  --color-bg:          #FDF8F3;   /* warm cream */
  --color-surface:     #FFFFFF;
  --color-surface-alt: #FFF4EC;
  --color-border:      #EDE0D4;
  --color-border-dark: #D4C4B4;

  /* Text */
  --color-text:        #3D2B1F;
  --color-text-muted:  #8B7355;
  --color-text-light:  #B8A090;

  /* Roles colors */
  --color-william:     #C8913A;
  --color-diana:       #E8845A;
  --color-dome:        #7CB9E8;
  --color-leo:         #90EE90;

  /* Sidebar */
  --sidebar-width:     260px;
  --sidebar-bg:        #2C3E2D;
  --sidebar-text:      #E8DDD0;
  --sidebar-active:    #C8724A;
  --sidebar-hover:     rgba(200,114,74,0.15);

  /* Misc */
  --radius-sm:    6px;
  --radius:       12px;
  --radius-lg:    20px;
  --radius-full:  9999px;
  --shadow-sm:    0 1px 3px rgba(44,62,45,0.08);
  --shadow:       0 4px 16px rgba(44,62,45,0.10);
  --shadow-lg:    0 8px 32px rgba(44,62,45,0.14);
  --transition:   all 0.2s ease;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Nunito', sans-serif;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dk); }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: var(--font-body); }

/* ── Layout: Sidebar + Main ────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.sidebar-logo .logo-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 6px;
}
.sidebar-logo h1 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-secondary);
  letter-spacing: 0.5px;
}
.sidebar-logo p {
  font-size: 0.7rem;
  color: rgba(232,221,208,0.6);
  font-style: italic;
  margin-top: 2px;
}

/* User card in sidebar */
.sidebar-user {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  margin: 8px 12px;
  border-radius: var(--radius);
}
.sidebar-user img, .sidebar-user .avatar-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-info .name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-info .role {
  font-size: 0.7rem;
  color: var(--color-secondary-lt);
  opacity: 0.8;
}

/* Nav */
.sidebar-nav {
  padding: 8px 0;
  flex: 1;
}
.nav-section-title {
  padding: 12px 20px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(232,221,208,0.4);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(232,221,208,0.85);
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--transition);
  position: relative;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.nav-item.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--sidebar-active);
}
.nav-item .icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.8;
}
.nav-item.active .icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--color-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: rgba(200,114,74,0.15);
  color: var(--color-primary-lt);
  border: 1px solid rgba(200,114,74,0.2);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-logout:hover {
  background: rgba(200,114,74,0.3);
  color: #fff;
}

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Bar ───────────────────────────────────────────── */
.topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  padding: 6px;
  border-radius: var(--radius-sm);
}
.page-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-notif {
  position: relative;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  transition: var(--transition);
}
.btn-notif:hover { background: var(--color-border); }
.notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 10px; height: 10px;
  background: var(--color-primary);
  border-radius: 50%;
  border: 2px solid var(--color-surface);
}

/* ── Page Content ──────────────────────────────────────── */
.page-content {
  padding: 28px 24px;
  flex: 1;
}

/* ── Hero Section (Dashboard) ──────────────────────────── */
.hero-section {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 28px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 1.5s ease;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,62,45,0.85) 0%, rgba(44,62,45,0.3) 50%, transparent 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 32px;
  width: 100%;
}
.hero-phrase {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  margin-bottom: 8px;
  font-style: italic;
}
.hero-date {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
}
.hero-edit-btn {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  z-index: 3;
}
.hero-edit-btn:hover { background: rgba(255,255,255,0.35); }

/* ── Presence Cards ────────────────────────────────────── */
.presence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.presence-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.presence-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.presence-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 1rem;
}
.presence-info .name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}
.presence-info .where {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 1px;
}
.presence-dot {
  width: 8px; height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  margin-right: 5px;
  display: inline-block;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ── Cards & Widgets ───────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .icon { color: var(--color-primary); }
.card-body { padding: 20px; }

/* ── Reminders strip ───────────────────────────────────── */
.reminders-strip {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: white;
}
.reminder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.reminder-item .days {
  font-weight: 700;
  font-size: 1rem;
}

/* ── Dashboard Grid ────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ── Stats/KPI Cards ───────────────────────────────────── */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.stat-card .stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
}
.stat-card .stat-trend.up { color: var(--color-accent-dk); }
.stat-card .stat-trend.down { color: #E05555; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: var(--transition);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(200,114,74,0.3);
}
.btn-primary:hover {
  background: var(--color-primary-dk);
  box-shadow: 0 4px 14px rgba(200,114,74,0.4);
  transform: translateY(-1px);
  color: white;
}
.btn-secondary {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-border);
  color: var(--color-text);
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.btn-icon:hover { background: var(--color-border); color: var(--color-text); }
.btn-danger { background: #E05555; color: white; }
.btn-danger:hover { background: #C04444; color: white; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(200,114,74,0.12);
}
select.form-control { appearance: none; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.data-table th {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
table.data-table tbody tr:hover { background: var(--color-surface-alt); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-success { background: #E8F5E9; color: #388E3C; }
.badge-warning { background: #FFF8E1; color: #F57F17; }
.badge-danger  { background: #FFEBEE; color: #D32F2F; }
.badge-info    { background: #E3F2FD; color: #1565C0; }
.badge-neutral { background: var(--color-surface-alt); color: var(--color-text-muted); }
.badge-primary { background: rgba(200,114,74,0.12); color: var(--color-primary-dk); }

/* ── Avatar ─────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-md  { width: 48px;  height: 48px; }
.avatar-lg  { width: 80px;  height: 80px; }
.avatar-xl  { width: 120px; height: 120px; }
.avatar-initials {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white;
  flex-shrink: 0;
}

/* ── Progress Bar ───────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ── Notifications panel ────────────────────────────────── */
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.notif-panel.show { display: block; }
.notif-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.9rem;
}
.notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: var(--transition);
}
.notif-item:hover { background: var(--color-surface-alt); }
.notif-item.unread { background: rgba(200,114,74,0.04); }
.notif-item .notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  background: var(--color-surface-alt);
}
.notif-item .notif-body { flex: 1; }
.notif-item .notif-title { font-size: 0.85rem; font-weight: 600; }
.notif-item .notif-text { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 2px; }
.notif-item .notif-time { font-size: 0.72rem; color: var(--color-text-light); margin-top: 4px; }

/* ── Login Page ─────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-visual {
  background: linear-gradient(135deg, var(--color-deep) 0%, #1a2e1b 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.login-visual::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,114,74,0.2), transparent 70%);
  top: -100px; left: -100px;
}
.login-visual::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,83,0.15), transparent 70%);
  bottom: -50px; right: -50px;
}
.login-visual-content { position: relative; z-index: 1; text-align: center; color: white; }
.login-visual .logo-emoji { font-size: 4rem; margin-bottom: 16px; display: block; }
.login-visual h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 8px;
}
.login-visual p { color: rgba(255,255,255,0.65); font-size: 1rem; font-style: italic; }
.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--color-bg);
}
.login-box {
  width: 100%;
  max-width: 400px;
}
.login-box h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-text);
}
.login-box .subtitle {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(44,62,45,0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

/* ── Message Board ──────────────────────────────────────── */
.message-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.message-item:last-child { border-bottom: none; }
.message-bubble {
  flex: 1;
  background: var(--color-surface-alt);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 12px 16px;
  position: relative;
}
.message-author { font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; }
.message-text { font-size: 0.9rem; line-height: 1.5; }
.message-meta {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 6px;
  display: flex;
  gap: 12px;
}
.message-reactions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.reaction-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.reaction-btn:hover { background: var(--color-border); }

/* ── Economy Charts ─────────────────────────────────────── */
.economy-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.eco-stat {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.eco-stat .label { font-size: 0.78rem; color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.eco-stat .value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin: 4px 0; }
.eco-stat.income .value { color: var(--color-accent-dk); }
.eco-stat.expense .value { color: #E05555; }
.eco-stat.balance .value { color: var(--color-primary-dk); }

/* ── Profile Page ───────────────────────────────────────── */
.profile-cover {
  height: 200px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  background-size: cover;
  background-position: center;
  position: relative;
}
.profile-avatar-wrap {
  position: absolute;
  bottom: -40px;
  left: 32px;
}
.profile-avatar-wrap img,
.profile-avatar-wrap .avatar-initials {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 4px solid var(--color-surface);
  box-shadow: var(--shadow);
  object-fit: cover;
}
.profile-info { padding: 52px 32px 24px; }
.profile-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ── Shopping List ──────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}
.list-item:hover { background: var(--color-surface-alt); }
.list-item:last-child { border-bottom: none; }
.list-item.checked .item-name {
  text-decoration: line-through;
  color: var(--color-text-light);
}
.checkbox-custom {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--color-border);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.checkbox-custom.checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

/* ── Goals ──────────────────────────────────────────────── */
.goal-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.goal-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.goal-card-img {
  height: 140px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  background-size: cover;
  background-position: center;
}
.goal-card-body { padding: 16px; }
.goal-card .goal-title { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.goal-card .goal-desc { font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: 12px; }

/* ── Album ──────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--color-border);
}
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.photo-thumb:hover img { transform: scale(1.05); }
.photo-thumb-overlay {
  position: absolute; inset: 0;
  background: rgba(44,62,45,0.5);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
  color: white; font-size: 1.5rem;
}
.photo-thumb:hover .photo-thumb-overlay { opacity: 1; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: #E8F5E9; border: 1px solid #A5D6A7; color: #2E7D32; }
.alert-error   { background: #FFEBEE; border: 1px solid #EF9A9A; color: #C62828; }
.alert-warning { background: #FFF8E1; border: 1px solid #FFE082; color: #E65100; }
.alert-info    { background: #E3F2FD; border: 1px solid #90CAF9; color: #1565C0; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .col-4 { grid-column: span 6; }
  .economy-summary { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .btn-menu-toggle {
    display: flex;
  }
  .col-4, .col-6, .col-8 {
    grid-column: span 12;
  }
  .login-wrapper {
    grid-template-columns: 1fr;
  }
  .login-visual { display: none; }
  .login-form-side { padding: 32px 20px; }
  .page-content { padding: 16px; }
  .hero-section { min-height: 220px; }
  .presence-grid { grid-template-columns: repeat(2, 1fr); }
  .economy-summary { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-cover { height: 150px; }
}

@media (max-width: 480px) {
  .presence-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-phrase { font-size: 1.3rem; }
  .reminders-strip { flex-direction: column; align-items: flex-start; }
  .modal { max-width: 100%; border-radius: var(--radius); }
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(44,62,45,0.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-dark); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-light); }

/* ── Calendar Overrides (FullCalendar) ──────────────────── */
.fc { font-family: var(--font-body) !important; }
.fc-toolbar-title { font-family: var(--font-display) !important; font-size: 1.2rem !important; }
.fc-button-primary { background: var(--color-primary) !important; border-color: var(--color-primary) !important; }
.fc-button-primary:hover { background: var(--color-primary-dk) !important; border-color: var(--color-primary-dk) !important; }
.fc-today-button { background: var(--color-secondary) !important; border-color: var(--color-secondary) !important; }

/* ── Utility ─────────────────────────────────────────────── */
.text-muted   { color: var(--color-text-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
