/* Atchayam Agro – black & yellow brand theme */
:root {
  --brand: #f6c90e;        /* logo yellow */
  --brand-strong: #e0b000; /* hover */
  --brand-soft: #fff6cc;   /* tints, selected rows */
  --brand-line: #f1dc85;
  --ink: #141414;          /* brand black */
  --ink-2: #2a2a2a;
  --gold-text: #7a5c00;    /* readable "yellow" for text on white */
  --green: #2e7d32;        /* profit / paid only */
  --green-soft: #e8f5e9;
  --amber: #b26a00;
  --amber-soft: #fff4e0;
  --red: #c62828;
  --red-soft: #fdecea;
  --text: #1c1b18;
  --muted: #6b675c;
  --line: #ebe7dc;
  --bg: #faf8f2;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.05), 0 4px 14px rgba(20, 20, 20, 0.05);
  --font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Tamil', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--gold-text); font-weight: 600; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; font-family: var(--font-head); font-weight: 600; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  background: var(--ink); color: #fff;
  padding: 0 16px; height: 60px;
  border-bottom: 3px solid var(--brand);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 18px; white-space: nowrap; color: var(--brand); }
.brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 2px rgba(246, 201, 14, 0.35); }
.brand small { display: block; font-family: system-ui, sans-serif; font-size: 11px; font-weight: 500; color: #bdb59b; letter-spacing: 0.04em; margin-top: -2px; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #d9d6cc; text-decoration: none; padding: 8px 12px; border-radius: 8px; white-space: nowrap; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a.active { background: var(--brand); color: var(--ink); font-weight: 700; }
.topbar .logout { background: transparent; color: var(--brand); border: 1px solid rgba(246, 201, 14, 0.5); }
.topbar .logout:hover { background: rgba(246, 201, 14, 0.12); }
main { max-width: 1240px; margin: 0 auto; padding: 22px 16px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- cards / grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 16px; }
.kpi { border-top: 4px solid var(--brand); }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi .value { font-family: var(--font-head); font-size: 26px; font-weight: 700; margin: 4px 0; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; color: var(--muted); }
.kpi .sub b { color: var(--text); }
.kpi.dark { background: var(--ink); color: #fff; border-color: var(--ink); border-top-color: var(--brand); }
.kpi.dark .label, .kpi.dark .sub { color: #bdb59b; }
.kpi.dark .value { color: var(--brand); }
.kpi.dark .sub b { color: #fff; }
.kpi.alert { border-color: #f3c27a; border-top-color: var(--amber); background: var(--amber-soft); }
.profit-pos { color: var(--green); }
.profit-neg { color: var(--red); }
.kpi.dark .profit-pos { color: #7ee08a; }
.kpi.dark .profit-neg { color: #ff8a80; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; background: #fbf9f3; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: #fffbea; }
tr.clickable { cursor: pointer; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.paid { background: var(--green-soft); color: var(--green); }
.badge.pending { background: var(--amber-soft); color: var(--amber); }
.badge.low { background: var(--red-soft); color: var(--red); }
.badge.fast { background: var(--ink); color: var(--brand); }
.badge.slow { background: #efede6; color: #5e5a4e; }
.badge.cat { background: var(--brand-soft); color: var(--gold-text); border: 1px solid var(--brand-line); }

/* stock quantity pill – same width for every row so numbers line up */
.qty { display: inline-block; min-width: 48px; padding: 2px 10px; border-radius: 999px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty.warn { background: var(--amber-soft); color: var(--amber); }
.qty.out { background: var(--red-soft); color: var(--red); }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 9px 10px; border: 1px solid #d9d3c3; border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(246, 201, 14, 0.45); border-color: var(--ink); }
textarea { resize: vertical; min-height: 60px; }
.field { margin-bottom: 12px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input, .inline select { width: auto; }
.seg { display: inline-flex; border: 1px solid #d9d3c3; border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: #fff; color: var(--text); padding: 8px 14px; }
.seg button:hover { background: var(--brand-soft); }
.seg button.on { background: var(--ink); color: var(--brand); }

button, .btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 8px; padding: 9px 14px;
  border: 1px solid var(--brand); background: var(--brand); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background 0.15s, transform 0.05s;
}
button:hover, .btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
button:active, .btn:active { transform: translateY(1px); }
button.dark, .btn.dark { background: var(--ink); border-color: var(--ink); color: var(--brand); }
button.dark:hover, .btn.dark:hover { background: var(--ink-2); }
button.secondary, .btn.secondary { background: #fff; color: var(--ink); border-color: #d9d3c3; }
button.secondary:hover, .btn.secondary:hover { background: var(--brand-soft); border-color: var(--brand-line); }
button.danger { background: #fff; color: var(--red); border-color: #f0b8b8; }
button.danger:hover { background: var(--red-soft); }
button.wa, .btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
button.wa:hover, .btn.wa:hover { background: #1da851; }
button.sm, .btn.sm { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
.icon-btn { background: transparent; border: 0; color: var(--muted); padding: 4px 8px; font-weight: 400; }
.icon-btn:hover { background: #f1eee5; color: var(--text); border: 0; }

/* ---------- sale form ---------- */
.items-table input, .items-table select { padding: 7px 8px; }
.items-table td { padding: 6px; }
.totals { margin-left: auto; max-width: 340px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-family: var(--font-head); font-size: 20px; font-weight: 700; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 20, 20, 0.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 12px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); overflow: hidden; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 3px solid var(--brand); background: var(--ink); color: #fff; }
.modal-head h3 { margin: 0; color: var(--brand); }
.modal-head .icon-btn { color: #ddd; }
.modal-head .icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; background: #fcfbf7; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--brand); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 600; }
.toast.error { background: var(--red); color: #fff; }

/* ---------- chart ---------- */
.chart-box { position: relative; height: 290px; }

/* ---------- category bars (expenses) ---------- */
.bar-list { display: grid; gap: 8px; }
.bar-list .bl-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar-list .bl-track { height: 10px; background: #f1eee5; border-radius: 5px; overflow: hidden; }
.bar-list .bl-fill { height: 100%; background: var(--ink); border-radius: 5px; }
.bar-list .bl-row:first-child .bl-fill { background: var(--brand-strong); }

/* ---------- P&L statement ---------- */
.pnl { max-width: 720px; }
.pnl table td { padding: 10px 12px; }
.pnl .pnl-head td { background: var(--ink); color: var(--brand); font-family: var(--font-head); font-weight: 600; }
.pnl .indent td:first-child { padding-left: 32px; color: var(--muted); }
.pnl .subtotal td { font-weight: 700; border-top: 2px solid var(--ink); background: #fffbea; }
.pnl .grand td { font-family: var(--font-head); font-size: 18px; font-weight: 700; border-top: 3px double var(--ink); border-bottom: 0; }
.pnl .grand.loss td { background: var(--red-soft); }
.pnl .grand.gain td { background: var(--brand-soft); }

/* ---------- multi-select ---------- */
input.chk { width: 18px; height: 18px; padding: 0; accent-color: var(--ink); cursor: pointer; vertical-align: middle; }
tr.selected { background: var(--brand-soft) !important; }
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 16px; background: var(--brand-soft); border-color: var(--brand-line); }
.bulk-bar b { margin-right: auto; }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 16px;
  background:
    radial-gradient(circle at 15% 20%, rgba(246, 201, 14, 0.18), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(246, 201, 14, 0.12), transparent 45%),
    var(--ink);
}
.login-shell {
  width: 100%; max-width: 880px; display: grid; grid-template-columns: 1fr 1fr;
  background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  animation: rise 0.5s ease-out both;
}
.login-art { position: relative; background: #fcd54c; min-height: 460px; display: grid; place-items: center; padding: 24px 24px 56px; }
.login-art img { width: 100%; max-width: 400px; height: auto; display: block; border-radius: 12px; }
.login-art .ribbon {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 22px;
  background: linear-gradient(transparent, rgba(20, 20, 20, 0.85)); color: #fff; font-size: 13px; letter-spacing: 0.03em;
}
.login-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form .eyebrow { display: inline-block; align-self: flex-start; background: var(--ink); color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.login-form h1 { font-size: 28px; margin: 0 0 4px; color: var(--ink); }
.login-form .lead { color: var(--muted); margin: 0 0 26px; }
.login-form .field { margin-bottom: 16px; }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #a39d8c; pointer-events: none; display: flex; }
.input-icon input { padding: 12px 44px 12px 40px; border-radius: 10px; background: #fbfaf6; }
.input-icon input:focus { background: #fff; }
.input-icon .peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; color: #8a8576; padding: 6px 8px; font-weight: 600; font-size: 12px; }
.input-icon .peek:hover { color: var(--ink); background: #f1eee5; }
.login-form .submit { width: 100%; justify-content: center; padding: 13px; font-size: 16px; border-radius: 10px; background: var(--ink); border-color: var(--ink); color: var(--brand); margin-top: 4px; }
.login-form .submit:hover { background: var(--ink-2); }
.login-form .foot { margin-top: 22px; font-size: 12px; color: #a39d8c; text-align: center; }
.powered-by {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px;
  border: 1px solid rgba(246, 201, 14, 0.25); border-radius: 999px; background: rgba(255, 255, 255, 0.04);
  color: #cfc8b0; font-size: 13px; letter-spacing: 0.02em; animation: rise 0.5s 0.15s ease-out both; text-align: left;
}
.powered-by b { color: var(--brand); font-weight: 700; }
.powered-by .pb-logo { flex: none; }
.error-text { color: var(--red); font-size: 14px; min-height: 20px; margin: 0 0 8px; }
.shake { animation: shake 0.35s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .login-shell, .shake { animation: none; } }

/* ---------- invoice ---------- */
.invoice { background: #fff; color: #111; padding: 24px; font-size: 14px; }
.invoice .inv-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 4px solid var(--brand); padding-bottom: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.invoice .inv-brand { display: flex; gap: 12px; align-items: center; }
.invoice .inv-brand img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.invoice .shop-name { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--ink); }
.invoice .tagline { font-style: italic; color: var(--gold-text); font-size: 13px; }
.invoice .inv-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; text-align: right; letter-spacing: 0.1em; color: var(--ink); }
.invoice .meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.invoice table th { background: var(--ink); color: var(--brand); position: static; }
.invoice .inv-totals { margin-left: auto; width: 280px; max-width: 100%; margin-top: 10px; }
.invoice .inv-totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.invoice .inv-totals .grand { font-weight: 800; font-size: 17px; border-top: 2px solid #111; margin-top: 4px; padding: 6px 6px 4px; background: var(--brand); }
.invoice .thanks { text-align: center; margin-top: 22px; color: var(--muted); font-style: italic; }
.public-invoice { max-width: 760px; margin: 20px auto; box-shadow: var(--shadow); border-radius: 12px; overflow: hidden; }
.public-actions { max-width: 760px; margin: 12px auto; display: flex; gap: 8px; justify-content: flex-end; padding: 0 12px; }

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; max-width: 420px; }
  .login-art { min-height: 0; padding: 0; }
  .login-art img { max-width: 100%; height: 190px; object-fit: cover; object-position: center 52%; border-radius: 0; }
  .login-art .ribbon { display: none; }
  .login-form { padding: 28px 24px 30px; }
}
@media (max-width: 640px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 6px; }
  .nav { order: 3; width: 100%; flex: none; }
  .brand { flex: 1; }
  .kpi .value { font-size: 22px; }
  .invoice { padding: 14px; }
  .bulk-bar { top: 0; }
}

@media print {
  body { background: #fff; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .no-print, .modal-head, .modal-foot, .public-actions, #toast { display: none !important; }
  .modal-backdrop { position: static; background: none; padding: 0; display: block; }
  .modal { box-shadow: none; max-width: none; }
  .modal-body { padding: 0; }
  body.printing-invoice main { display: none; }
  .public-invoice { box-shadow: none; margin: 0; }
  .card { box-shadow: none; }
}

/* =====================================================================
   CUSTOMER SHOP
   ===================================================================== */
body.shop { background: var(--bg); }
.shop-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); padding: 10px 16px; border-bottom: 3px solid var(--brand);
}
.shop-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.shop-brand img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.shop-brand small { display: block; font-family: system-ui, sans-serif; font-size: 11px; font-weight: 500; color: #bdb59b; letter-spacing: 0.04em; }
.shop-top-actions { display: flex; align-items: center; gap: 8px; }
.admin-link { background: transparent; color: #cfc8b0; border-color: rgba(246, 201, 14, 0.35); font-weight: 600; }
.admin-link:hover { background: rgba(246, 201, 14, 0.12); color: var(--brand); border-color: var(--brand); }
.cart-btn { position: relative; background: var(--brand); color: var(--ink); border-color: var(--brand); padding: 8px 14px; }
.cart-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--brand); font-size: 12px; }
.cart-count.zero { opacity: 0.55; }

.shop-hero { background: linear-gradient(120deg, #fcd54c 0%, #f6c90e 60%, #f0b800 100%); }
.shop-hero-inner { max-width: 1200px; margin: 0 auto; padding: 22px 16px; }
.shop-hero h1 { font-size: clamp(20px, 3.4vw, 30px); margin: 0 0 6px; color: var(--ink); }
.shop-hero p { margin: 0; color: #3b3200; font-weight: 500; }

.shop-main { max-width: 1200px; margin: 0 auto; padding: 16px 16px 120px; }
.shop-closed { background: var(--amber-soft); border: 1px solid #f3c27a; color: var(--amber); padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-weight: 600; }
.shop-tools { position: sticky; top: 67px; z-index: 20; background: var(--bg); padding: 8px 0 10px; }
.shop-tools input[type=search] { border-radius: 999px; padding: 11px 16px; background: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; background: #fff; color: var(--ink); border: 1px solid #ddd6c3; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; }
.chip:hover { background: var(--brand-soft); border-color: var(--brand-line); }
.chip.on { background: var(--ink); color: var(--brand); border-color: var(--ink); }

.grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 6px; }
.grid-products > .empty { grid-column: 1 / -1; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform 0.12s, box-shadow 0.12s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20, 20, 20, 0.08); }
.pimg { aspect-ratio: 1 / 1; background: #fbf7e8; position: relative; }
.pimg > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: repeating-linear-gradient(45deg, #fff8d9, #fff8d9 10px, #fff3c2 10px, #fff3c2 20px); color: #8a7a3c; font-size: 12px; font-weight: 600; text-align: center; padding: 8px; }
.ph img { width: 46%; max-width: 90px; border-radius: 10px; opacity: 0.7; filter: grayscale(0.2); }
.ph.small { font-size: 0; gap: 0; }
.ph.small img { width: 70%; }
.pbody { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.pcat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pname { font-family: var(--font-head); font-size: 15px; font-weight: 600; margin: 2px 0 6px; line-height: 1.25; }
.pmeta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; min-height: 22px; }
.pack { background: #f1eee5; color: #4b473c; border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.few { background: var(--amber-soft); color: var(--amber); border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.pprice { font-family: var(--font-head); font-size: 20px; font-weight: 700; margin-bottom: 10px; margin-top: auto; }
.pactions { display: flex; gap: 6px; align-items: center; }
.stepper { display: inline-flex; align-items: center; border: 1px solid #d9d3c3; border-radius: 10px; overflow: hidden; background: #fff; flex: none; }
.stepper button { background: #fff; color: var(--ink); border: 0; border-radius: 0; padding: 6px 10px; font-size: 16px; line-height: 1; }
.stepper button:hover { background: var(--brand-soft); }
.stepper input { width: 38px; border: 0; padding: 6px 0; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; }
.stepper.sm button { padding: 3px 9px; }
.add-btn { flex: 1; justify-content: center; padding: 8px 6px; font-size: 14px; background: var(--ink); color: var(--brand); border-color: var(--ink); }
.add-btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.incart { margin-top: 6px; font-size: 12px; color: var(--green); font-weight: 700; }

.cart-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 25; display: none; justify-content: space-between; padding: 14px 18px; border-radius: 14px; background: var(--ink); color: var(--brand); border-color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); font-size: 15px; }
.cart-bar b { color: #fff; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 20, 20, 0.5); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: #fff; z-index: 41; transform: translateX(105%); transition: transform 0.25s ease; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25); }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--ink); border-bottom: 3px solid var(--brand); }
.drawer-head h3 { margin: 0; color: var(--brand); }
.drawer-head .icon-btn { color: #ddd; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 24px; }
.drawer-body h4 { font-family: var(--font-head); margin: 18px 0 8px; font-size: 15px; }
.cline { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cthumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #fbf7e8; }
.cthumb img { width: 100%; height: 100%; object-fit: cover; }
.cname { font-weight: 700; line-height: 1.25; }
.cinfo .stepper { margin-top: 6px; }
.cright { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ful { display: grid; gap: 8px; }
.ful-opt { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--text); font-weight: 400; margin: 0; }
.ful-opt input { grid-row: span 2; width: 18px; height: 18px; accent-color: var(--ink); }
.ful-opt b { font-size: 15px; }
.ful-opt span { grid-column: 2; font-size: 12px; color: var(--muted); }
.ful-opt em { grid-row: 1; grid-column: 3; font-style: normal; font-weight: 700; font-size: 13px; }
.ful-opt.on { border-color: var(--ink); background: var(--brand-soft); }
.ctotals { margin-top: 14px; border-top: 1px dashed #d9d3c3; padding-top: 10px; }
.ctotals > div { display: flex; justify-content: space-between; padding: 3px 0; }
.ctotals .grand { font-family: var(--font-head); font-weight: 700; font-size: 20px; padding-top: 8px; }
.hint { font-size: 12px; color: var(--green); font-weight: 600; }
.checkout { width: 100%; justify-content: center; margin-top: 14px; padding: 14px; font-size: 16px; border-radius: 12px; }
.linkish { display: block; width: 100%; background: transparent; border: 0; color: var(--muted); text-decoration: underline; font-weight: 600; margin-top: 10px; }
.linkish:hover { background: transparent; color: var(--ink); }

.shop-modal { max-width: 420px; }
.pay-amount { font-family: var(--font-head); font-size: 34px; font-weight: 700; text-align: center; }
.qr-box { width: 240px; max-width: 80%; margin: 0 auto; padding: 10px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; }
.qr-box svg { display: block; width: 100%; height: auto; }
.pay-steps { text-align: center; color: var(--muted); font-size: 14px; }
.upi-id { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fbf9f3; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; word-break: break-all; }
.placed { text-align: center; padding-top: 26px; }
.placed .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: var(--ink); display: grid; place-items: center; font-size: 34px; font-weight: 800; margin: 0 auto 10px; }
.placed h2 { margin-bottom: 4px; }
.order-no { display: inline-block; background: var(--ink); color: var(--brand); font-family: var(--font-head); font-weight: 700; padding: 6px 14px; border-radius: 999px; margin: 6px 0 12px; }
.placed-sum { text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.placed-sum > div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; }
.placed-sum .grand { font-weight: 800; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-size: 16px; }

.shop-foot { background: var(--ink); color: #cfc8b0; text-align: center; padding: 22px 16px 90px; font-size: 14px; line-height: 1.8; }
.shop-foot a { color: var(--brand); }

.track { max-width: 640px; margin: 0 auto; padding: 18px 16px 60px; display: grid; gap: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding-bottom: 18px; position: relative; color: var(--muted); }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.steps li.done:not(:last-child)::before { background: var(--ink); }
.steps .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #f1eee5; font-weight: 700; }
.steps li.done { color: var(--text); }
.steps li.done .dot { background: var(--ink); color: var(--brand); }
.steps li.now .dot { box-shadow: 0 0 0 4px rgba(246, 201, 14, 0.5); }

/* admin: orders + photos */
.thumb { width: 42px; height: 42px; border-radius: 8px; overflow: hidden; background: #fbf7e8; flex: none; display: inline-block; vertical-align: middle; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { font-size: 0; gap: 0; padding: 4px; }
.thumb .ph img { width: 80%; }
.photo-preview { width: 100%; max-width: 280px; aspect-ratio: 1 / 1; margin: 0 auto 12px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fbf7e8; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; margin-left: 4px; }
.order-card { display: grid; gap: 10px; }
.order-card .oc-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.order-card .oc-items { font-size: 14px; }
.order-card .oc-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.badge.st-Placed { background: #e3f2fd; color: #1565c0; }
.badge.st-Ready { background: var(--brand-soft); color: var(--gold-text); border: 1px solid var(--brand-line); }
.badge.st-Completed { background: var(--green-soft); color: var(--green); }
.badge.st-Cancelled { background: #efede6; color: #6b675c; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

@media (max-width: 640px) {
  .shop-brand span { font-size: 16px; }
  .shop-brand small { display: none; }
  .admin-link { padding: 6px 8px; font-size: 12px; }
  .cart-label { display: none; }
  .grid-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pbody { padding: 8px 10px 10px; }
  .pname { font-size: 14px; }
  .pprice { font-size: 18px; }
  .pactions { flex-direction: column; align-items: stretch; }
  .stepper { justify-content: space-between; }
  .stepper input { flex: 1; }
  .cart-bar:not(.hidden) { display: flex; }
  .shop-tools { top: 64px; padding: 6px 0 6px; }
  .shop-tools input[type=search] { padding: 8px 14px; }
  .chips { padding-top: 6px; }
  .chip { padding: 4px 12px; font-size: 13px; }
  .admin-text { display: none; }
  .admin-link { padding: 6px 10px; }
  .shop-brand { font-size: 16px; white-space: nowrap; }
  .shop-brand img { width: 38px; height: 38px; }
  .pimg { aspect-ratio: 4 / 3; }
  .ph { gap: 4px; font-size: 11px; }
  .ph img { width: 34%; }
  .shop-hero-inner { padding: 14px 16px; }
}

/* toast above the floating cart bar on the shop */
body.shop #toast { bottom: 92px; }

/* admin menu: wrap onto two lines on laptops instead of hiding items */
@media (min-width: 641px) {
  .topbar { height: auto; min-height: 60px; padding: 6px 16px; flex-wrap: nowrap; }
  .nav { flex-wrap: wrap; overflow: visible; row-gap: 4px; }
  .nav a { padding: 7px 10px; }
}

/* admin: product photos + offers */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.photo-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.photo-card.saved { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.photo-box { aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #fbf7e8; margin-bottom: 4px; position: relative; }
.photo-box > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-box.busy::after { content: "Uploading…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.8); font-weight: 700; }
.photo-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.photo-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.offer-card { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; }
.offer-thumb { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--brand-soft); display: grid; place-items: center; }
.offer-thumb img { width: 100%; height: 100%; object-fit: cover; }
.offer-ico { font-size: 40px; }
.offer-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; margin: 4px 0 2px; }
.offer-actions { display: flex; flex-direction: column; gap: 6px; }
.banner-preview { width: 100%; aspect-ratio: 12 / 5; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fbf7e8; margin-bottom: 12px; }
.banner-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) {
  .offer-card { grid-template-columns: 64px 1fr; }
  .offer-thumb { width: 64px; height: 64px; }
  .offer-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* login: forgot / reset password */
.forgot-row { display: flex; justify-content: flex-end; margin: -6px 0 8px; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--gold-text); font-weight: 700; font-size: 14px; text-decoration: underline; cursor: pointer; }
.linkbtn:hover { background: none; color: var(--ink); }
.linkbtn:disabled { color: var(--muted); text-decoration: none; cursor: default; opacity: 1; }
.reset-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.sent-note { background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
.sent-note span { color: var(--muted); font-size: 13px; }
.code-input { font-size: 26px; letter-spacing: 12px; text-align: center; font-weight: 700; padding: 10px; }
.ok-text { background: var(--green-soft); color: var(--green); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 600; margin-bottom: 8px; }

/* users & access */
.user-chip { color: #d9d6cc; font-size: 13px; font-weight: 600; white-space: nowrap; padding: 0 4px; }
.user-chip small { color: var(--brand); font-weight: 700; margin-left: 2px; }
.user-card.off { opacity: 0.6; }
.user-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.user-name { font-family: var(--font-head); font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.perm { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; margin: 0; cursor: pointer; color: var(--text); font-weight: 400; background: #fff; }
.perm input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.perm b { display: block; font-size: 14px; }
.perm small { color: var(--muted); font-size: 12px; }
.perm.on { border-color: var(--brand-line); background: var(--brand-soft); }
.perm-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 640px) { .user-chip { display: none; } }
