:root {
  --font-sans: 'Hind Siliguri', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-latin: 'Poppins', 'Hind Siliguri', system-ui, sans-serif;
  --bg: #f3f1e8;
  --surface: #fffefa;
  --surface-2: #f5f2e9;
  --surface-3: #ece7d9;
  --ink: #1c2617;
  --ink-soft: #3b4635;
  --muted: #707a68;
  --line: #e2dccb;
  --line-strong: #d0c8b3;
  --brand: #2f6b1f;
  --brand-700: #245416;
  --brand-100: #e7efdc;
  --brand-050: #f1f6ea;
  --accent: #e6ae35;
  --accent-ink: #3a2904;
  --danger: #b0372b;
  --danger-soft: #fbe8e5;
  --ok: #2b7a4a;
  --ok-soft: #e4f2e9;
  --info: #2b5f88;
  --info-soft: #e5eef7;
  --warn: #96610f;
  --warn-soft: #fbf0d7;
  --side: #16241b;
  --side-soft: #1e3024;
  --side-line: rgba(255, 255, 255, .09);
  --side-ink: #d9e3d3;
  --side-muted: #92a58a;
  --shadow-sm: 0 2px 6px rgba(40, 34, 18, .05), 0 1px 2px rgba(40, 34, 18, .06);
  --shadow-md: 0 16px 40px rgba(40, 34, 18, .12);
  --radius: 18px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans); font-size: 15px; line-height: 1.6;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 5px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.icon { width: 1.15em; height: 1.15em; flex: none; }
