/* app.css — Eggcel Tracker Frontend v0.1.0 */
/* Warm farm-journal aesthetic: deep olive, cream, terracotta */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --bg:           #1c1a12;
  --bg2:          #252318;
  --bg3:          #2e2c1f;
  --surface:      #322f22;
  --surface2:     #3d3a2a;
  --border:       rgba(255,245,210,0.1);
  --border2:      rgba(255,245,210,0.18);

  --cream:        #f5edd6;
  --cream2:       #e8ddc0;
  --cream3:       #d4c9a8;
  --gold:         #e8b84b;
  --gold2:        #c99a2e;
  --terracotta:   #c4613a;
  --terra2:       #a84e2c;
  --sage:         #7a8c5e;
  --sage2:        #5e6e47;
  --muted:        rgba(245,237,214,0.45);
  --muted2:       rgba(245,237,214,0.25);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;

  --radius:       14px;
  --radius-sm:    8px;
  --radius-lg:    22px;
  --radius-pill:  999px;

  --nav-h:        72px;
  --topbar-h:     56px;
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
  --safe-top:     env(safe-area-inset-top, 0px);

  --shadow:       0 4px 24px rgba(0,0,0,0.45);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
  --shadow-gold:  0 4px 20px rgba(232,184,75,0.25);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--cream);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

a { color: var(--gold); text-decoration: none; }
button { cursor: pointer; border: none; background: none; }

/* ── Utilities ──────────────────────────────────────────────────── */
.hidden { display: none !important; }
.muted  { color: var(--muted); }
.small  { font-size: 0.8rem; }

/* ── Auth Screen ────────────────────────────────────────────────── */
.auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 24px;
  padding-top: max(24px, var(--safe-top));
}

.auth-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(232,184,75,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(196,97,58,0.08) 0%, transparent 60%),
    var(--bg);
}

.auth-card {
  position: relative;
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 36px 28px 32px;
  box-shadow: var(--shadow);
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-egg  { font-size: 2.5rem; display: block; margin-bottom: 8px; }

.auth-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold);
  letter-spacing: -0.02em;
  line-height: 1;
}

.auth-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-tabs {
  display: flex;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--surface2);
  color: var(--cream);
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-error {
  color: var(--terracotta);
  font-size: 0.82rem;
  text-align: center;
}

/* ── App Shell ──────────────────────────────────────────────────── */
.app {
  display: flex; flex-direction: column;
  min-height: 100dvh;
  padding-top: calc(var(--topbar-h) + var(--safe-top));
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

/* ── Top Bar ────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(28,26,18,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.topbar-inner {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  font-style: italic;
}

.user-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* ── Page Container ─────────────────────────────────────────────── */
.page-container {
  flex: 1;
  position: relative;
}

.page {
  display: none;
  padding: 20px 16px 8px;
  animation: fadeUp 0.25s ease;
}
.page.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Bottom Nav ─────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(28,26,18,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  z-index: 50;
}

.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  color: var(--muted2);
  transition: color 0.2s;
  padding-bottom: 2px;
  -webkit-tap-highlight-color: transparent;
}

.nav-item.active { color: var(--gold); }
.nav-icon  { font-size: 1.35rem; line-height: 1; }
.nav-label { font-size: 0.65rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Form Elements ──────────────────────────────────────────────── */
.field-group {
  display: flex; flex-direction: column; gap: 6px;
}

.field-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
select,
textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--cream);
  padding: 12px 14px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
}

input::placeholder { color: var(--muted2); }

select option { background: var(--bg3); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--gold);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { background: var(--gold2); transform: scale(0.98); }

.btn-secondary {
  background: var(--surface2);
  color: var(--cream2);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  transition: background 0.2s;
}
.btn-secondary:active { background: var(--bg3); }

.btn-danger {
  background: rgba(196,97,58,0.15);
  color: var(--terracotta);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(196,97,58,0.3);
}
.btn-danger:active { background: rgba(196,97,58,0.25); }

.btn-full { width: 100%; }

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  font-size: 1.1rem;
  color: var(--cream2);
  border: 1px solid var(--border);
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
}

/* ── Stat Grid ──────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1;
}

.stat-value.gold { color: var(--gold); }
.stat-value.terra { color: var(--terracotta); }
.stat-value.sage { color: var(--sage); }

.stat-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Hero Egg Count ─────────────────────────────────────────────── */
.hero-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg3) 100%);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '🥚';
  position: absolute;
  right: -10px; top: -10px;
  font-size: 6rem;
  opacity: 0.06;
  transform: rotate(20deg);
}

.hero-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-number {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}

/* ── Quick Log Widget ───────────────────────────────────────────── */
.quick-log {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.quick-log-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 16px;
}

.egg-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.counter-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  font-size: 1.5rem;
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.counter-btn:active { background: var(--bg3); transform: scale(0.92); }

.counter-display {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 80px;
  text-align: center;
  line-height: 1;
}

.quick-log-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.quick-log-row .field-group { flex: 1; }

.today-collections {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
}

.collection-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.collection-entry:last-child { border-bottom: none; }

.collection-time { color: var(--muted); font-size: 0.82rem; }
.collection-count {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
}

/* ── Collapsible Sale Drawer ────────────────────────────────────── */
.drawer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.drawer-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cream2);
}

.drawer-chevron {
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 0.25s;
}
.drawer.open .drawer-chevron { transform: rotate(180deg); }

.drawer-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.drawer.open .drawer-body { max-height: 600px; }

