/* Natural Flora — admin (mobile-first, works one-handed on a phone) */
:root {
  --green: #2F5A1C; --green-dark: #23441A; --leaf: #6B9A2E; --light: #A8C66C;
  --cream: #FBF8EE; --cream-2: #F3EEDC; --gold: #C9962E; --text: #2B2B2B; --muted: #6B6B6B;
  --line: #E7E1CB; --danger: #B3261E; --wa: #1FA855; --r: 12px;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--sans); color: var(--text); background: #F4F1E6; }
a { color: var(--green); }
h1 { font: 700 24px/1.2 Georgia, 'Times New Roman', serif; color: var(--green); margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
h2 { font: 700 18px/1.3 Georgia, serif; color: var(--green); margin: 0 0 12px; }
small { font-size: 12.5px; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }

.a-main { max-width: 1100px; margin: 0 auto; padding: 16px 14px 110px; }
.a-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 0 0 96px; }
.a-muted { color: var(--muted); }
.a-center { text-align: center; }
.a-mt { margin-top: 22px; }
.a-hint { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }

/* Top bar & navigation */
.a-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--green-dark); color: #fff; }
.a-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.a-brand img { width: 34px; height: 34px; border-radius: 50%; }
.a-brand span { font: 700 17px/1.1 Georgia, serif; display: grid; }
.a-brand small { font: 500 10px/1.2 var(--sans); letter-spacing: 2px; text-transform: uppercase; color: var(--light); }
.a-top-actions { display: flex; align-items: center; gap: 6px; }
.a-chip { color: #fff; font-size: 13px; text-decoration: none; padding: 6px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; }
.a-more { position: relative; }
.a-more summary { list-style: none; cursor: pointer; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; font-size: 22px; line-height: 1; }
.a-more summary::-webkit-details-marker { display: none; }
.a-more[open] summary { background: rgba(255,255,255,.12); }
.a-more > div { position: absolute; right: 0; top: 44px; min-width: 220px; background: #fff; border-radius: var(--r); box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 6px; }
.a-more a, .a-more button { display: block; width: 100%; text-align: left; padding: 12px; color: var(--text); text-decoration: none; background: none; border: 0; border-radius: 8px; font: inherit; cursor: pointer; }
.a-more a:hover, .a-more button:hover { background: var(--cream); }

.a-side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(0,0,0,.05); }
.a-side a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 9px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 500; }
.a-side a.is-active { color: var(--green); }
.a-side a.is-active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--leaf); }
.a-side svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.a-side .a-desk-only { display: none; }
.a-dot { position: absolute; top: 4px; left: 54%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #fff; font: 600 11px/18px var(--sans); font-style: normal; text-align: center; }

/* Buttons */
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--green); background: var(--green); color: #fff; font: 500 14px/1.2 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.a-btn:hover { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.a-btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.a-btn-block { display: flex; width: 100%; }
.a-btn-outline { background: #fff; color: var(--green); }
.a-btn-outline:hover { background: var(--green); color: #fff; }
.a-btn-wa { background: var(--wa); border-color: var(--wa); }
.a-btn-wa:hover { background: #178A45; border-color: #178A45; }
.a-btn-danger { background: var(--danger); border-color: var(--danger); }
.a-btn-danger:hover { background: #8C1D18; border-color: #8C1D18; }
.a-btn-danger-outline { background: #fff; color: var(--danger); border-color: #E5B4AF; }
.a-btn-danger-outline:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.a-btn:disabled { opacity: .6; cursor: wait; }

/* Layout pieces */
.a-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.a-head p { margin: 0; }
.a-back { display: inline-block; font-size: 13px; text-decoration: none; margin-bottom: 4px; }
.a-card { background: #fff; border-radius: var(--r); padding: 16px; box-shadow: 0 1px 3px rgba(47,90,28,.08); margin-bottom: 14px; }
.a-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.a-card-head h2 { margin: 0; }
.a-cols { display: grid; gap: 14px; }
.a-cols > .a-card { margin: 0; }
.a-narrow { max-width: 480px; }
.a-empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.a-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.a-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.a-alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.a-alert-success { background: #EEF4E0; color: var(--green); border: 1px solid var(--light); }
.a-alert-error { background: #FBE9E7; color: #8C1D18; border: 1px solid #F3C4BF; }
.a-alert-info { background: #FBF3DD; color: #7A5A12; border: 1px solid #EED9A3; }

/* Stats */
.a-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.a-stat { display: grid; gap: 2px; padding: 14px; border-radius: var(--r); background: #fff; text-decoration: none; color: var(--text); box-shadow: 0 1px 3px rgba(47,90,28,.08); }
.a-stat small { color: var(--muted); font-size: 12px; }
.a-stat b { font-size: 22px; color: var(--green); }
.a-stat-warn { background: #FBF3DD; }
.a-stat-warn b { color: #8A6413; }

/* Lists */
.a-list { display: grid; }
.a-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; }
.a-row:last-child { border-bottom: 0; }
.a-row small { display: block; color: var(--muted); }
.a-row .a-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; text-align: right; }
.a-row .a-right form { margin: 0; }
.a-total { font-size: 16px; }
.a-total b { color: var(--green); }
.a-with-img { display: flex; align-items: center; gap: 10px; }
.a-with-img img { width: 36px; height: 36px; border-radius: 8px; }

.a-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 600 11px/1.6 var(--sans); font-style: normal; white-space: nowrap; background: #ECE8DA; color: #555; }
.st-pending { background: #FBF0D7; color: #8A6413; }
.st-confirmed { background: #E3EEF9; color: #1F4E79; }
.st-packed { background: #EDE5F7; color: #5B3A8A; }
.st-shipped { background: #E0F2F1; color: #1C5E58; }
.st-delivered { background: #E6F0D6; color: #2F5A1C; }
.st-returned { background: #FCE4D6; color: #9A3E0B; }
.st-cancelled { background: #F6DCDA; color: #8C1D18; }
.st-sample { background: #EEE; color: #666; }

/* Tabs & filters */
.a-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.a-tabs::-webkit-scrollbar { display: none; }
.a-tabs a { flex: none; display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 13px; }
.a-tabs a i { font-style: normal; color: var(--muted); font-size: 12px; }
.a-tabs a.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.a-tabs a.is-active i { color: var(--light); }
.a-filter { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
.a-filter input[type=search] { grid-column: 1 / -1; }

/* Orders */
.a-orders { display: grid; gap: 10px; }
.a-order { display: grid; gap: 4px; padding: 14px; background: #fff; border-radius: var(--r); text-decoration: none; color: var(--text); box-shadow: 0 1px 3px rgba(47,90,28,.08); border-left: 4px solid transparent; }
.a-order:has(.st-pending) { border-left-color: var(--gold); }
.a-order-top, .a-order-mid { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.a-order-top b { font-size: 16px; color: var(--green); }
.a-items { color: #4A4A42; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; }
.a-dl { display: grid; grid-template-columns: 82px 1fr; gap: 8px 10px; margin: 0 0 12px; font-size: 14px; }
.a-dl dt { color: var(--muted); }
.a-dl dd { margin: 0; word-break: break-word; }
.a-note { background: #FBF3DD; padding: 6px 10px; border-radius: 8px; }
.a-timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.a-timeline li { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line); font-size: 13.5px; }
.a-timeline li .a-badge { justify-self: start; }
.a-danger summary { color: var(--danger); cursor: pointer; font-size: 13px; }

/* Products */
.a-products { display: grid; gap: 10px; }
.a-prod { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px; background: #fff; border-radius: var(--r); box-shadow: 0 1px 3px rgba(47,90,28,.08); }
.a-prod.is-off { opacity: .65; }
.a-prod-img img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--cream); }
.a-prod-info { display: grid; gap: 2px; min-width: 0; }
.a-prod-info a { text-decoration: none; color: var(--text); }
.a-prod-info small { color: var(--muted); }
.a-prod-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.a-prod-tags b { color: var(--green); margin-right: 2px; }
.a-prod-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }
.a-prod-actions form { margin: 0; }
.a-inline-stock { display: flex; gap: 4px; margin-right: auto !important; }

/* Forms */
.a-form { display: grid; gap: 0; }
.a-field { display: block; margin-bottom: 14px; border: 0; padding: 0; }
.a-field > span, .a-field > legend { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; padding: 0; }
.a-field small { font-weight: 400; color: var(--muted); }
.a-input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #D8D1B8; border-radius: 10px; background: #fff; font: 16px/1.4 var(--sans); color: var(--text); }
.a-input:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(107,154,46,.18); }
textarea.a-input { resize: vertical; }
input[type=file].a-input { padding: 9px; font-size: 14px; }
.a-input-sm { width: 80px; min-height: 36px; padding: 6px 8px; }
.a-error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }
.a-grid2, .a-grid3 { display: grid; gap: 0 12px; }
.a-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.a-check { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); font-size: 14px; cursor: pointer; }
.a-check input { width: 18px; height: 18px; accent-color: var(--green); }
.a-check-big { display: flex; margin-bottom: 14px; font-weight: 500; }
.a-components { display: grid; gap: 8px; margin-bottom: 10px; }
.a-comp { display: grid; grid-template-columns: 1fr 70px auto; gap: 6px; align-items: center; }
.a-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.a-imgs figure { margin: 0; }
.a-imgs img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; background: var(--cream); }
.a-imgs figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 4px; }
.a-img-pick { display: grid; gap: 4px; font-size: 13px; cursor: pointer; }
.a-img-pick span { display: flex; align-items: center; gap: 6px; }
.a-more-fields summary { cursor: pointer; font-weight: 600; color: var(--green); padding: 6px 0 12px; }
.a-savebar { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 30; display: flex; gap: 8px; justify-content: flex-end; padding: 12px; margin: 0 -14px; background: rgba(244,241,230,.96); border-top: 1px solid var(--line); }
.a-savebar .a-btn { flex: 1; max-width: 260px; }
.a-brand-preview { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; font-size: 13.5px; }
.a-logo-box { background: var(--cream); border-radius: 10px; padding: 8px 14px; }
.a-logo { height: 48px; width: auto; }
.logo-text { font: 700 24px Georgia, serif; color: var(--green); }

/* Login */
.admin-guest { background: radial-gradient(ellipse at top, #F2EDD6, #F4F1E6 60%); }
.admin-guest .a-foot { padding-bottom: 24px; }
.a-login { min-height: 80vh; display: grid; place-items: center; }
.a-login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 28px 22px; box-shadow: 0 12px 34px rgba(47,90,28,.12); }
.a-login-logo { display: flex; justify-content: center; margin-bottom: 12px; }
.a-login-logo .a-logo { height: 64px; }
.a-login h1 { justify-content: center; margin-bottom: 16px; }

@media (min-width: 720px) {
  .a-main { padding: 24px 24px 60px; }
  .a-stats { grid-template-columns: repeat(3, 1fr); }
  .a-cols { grid-template-columns: 1fr 1fr; align-items: start; }
  .a-grid2 { grid-template-columns: 1fr 1fr; }
  .a-grid3 { grid-template-columns: 1fr 1fr 1fr; }
  .a-filter { grid-template-columns: 1fr 200px auto; }
  .a-filter input[type=search] { grid-column: auto; }
  .a-prod { grid-template-columns: 72px 1fr auto; align-items: center; }
  .a-prod-actions { grid-column: auto; border: 0; padding: 0; justify-content: flex-end; max-width: 420px; }
}
@media (min-width: 1000px) {
  body.admin:not(.admin-guest) { padding-left: 220px; }
  .a-top { position: fixed; left: 0; top: 0; bottom: 0; width: 220px; flex-direction: column; align-items: stretch; padding: 18px 12px; gap: 18px; }
  .a-brand { margin: 0 0 6px; }
  .a-side { position: static; display: grid; grid-template-columns: 1fr; background: none; border: 0; box-shadow: none; padding: 0; gap: 2px; }
  .a-side a, .a-side .a-desk-only { display: flex; justify-items: start; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; color: #D9DCC8; font-size: 14px; }
  .a-side a:hover { background: rgba(255,255,255,.07); color: #fff; }
  .a-side a.is-active { background: rgba(255,255,255,.12); color: #fff; }
  .a-side a.is-active::before { display: none; }
  .a-dot { position: static; margin-left: auto; }
  .a-top-actions { margin-top: auto; flex-direction: column; align-items: stretch; }
  .a-chip { text-align: center; }
  .a-more > div { bottom: 44px; top: auto; left: 0; right: auto; }
  .a-foot { padding: 0 0 24px; }
  .a-savebar { bottom: 0; margin: 0; border-radius: var(--r); }
}

/* ---------- Phase 2 ---------- */
.a-hub { display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(47,90,28,.08); }
.a-hub a { display: flex; justify-content: space-between; padding: 14px 16px; background: #fff; color: var(--text); text-decoration: none; font-weight: 500; }
.a-hub a span { color: var(--muted); }
.a-switch { display: flex; align-items: center; gap: 10px; font: 700 18px/1.3 Georgia, serif; color: var(--green); margin-bottom: 10px; cursor: pointer; }
.a-switch input { width: 22px; height: 22px; accent-color: var(--green); }
.a-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.a-inline-form .a-input:not(.a-input-sm) { flex: 1 1 180px; width: auto; }
.a-inline-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.a-proof { display: block; margin: 8px 0 12px; text-decoration: none; }
.a-proof img { max-height: 320px; width: auto; border-radius: 10px; border: 1px solid var(--line); }
.a-proof span { font-size: 12px; color: var(--muted); }
.a-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.a-order-sel { position: relative; padding: 0; display: block; }
.a-order-sel.is-pending { border-left-color: var(--gold); }
.a-order-link { display: grid; gap: 4px; padding: 14px 14px 14px 46px; color: var(--text); text-decoration: none; }
.a-order-tick { position: absolute; left: 14px; top: 16px; width: 22px; height: 22px; accent-color: var(--green); z-index: 1; }
.a-selectall { margin-bottom: 10px; }
.a-bulkbar { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 30; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--green-dark); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.a-bulkbar .a-input { flex: 1 1 160px; width: auto; min-height: 40px; }
.a-bulkbar .a-btn { background: var(--gold); border-color: var(--gold); }
.a-code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; color: var(--green); }
.a-row-hl { background: #FBF3DD; border-radius: 8px; padding-inline: 8px; }
.a-report { list-style: none; padding: 0; margin: 0 0 14px; font-size: 13.5px; max-height: 360px; overflow: auto; }
.a-report li { padding: 5px 0; border-bottom: 1px solid var(--line); }
code { background: var(--cream-2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
@media (min-width: 720px) { .a-hub { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .a-bulkbar { bottom: 12px; } }