.block { display: block; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 300; background: var(--brand-700); color: #fff; padding: .6rem 1rem; border-radius: 0 0 10px 10px; }
.skip-link:focus { top: 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: .52rem 1.05rem;
  background: var(--brand); color: #fff; border: 1px solid transparent; border-radius: 10px;
  font-size: .86rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease, color .16s ease;
}
.btn:hover { background: var(--brand-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 1.05em; height: 1.05em; }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink-soft); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-wa { background: #25d366; color: #06351b; }
.btn-wa:hover { background: #1fbd5a; }
.btn-sm { min-height: 34px; padding: .34rem .7rem; font-size: .78rem; border-radius: 8px; }
.btn-lg { min-height: 48px; font-size: .95rem; }
.btn-block { width: 100%; }
.link-btn { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 0; padding: 0; font-size: .82rem; color: var(--side-ink); }
.link-btn:hover { color: #fff; }
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { color: #8a2319; }
.link-arrow { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--brand); }
.link-arrow.back .icon { transform: rotate(180deg); }
.link-arrow:hover .icon { transform: translateX(2px); }
.link-arrow.back:hover .icon { transform: rotate(180deg) translateX(2px); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px;
  background: transparent; border: 1px solid transparent; color: inherit;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }

/* ---------- shell ---------- */

.admin-side {
  position: fixed; inset: 0 auto 0 0; z-index: 100;
  width: 262px; display: flex; flex-direction: column;
  background: var(--side); color: var(--side-ink);
  border-right: 1px solid var(--side-line);
}
.admin-brand { display: flex; align-items: center; gap: .65rem; padding: 20px 20px 18px; border-bottom: 1px solid var(--side-line); }
.admin-brand img { width: 38px; height: 38px; border-radius: 10px; }
.admin-brand strong { display: block; color: #fff; font-size: 1rem; line-height: 1.2; }
.admin-brand small { display: block; color: var(--side-muted); font-size: .68rem; }
.admin-nav { flex: 1; padding: 14px 12px; display: grid; align-content: start; gap: 3px; overflow-y: auto; }
.admin-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .62rem .75rem; border-radius: 10px;
  font-size: .87rem; color: var(--side-ink);
  border: 1px solid transparent;
}
.admin-nav a:hover { background: var(--side-soft); color: #fff; }
.admin-nav a.active { background: var(--brand); color: #fff; border-color: rgba(255, 255, 255, .14); }
.admin-nav .icon { width: 18px; height: 18px; opacity: .9; }
.admin-side-foot { padding: 14px 18px 18px; border-top: 1px solid var(--side-line); display: grid; gap: .55rem; }
.admin-side-foot > a { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--side-muted); }
.admin-side-foot > a:hover { color: #fff; }
.admin-side-foot form { margin: 0; }
.admin-side-foot .link-btn { font-size: .8rem; color: var(--side-muted); }
.admin-side-foot .link-btn:hover { color: #fff; }
.admin-main { margin-left: 262px; min-height: 100vh; display: flex; flex-direction: column; }
.admin-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 26px; background: rgba(243, 241, 232, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.admin-menu-btn { display: none; background: var(--surface); border-color: var(--line); }
.admin-page-title { min-width: 0; }
.admin-page-title p { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.admin-page-title h1 { font-size: 1.18rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user { margin-left: auto; display: flex; align-items: center; gap: .55rem; }
.admin-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .9rem;
}
.admin-user-name { display: flex; flex-direction: column; font-size: .8rem; font-weight: 600; line-height: 1.25; }
.admin-user-name small { font-size: .68rem; color: var(--muted); font-weight: 400; }
.admin-content { padding: 24px 26px 48px; max-width: 1460px; width: 100%; }
.admin-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(9, 16, 8, .5); }

/* ---------- shared ---------- */

.flash {
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .7rem .9rem; border-radius: 12px; font-size: .84rem;
  background: var(--ok-soft); color: var(--ok); margin-bottom: 16px;
  border: 1px solid transparent;
}
.flash .icon { margin-top: .12rem; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-warn { background: var(--warn-soft); color: var(--warn); }
.flash a { text-decoration: underline; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 18px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head.wrap { row-gap: .7rem; }
.panel-head h2 { font-size: .98rem; }
.panel-empty { padding: 30px 18px; text-align: center; color: var(--muted); font-size: .84rem; }
.panel-empty a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.panel > form:not(.admin-form) { padding: 14px 18px; }
.panel > .admin-form { padding: 18px; }
.panel > .info-list { padding: 8px 18px 4px; }
.panel > .totals { padding: 12px 18px 4px; }
.panel > .cod-note { padding: 0 18px 14px; }

.admin-grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-grid-2.categories-grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
.admin-grid-2.order-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

/* ---------- dashboard ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--brand-100); color: var(--brand); }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-card p { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.stat-card strong { display: block; font-family: var(--font-latin); font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-top: 1px; }
.tone-amber .stat-icon { background: var(--warn-soft); color: var(--warn); }
.tone-blue .stat-icon { background: var(--info-soft); color: var(--info); }
.tone-slate .stat-icon { background: var(--surface-3); color: var(--ink-soft); }
.stock-list { display: grid; }
.stock-list li { display: flex; align-items: center; gap: .65rem; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.stock-list li:last-child { border-bottom: 0; }
.stock-list img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: var(--surface-2); }
.stock-list div { min-width: 0; flex: 1; }
.stock-list strong { display: block; font-size: .82rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-list small { font-size: .68rem; color: var(--muted); }
.stock-count { font-family: var(--font-latin); font-size: .76rem; background: var(--surface-2); border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; }
.stock-count.low, .stock-count.zero { background: var(--danger-soft); color: var(--danger); }
.quick-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 18px; }
.quick-links a { display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 11px; font-size: .8rem; background: var(--surface-2); }
.quick-links a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-050); }
.quick-links .icon { width: 17px; height: 17px; }

/* ---------- tables ---------- */

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 640px; }
.data-table th {
  text-align: left; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 9px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--brand-050); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-strong { font-weight: 600; font-family: var(--font-latin); font-size: .78rem; color: var(--brand); }
.data-table small.block { font-size: .68rem; color: var(--muted); font-family: var(--font-sans); }
.table-product { display: flex; align-items: center; gap: .55rem; min-width: 190px; }
.table-product img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--surface-2); }
.table-product span { font-weight: 600; font-size: .8rem; line-height: 1.35; }
.table-product small.block { font-weight: 400; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.row-actions form { margin: 0; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.pagination { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.page-link { min-width: 32px; height: 32px; padding: 0 .55rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: .74rem; }
.page-link:hover { border-color: var(--brand); color: var(--brand); }
.page-link.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-link.disabled { opacity: .4; }
.page-info { font-size: .72rem; color: var(--muted); padding-inline: .3rem; }
.status-tabs { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: .34rem .7rem; border-radius: 999px; font-size: .76rem; color: var(--ink-soft); border: 1px solid transparent; }
.tab:hover { background: var(--surface-2); }
.tab.active { background: var(--brand); color: #fff; }
.admin-search { display: flex; gap: .4rem; align-items: center; }
.admin-search input { border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: .42rem .65rem; font-size: .8rem; min-width: 210px; outline: none; }
.admin-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.head-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: .14rem .55rem; font-size: .66rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-confirmed, .status-packed { background: var(--info-soft); color: var(--info); }
.status-shipped { background: var(--brand-100); color: var(--brand); }
.status-delivered { background: var(--ok-soft); color: var(--ok); }
.status-cancelled { background: var(--danger-soft); color: var(--danger); }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: .1rem .45rem; font-size: .64rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-featured { background: var(--accent); color: var(--accent-ink); }

/* ---------- detail ---------- */

.detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.order-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: 1.25rem; margin-top: .35rem; font-family: var(--font-latin); }
.detail-head .muted { font-size: .72rem; margin-top: .2rem; }
.totals { display: grid; gap: .35rem; max-width: 340px; margin-left: auto; }
.totals > div { display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; color: var(--muted); }
.totals dd { color: var(--ink); font-family: var(--font-latin); }
.totals .summary-total { border-top: 1px solid var(--line); padding-top: .4rem; margin-top: .2rem; font-weight: 700; color: var(--ink); }
.cod-note { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--muted); }
.cod-note .icon { width: 14px; height: 14px; }
.info-list { display: grid; gap: .1rem; }
.info-list > div { display: flex; justify-content: space-between; gap: 1.2rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: .8rem; }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); flex: none; }
.info-list dd { text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.info-list a { color: var(--brand); font-weight: 600; }

/* ---------- forms ---------- */

.admin-form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field.span-2 { grid-column: 1 / -1; }
.field label { font-size: .76rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); background: var(--bg); border-radius: 9px;
  padding: .52rem .65rem; font-size: .84rem; width: 100%; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.field textarea { resize: vertical; }
.help { font-size: .68rem; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check-row { display: flex; flex-direction: row; flex-wrap: wrap; gap: 1.2rem; align-items: center; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: 4px; }
.image-field { display: flex; align-items: flex-start; gap: .8rem; }
.image-field > img { width: 84px; height: 84px; border-radius: 11px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); padding: 4px; flex: none; }
.image-field > span.logo-placeholder { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; padding: .6rem .7rem; flex: none; }
.image-field > div { flex: 1; min-width: 0; display: grid; gap: .3rem; }
.image-field input[type="file"] { font-size: .74rem; background: transparent; border: 1px dashed var(--line-strong); padding: .45rem; border-radius: 8px; width: 100%; }
.logo-preview { width: 140px; height: 52px; object-fit: contain; }
.admin-brand .admin-brand-logo { width: auto; max-width: 140px; height: 36px; border-radius: 0; object-fit: contain; }
.login-brand .admin-login-logo { width: auto; max-width: 190px; height: 52px; border-radius: 0; object-fit: contain; }
.field-label { font-size: .76rem; font-weight: 600; color: var(--ink-soft); }
.theme-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.theme-choice {
  display: flex; align-items: center; gap: .5rem; min-width: 0;
  padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); font-size: .78rem; cursor: pointer;
}
.theme-choice:hover { border-color: var(--brand); }
.theme-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-050); }
.theme-choice input[type="radio"] {
  width: 15px; height: 15px; padding: 0; margin: 0; flex: none;
  border: 0; background: none; box-shadow: none; accent-color: var(--brand);
}
.theme-choice .swatch { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.swatch-fresh { background: linear-gradient(135deg, #2f6b1f 0 50%, #e6ae35 50% 100%); }
.swatch-harvest { background: linear-gradient(135deg, #8a4a1f 0 50%, #d99a2b 50% 100%); }
.swatch-rose { background: linear-gradient(135deg, #8c3550 0 50%, #db8a63 50% 100%); }
.swatch-night { background: linear-gradient(135deg, #0c1410 0 50%, #82bf65 50% 100%); }
.inline-cat-form { padding-top: 4px; }
.category-admin { border-bottom: 1px solid var(--line); }
.category-admin:last-child { border-bottom: 0; }
.category-admin summary { display: flex; align-items: center; gap: .6rem; padding: 10px 18px; cursor: pointer; list-style: none; font-size: .8rem; }
.category-admin summary::-webkit-details-marker { display: none; }
.category-admin summary:hover { background: var(--brand-050); }
.category-admin summary img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; background: var(--surface-2); }
.cat-admin-name { flex: 1; min-width: 0; font-weight: 600; }
.cat-admin-name small { display: block; font-size: .66rem; color: var(--muted); font-weight: 400; }
.cat-admin-toggle { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; color: var(--brand); white-space: nowrap; }
.category-admin > form { padding: 0 18px 12px; }
.category-admin > form:last-child { padding-bottom: 14px; }
.coupon-admin-code { flex: 1; min-width: 0; font-weight: 700; letter-spacing: .04em; }
.coupon-admin-code small { display: block; font-size: .66rem; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.coupon-admin-meta { padding: 0 18px 8px; font-size: .7rem; color: var(--muted); }
.coupon-admin-actions { display: flex; gap: 14px; flex-wrap: wrap; padding: 0 18px 14px; }
.settings-form .panel { margin-bottom: 16px; }

/* ---------- login ---------- */

.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(47, 107, 31, .16), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(230, 174, 53, .2), transparent 46%);
}
.login-wrap { width: 100%; max-width: 430px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: var(--shadow-md); }
.login-brand { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.3rem; }
.login-brand img { width: 46px; height: 46px; border-radius: 12px; }
.login-brand strong { display: block; font-size: 1.05rem; line-height: 1.2; }
.login-brand small { display: block; font-size: .7rem; color: var(--muted); }
.login-card h1 { font-size: 1.35rem; }
.login-lead { font-size: .82rem; color: var(--muted); margin-top: .25rem; margin-bottom: 1.1rem; }
.login-form { display: grid; gap: 12px; }
.login-form .btn { margin-top: 4px; }
.login-help { margin-top: 1rem; font-size: .72rem; color: var(--muted); }
.login-help code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .08rem .3rem; font-size: .7rem; }
.login-back { display: inline-flex; align-items: center; gap: .35rem; margin-top: .9rem; font-size: .76rem; color: var(--brand); }
.login-back .icon { transform: rotate(180deg); }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-2, .admin-grid-2.order-grid { grid-template-columns: 1fr; }
  .admin-grid-2.categories-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .admin-side { transform: translateX(-102%); transition: transform .24s ease; box-shadow: var(--shadow-md); }
  .admin-side.open { transform: none; }
  .admin-main { margin-left: 0; }
  .admin-menu-btn { display: inline-flex; }
  .admin-top { padding-inline: 18px; }
  .admin-content { padding: 18px 18px 40px; }
}

@media (max-width: 720px) {
  .admin-user-name { display: none; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; }
  .admin-search { width: 100%; }
  .admin-search input { flex: 1; min-width: 0; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 12px; }
  .stat-icon { width: 40px; height: 40px; }
  .stat-card strong { font-size: 1.05rem; }
  .quick-links { grid-template-columns: 1fr; }
  .detail-head { align-items: flex-start; }
  .totals { margin-left: 0; }
  .admin-content { padding-inline: 14px; }
  .login-card { padding: 24px 20px; }
  .image-field { flex-direction: column; }
  .data-table { min-width: 560px; }
  .admin-search input,
  .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  .field select,
  .field textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* ---------- dashboard ranges, order filters, notes and history ---------- */

.range-tabs { margin-bottom: 12px; }
.status-summary { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 16px; }
.status-summary .status-pill { text-decoration: none; }
.order-filter {
  display: grid; grid-template-columns: minmax(200px, 2fr) minmax(140px, 1fr) minmax(140px, 1fr) auto;
  gap: 10px; align-items: end; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.order-filter .field { margin: 0; }
.order-filter .field label { font-size: .68rem; }
.order-filter-actions { display: flex; align-items: center; gap: .35rem; }
.note-form { display: grid; gap: 8px; padding: 0 18px 14px; }
.note-form textarea { width: 100%; resize: vertical; min-height: 76px; }
.note-list { list-style: none; margin: 0; padding: 0 18px 16px; display: grid; gap: 8px; }
.note-list li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.note-meta { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .66rem; color: var(--muted); }
.note-meta strong { color: var(--ink); font-size: .72rem; overflow-wrap: anywhere; }
.note-list p { margin-top: .3rem; font-size: .78rem; white-space: pre-wrap; }
.timeline { list-style: none; margin: 0; padding: 2px 18px 16px; display: grid; }
.timeline li { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: .5rem; padding-bottom: 14px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline-dot { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.timeline-title { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; font-size: .74rem; }
.timeline p { margin-top: .25rem; font-size: .76rem; }
.timeline small { display: block; margin-top: .2rem; font-size: .66rem; color: var(--muted); }

@media (max-width: 820px) {
  .order-filter { grid-template-columns: 1fr 1fr; }
  .order-filter .field:first-of-type { grid-column: 1 / -1; }
  .order-filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .order-filter { grid-template-columns: 1fr; }
}

/* ---------- settings spacing fix ---------- */
.settings-form .form-grid { padding: 18px; gap: 16px; }
.settings-form .panel-head { padding-bottom: 13px; }
@media (max-width: 720px) {
  .settings-form .form-grid { padding: 14px; }
  .theme-choice-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- product filters and quick stock ---------- */
.product-filter { grid-template-columns: minmax(180px, 1.7fr) minmax(140px, 1fr) minmax(120px, .8fr) auto auto; }
.product-filter .field-check { justify-content: flex-end; padding-bottom: .42rem; }
.stock-form { display: flex; align-items: center; gap: 4px; }
.stock-input {
  width: 62px; text-align: center; padding: .27rem .28rem; font: inherit; font-size: .76rem;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; outline: none;
}
.stock-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.stock-input.low { color: var(--danger); background: var(--danger-soft); border-color: currentColor; }
.stock-save { width: 30px; height: 30px; border-radius: 7px; color: var(--brand); background: var(--surface-2); border-color: var(--line); }
.stock-save .icon { width: 14px; height: 14px; }
.stock-save:hover { background: var(--brand-100); border-color: var(--brand); }
@media (max-width: 1100px) {
  .product-filter { grid-template-columns: 1fr 1fr; }
  .product-filter .field:first-child,
  .product-filter .order-filter-actions { grid-column: 1 / -1; }
  .product-filter .field-check { justify-content: flex-start; padding-bottom: 0; }
}
@media (max-width: 720px) {
  .product-filter { grid-template-columns: 1fr; }
  .product-table { min-width: 0; display: block; }
  .product-table thead { display: none; }
  .product-table tbody { display: grid; gap: 8px; padding: 10px; }
  .product-table tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px;
    padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  }
  .product-table tbody tr:hover { background: var(--surface); }
  .product-table td { display: block; padding: 0; border: 0; }
  .product-table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: .62rem; line-height: 1.3; letter-spacing: .04em;
    text-transform: uppercase; color: var(--muted); font-weight: 700;
  }
  .product-table td:first-child { grid-column: 1 / -1; }
  .product-table td:first-child::before { display: none; }
  .product-table td:nth-child(2) { grid-column: 1; }
  .product-table td:nth-child(3) { grid-column: 2; text-align: right; }
  .product-table td:nth-child(4) { grid-column: 1; }
  .product-table td:nth-child(5) { grid-column: 2; text-align: right; }
  .product-table td:nth-child(6) { grid-column: 1 / -1; }
  .product-table .table-product { min-width: 0; }
  .product-table .row-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; padding-top: 2px; }
}