.drawer-inner { padding: 0 18px 18px; }

/* ── P&L Bar ────────────────────────────────────────────────────── */
.pnl-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.pnl-item { text-align: center; flex: 1; }
.pnl-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 4px; }
.pnl-value { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
.pnl-value.green { color: #7ec87e; }
.pnl-value.red   { color: var(--terracotta); }
.pnl-value.gold  { color: var(--gold); }
.pnl-divider { width: 1px; height: 36px; background: var(--border); }

/* ── Calendar ───────────────────────────────────────────────────── */
.calendar-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.cal-month {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--cream);
  font-style: italic;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  text-align: center;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
  padding: 4px 0 8px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg3);
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  gap: 1px;
}

.cal-day:active { background: var(--surface2); }
.cal-day.today  { border-color: var(--gold); }
.cal-day.empty  { background: transparent; border-color: transparent; cursor: default; }
.cal-day.future { opacity: 0.35; cursor: default; pointer-events: none; }

.cal-day-num {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--cream2);
  line-height: 1;
}

.cal-day-eggs {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
}

/* Heat colors */
.cal-day.heat-0  { background: var(--bg3); }
.cal-day.heat-1  { background: rgba(122,140,94,0.15); }
.cal-day.heat-2  { background: rgba(122,140,94,0.3); }
.cal-day.heat-3  { background: rgba(232,184,75,0.2); }
.cal-day.heat-4  { background: rgba(232,184,75,0.35); }
.cal-day.heat-5  { background: rgba(232,184,75,0.5); }

.cal-day.heat-1 .cal-day-eggs { color: var(--sage); }
.cal-day.heat-2 .cal-day-eggs { color: var(--sage); }
.cal-day.heat-3 .cal-day-eggs { color: var(--gold2); }
.cal-day.heat-4 .cal-day-eggs { color: var(--gold); }
.cal-day.heat-5 .cal-day-eggs { color: var(--gold); }

/* ── Flock Cards ────────────────────────────────────────────────── */
.flock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.chicken-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.chicken-card:active { border-color: var(--gold); }
.chicken-card.deceased { opacity: 0.5; }

.chicken-emoji { font-size: 1.8rem; margin-bottom: 6px; display: block; }
.chicken-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--cream);
  margin-bottom: 2px;
}
.chicken-breed { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }

/* ── Sales List ─────────────────────────────────────────────────── */
.sale-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.sale-name { font-weight: 500; font-size: 0.95rem; color: var(--cream); }
.sale-meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.sale-total {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold);
  font-weight: 700;
}

/* ── Section Headers ────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--cream);
  font-style: italic;
}

/* ── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  left: 50%; transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--cream);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 200;
  white-space: nowrap;
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
}

.toast.success { border-color: rgba(126,200,126,0.5); color: #7ec87e; }
.toast.error   { border-color: rgba(196,97,58,0.5); color: var(--terracotta); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: flex; align-items: flex-end;
  padding: 0;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
  padding: 24px 20px;
  padding-bottom: calc(24px + var(--safe-bottom));
  position: relative;
  animation: slideUp 0.28s cubic-bezier(0.32,0.72,0,1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--cream);
  margin-bottom: 20px;
  padding-right: 36px;
}

/* ── Settings ───────────────────────────────────────────────────── */
.settings-group {
  margin-bottom: 24px;
}

.settings-group-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.settings-row-label { font-size: 0.9rem; color: var(--cream2); }
.settings-row-sub   { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ── Token List ─────────────────────────────────────────────────── */
.token-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.token-label { font-size: 0.88rem; font-weight: 500; color: var(--cream2); }
.token-meta  { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.token-badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.token-badge.write    { background: rgba(232,184,75,0.15); color: var(--gold); }
.token-badge.readonly { background: rgba(122,140,94,0.15); color: var(--sage); }
.token-badge.revoked  { background: rgba(196,97,58,0.15); color: var(--terracotta); }

/* ── Version Footer ─────────────────────────────────────────────── */
.version-footer {
  text-align: center;
  padding: 20px 0 8px;
  font-size: 0.7rem;
  color: var(--muted2);
  letter-spacing: 0.05em;
}

/* ── Loading spinner ────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 24px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-center {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 0;
}

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state-text { font-size: 0.9rem; line-height: 1.5; }

/* ── Divider ────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Search input ───────────────────────────────────────────────── */
.search-bar {
  position: relative;
  margin-bottom: 14px;
}
.search-bar input { padding-left: 38px; }
.search-bar::before {
  content: '🔍';
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
}

/* ── Tabs (inline) ──────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
  gap: 2px;
}

.tab-btn {
  flex: 1;
  padding: 9px;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s;
  text-align: center;
}
.tab-btn.active {
  background: var(--surface2);
  color: var(--cream);
}

/* ── Deceased section toggle ────────────────────────────────────── */
.deceased-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.deceased-toggle-icon { transition: transform 0.25s; }
.deceased-toggle.open .deceased-toggle-icon { transform: rotate(90deg); }

/* Gear button */
.gear-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  padding: 4px 6px;
  margin-left: 8px;
  opacity: 0.7;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gear-btn:active { opacity: 1; }

/* Feeder widget */
.feeder-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.feeder-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 4px;
}
.feeder-days {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}
.feeder-days.green  { color: #7ec87e; }
.feeder-days.yellow { color: var(--gold); }
.feeder-days.red    { color: var(--terracotta); }
