/* =============================================================================
   Dosuras Empanadas — Styles
   Warm, artisanal, Argentine. Golden empanada tones + sky-blue accents.
   ========================================================================== */

:root {
  --gold:        #E0922F;
  --gold-deep:   #C2761B;
  --gold-soft:   #F4C778;
  --cream:       #FBF4E9;
  --cream-2:     #F4E8D5;
  --ink:         #2A2118;
  --ink-soft:    #6B5E4E;
  --sky:         #74ACDF;   /* Argentine flag blue */
  --sky-deep:    #4A86C5;
  --red:         #C0392B;
  --green:       #2E8B57;
  --white:       #FFFFFF;
  --line:        #E6D9C4;
  --shadow:      0 10px 30px rgba(74, 54, 24, 0.12);
  --shadow-sm:   0 4px 14px rgba(74, 54, 24, 0.10);
  --radius:      16px;
  --radius-sm:   10px;
  --serif: "Fraunces", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
/* `hidden` must always win, even over our display:grid/flex layout rules. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--ink-soft); }
.error { color: var(--red); font-weight: 500; }
.notice {
  background: #FFF7E6; border: 1px solid var(--gold-soft);
  color: var(--ink); padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .9rem;
}
code {
  background: var(--cream-2); padding: 1px 6px; border-radius: 6px;
  font-size: .85em;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: .95rem;
  border: none; cursor: pointer; border-radius: 999px;
  padding: 11px 20px; background: var(--gold); color: var(--white);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  box-shadow: 0 4px 12px rgba(194, 118, 27, .28);
}
.btn:hover { background: var(--gold-deep); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { background: var(--cream-2); color: var(--ink-soft); cursor: not-allowed; box-shadow: none; transform: none; }
.btn--sm { padding: 7px 14px; font-size: .85rem; }
.btn--lg { padding: 14px 26px; font-size: 1.05rem; }
.btn--block { display: block; width: 100%; }
.btn--ghost { background: transparent; color: var(--gold-deep); box-shadow: none; border: 1.5px solid var(--line); }
.btn--ghost:hover { background: var(--cream-2); color: var(--gold-deep); }
.btn--danger { color: var(--red); border-color: #ECC4BF; }
.btn--danger:hover { background: #FBEDEB; color: var(--red); }
.btn--hero { box-shadow: 0 10px 24px rgba(194, 118, 27, .35); }
.icon-btn {
  background: transparent; border: none; font-size: 1.2rem; cursor: pointer;
  color: var(--ink-soft); width: 38px; height: 38px; border-radius: 10px;
}
.icon-btn:hover { background: var(--cream-2); }

/* ---- Demo banner ------------------------------------------------------- */
.demo-banner {
  background: var(--ink); color: var(--cream); text-align: center;
  padding: 8px 14px; font-size: .85rem;
}
.demo-banner code { background: rgba(255,255,255,.15); color: var(--cream); }

/* ---- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: rgba(251, 244, 233, .9);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 1.4rem; font-weight: 700; }
.logo__mark { font-size: 1.5rem; }
.logo__flag { font-size: 1rem; }
.site-nav { display: flex; align-items: center; gap: 22px; font-weight: 500; }
.site-nav a:hover { color: var(--gold-deep); }
.nav-admin {
  border: 1.5px solid var(--line); padding: 6px 14px; border-radius: 999px;
  font-size: .9rem;
}
.nav-admin:hover { background: var(--cream-2); }

/* ---- Hero -------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(244,199,120,.55), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(116,172,223,.28), transparent 55%),
    var(--cream);
  padding: 84px 28px 96px;
  text-align: center;
}
.hero__inner { max-width: 760px; margin: 0 auto; }
.hero__eyebrow { font-weight: 600; letter-spacing: .04em; color: var(--ink-soft); margin: 0 0 14px; }
.hero__title { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; }
.hero__title em { color: var(--gold-deep); font-style: italic; }
.hero__sub { font-size: 1.15rem; color: var(--ink-soft); max-width: 540px; margin: 18px auto 30px; }
.hero__badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 34px; color: var(--ink-soft); font-size: .92rem; font-weight: 500; }

/* ---- Sections ---------------------------------------------------------- */
.section { max-width: 1080px; margin: 0 auto; padding: 72px 24px; }
.section--alt { background: var(--cream-2); max-width: none; }
.section--alt > * { max-width: 1080px; margin-inline: auto; }
.section__head { text-align: center; margin-bottom: 40px; }
.section__head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

/* ---- Menu -------------------------------------------------------------- */
.menu-cat { margin-bottom: 44px; }
.menu-cat__title {
  font-size: 1.4rem; color: var(--gold-deep); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.menu-cat__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__img { width: 100%; height: 160px; object-fit: cover; }
.card__emoji {
  height: 130px; display: grid; place-items: center; font-size: 3.4rem;
  background: linear-gradient(160deg, var(--gold-soft), var(--cream-2));
}
.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card__name { font-size: 1.12rem; }
.card__desc { color: var(--ink-soft); font-size: .9rem; margin: 6px 0 14px; flex: 1; }
.card__sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.size-opt {
  flex: 1 1 0; min-width: 64px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--white); color: var(--ink-soft);
  border-radius: 10px; padding: 6px 6px; display: grid; gap: 1px; text-align: center;
  font-family: var(--sans); line-height: 1.15;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.size-opt:hover { border-color: var(--gold); }
.size-opt.is-on { border-color: var(--gold); background: #FFF7E6; color: var(--ink); }
.size-opt__label { font-size: .72rem; font-weight: 600; }
.size-opt__price { font-size: .82rem; font-weight: 700; color: var(--gold-deep); }
.card__row { display: flex; align-items: center; justify-content: space-between; }
.card { position: relative; }
.card__badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--red); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.card__badge--low { background: var(--gold-deep); }
.card--soldout .card__emoji, .card--soldout .card__img { filter: grayscale(.7) opacity(.55); }
.card--soldout .card__name { color: var(--ink-soft); }
.size-opt.is-disabled, .size-opt:disabled { opacity: .45; cursor: not-allowed; }
.size-opt.is-disabled .size-opt__price { color: var(--red); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--cream); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); z-index: 120;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.card__price { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--gold-deep); }
.card__add.pop { animation: pop .3s ease; }
@keyframes pop { 0%{transform:scale(1)} 40%{transform:scale(.9)} 100%{transform:scale(1)} }

