:root {
  /* DAHEYA palette: deep green #075638, muted gold #C4983F, charcoal #25292B */
  --bg: #f7f6f2; --card: #fff; --text: #25292B; --muted: #6b7068; --line: #e6e3da;
  --brand: #075638; --brand-dark: #05432b; --gold: #C4983F; --gold-light: #f6eedc;
  --danger: #b42318; --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 10px 16px; background: var(--brand); color: #fff; }
button:hover { background: var(--brand-dark); }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.ghost:hover { background: #f0f1f3; }
button.danger { background: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
label { display: block; font-size: 14px; margin: 10px 0 4px; color: var(--muted); }

header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line); }
header.top h1 { font-size: 20px; margin: 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; background: #eee; }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.price { font-weight: 700; }
.muted { color: var(--muted); font-size: 14px; }

.drawer { position: fixed; inset: 0 0 0 auto; width: min(420px, 100%); background: #fff; box-shadow: -4px 0 20px rgba(0,0,0,.1); transform: translateX(100%); transition: transform .2s; z-index: 20; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .head, .drawer .foot { padding: 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.drawer .foot { border-top: 1px solid var(--line); border-bottom: 0; flex-direction: column; align-items: stretch; gap: 10px; }
.drawer .items { flex: 1; overflow: auto; padding: 16px; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { padding: 2px 10px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 15; display: none; }
.overlay.show { display: block; }
.modal { position: fixed; inset: 0; display: none; place-items: center; z-index: 30; background: rgba(0,0,0,.35); padding: 16px; }
.modal.show { display: grid; }
.modal .box { background: #fff; border-radius: var(--radius); padding: 24px; width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--danger); margin-top: 10px; }

/* admin */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button.active { background: var(--text); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 22px; margin-top: 4px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input, .toolbar select { width: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { background: #f9fafb; color: var(--muted); font-weight: 600; }
tr.click:hover { background: #f9fafb; cursor: pointer; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #eef2ff; color: #3730a3; white-space: nowrap; }
.badge.queued { background: #fef3c7; color: #92400e; }
.badge.sent_to_taager { background: #e0f2fe; color: #075985; }
.badge.confirmed { background: #ede9fe; color: #5b21b6; }
.badge.shipped { background: #dbeafe; color: #1e40af; }
.badge.delivered { background: #dcfce7; color: #166534; }
.badge.cancelled, .badge.returned { background: #fee2e2; color: #991b1b; }
.banner { padding: 12px 16px; border-radius: var(--radius); background: #fef3c7; color: #92400e; margin-bottom: 16px; }
.hidden { display: none !important; }
.settings-grid fieldset { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 16px; margin: 0 0 14px; }
.settings-grid legend { font-weight: 700; padding: 0 6px; }
.toggle-active { min-width: 64px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } .wrap { padding: 14px; } }
