/* Meatshop public/staff pages. Same palette as the admin theme (maroon + amber). */
:root {
  --brand: #6d1a26; --brand-deep: #4a1019; --accent: #f2a900; --page: #f6f3f1; --card: #fff; --line: #e7dfdb;
  --ink: #2a1a1d; --muted: #7a6a68; --link: #8c1d2c;
  font-family: Inter, "Segoe UI", Roboto, system-ui, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); }
.muted { color: var(--muted); font-weight: 400; }
form.inline { display: inline; margin: 0; }

html { scrollbar-gutter: stable; }
.topbar, .app .topbar { background: var(--brand-deep); color: #fff; display: flex; align-items: center; height: 56px; padding: 0 28px; box-sizing: border-box; flex: none; }
.brand { color: #fff; text-decoration: none; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.topbar nav.main { display: flex; align-items: center; gap: 4px; margin-left: 28px; }
.topbar nav.main a { color: #ecd9dc; text-decoration: none; font-size: .9rem; font-weight: 600; padding: 6px 12px; border-radius: 8px; line-height: 1.4; white-space: nowrap; }
.topbar nav.main a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar nav.main a.on { background: rgba(255,255,255,.16); color: #fff; }
.topbar nav.main a.sell { background: var(--accent); color: #3b2a00; margin: 0 4px; }
.topbar nav.main a.sell:hover { background: #ffbb1f; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar .right a { color: #ecd9dc; text-decoration: none; font-size: .9rem; }
.topbar .right .btn { padding: 6px 14px; }
.who { color: #c9a3a9; font-size: .85rem; }

.btn { display: inline-block; border: 0; border-radius: 10px; padding: 9px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-lg { padding: 13px 28px; font-size: 1.05rem; }
.btn-amber { background: var(--accent); color: #3a2600; }
.btn-amber:hover { background: #ffbb1f; }
.btn-brand { background: var(--brand); color: #fff; width: 100%; margin-top: 8px; }
.btn-brand:hover { background: #521320; }
.btn-ghost { background: transparent; color: #ecd9dc; border: 1px solid rgba(255,255,255,.28); padding: 6px 14px; }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* home */
.hero { background: linear-gradient(135deg, var(--brand-deep), var(--brand)); color: #fff; padding: 84px 28px 96px; }
.hero-inner { max-width: 880px; margin: 0 auto; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 800; margin: 0 0 14px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 18px; }
.lead { font-size: 1.15rem; line-height: 1.55; color: #f0dde0; max-width: 640px; margin: 0 0 30px; }
.features { max-width: 1100px; margin: -42px auto 40px; padding: 0 28px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); width: 100%; }
.features .card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.features .card p { margin: 0; color: #5d504e; line-height: 1.5; font-size: .94rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.card h2 { margin: 0 0 14px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-deep); font-weight: 800; }
.card h2 .muted { text-transform: none; letter-spacing: 0; font-size: .8rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-head h2 { margin: 0; }

/* login */
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; padding: 32px; box-shadow: 0 12px 34px rgba(74,16,25,.12); }
.auth-card h1 { margin: 0 0 6px; font-size: 1.7rem; letter-spacing: -.02em; }
.auth-card label { display: block; font-weight: 600; font-size: .88rem; margin: 18px 0 6px; }
.auth-card input[type=text], .auth-card input[type=password] { width: 100%; padding: 11px 12px; border: 1px solid #d9cec9; border-radius: 10px; font: inherit; }
.auth-card input:focus { outline: 2px solid rgba(242,169,0,.6); border-color: var(--accent); }
.auth-card .btn-brand { margin-top: 24px; }
.error { background: #fde6e6; color: #a31d1d; border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.back { text-align: center; margin: 18px 0 0; font-size: .9rem; }

/* dashboard */
.page { max-width: 1180px; width: 100%; margin: 0 auto; padding: 28px; flex: 1; }
.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.02em; }
.page-head p { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; }
.kpi-n { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.kpi-l { color: var(--muted); font-size: .85rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 6px; border-bottom: 2px solid var(--brand); }
td { padding: 10px 6px; border-bottom: 1px solid #f1ebe8; }
tr:hover td { background: #fffaf0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.empty { color: var(--muted); margin: 8px 0; }
.more { margin: 14px 0 0; font-size: .9rem; }
select { padding: 8px 10px; border: 1px solid #d9cec9; border-radius: 9px; font: inherit; background: #fff; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.pill-green { background: #e3f4ea; color: #146c3d; }
.pill-amber { background: #fff1cf; color: #8a5a00; }
.pill-red { background: #fde6e6; color: #a31d1d; }
.pill-grey { background: #ece8e6; color: #5d504e; }

.foot { margin-top: auto; text-align: center; color: var(--muted); font-size: .82rem; padding: 22px; }

@media (max-width: 640px) {
  .topbar, .app .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; row-gap: 6px; }
  .topbar nav.main { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .who, .hide-sm { display: none; }
  .hero { padding: 56px 20px 72px; }
  .page { padding: 18px 14px; }
}

/* Telugu text: use fonts that ship with Windows/Android, then Noto if present */
.te, [lang="te"] { font-family: "Nirmala UI", "Noto Sans Telugu", "Gautami", "Segoe UI", system-ui, sans-serif; }
.te { font-weight: 500; }

/* public rate board, sits between hero and feature cards */
.ratebar { max-width: 1100px; width: 100%; margin: -46px auto 22px; padding: 0 28px; position: relative; z-index: 1; }
.ratebar-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; padding: 14px 22px 8px; }
.ratebar-head h2 { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-deep); font-weight: 800; }
.ratebar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 0 0 14px 14px; overflow: hidden; }
.rate { background: var(--card); padding: 16px 22px 18px; display: flex; flex-direction: column; gap: 6px; }
.rate-name { font-weight: 700; font-size: 1.15rem; }
.rate-price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.rate-price.none { color: #b9aaa6; }
.rate-sub { color: var(--muted); font-size: .85rem; }
.rate .pill { align-self: flex-start; }
.home .features { margin-top: 0; }
[lang="te"] h2, [lang="te"] .pill, [lang="te"] .rate-name, [lang="te"] .muted { letter-spacing: 0 !important; text-transform: none !important; }
.ratebar-head[lang="te"] h2 { font-size: 1rem; }

/* ---- messages, forms ---- */
.msgs { max-width: 1180px; width: 100%; margin: 16px auto 0; padding: 0 28px; }
.msg { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; font-weight: 600; }
.msg-success { background: #e3f4ea; color: #146c3d; }
.msg-error { background: #fde6e6; color: #a31d1d; }
.form .field { margin-bottom: 14px; }
.form label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 5px; }
.form input, .form select, .cust input, .cust select, #search { width: 100%; padding: 10px 12px; border: 1px solid #d9cec9; border-radius: 10px; font: inherit; background: #fff; }
.form input:focus, .form select:focus, .cust input:focus, #search:focus { outline: 2px solid rgba(242,169,0,.6); border-color: var(--accent); }
.form .btn-brand { width: auto; margin-top: 10px; }
.error-inline { color: #a31d1d; font-size: .82rem; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.sub { margin: 18px 0 10px !important; }
.parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; }
.sumline { background: #faf5f2; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.btn-lg[type=submit] { margin-top: 14px; }

/* ---- sell screen ---- */
.pos-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; max-height: 62vh; overflow: auto; }
.tile { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: inherit; }
.tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(74,16,25,.1); }
.tile.disabled { opacity: .5; cursor: not-allowed; }
.t-name { font-weight: 700; }
.t-price { color: var(--brand); font-weight: 800; }
.t-stock { color: var(--muted); font-size: .78rem; }
.bill input.q, .bill input.p { width: 84px; padding: 6px 8px; border: 1px solid #d9cec9; border-radius: 8px; font: inherit; text-align: right; }
.bill .x { background: none; border: 0; font-size: 1.3rem; color: #a31d1d; cursor: pointer; }
.totalrow { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.2rem; padding: 14px 4px; border-top: 2px solid var(--brand); margin-top: 8px; }
.totalrow strong { font-size: 1.8rem; color: var(--brand); }
.cust { display: grid; gap: 8px; margin-bottom: 12px; }
.bill .btn-brand { width: 100%; }
.page-head select { min-width: 200px; }
@media (max-width: 900px) { .pos-grid { grid-template-columns: 1fr; } }

/* ---- dashboard extras ---- */
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.quick .btn { text-align: center; }
.btn-outline { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-outline:hover { background: #fff4f4; }

/* ---- printable invoice ---- */
.invoice-body { background: #eee; }
.bar { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; }
.invoice { background: #fff; max-width: 420px; margin: 8px auto 40px; padding: 22px 20px; box-shadow: 0 4px 24px rgba(0,0,0,.12); font-size: .9rem; }
.invoice header { text-align: center; border-bottom: 1px dashed #999; padding-bottom: 10px; }
.invoice h1 { margin: 0; font-size: 1.2rem; }
.invoice h2 { margin: 8px 0 0; font-size: 1rem; letter-spacing: .08em; }
.invoice header p { margin: 2px 0; color: #444; }
.invoice .meta { margin: 10px 0; display: grid; gap: 2px; }
.invoice .meta div, .invoice .totals div { display: flex; justify-content: space-between; }
.invoice dt { color: #555; } .invoice dd { margin: 0; font-weight: 600; }
.invoice table th { font-size: .66rem; }
.invoice td { padding: 6px 4px; }
.invoice small { color: #666; }
.invoice .totals { margin: 10px 0 0; border-top: 1px dashed #999; padding-top: 8px; }
.invoice .grand { font-size: 1.2rem; font-weight: 800; border-top: 1px solid #000; margin-top: 6px; padding-top: 6px; }
.invoice .note { color: #555; font-size: .78rem; text-align: center; margin: 10px 0 0; }
.invoice .thanks { text-align: center; margin: 8px 0 0; font-weight: 600; }
@media print {
  .noprint, .topbar, .foot { display: none !important; }
  .invoice-body { background: #fff; }
  .invoice { box-shadow: none; margin: 0 auto; max-width: 80mm; padding: 0; font-size: 11px; }
  @page { margin: 4mm; }
}
.bar .btn-brand { width: auto; margin: 0; }
.bill input.q { width: 90px; } .bill input.p { width: 104px; }

/* ===== v2 form design: steps, tiles, input units, sticky summary ===== */
.chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 14px; }
.chip label { font-size: .8rem; color: var(--muted); font-weight: 600; margin: 0; }
.chip select { border: 0; background: transparent; font-weight: 700; padding: 6px 8px; min-width: 0; width: auto; }
.page-head { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.steps { display: grid; gap: 16px; }
.side { position: sticky; top: 16px; display: grid; gap: 16px; }
.step h2 { display: flex; align-items: center; gap: 10px; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0 0 16px; }
.step h2 .num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-grid; place-items: center; font-size: .8rem; font-weight: 800; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { margin-bottom: 14px; }
.field.narrow { max-width: 280px; }
.form label, .field label, .step label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: #3b2a2d; }
.field input[type=text], .field input[type=date], .field input[type=datetime-local], .field input[type=tel], .field select, .chip select, #loc { font: inherit; }
.field input[type=text], .field input[type=date], .field input[type=datetime-local], .field input[type=tel], .field select, .inp input { width: 100%; padding: 12px 14px; border: 1px solid #d9cec9; border-radius: 10px; font: inherit; font-size: 1rem; background: #fff; min-height: 46px; }
.inp { display: flex; align-items: stretch; border: 1px solid #d9cec9; border-radius: 10px; background: #fff; overflow: hidden; }
.inp input { border: 0 !important; border-radius: 0 !important; min-width: 0; font-size: 1.1rem !important; font-variant-numeric: tabular-nums; }
.inp span { display: grid; place-items: center; padding: 0 14px; background: #faf5f2; color: var(--muted); font-weight: 600; font-size: .85rem; border-left: 1px solid var(--line); }
.inp.pre span { border-left: 0; border-right: 1px solid var(--line); font-size: 1rem; color: var(--brand); }
.inp:focus-within, .field input:focus, .field select:focus { outline: 2px solid rgba(242,169,0,.6); border-color: var(--accent); }
.inp input:focus { outline: 0 !important; }
.has-error .inp, .has-error input { border-color: #d44; }
.choice-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 2px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .12s, background .12s; }
.choice-body strong { font-size: 1.15rem; }
.choice-body small { color: var(--muted); }
.choice input:checked + .choice-body { border-color: var(--brand); background: #fbf1f2; box-shadow: 0 0 0 3px rgba(109,26,38,.12); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--accent); }
.summary dl { margin: 0 0 14px; }
.summary dl div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f1ebe8; }
.summary dt { color: var(--muted); font-size: .9rem; }
.summary dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary .btn-brand { width: 100%; margin: 0; }
.big-yield { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.big-yield .pill { font-size: 1.6rem; padding: 6px 18px; }
.big-yield small { color: var(--muted); }
.parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; }
.parts .field { margin-bottom: 12px; }
.tag-no { font-size: .68rem; background: #ece8e6; color: #5d504e; border-radius: 999px; padding: 1px 8px; margin-left: 4px; font-weight: 700; }
tfoot td { font-weight: 800; border-top: 2px solid var(--brand); border-bottom: 0; }
.btn-brand.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .side { position: static; } .two { grid-template-columns: 1fr; } }

/* ---- deliveries (before / after) */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.count { display: inline-block; margin-left: 6px; padding: 0 9px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .75rem; vertical-align: middle; }
.trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.trip { border: 1px solid #eadfdb; border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 16px; background: #fffdfb; display: flex; flex-direction: column; gap: 6px; }
.trip header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trip-main { font-size: 1.25rem; font-weight: 700; margin: 0; }
.trip .btn { margin-top: 6px; align-self: flex-start; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-top: 18px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f0e8e5; }
.kv dt { color: #6b5d5a; } .kv dd { margin: 0; font-weight: 600; text-align: right; }
.note { font-size: .85rem; margin: 10px 0 0; } .center { text-align: center; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } .head-actions .btn { flex: 1; text-align: center; } }
.summary .btn-outline { width: 100%; margin-top: 8px; }
td.num { white-space: nowrap; }
@media (max-width: 640px) { .hide-sm { display: none; } }

input[readonly].derived, .inp input[readonly] { background: #f6f3f1; }

[hidden] { display: none !important; }

/* sell: category tabs */
.cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cat { border: 1px solid #d9cec9; background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .85rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.cat:hover { border-color: var(--brand); }
.cat.on { background: var(--brand); border-color: var(--brand); color: #fff; }