/* ---- Steps ------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }
.step { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; text-align: center; }
.step__n {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--gold); color: #fff; font-weight: 700;
  font-family: var(--serif); font-size: 1.2rem; margin-bottom: 12px;
}
.step h4 { font-size: 1.15rem; margin-bottom: 4px; }
.step p { color: var(--ink-soft); margin: 0; font-size: .92rem; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  background: var(--ink); color: var(--cream); padding: 48px 28px;
  display: grid; gap: 18px; justify-items: center; text-align: center;
}
.foot__brand { display: grid; justify-items: center; gap: 4px; }
.foot__brand b { font-family: var(--serif); font-size: 1.3rem; }
.foot__brand .muted { color: #C9B89C; }
.foot__links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.foot__links a:hover { color: var(--gold-soft); }
.foot__copy { color: #B9A88C; font-size: .85rem; }

/* ---- Cart FAB ---------------------------------------------------------- */
.cart-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  background: var(--gold); color: #fff; border: none; cursor: pointer;
  width: 62px; height: 62px; border-radius: 50%; font-size: 1.5rem;
  box-shadow: 0 10px 24px rgba(194,118,27,.42);
  display: grid; place-items: center;
  transition: transform .15s ease;
}
.cart-fab:hover { transform: scale(1.06); }
.cart-fab.bump { animation: bump .35s ease; }
@keyframes bump { 0%,100%{transform:scale(1)} 30%{transform:scale(1.18)} }
.cart-fab__count {
  position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff;
  font-size: .75rem; font-weight: 700; min-width: 22px; height: 22px;
  border-radius: 11px; display: grid; place-items: center; padding: 0 6px;
  border: 2px solid var(--cream);
}

/* ---- Overlay & drawers ------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(42,33,24,.5); z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 92vw);
  background: var(--cream); z-index: 80; box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer--wide { width: min(560px, 96vw); transform: translateX(100%); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--white);
}
.drawer__head h3 { font-size: 1.25rem; }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer__foot { border-top: 1px solid var(--line); padding: 18px 20px; background: var(--white); }

/* Cart lines */
.cart__empty { text-align: center; padding: 40px 10px; }
.cart-line {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.cart-line__name { font-weight: 600; display: block; }
.cart-line__total { font-weight: 700; font-family: var(--serif); min-width: 60px; text-align: right; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty__btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--white); cursor: pointer; font-size: 1rem; line-height: 1; color: var(--ink);
}
.qty__btn:hover { background: var(--cream-2); }
.qty__num { min-width: 18px; text-align: center; font-weight: 600; }
.sum { display: flex; justify-content: space-between; padding: 4px 0; color: var(--ink-soft); }
.sum--total { color: var(--ink); font-weight: 700; font-size: 1.15rem; font-family: var(--serif); padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); }

