/* ═══════════════════════════════════════════
   Family Center — Ayu Theme System
   Light Ayu = default | Dark Ayu = .dark
   ═══════════════════════════════════════════ */

/* ── Light Ayu (default) ─────────────── */
:root {
  --bg:          #fafaf9;
  --bg-dark:     #f0efe9;
  --bg-card:     #ffffff;
  --bg-hover:    #f5f4f0;
  --text:        #5c6773;
  --text-dim:    #8a95a3;
  --text-bright: #30425a;
  --accent:      #099268;
  --accent-hi:   #099268;
  --green:       #099268;
  --red:         #e64e53;
  --orange:      #f0943d;
  --yellow:      #f2a541;
  --purple:      #8c6eb2;
  --border:      #e0ddd5;
  --shadow:      0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg:   0 8px 30px rgba(0, 0, 0, 0.08);
  --radius:      12px;
  --transition:  0.2s ease;
  --input-bg:    #fafaf9;
  --modal-overlay: rgba(48, 66, 90, 0.35);
  --toast-bg:    #30425a;
  --toast-text:  #fafaf9;
}

/* ── Dark Ayu ───────────────────────── */
body.dark {
  --bg:          #213040;
  --bg-dark:     #1a2733;
  --bg-card:     #263545;
  --bg-hover:    #2d3f52;
  --text:        #c5cdd8;
  --text-dim:    #707a8a;
  --text-bright: #e1e4e8;
  --accent:      #36a3d9;
  --accent-hi:   #09b4e3;
  --green:       #56c4a1;
  --red:         #ff6b6b;
  --orange:      #ff8f40;
  --yellow:      #ffc44c;
  --purple:      #b183bf;
  --border:      #324558;
  --shadow:      0 2px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg:   0 8px 30px rgba(0, 0, 0, 0.35);
  --input-bg:    #1a2733;
  --modal-overlay: rgba(10, 14, 19, 0.6);
  --toast-bg:    #e1e4e8;
  --toast-text:  #213040;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */

.sidebar {
  width: 240px;
  background: var(--bg-dark);
  color: var(--text);
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}

.sidebar .logo {
  padding: 24px 24px 20px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-bright);
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar .logo::before {
  content: '🏠';
  font-size: 1.1rem;
}

.sidebar ul {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.sidebar li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar li a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.sidebar li.active a {
  background: var(--bg-hover);
  color: var(--accent-hi);
  border-left-color: var(--accent-hi);
}

/* ── Sidebar Footer ─────────────────── */
.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.btn-logout {
  display: block;
  text-align: center;
  padding: 8px 16px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all var(--transition);
}

.btn-logout:hover {
  background: var(--bg-hover);
  color: var(--red);
}

/* ═══════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════ */

.content {
  margin-left: 240px;
  flex: 1;
  padding: 32px 40px;
  min-height: 100vh;
}

/* ── Topbar ────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.topbar h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.03em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-info span {
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 500;
}

.topbar-info .separator {
  color: var(--border);
  user-select: none;
}

/* ── Theme Toggle ────────────────── */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle::before {
  content: '☀️';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: transform var(--transition);
}

body.dark .theme-toggle::before {
  content: '🌙';
  transform: translateX(24px);
  background: var(--purple);
}

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card h2 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════
   LANDING PAGE — Household Choice Cards
   ═══════════════════════════════════════════ */

.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 160px);
  gap: 32px;
}

.landing-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-bright);
  text-align: center;
  margin-bottom: 8px;
}

.landing-subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 16px;
}

