/* ═══ ADMIN ════════════════════════════════════════════════════ */
.admin-body { background: #F2EFE9; }

/* ─── AUTH ───────────────────────────────────────────────────── */
.auth {
  position: fixed; inset: 0; z-index: 300;
  background: var(--paper);
  display: none; place-items: center; padding: 1.5rem;
}
.auth.on { display: grid; }
.auth-card {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 2.8rem 2.4rem; max-width: 420px; width: 100%;
  box-shadow: var(--sh-3); text-align: center;
}
.auth-brand {
  font-family: var(--display); font-size: 2rem; font-weight: 500;
  letter-spacing: .1em; margin-bottom: 1.4rem;
}
.auth-brand sup { font-family: var(--ui); font-size: .55rem; font-weight: 600; color: var(--clay); }
.auth-card h2 { font-size: 1.5rem; }
.auth-sub { font-size: .86rem; color: var(--ink-3); margin-bottom: 1.8rem; }
.auth-card .form-grid { text-align: left; }
.auth-err { font-size: .8rem; color: var(--clay-deep); min-height: 1.2em; text-align: center; }
.auth-hint { margin-top: 1.2rem; font-size: .74rem; color: var(--ink-3); line-height: 1.6; }

/* ─── SIDEBAR ────────────────────────────────────────────────── */
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 80;
  width: 244px; background: var(--ink);
  display: flex; flex-direction: column;
}
.side-top {
  padding: 1.7rem 1.5rem 1.3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: baseline; gap: .7rem;
}
.side-brand { font-family: var(--display); font-size: 1.5rem; font-weight: 500; letter-spacing: .1em; color: #fff; }
.side-brand sup { font-family: var(--ui); font-size: .45rem; font-weight: 600; color: var(--clay); }
.side-tag {
  font-size: .58rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--clay); background: rgba(176,139,147,.16);
  padding: .18rem .5rem; border-radius: 100px;
}
.side-nav { flex: 1; padding: 1.2rem .65rem; display: grid; gap: .2rem; align-content: start; }
.side-link {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .72rem .9rem; border-radius: var(--r-sm);
  font-size: .85rem; font-weight: 500; text-align: left;
  color: rgba(255,255,255,.55); transition: all var(--t);
}
.side-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-link.on { color: #fff; background: rgba(255,255,255,.11); }
.side-link .ic { width: 18px; text-align: center; font-size: .95rem; }
.side-pill {
  margin-left: auto; font-size: .68rem; font-weight: 700;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.75);
  padding: .1rem .45rem; border-radius: 100px; min-width: 22px; text-align: center;
}
.side-link.on .side-pill { background: var(--clay); color: #fff; }
.side-foot { padding: 1.3rem 1.5rem; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: .8rem; }
.side-back { font-size: .8rem; color: rgba(255,255,255,.45); transition: color var(--t); }
.side-back:hover { color: rgba(255,255,255,.85); }
.side-out { font-size: .8rem; color: rgba(255,255,255,.4); text-align: left; transition: color var(--t); }
.side-out:hover { color: var(--clay); }

.side-toggle {
  position: fixed; top: 1rem; left: 1rem; z-index: 85;
  width: 42px; height: 42px; border-radius: 100px;
  background: var(--ink); color: #fff; font-size: 1.1rem;
  display: none; place-items: center; box-shadow: var(--sh-2);
}

/* ─── MAIN ───────────────────────────────────────────────────── */
.main { margin-left: 244px; padding: 2.2rem; min-height: 100vh; }
.sec-a { display: none; }
.sec-a.on { display: block; }

.a-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.7rem; flex-wrap: wrap;
}
.a-head h1 { font-size: 1.9rem; }
.a-sub { font-size: .85rem; color: var(--ink-3); margin-top: .15rem; }

