/* ===== VARIABLES ===== */
:root {
  color-scheme: light;
  --cream: #faf6ef;
  --green: #2d6a4f;
  --green2: #40916c;
  --green-pale: #d8f3dc;
  --orange: #e07c24;
  --orange-pale: #fde8cc;
  --text: #1a2e22;
  --muted: #6b7f72;
  --white: #fff;
  --red: #e74c3c;
  --red-pale: #fdecea;
  --r: 14px;
  --sh: 0 4px 24px rgba(45,106,79,.10);
  --nav-h: 62px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; color-scheme: light; }
html, body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
input, select, textarea, button { font-family: 'DM Sans', sans-serif; color-scheme: light; }
input:not([type="checkbox"]):not([type="radio"]), textarea { background: #fff !important; color: var(--text) !important; }
select { background: #fff !important; color: var(--text) !important; }
a { text-decoration: none; }

/* Force light mode always */
@media (prefers-color-scheme: dark) {
  :root { --cream:#faf6ef; --green:#2d6a4f; --green2:#40916c; --green-pale:#d8f3dc; --orange:#e07c24; --orange-pale:#fde8cc; --text:#1a2e22; --muted:#6b7f72; --white:#fff; --red:#e74c3c; --red-pale:#fdecea; }
  html, body { background: #faf6ef !important; color: #1a2e22 !important; }
  .modal, .card, .auth-card { background: #fff !important; }
  .bottom-nav, header { background: var(--green) !important; }
}

/* ===== AUTH SCREEN ===== */
#authScreen {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(150deg, var(--green) 0%, var(--green2) 55%, #52b788 100%);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
#authScreen::before {
  content: '🍓🥭🍋🫐🍍🥝';
  position: absolute; font-size: 6rem; opacity: .06;
  top: 0; left: 0; letter-spacing: 8px; white-space: nowrap;
  transform: rotate(-6deg); pointer-events: none;
}
.auth-card {
  background: var(--white); border-radius: 22px; padding: 1.8rem;
  width: 100%; max-width: 390px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: slideUp .3s ease;
}
.auth-logo { font-family: 'Fraunces', serif; font-size: 1.7rem; font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 8px; margin-bottom: .25rem; }
.auth-logo em { font-style: italic; font-weight: 300; opacity: .7; }
.auth-sub { color: var(--muted); font-size: .8rem; margin-bottom: 1.3rem; }
.auth-tabs { display: flex; gap: 4px; background: #f0f4f1; border-radius: 10px; padding: 3px; margin-bottom: 1.2rem; }
.auth-tab { flex: 1; padding: 7px; border: none; border-radius: 8px; font-size: .82rem; cursor: pointer; transition: all .18s; background: none; color: var(--muted); font-weight: 500; }
.auth-tab.active { background: var(--white); color: var(--green); box-shadow: 0 1px 6px rgba(0,0,0,.1); }
.auth-form { display: flex; flex-direction: column; gap: .7rem; }
.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 38px; }
.auth-eye-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: .95rem; padding: 4px; opacity: .5; transition: opacity .15s; line-height: 1; }
.auth-eye-btn:hover { opacity: .85; }
.auth-input { width: 100%; padding: 10px 12px; border: 1.5px solid #dde8df; border-radius: 10px; font-size: .88rem; outline: none; transition: border-color .2s; box-sizing: border-box; }
.auth-input:focus { border-color: var(--green); }
.auth-btn { background: var(--green); color: white; border: none; padding: 11px; border-radius: 10px; font-weight: 600; font-size: .9rem; cursor: pointer; transition: background .2s; }
.auth-btn:hover { background: #245a3f; }
.auth-btn:disabled { background: #9ec9ab; cursor: not-allowed; }
.auth-error { background: var(--red-pale); border: 1.5px solid var(--red); border-radius: 9px; padding: 8px 11px; font-size: .8rem; color: var(--red); display: none; }
.auth-sep { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .73rem; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: #dde8df; }
.auth-join-toggle { background: none; border: 1.5px solid var(--orange); color: var(--orange); padding: 8px; border-radius: 10px; font-size: .8rem; cursor: pointer; transition: all .18s; width: 100%; }
.auth-join-toggle:hover, .auth-join-toggle.active { background: var(--orange); color: white; }
.auth-guest-btn { background: #f7faf8; border: 1.5px solid #dde8df; color: var(--green); padding: 11px; border-radius: 10px; font-size: .88rem; font-weight: 500; cursor: pointer; transition: all .2s; width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; }
.auth-guest-btn:hover { background: var(--green-pale); border-color: var(--green); }

/* ===== BANNERS ===== */
.guest-banner { background: var(--orange); color: white; text-align: center; padding: 7px 1rem; font-size: .78rem; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 9px; }
.guest-banner button { background: white; color: var(--orange); border: none; padding: 3px 11px; border-radius: 100px; font-size: .72rem; font-weight: 700; cursor: pointer; }
.trial-banner { background: #1a2e22; color: rgba(255,255,255,.8); text-align: center; padding: 6px 1rem; font-size: .75rem; }

/* ===== HEADER ===== */
header { background: var(--green); height: 50px; padding: 0 1rem; position: sticky; top: 0; z-index: 200; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 12px rgba(45,106,79,.3); }
.logo { font-family: 'Fraunces', serif; font-weight: 600; color: var(--white); font-size: 1.15rem; display: flex; align-items: center; gap: 6px; }
.logo em { font-style: italic; font-weight: 300; opacity: .75; }
.desktop-nav { display: flex; gap: 3px; }
.dnav-btn { background: transparent; border: 1.5px solid rgba(255,255,255,.3); color: var(--white); padding: 5px 12px; border-radius: 20px; font-size: .78rem; cursor: pointer; transition: all .18s; font-weight: 500; opacity: .75; }
.dnav-btn:hover, .dnav-btn.active { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.65); opacity: 1; }
.dnav-btn.locked { opacity: .3; cursor: not-allowed; pointer-events: none; }
.user-chip { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.3); border-radius: 100px; padding: 3px 9px 3px 3px; cursor: pointer; transition: all .2s; color: var(--white); flex-shrink: 0; }
.user-chip:hover { background: rgba(255,255,255,.25); }
.u-avatar { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; background: rgba(255,255,255,.25); }
.u-name { font-size: .72rem; font-weight: 500; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #52b788; flex-shrink: 0; }
.sync-dot.syncing { background: var(--orange); animation: blink .8s infinite; }
.sync-dot.offline { background: #bdbdbd; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ===== HERO ===== */
.hero { background: var(--green); padding: 1.2rem 1rem 1.3rem; }
.hero-title { font-family: 'Fraunces', serif; color: white; font-size: 1.3rem; font-weight: 700; margin-bottom: .8rem; }
.search-bar { display: flex; align-items: center; background: white; border-radius: 12px; padding: 0 12px; gap: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.search-ico { font-size: 1rem; opacity: .45; }
.search-input { flex: 1; border: none; outline: none; padding: 10px 0; font-size: .9rem; background: transparent !important; }
.search-clear { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1rem; padding: 4px; }
.filter-pills { display: flex; gap: 6px; overflow-x: auto; padding: .7rem 0 0; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill { background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.35); color: white; padding: 4px 13px; border-radius: 100px; font-size: .75rem; cursor: pointer; transition: all .15s; white-space: nowrap; font-weight: 500; }
.filter-pill:hover, .filter-pill.active { background: white; color: var(--green); border-color: white; }

/* ===== STATS BAR ===== */
.stats-bar { display: flex; gap: 8px; overflow-x: auto; padding: .8rem 1rem; scrollbar-width: none; }
.stats-bar::-webkit-scrollbar { display: none; }
.stat-chip { background: var(--white); border-radius: 100px; padding: 5px 13px; font-size: .75rem; color: var(--muted); white-space: nowrap; box-shadow: var(--sh); font-weight: 500; }
.stat-chip span { color: var(--green); font-weight: 700; }

/* ===== SECTIONS ===== */
.app-section { display: none; padding-bottom: 1rem; }
.app-section.active { display: block; }
.section-header { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem .75rem; }
.section-title { font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 700; }
.btn-action { background: var(--green); color: white; border: none; padding: 6px 14px; border-radius: 100px; font-size: .8rem; font-weight: 600; cursor: pointer; transition: background .2s; }
.btn-action:hover { background: var(--green2); }

/* ===== TODAY BANNER ===== */
.today-header { display: flex; align-items: center; justify-content: space-between; padding: 0 1rem .55rem; }
.today-greeting { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.today-count { font-size: .72rem; font-weight: 600; color: var(--green); background: var(--green-pale); border-radius: 20px; padding: 2px 9px; }
.today-list { display: flex; flex-direction: column; gap: 8px; padding: 0 1rem .4rem; }
.today-item { background: linear-gradient(135deg, var(--green), var(--green2)); border-radius: 14px; padding: .85rem 1rem; display: flex; align-items: center; gap: 12px; cursor: pointer; box-shadow: var(--sh); transition: transform .15s, opacity .15s; }
.today-item:hover { transform: translateY(-1px); }
.today-item-done { opacity: .6; }
.today-item-ico { font-size: 1.6rem; width: 44px; height: 44px; background: rgba(255,255,255,.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.today-item-info { flex: 1; min-width: 0; }
.today-item-name { font-family: 'Fraunces', serif; font-size: 1rem; color: white; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-item-sub { font-size: .7rem; color: rgba(255,255,255,.65); margin-top: 1px; }
.today-item-arrow { color: rgba(255,255,255,.5); font-size: 1.2rem; flex-shrink: 0; }

/* ===== CARDS GRID ===== */
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; padding: 0 1rem; }
@media (min-width: 600px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .cards-grid { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--white); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh); cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(45,106,79,.16); }
.card-top { padding: .9rem .9rem .5rem; display: flex; align-items: flex-start; gap: 8px; }
.card-emoji-wrap { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.card-info { flex: 1; min-width: 0; }
.card-name { font-family: 'Fraunces', serif; font-size: .92rem; font-weight: 700; color: var(--text); line-height: 1.25; margin-bottom: 3px; }
.card-cat { font-size: .68rem; color: var(--muted); font-weight: 500; }
.card-fruits { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 .9rem .6rem; }
.fruit-tag { font-size: .63rem; background: var(--cream); color: var(--muted); padding: 2px 7px; border-radius: 100px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding: .5rem .9rem .7rem; border-top: 1px solid #f3f7f4; margin-top: auto; gap: .4rem; }
.card-footer-left { display: flex; align-items: center; gap: .25rem; }
.card-time { font-size: .7rem; color: var(--muted); }
.card-sched-btn { background: var(--green-pale); border: none; color: var(--green); padding: 4px 9px; border-radius: 100px; font-size: .75rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.card-sched-btn:hover { background: var(--green); color: white; }
.mini-star { font-size: .75rem; color: #f5a623; }
.mini-star.empty { color: #ddd; }
.btn-load-more { background: var(--green); color: white; border: none; padding: 10px 28px; border-radius: 100px; font-size: .85rem; font-weight: 600; cursor: pointer; transition: background .2s; }
.btn-load-more:hover { background: var(--green2); }

/* ===== MODAL BASE ===== */
.overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal {
  position: fixed; z-index: 310;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white); border-radius: 22px;
  width: calc(100% - 2rem); max-width: 480px;
  max-height: 88vh; overflow-y: auto;
  animation: modalIn .28s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn { from { transform: translate(-50%, -48%) scale(.93); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.modal-header { padding: 1.2rem 1rem 1rem; text-align: center; position: relative; border-radius: 22px 22px 0 0; }
.modal-close {
  position: absolute; top: .75rem; right: .75rem;
  background: rgba(0,0,0,.18); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; color: #1a2e22;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.modal-close:hover { background: rgba(0,0,0,.28); }
.modal-body { padding: 1rem 1.1rem 1.8rem; }

/* ===== RECIPE DETAIL ===== */
.detail-emoji { font-size: 2.8rem; margin-bottom: .4rem; display: block; }
.detail-name { font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 700; margin-bottom: .4rem; line-height: 1.25; }
.detail-meta { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: .2rem; }
.detail-badge { background: rgba(255,255,255,.25); backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.35); padding: 4px 12px; border-radius: 100px; font-size: .75rem; font-weight: 600; }
.detail-section { margin-bottom: 1rem; }
.detail-section h4 { font-size: .65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: .5rem; font-weight: 600; }
.detail-section p { font-size: .86rem; line-height: 1.7; white-space: pre-line; color: #2d4a35; }
.detail-divider { height: 1px; background: #eef2ee; margin: .2rem 0 1rem; }
.detail-benefits { background: var(--green-pale); border-radius: 12px; padding: .8rem 1rem; font-size: .83rem; color: var(--green); font-weight: 500; line-height: 1.5; }
.detail-actions { display: flex; gap: .5rem; margin-top: .3rem; }
.btn-detail-sched { flex: 1; background: var(--green); color: white; border: none; padding: 13px; border-radius: 12px; font-weight: 700; font-size: .9rem; cursor: pointer; transition: background .2s; letter-spacing: .2px; }
.btn-detail-sched:hover { background: var(--green2); }
.star-row { display: flex; align-items: center; gap: 4px; margin: .5rem 0; }
.star { font-size: 1.4rem; cursor: pointer; transition: transform .1s; color: #ddd; user-select: none; }
.star.filled { color: #f5a623; }
.star:hover { transform: scale(1.15); }

/* ===== CALENDAR ===== */
.cal-wrapper { padding: 0 .5rem 1rem; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; padding: .5rem .5rem .6rem; }
.cal-nav button { background: var(--white); border: 1.5px solid #dde8df; color: var(--text); padding: 5px 14px; border-radius: 100px; cursor: pointer; font-size: .8rem; transition: all .15s; }
.cal-nav button:hover { background: var(--green-pale); border-color: var(--green); }
.cal-month-title { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 700; }

/* View toggle */
.cal-view-toggle { display: flex; gap: 4px; padding: 0 .5rem .7rem; }
.cal-view-btn { flex: 1; background: #f2f6f3; border: 1.5px solid transparent; color: var(--muted); padding: 6px 0; border-radius: 100px; cursor: pointer; font-size: .75rem; font-weight: 600; transition: all .15s; }
.cal-view-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.cal-view-btn:not(.active):hover { background: var(--green-pale); }

/* Grid view */
.cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-bottom: 3px; }
.cal-wd { text-align: center; font-size: .62rem; font-weight: 600; color: var(--muted); padding: 3px 0; text-transform: uppercase; letter-spacing: .4px; min-width: 0; overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-cell { background: var(--white); border-radius: 8px; padding: 4px 2px; min-height: 58px; cursor: pointer; transition: all .15s; border: 1.5px solid transparent; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; }
.cal-cell:hover { border-color: var(--green-pale); background: #f8fdf9; }
.cal-cell.other-month { background: #f4f7f5; opacity: .5; pointer-events: none; }
.cal-cell.today { border-color: var(--green) !important; background: #f0faf4; }
.cal-cell.has-entry { border-color: var(--orange-pale); }
.cal-day-num { font-size: .68rem; font-weight: 600; color: var(--muted); text-align: center; margin-bottom: 1px; width: 100%; }
.cal-cell.today .cal-day-num { color: var(--green); font-weight: 800; }
.cal-entry-dot { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; }
.cal-dot { font-size: .82rem; line-height: 1.1; display: flex; flex-direction: column; align-items: center; width: 100%; }
.cal-dot.done { opacity: .4; }
.cal-dot-name { font-size: .5rem; font-weight: 600; color: var(--text); line-height: 1.1; max-width: 100%; overflow: hidden; white-space: nowrap; text-align: center; margin-top: 1px; }
.cal-dot-more { font-size: .5rem; color: var(--muted); font-weight: 700; }

/* List view */
.cal-list-empty { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }
.cal-list-day { background: var(--white); border-radius: 12px; margin-bottom: 8px; border: 1.5px solid #edf2ee; overflow: hidden; cursor: pointer; transition: border-color .15s; }
.cal-list-day:hover { border-color: var(--green-pale); }
.cal-list-day.today { border-color: var(--green); }
.cal-list-date { display: flex; align-items: center; gap: 8px; padding: 8px 12px 6px; border-bottom: 1px solid #f0f5f1; background: #fafcfa; }
.cal-list-num { font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 700; color: var(--muted); line-height: 1; min-width: 1.8rem; text-align: center; }
.cal-list-num.today { color: var(--green); }
.cal-list-dayname { font-size: .78rem; color: var(--muted); font-weight: 500; text-transform: capitalize; }
.cal-list-entries { padding: 7px 12px 8px; display: flex; flex-direction: column; gap: 5px; }
.cal-list-entry { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 8px; background: #f7faf8; }
.cal-list-entry.done { opacity: .55; }
.cal-list-emoji { font-size: 1.1rem; line-height: 1; flex-shrink: 0; }
.cal-list-name { font-size: .82rem; font-weight: 600; color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-list-check { font-size: .7rem; color: var(--green); font-weight: 700; margin-left: auto; }

/* ===== SHOPPING LIST ===== */
.shop-week-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); padding: .4rem 1rem .2rem; font-weight: 600; }
.shop-row { display: flex; align-items: center; gap: 10px; padding: 10px 1rem; background: var(--white); border-bottom: 1px solid #f3f7f4; cursor: pointer; transition: background .12s; }
.shop-row:hover { background: #f8fdf9; }
.shop-chk { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; flex-shrink: 0; }
.shop-name { flex: 1; font-size: .84rem; }
.shop-qty { font-size: .75rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.shop-row.checked .shop-name { text-decoration: line-through; opacity: .5; }
.shop-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: .85rem; }

/* ===== INVENTORY ===== */
.inv-item { display: flex; align-items: center; gap: 10px; padding: 11px 1rem; background: var(--white); border-bottom: 1px solid #f3f7f4; }
.inv-name { flex: 1; font-size: .85rem; font-weight: 500; }
.inv-qty { font-size: .8rem; color: var(--muted); }
.inv-low { color: var(--red) !important; font-weight: 700; }
.inv-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: .85rem; }
.inv-del { background: none; border: none; color: var(--red); cursor: pointer; padding: 4px 8px; font-size: .9rem; opacity: .6; transition: opacity .15s; }
.inv-del:hover { opacity: 1; }

/* ===== MI HOGAR MODAL ===== */
.hh-code-box { background: var(--green); border-radius: 14px; padding: 1.2rem; text-align: center; margin-bottom: 1rem; }
.hh-code-label { font-size: .68rem; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: 1px; margin-bottom: .4rem; }
.hh-code { font-family: 'Fraunces', serif; font-size: 2.1rem; color: white; letter-spacing: .35em; font-weight: 700; }
.hh-code-sub { font-size: .7rem; color: rgba(255,255,255,.55); margin-top: .3rem; }
.hh-code-btns { display: flex; gap: 6px; justify-content: center; margin-top: .7rem; }
.btn-hh { background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.35); color: white; padding: 5px 14px; border-radius: 100px; font-size: .73rem; cursor: pointer; transition: all .18s; }
.btn-hh:hover { background: rgba(255,255,255,.32); }
.hh-members-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: .55rem; font-weight: 600; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--cream); border-radius: 10px; margin-bottom: 5px; }
.member-av { width: 34px; height: 34px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; color: white; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 600; font-size: .85rem; }
.member-sub { font-size: .68rem; color: var(--muted); }
.member-you { font-size: .65rem; background: var(--green); color: white; padding: 2px 8px; border-radius: 100px; white-space: nowrap; flex-shrink: 0; }
.hh-sep { border: none; border-top: 1px solid #eee; margin: .9rem 0; }
.hh-modal-menu { display: flex; flex-direction: column; gap: .45rem; }
.hh-menu-btn { background: #f7faf8; border: 1.5px solid #e8eee9; color: var(--text); padding: 10px 14px; border-radius: 10px; cursor: pointer; font-size: .84rem; text-align: left; transition: all .18s; display: flex; align-items: center; gap: 9px; font-weight: 500; width: 100%; }
.hh-menu-btn:hover { background: var(--green-pale); border-color: var(--green); color: var(--green); }

/* LOGOUT BUTTON - borde rojo, hover rojo sólido */
.logout-btn {
  width: 100%;
  background: none;
  border: 1.5px solid var(--red);
  color: var(--red);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: .7rem;
}
.logout-btn:hover { background: var(--red); color: white; }

/* ===== CONFIGURACIÓN MODAL ===== */
.config-section { margin-bottom: 1.1rem; }
.config-section-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; margin-bottom: .6rem; }
.config-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f3f7f4; }
.config-row:last-child { border-bottom: none; }
.config-row-label { font-size: .84rem; font-weight: 500; }
.config-row-sub { font-size: .72rem; color: var(--muted); margin-top: 1px; }

/* Toggle switch */
.toggle-sw { position: relative; display: inline-block; width: 42px; height: 23px; flex-shrink: 0; }
.toggle-sw input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 23px; transition: .3s; }
.toggle-slider:before { position: absolute; content: ''; height: 17px; width: 17px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; }
.toggle-sw input:checked + .toggle-slider { background: var(--green); }
.toggle-sw input:checked + .toggle-slider:before { transform: translateX(19px); }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: .65rem; }
.form-label { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .28rem; display: block; }
.form-input { width: 100%; padding: 9px 12px; border: 1.5px solid #dde8df; border-radius: 10px; font-size: .88rem; color: var(--text); outline: none; transition: border-color .2s; resize: vertical; }
.form-input:focus { border-color: var(--green); }

/* ===== SCHEDULE MODAL ===== */
.sch-tabs { display: flex; gap: 4px; background: #f0f4f1; border-radius: 10px; padding: 3px; }
.sch-tab { flex: 1; padding: 7px; border: none; background: none; border-radius: 8px; font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s; }
.sch-tab.active { background: white; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.sch-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: .5rem 0; }
.sch-day { padding: 6px 2px; border: 1.5px solid #dde8df; border-radius: 9px; text-align: center; cursor: pointer; transition: all .15s; min-width: 0; }
.sch-day:hover { border-color: var(--green); background: var(--green-pale); }
.sch-day.selected { background: var(--green); border-color: var(--green); color: white; }
.sch-day-name { font-size: .58rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.sch-day.selected .sch-day-name, .sch-day.selected .sch-day-num { color: white; }
.sch-day-num { font-size: .78rem; font-weight: 700; margin-top: 1px; }
.sch-week-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: .5rem; font-weight: 600; }
.sch-month-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.sch-month-weekdays span { text-align: center; font-size: .55rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 2px 0; }
.sch-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.sch-month-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: .78rem; font-weight: 600; cursor: pointer; transition: all .15s; border: 1.5px solid transparent; }
.sch-month-day:hover { background: var(--green-pale); border-color: var(--green); }
.sch-month-day.selected { background: var(--green); color: white; border-color: var(--green); }
.sch-month-day.sch-today { border-color: var(--green); color: var(--green); font-weight: 800; }
.sch-month-day.sch-today.selected { color: white; }
.sch-month-day.sch-past { color: #ccc; }
.sch-selected-date { background: var(--green-pale); border-radius: 10px; padding: .6rem .9rem; font-size: .85rem; color: var(--green); font-weight: 600; text-align: center; }
.sch-entry-list { display: flex; flex-direction: column; gap: 5px; margin-top: .6rem; }
.sch-entry { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--cream); border-radius: 9px; font-size: .81rem; }
.sch-entry-done { opacity: .5; }
.sch-entry-remove { background: none; border: none; color: var(--red); cursor: pointer; font-size: .9rem; margin-left: auto; padding: 2px 5px; opacity: .7; }
.sch-entry-remove:hover { opacity: 1; }

/* ===== POPUP ===== */
.popup-card {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%);
  z-index: 500; background: var(--white); border-radius: 18px; padding: 1.3rem;
  max-width: 320px; width: calc(100% - 2rem);
  box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: slideUp .3s ease;
}
.popup-close { position: absolute; top: .6rem; right: .6rem; background: var(--cream); border: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.popup-img { width: 100%; border-radius: 10px; margin-bottom: .8rem; max-height: 150px; object-fit: cover; }
.popup-title { font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; }
.popup-body-text { font-size: .83rem; color: var(--muted); line-height: 1.5; margin-bottom: .8rem; }
.popup-cta { display: block; background: var(--green); color: white; padding: 9px; border-radius: 10px; text-align: center; font-weight: 600; font-size: .85rem; transition: background .2s; }
.popup-cta:hover { background: var(--green2); }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a2e22; color: white; padding: 9px 18px;
  border-radius: 100px; font-size: .82rem; font-weight: 500;
  opacity: 0; transition: all .25s; z-index: 600;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-h);
  background: var(--white); border-top: 1px solid #e8eee9;
  display: flex; z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(45,106,79,.08);
}
.bnav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: none; background: none; cursor: pointer; color: var(--muted); transition: color .15s; padding: 0; }
.bnav-btn.active { color: var(--green); }
.bnav-btn.locked { opacity: .35; cursor: not-allowed; }
.bico { font-size: 1.25rem; line-height: 1; }
.blabel { font-size: .62rem; font-weight: 500; }

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
  .cards-grid { grid-template-columns: 1fr 1fr; gap: .5rem; padding: 0 .6rem; }
  .hero { padding: 1rem .8rem 1.1rem; }
  .hero-title { font-size: 1.1rem; }
  .stats-bar { padding: .6rem .8rem; }
  .section-header { padding: .5rem .8rem .6rem; }
}
@media (max-width: 480px) {
  .desktop-nav { display: none; }
}
@media (min-width: 481px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
  .toast { bottom: 20px; }
  .popup-card { bottom: 20px; }
}
/* ===== SCHEDULE MEMBER SELECTOR ===== */
.sch-portion-config { margin-top: .6rem; }
.sch-members { display: flex; flex-direction: column; gap: 8px; margin-top: .4rem; }
.sch-member-row { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: #f8faf8; border-radius: 14px; border: 1px solid #eef2ee; }
.sch-member-top { display: flex; align-items: center; gap: 10px; }
.sch-member-avatar { width: 36px; height: 36px; background: var(--green); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; flex-shrink: 0; }
.sch-member-info { flex: 1; min-width: 0; }
.sch-member-name { font-size: .88rem; font-weight: 600; }
.sch-member-qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sch-qty-btn { width: 32px; height: 32px; border: 1.5px solid #dde8df; border-radius: 9px; background: white; font-size: 1.1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--green); line-height: 1; transition: all .12s; }
.sch-qty-btn:hover { background: var(--green); color: white; border-color: var(--green); }
.sch-member-portions { width: 38px; padding: 4px 2px; border: 1.5px solid #dde8df; border-radius: 8px; font-size: .95rem; font-weight: 700; text-align: center; outline: none; background: white; }
.sch-member-portions:focus { border-color: var(--green); }
.sch-member-ozrow { display: flex; align-items: center; gap: 0; background: #eef2ee; border-radius: 10px; padding: 3px; }
.sch-oz-label { font-size: .65rem; color: var(--muted); font-weight: 700; padding: 0 6px; text-transform: uppercase; letter-spacing: .5px; }
.sch-oz-sm { flex: 1; padding: 7px 4px; border: none; border-radius: 8px; font-size: .78rem; font-weight: 700; background: transparent; cursor: pointer; color: var(--muted); transition: all .15s; text-align: center; }
.sch-oz-sm.active { background: white; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.sch-oz-sm:hover:not(.active) { color: var(--green); }
.sch-total-bar { background: var(--green-pale); border-radius: 10px; padding: .65rem .9rem; font-size: .85rem; color: var(--green); margin-top: .7rem; text-align: center; font-weight: 500; }
/* ===== MODAL BLUR & SCROLL LOCK ===== */
#app.app-blurred { filter: blur(4px); transition: filter .2s; pointer-events: none; }
.modal-blurred { filter: blur(3px) !important; transition: filter .2s; }
.overlay-stacked { background: rgba(0,0,0,.25) !important; backdrop-filter: none !important; }
/* ===== RATINGS ===== */
/* Rating badge in card footer */
.card-rating { display: flex; align-items: center; gap: 3px; }
.card-rating-empty { display: flex; align-items: center; }
.card-rating-star { color: #f5a623; font-size: .9rem; line-height: 1; }
.card-rating-txt { font-size: .74rem; font-weight: 700; color: var(--text); line-height: 1; }
.card-rating-count { font-weight: 400; color: var(--muted); }
.card-rating-empty .card-rating-txt { color: #ccc; font-weight: 400; }

/* Rating block inside today detail modal */
.today-rate-block { background: #fffbf0; border: 1px solid #fde8a0; border-radius: 14px; padding: .8rem 1rem; }
.star-row { display: flex; gap: 6px; justify-content: center; }
.star-row .star { font-size: 2rem; color: #ddd; cursor: pointer; transition: color .1s, transform .1s; line-height: 1; }
.star-row .star:hover, .star-row .star.filled { color: #f5a623; transform: scale(1.15); }


/* ── FAVORITES ──────────────────────────────────────────────── */
.fav-btn {
  background: none;
  border: none;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 100px;
  transition: transform .15s, background .15s;
  flex-shrink: 0;
  opacity: .65;
}
.fav-btn:hover { transform: scale(1.15); opacity: 1; background: #ffe4e6; }
.fav-btn.fav-active { opacity: 1; background: #ffe4e6; }

/* Fav filter pill */
.fav-filter-pill { border: 1.5px solid #fca5a5 !important; color: #e11d48 !important; }
.fav-filter-pill.active { background: #ffe4e6 !important; color: #e11d48 !important; border-color: #e11d48 !important; }

/* Fav button in detail modal */
.btn-fav-detail {
  border-radius: 12px !important;
  font-size: 1.1rem !important;
  transition: background .2s, color .2s !important;
  cursor: pointer;
}
.btn-fav-detail:hover { opacity: .85; }
.btn-fav-detail.fav-active { background: #ffe4e6 !important; color: #e11d48 !important; }

.detail-badge-rating { background: rgba(245,166,35,.22); color: #8a5a00; }