/* ---- Modal ------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: 20px; background: rgba(42,33,24,.5); overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal__card {
  background: var(--cream); border-radius: var(--radius); width: min(560px, 100%);
  box-shadow: var(--shadow); max-height: 92vh; display: flex; flex-direction: column;
  animation: rise .3s cubic-bezier(.2,.8,.2,1);
}
.modal__card--sm { width: min(420px, 100%); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal__body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 14px; }

/* Form */
label { font-weight: 600; font-size: .9rem; display: grid; gap: 6px; }
input, textarea, select {
  font-family: var(--sans); font-size: 1rem; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink); width: 100%; font-weight: 400;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,146,47,.16); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Map block.
   NB: no `overflow:hidden` here — as a CSS grid item it would make
   `min-height:auto` resolve to 0 and collapse the Leaflet map's row track.
   The map is clipped by its own rounded corners + the head/hint above & below. */
.map-block { border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.map-block__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; flex-wrap: wrap; font-weight: 600; font-size: .9rem; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.map { height: 220px; width: 100%; }
.map-hint { font-size: .8rem; padding: 8px 14px 0; }
.pin-status { padding: 8px 14px 12px; color: var(--green); font-weight: 600; font-size: .88rem; }

/* Payment */
.pay { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 10px; }
.pay legend { font-weight: 700; padding: 0 6px; font-size: .9rem; }
.pay__opt { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.pay__opt input { width: auto; }
.card-box { margin-top: 4px; }

/* Checkout summary */
.co-summary { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 4px; }
.co-line, .d-line { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.d-total { font-weight: 700; font-family: var(--serif); font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }

/* Success */
.success { text-align: center; padding: 34px 26px; display: grid; gap: 10px; justify-items: center; }
.success__check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-size: 2rem; margin-bottom: 6px;
  animation: pop .4s ease;
}

/* =============================================================================
   ADMIN
   ========================================================================== */
.admin { background: var(--cream-2); }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 34px 30px; width: min(400px, 100%); display: grid; gap: 14px;
  border: 1px solid var(--line);
}
.login-logo { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; text-align: center; }
.login-card h2 { font-size: 1.3rem; text-align: center; }
.login-card > .muted { text-align: center; margin-top: -8px; }
.back-link { text-align: center; font-size: .9rem; }
.back-link:hover { color: var(--gold-deep); }

.dash { min-height: 100vh; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; background: var(--ink); color: var(--cream); flex-wrap: wrap;
}
.admin-header__brand { font-family: var(--serif); font-size: 1.2rem; }
.admin-header__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-header__right .btn--ghost { color: var(--cream); border-color: rgba(255,255,255,.25); }
.admin-header__right .btn--ghost:hover { background: rgba(255,255,255,.12); }

/* Tabs */
.admin-tabs { display: flex; gap: 6px; background: rgba(255,255,255,.1); padding: 4px; border-radius: 999px; }
.admin-tabs .tab {
  border: none; background: transparent; color: #D8C7AC; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: .85rem;
  padding: 7px 16px; border-radius: 999px; transition: background .15s, color .15s;
}
.admin-tabs .tab:hover { color: var(--cream); }
.admin-tabs .tab.is-on { background: var(--gold); color: #fff; }

/* Menú & precios */
.prods-head { padding: 22px 24px 4px; }
.prods-head h2 { font-size: 1.5rem; }
.prods-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding: 16px 24px 60px; }
.prod-row { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.prod-row__main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.prod-row__name { display: flex; gap: 10px; align-items: center; }
.prod-row__emoji { font-size: 1.6rem; }
.prod-row__name b { display: block; font-family: var(--serif); font-size: 1.05rem; }
.prod-row__cat { font-size: .78rem; }
.prod-row__prices { display: grid; gap: 10px; margin: 14px 0; }
.price-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .85rem; font-weight: 600; }
.price-field em { font-style: normal; font-weight: 400; }
.price-input { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 4px 10px; background: var(--white); width: 116px; }
.price-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,146,47,.16); }
.price-input i { color: var(--ink-soft); font-style: normal; }
.price-input input { border: none; padding: 4px 0; width: 100%; font-weight: 600; }
.price-input input:focus { outline: none; box-shadow: none; }
.prod-row__foot { display: flex; align-items: center; gap: 12px; }
.saved-flash { color: var(--green); font-weight: 600; font-size: .85rem; }