/* ─── STATS ──────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1.6rem; }
.stat-c {
  background: var(--surface); border-radius: var(--r);
  padding: 1.3rem 1.4rem; box-shadow: var(--sh-1);
  display: grid; gap: .2rem;
}
.stat-c .n { font-family: var(--display); font-size: 2rem; font-weight: 600; line-height: 1; }
.stat-c .l { font-size: .74rem; color: var(--ink-3); letter-spacing: .04em; }

/* ─── TOOLBAR ────────────────────────────────────────────────── */
.a-bar { display: flex; gap: .8rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.a-bar input[type="search"], .a-bar select {
  padding: .72rem 1rem; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface);
  font-size: .86rem; outline: none; transition: border-color var(--t);
}
.a-bar input[type="search"] { flex: 1; min-width: 200px; }
.a-bar input:focus, .a-bar select:focus { border-color: var(--ink); }

/* ─── ORDER ROWS ─────────────────────────────────────────────── */
.ord {
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--sh-1); margin-bottom: .7rem;
  padding: 1.1rem 1.3rem;
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 1.2rem; align-items: center;
  transition: box-shadow var(--t);
}
.ord:hover { box-shadow: var(--sh-2); }
.ord-no { font-family: var(--display); font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; color: var(--clay-text); }
.ord-who { font-size: .88rem; font-weight: 500; margin-top: .1rem; }
.ord-meta { font-size: .76rem; color: var(--ink-3); margin-top: .18rem; }
.ord-amt { font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
.ord-act { display: flex; gap: .5rem; align-items: center; }
.ord-sel {
  padding: .45rem .7rem; border: 1.5px solid var(--line);
  border-radius: 100px; font-size: .76rem; background: var(--surface);
  outline: none; cursor: pointer; transition: border-color var(--t);
}
.ord-sel:focus { border-color: var(--ink); }

/* ─── PILLS ──────────────────────────────────────────────────── */
.pill {
  display: inline-block; white-space: nowrap;
  font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  padding: .26rem .7rem; border-radius: 100px;
  background: var(--muted-2); color: var(--ink-2);
}
.pay-paid      { background: rgba(85,117,106,.12);   color: var(--forest); }
.pay-pending   { background: rgba(180,154,124,.20); color: #7A6446; }
.pay-failed    { background: rgba(176,139,147,.14);  color: var(--clay-deep); }
.st-placed     { background: rgba(29,58,87,.12);   color: #1D3A57; }
.st-confirmed  { background: rgba(180,154,124,.20); color: #7A6446; }
.st-shipped    { background: rgba(92,74,75,.15);   color: #5C4A4B; }
.st-delivered  { background: rgba(85,117,106,.12);   color: var(--forest); }
.st-cancelled  { background: rgba(176,139,147,.14);  color: var(--clay-deep); }

/* ─── ORDER DETAIL ───────────────────────────────────────────── */
.od { padding: 1.5rem; }
.od-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line);
}
.od-no { font-family: var(--display); font-size: 1.5rem; font-weight: 700; letter-spacing: .05em; color: var(--clay-text); }
.od-date { font-size: .78rem; color: var(--ink-3); margin-top: .2rem; }
.od-h {
  font-family: var(--ui); font-size: .7rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
  margin: 1.6rem 0 .7rem;
}
.od-kv {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: .86rem; padding: .4rem 0;
}
.od-kv span { color: var(--ink-3); }
.od-kv b { font-weight: 600; text-align: right; }
.od-kv a { border-bottom: 1px solid var(--line); }
.od-addr {
  font-size: .88rem; line-height: 1.7; color: var(--ink-2);
  background: var(--muted); padding: .9rem 1rem;
  border-radius: var(--r-sm); margin-bottom: .8rem;
}

/* ─── TABLE ──────────────────────────────────────────────────── */
.tbl-wrap { background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; padding: .9rem 1.2rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); background: var(--muted); border-bottom: 1px solid var(--line);
}
.tbl td { padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); font-size: .87rem; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--paper); }
.thumb { width: 48px; aspect-ratio: 3/4; object-fit: cover; border-radius: 7px; background: var(--muted-2); }
.thumb.ph { display: grid; place-items: center; color: var(--clay); font-size: .9rem; }
.t-nm { font-weight: 600; }
.t-cat {
  font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--clay-text); background: rgba(176,139,147,.12);
  padding: .2rem .6rem; border-radius: 100px;
}
.t-pr { font-weight: 600; }
.t-act { display: flex; gap: .4rem; }
.btn-line.danger { color: var(--clay-deep); border-color: rgba(176,139,147,.3); }
.btn-line.danger:hover { background: var(--clay-deep); border-color: var(--clay-deep); color: #fff; }
.dash { color: var(--ink-3); }
.tbl-empty { padding: 3rem 1.5rem; text-align: center; color: var(--ink-3); font-size: .88rem; }
.lnk { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--ink); }