.landing-cards {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 280px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.landing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.landing-card-icon {
  margin-bottom: 20px;
}

.landing-card-icon svg {
  width: 64px;
  height: 64px;
}

.landing-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.landing-card p {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Animated house icon */
@keyframes house-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.landing-card:hover .house-animated {
  animation: house-bounce 1s ease infinite;
}

/* ═══════════════════════════════════════════
   DASHBOARD GRID
   ═══════════════════════════════════════════ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Weather Card ──────────────────── */
.weather-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
  grid-column: span 1;
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.weather-header h2 {
  margin-bottom: 0;
}

.weather-unit-toggle {
  display: flex;
  background: var(--bg-dark);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.weather-unit-toggle button {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.weather-unit-toggle button.active {
  background: var(--accent);
  color: var(--bg);
}

.weather-unit-toggle button:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text);
}

.weather-location {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.weather-loading,
.weather-error {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 12px 0;
}

.weather-current {
  margin-bottom: 20px;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.weather-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.weather-temp {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: -0.04em;
  line-height: 1.1;
  display: block;
}

.weather-condition {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.weather-details {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.weather-details span::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--border);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.weather-details span:first-child::before {
  display: none;
}

/* ── Forecast ─────────────────────── */
.weather-forecast {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 6px;
  background: var(--bg-hover);
}

.forecast-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.forecast-icon {
  font-size: 1.3rem;
}

.forecast-temp {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}

/* ── Messages Card ─────────────── */
.messages-card {
  grid-column: span 1;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.message {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.message:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.message:first-child {
  padding-top: 0;
}

.message strong {
  color: var(--accent-hi);
  font-weight: 600;
  font-size: 0.875rem;
}

.message p {
  margin: 4px 0;
  color: var(--text);
  font-size: 0.925rem;
}

.message small {
  color: var(--text-dim);
  font-size: 0.775rem;
}

/* ═══════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════ */

.calendar-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-nav h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

.cal-nav-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.cal-nav-btn:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.calendar-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 0;
}

.calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-day {
  background: var(--bg-card);
  min-height: 180px;
  padding: 6px;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-day:hover {
  background: var(--bg-hover);
}

.calendar-day.other-month {
  opacity: 0.3;
  pointer-events: none;
}

.calendar-day.today {
  background: rgba(9, 146, 104, 0.08);
}

body.dark .calendar-day.today {
  background: rgba(54, 163, 217, 0.08);
}

.day-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 2px 4px;
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
}

.day-number.today-num {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.day-event {
  font-size: 0.7rem;
  padding: 2px 4px;
  border-radius: 3px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--bg);
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  opacity: 0.9;
  color: #fff;
  border-color: var(--accent);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.btn-danger:hover {
  opacity: 0.9;
  color: #fff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn-small {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-warning {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.btn-warning:hover {
  opacity: 0.85;
  color: #fff;
}

/* ── Theme Toggle Button ─────────────── */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.theme-toggle-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

/* ── Invite Code Section ─────────────── */
.invite-code-section {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.invite-code-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.invite-code-section .help-text {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.invite-code-display {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.invite-code-display code {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--accent-hi);
  user-select: all;
}

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-bright);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9, 146, 104, 0.15);
}

body.dark input:focus,
body.dark textarea:focus,
body.dark select:focus {
  box-shadow: 0 0 0 3px rgba(54, 163, 217, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

/* ═══════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal-large {
  max-width: 720px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--red);
}

.modal-body {
  padding: 24px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.form-actions-right {
  display: flex;
  gap: 8px;
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease;
  max-width: 360px;
}

.toast.success {
  border-left: 4px solid var(--green);
}

.toast.error {
  border-left: 4px solid var(--red);
}

.toast.info {
  border-left: 4px solid var(--accent);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════ */

.settings-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  background: var(--bg-dark);
}

.settings-tab {
  padding: 14px 20px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.settings-tab:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.settings-tab.active {
  color: var(--accent-hi);
  border-bottom-color: var(--accent-hi);
}

.settings-content {
  padding: 24px;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.settings-panel h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 20px;
}

.settings-panel h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 12px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ── Invite Code ──────────────────── */
.invite-code-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.invite-code-value {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.08em;
  padding: 10px 16px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  user-select: all;
}

/* ═══════════════════════════════════════════
   HOUSEHOLDS
   ═══════════════════════════════════════════ */

.households-list {
  display: grid;
  gap: 12px;
}

.household-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.household-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
}

.household-info p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.household-actions {
  display: flex;
  gap: 8px;
}

/* ═══════════════════════════════════════════
   CURRENT HOUSEHOLD DETAIL CARD
   ═══════════════════════════════════════════ */

.household-detail-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
}

.ho-h-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: 8px;
  margin-bottom: 16px;
}

.ho-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

.ho-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-left: auto;
}

.household-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   FAMILY MEMBERS LIST
   ═══════════════════════════════════════════ */

.members-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.member-card,
.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-hover);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.member-card:hover,
.member-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.member-avatar {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  flex-shrink: 0;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-role {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.member-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.member-status.inactive {
  background: var(--text-dim);
}

.member-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
}

.member-info p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════
   USERS LIST
   ═══════════════════════════════════════════ */

.users-list {
  display: grid;
  gap: 8px;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.user-item .user-details {
  display: flex;
  flex-direction: column;
}

.user-item .user-details strong {
  color: var(--text-bright);
  font-size: 0.9rem;
}

.user-item .user-details span {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════
   CHORES
   ═══════════════════════════════════════════ */

.chores-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.chores-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chores-header h2 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.3rem;
  color: var(--text-bright);
  margin-bottom: 0;
}

.chores-list {
  display: grid;
  gap: 8px;
}

.chore-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.chore-title {
  flex: 1;
  font-weight: 500;
  color: var(--text-bright);
}

.chore-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.chore-status.pending { background: var(--yellow); color: #333; }
.chore-status.in_progress { background: var(--accent); color: #fff; }
.chore-status.completed { background: var(--green); color: #fff; }
.chore-status.overdue { background: var(--red); color: #fff; }

/* ═══════════════════════════════════════════
   GROCERIES
   ═══════════════════════════════════════════ */

.groceries-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.groceries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.groceries-header h2 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.3rem;
  color: var(--text-bright);
  margin-bottom: 0;
}

.grocery-filters {
  margin-bottom: 16px;
}

.groceries-list {
  display: grid;
  gap: 8px;
}

.grocery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.grocery-item input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

.grocery-item.bought .grocery-name {
  text-decoration: line-through;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════
   HOMEWORK
   ═══════════════════════════════════════════ */

.homework-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.homework-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.homework-header h2 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.3rem;
  color: var(--text-bright);
  margin-bottom: 0;
}

.homework-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.progress-bar {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: -24px;
  right: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.homework-list {
  display: grid;
  gap: 8px;
}

.homework-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   MARKETPLACE
   ═══════════════════════════════════════════ */

.marketplace-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.marketplace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.marketplace-header h2 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.3rem;
  color: var(--text-bright);
  margin-bottom: 0;
}

.marketplace-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.points-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-hover);
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.points-icon {
  font-size: 1.5rem;
}

.points-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--yellow);
}

.points-label {
  font-size: 0.875rem;
  color: var(--text-dim);
}

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.prize-card {
  background: var(--bg-hover);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border);
}

.prize-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.prize-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.prize-cost {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--yellow);
}

/* ═══════════════════════════════════════════
   SMART HOME
   ═══════════════════════════════════════════ */

.ha-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.ha-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ha-header h2 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.3rem;
  color: var(--text-bright);
  margin-bottom: 0;
}

.ha-status {
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.ha-entities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.ha-entity {
  background: var(--bg-hover);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  text-align: center;
}

.ha-entity .entity-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.ha-entity .entity-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.ha-entity .entity-state {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════
   COLOR PICKER
   ═══════════════════════════════════════════ */

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-picker label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text);
  transition: background var(--transition);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.color-picker label:hover {
  background: var(--bg-hover);
}

.color-picker input[type="radio"] {
  width: auto;
  accent-color: var(--accent);
}

/* ═══════════════════════════════════════════
   LOGIN / REGISTER PAGES
   ═══════════════════════════════════════════ */

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

.auth-wrapper {
  display: flex;
  width: 100%;
  flex: 1;
}

/* ── Hero Section (Left Side) ───────── */
.auth-hero {
  flex: 1;
  background: linear-gradient(135deg, var(--accent) 0%, #076d4f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.dark .auth-hero {
  background: linear-gradient(135deg, #099268 0%, #076d4f 100%);
}

.auth-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-decoration {
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 420px;
  text-align: center;
}

.hero-icon {
  font-size: 4rem;
  margin-bottom: 24px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.auth-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.hero-tagline {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 40px;
  line-height: 1.6;
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #ffffff;
  font-weight: 500;
  font-size: 0.95rem;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s ease;
}

.feature-item:hover {
  background: rgba(255,255,255,0.18);
  transform: translateX(4px);
}

.feature-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ── Form Section (Right Side) ─────── */
.auth-form-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
  min-width: 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

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

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--text-dim);
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form .form-checkbox-group {
  margin-bottom: 24px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  text-decoration: underline;
  color: var(--accent-hi);
}

/* ── Responsive: Stack on mobile ───── */
@media (max-width: 900px) {
  .auth-hero {
    display: none;
  }

  .auth-form-section {
    flex: 1;
    padding: 20px;
  }

  .auth-card {
    max-width: 100%;
    padding: 32px 24px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar .logo {
    padding: 16px 8px;
    font-size: 0;
  }

  .sidebar .logo::before {
    font-size: 1.3rem;
  }

  .sidebar li a {
    justify-content: center;
    padding: 12px 8px;
    font-size: 0;
  }

  .sidebar li a::after {
    content: attr(title);
  }

  .content {
    margin-left: 60px;
    padding: 20px;
  }

  .landing-cards {
    flex-direction: column;
    align-items: center;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .settings-tabs {
    overflow-x: auto;
  }
}

/* ── Password Match Indicator ─────── */
.password-match {
  font-size: 0.8rem;
  margin-top: 4px;
}

.password-match.match {
  color: var(--green);
}

.password-match.no-match {
  color: var(--red);
}

/* ═══════════════════════════════════════════
   PLACEHOLDERS
   ═══════════════════════════════════════════ */

.placeholder {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  border: 1px solid var(--border);
}

.placeholder p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.no-events {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════
   DANGER ZONE
   ═══════════════════════════════════════════ */

.danger-zone {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.danger-zone h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════
   BACKUP ACTIONS
   ═══════════════════════════════════════════ */

.backup-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.import-section {
  margin-top: 16px;
}

.import-section input[type="file"] {
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar .logo {
    padding: 16px 8px;
    font-size: 0;
  }

  .sidebar .logo::before {
    font-size: 1.3rem;
  }

  .sidebar li a {
    justify-content: center;
    padding: 12px 8px;
    font-size: 0;
  }

  .sidebar li a::after {
    content: attr(title);
  }

  .content {
    margin-left: 60px;
    padding: 20px;
  }

  .landing-cards {
    flex-direction: column;
    align-items: center;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .settings-tabs {
    overflow-x: auto;
  }
}