/* Availability switch */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.switch input { width: auto; accent-color: var(--green); width: 17px; height: 17px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 22px 24px 6px; max-width: 760px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat__n { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.9rem; color: var(--gold-deep); }
.stat__l { color: var(--ink-soft); font-size: .85rem; }

.filters { display: flex; gap: 8px; padding: 16px 24px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: var(--white); color: var(--ink-soft);
  border-radius: 999px; padding: 7px 15px; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--gold); }
.chip--on { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.board {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px; padding: 8px 24px 60px;
}
.empty { grid-column: 1/-1; text-align: center; padding: 60px 0; }
.ocard {
  background: var(--white); border: 1px solid var(--line);
  border-left: 5px solid var(--st, var(--gold)); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); transition: transform .14s ease, box-shadow .2s;
}
.ocard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ocard__head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px 6px; }
.ocard__id { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.ocard__time { font-size: .82rem; margin-left: 8px; }
.ocard__body { padding: 4px 16px 12px; }
.ocard__name { font-weight: 600; margin: 4px 0 2px; }
.ocard__meta { font-size: .85rem; margin: 2px 0; }
.ocard__addr { font-size: .85rem; margin: 4px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ocard__foot { display: flex; gap: 8px; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); margin-top: auto; }
.badge { color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .02em; }

/* Detail drawer */
.d-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.d-section:last-child { border-bottom: none; }
.d-section h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 8px; font-family: var(--sans); font-weight: 700; }
.d-section p { margin: 2px 0; }
.d-map { height: 200px; border-radius: var(--radius-sm); overflow: hidden; margin: 10px 0; border: 1px solid var(--line); }
.d-notes { background: #FFF7E6; border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px; }
.d-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 560px) {
  .site-header { padding: 12px 16px; }
  .site-nav { gap: 14px; }
  .grid2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:last-child { grid-column: 1/-1; }
  .section { padding: 52px 18px; }
}

/* Stock editor */
.stock-badge { font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.stock-badge.is-ok { background: #E4F3EA; color: var(--green); }
.stock-badge.is-low { background: #FCEFD7; color: var(--gold-deep); }
.stock-badge.is-out { background: #FBE3E0; color: var(--red); }
.quick-add { display: flex; align-items: center; gap: 6px; font-size: .82rem; }
.quick-add .btn { padding: 4px 10px; }

/* Analytics */
.an-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; padding: 8px 24px 4px; }
.an-stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.an-stat__n { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.7rem; }
.an-stat__l { color: var(--ink-soft); font-size: .82rem; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; padding: 12px 24px; }
.an-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin: 0 24px 16px; }
.an-grid .an-card { margin: 0; }
.an-card h3 { font-size: 1.1rem; margin-bottom: 12px; }
.an-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.an-card__head h3 { margin: 0; }
.an-sub { font-size: .85rem; font-weight: 400; }
.chart-box { position: relative; height: 240px; }

/* Period segmented toggle */
.seg { display: inline-flex; gap: 2px; background: var(--cream-2); padding: 3px; border-radius: 999px; }
.seg__b { border: none; background: transparent; color: var(--ink-soft); cursor: pointer; font-family: var(--sans); font-weight: 600; font-size: .8rem; padding: 5px 12px; border-radius: 999px; }
.seg__b.is-on { background: var(--gold); color: #fff; }

/* Break-even */
.breakeven { margin-bottom: 16px; }
.be-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .92rem; }
.be-bar { height: 14px; background: var(--cream-2); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.be-bar__fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); border-radius: 999px; transition: width .5s ease; }
.be-bar__fill.done { background: linear-gradient(90deg, var(--green), #7FCB9E); }
.be-eta { font-size: .85rem; margin-top: 4px; }

/* Margin table */
.margin-table { display: grid; gap: 2px; font-size: .88rem; }
.mt-row { display: grid; grid-template-columns: 1.6fr .8fr .8fr .9fr .6fr; gap: 8px; padding: 7px 4px; border-bottom: 1px dashed var(--line); align-items: center; }
.mt-row span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.mt-head { font-weight: 700; color: var(--ink-soft); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1.5px solid var(--line); }
.mt-row .pos { color: var(--green); font-weight: 600; }
.mt-row .neg { color: var(--red); font-weight: 600; }

/* Cost editor */
.cost-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 16px 0 8px; }
.cost-list { display: grid; gap: 8px; }
.cost-row { display: flex; align-items: center; gap: 8px; }
.cost-row input[data-label] { flex: 1; min-width: 0; }
.cost-row .price-input { width: 120px; flex: none; }
.cost-row select { width: auto; flex: none; padding: 8px 10px; }
.cost-save { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* Leaflet tweak so it never sits above our modals */
.leaflet-container { z-index: 1; font-family: var(--sans); }