/* ─── FORM ───────────────────────────────────────────────────── */
.a-card { background: var(--surface); border-radius: var(--r); padding: 1.8rem; box-shadow: var(--sh-1); }
.f-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem; margin-bottom: 1.7rem; }
.f-actions {
  display: flex; gap: .7rem; justify-content: flex-end;
  padding-top: 1.4rem; border-top: 1px solid var(--line);
}

/* checkbox */
.chk { display: flex; align-items: center; gap: .65rem; cursor: pointer; font-size: .87rem; user-select: none; }
.chk input { display: none; }
.chk-box {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  border: 1.5px solid var(--line); background: var(--surface);
  display: grid; place-items: center; transition: all var(--t);
}
.chk input:checked + .chk-box { background: var(--ink); border-color: var(--ink); }
.chk input:checked + .chk-box::after { content: '✓'; color: #fff; font-size: .72rem; }

/* image drop */
.drop {
  border: 2px dashed var(--line); border-radius: var(--r);
  background: var(--muted); min-height: 230px;
  display: grid; place-items: center; overflow: hidden;
  transition: border-color var(--t), background var(--t);
}
.drop.over { border-color: var(--ink); background: var(--muted-2); }
.drop-ph {
  display: grid; gap: .5rem; justify-items: center;
  padding: 2rem; cursor: pointer; text-align: center;
  font-size: .86rem; color: var(--ink-2);
}
.drop-ph .gl { font-size: 1.9rem; color: var(--ink-3); }
.drop-ph .hint { font-size: .74rem; color: var(--ink-3); }
.drop-prev { position: relative; width: 100%; }
.drop-prev img { width: 100%; height: 230px; object-fit: cover; }
.drop-x {
  position: absolute; top: .7rem; right: .7rem;
  width: 30px; height: 30px; border-radius: 100px;
  background: rgba(255,255,255,.94); font-size: 1.1rem;
  display: grid; place-items: center; transition: background var(--t);
}
.drop-x:hover { background: #fff; }
.drop-alt { display: flex; align-items: center; gap: .7rem; margin-top: .7rem; flex-wrap: wrap; }
.drop-alt .or { font-size: .8rem; color: var(--ink-3); }
.drop-alt input[type="url"] {
  flex: 1; min-width: 180px;
  padding: .5rem 1rem; border: 1.5px solid var(--line);
  border-radius: 100px; font-size: .82rem; background: var(--surface);
  outline: none; transition: border-color var(--t);
}
.drop-alt input[type="url"]:focus { border-color: var(--ink); }

/* colour input */
.col-in { display: flex; gap: .6rem; }
.col-in input {
  flex: 1; padding: .72rem 1rem; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface);
  font-size: .86rem; outline: none; transition: border-color var(--t);
}
.col-in input:focus { border-color: var(--ink); }
.chips { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .6rem; }
.chip-c {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .28rem .75rem; background: var(--muted);
  border: 1px solid var(--line); border-radius: 100px; font-size: .78rem;
}
.chip-c button { color: var(--ink-3); font-size: .9rem; line-height: 1; transition: color var(--t); }
.chip-c button:hover { color: var(--clay-deep); }

/* ─── DELETE MODAL ───────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(20,17,14,.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 1.5rem;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.modal.on { opacity: 1; pointer-events: auto; }
.modal-card {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 2.2rem; max-width: 400px; width: 100%; text-align: center;
  box-shadow: var(--sh-4);
  transform: scale(.94); transition: transform .3s var(--ease);
}
.modal.on .modal-card { transform: scale(1); }
.modal-gl { font-size: 2.2rem; color: var(--clay); margin-bottom: .8rem; }
.modal-card h3 { font-size: 1.35rem; margin-bottom: .4rem; }
.modal-card p { font-size: .87rem; color: var(--ink-3); margin-bottom: 1.5rem; }
.modal-act { display: flex; gap: .6rem; justify-content: center; }
.btn-danger { background: var(--clay-deep); color: #fff; }
.btn-danger:hover { background: #8E3F2C; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .f-cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ord { grid-template-columns: 1fr auto; row-gap: .8rem; }
  .ord-amt { text-align: right; }
  .ord-act { grid-column: 1 / -1; justify-content: space-between; }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: transform .32s var(--ease); }
  .side.open { transform: translateX(0); }
  .side-toggle { display: grid; }
  .main { margin-left: 0; padding: 4.5rem 1.2rem 2rem; }
  .tbl th:nth-child(4), .tbl td:nth-child(4) { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .tbl th:nth-child(3), .tbl td:nth-child(3) { display: none; }
  .a-bar { flex-direction: column; }
}

/* ─── ORDER ITEM LIST (drawer) ───────────────────────────────── */
.co-items {
  display: grid; gap: .9rem;
  padding-bottom: 1.1rem; margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.co-item { display: grid; grid-template-columns: 52px 1fr auto; gap: .8rem; align-items: center; }
.co-item img, .co-item .ph {
  width: 52px; aspect-ratio: 3/4; object-fit: cover;
  border-radius: 7px; background: var(--muted-2);
}
.co-item .ph { display: grid; place-items: center; color: var(--clay); font-size: .85rem; }
.co-item .nm { font-size: .86rem; font-weight: 600; line-height: 1.3; }
.co-item .vr { font-size: .72rem; color: var(--ink-3); margin-top: .1rem; }
.co-item .pr { font-size: .85rem; font-weight: 600; white-space: nowrap; }

/* Keep the notice pinned so the fixed sidebar can sit below it. */
.admin-body .setup { position: sticky; top: 0; z-index: 95; }

/* ─── FIELD HINTS ────────────────────────────────────────────── */
.fld-hint { font-size: .74rem; color: var(--ink-3); line-height: 1.55; margin: -.15rem 0 .1rem; }

/* ─── SIZE MATRIX ────────────────────────────────────────────── */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.matrix { width: 100%; border-collapse: collapse; min-width: 460px; }
.matrix th {
  font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); background: var(--muted); padding: .5rem .55rem; text-align: left;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.matrix td { padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
.matrix tr:last-child td { border-bottom: 0; }
.matrix td:first-child { padding-left: .7rem; font-size: .82rem; }
.matrix .ta-c { text-align: center; }
.matrix input[type="number"] {
  width: 100%; min-width: 58px;
  padding: .4rem .5rem; border: 1.5px solid transparent; border-radius: 6px;
  background: var(--surface); font-size: .82rem; outline: none;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--t), background var(--t);
}
.matrix input[type="number"]:hover { background: var(--muted); }
.matrix input[type="number"]:focus { border-color: var(--ink); background: var(--surface); }
.matrix input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--clay-deep); cursor: pointer; }

/* ─── ORDER: WHATSAPP ACTIONS ────────────────────────────────── */
.od-wa { display: flex; gap: .5rem; flex-wrap: wrap; }
.od-wa .btn { flex: 1; min-width: 140px; }
.btn-wa {
  background: #0B7A6D; color: #fff;
  padding: .7rem 1.2rem; border-radius: 100px;
  font-size: .8rem; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  transition: background var(--t);
}
.btn-wa:hover { background: #075E54; }
