/* ============================================================
   Admin portal — peacock dark shell
   ============================================================ */

.admin-body { background: #F3F1EA; }

/* ------------------------------------------------------------ login gate */
.login-gate {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px;
  background: var(--peacock-grad);
}
.login-gate::before {
  content: ''; position: absolute; inset: 0; opacity: .22;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 16px, rgba(227,178,60,.5) 16px 17px),
    repeating-linear-gradient(-45deg, transparent 0 16px, rgba(255,255,255,.25) 16px 17px);
}
.login-card {
  position: relative; z-index: 2; background: var(--surface); border-radius: 24px;
  padding: 38px 34px; width: min(420px, 100%); box-shadow: var(--shadow-lg); text-align: center;
}
.login-card h1 { font-size: 30px; margin-bottom: 4px; }
.login-card p { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.login-card .field { text-align: left; }
.back-link { display: block; margin-top: 18px; font-size: 13px; color: var(--muted); }
.back-link:hover { color: var(--pg-700); }

/* ---------------------------------------------------------------- shell */
.admin-shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

.side {
  background: var(--pg-900); color: rgba(246,242,233,.8);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid rgba(246,242,233,.1); }
.side-brand strong { display: block; font-family: var(--display); font-size: 19px; color: var(--cream); }
.side-brand small { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; opacity: .6; }

.side-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-nav button {
  display: flex; align-items: center; gap: 12px; padding: 12px 15px; border-radius: 11px;
  font-size: 13.5px; text-align: left; color: rgba(246,242,233,.72); transition: background .2s, color .2s;
}
.side-nav button i { font-style: normal; width: 20px; text-align: center; opacity: .8; }
.side-nav button:hover { background: rgba(246,242,233,.08); color: var(--cream); }
.side-nav button.on { background: var(--peacock-grad); color: #fff; box-shadow: 0 6px 18px rgba(10,99,121,.4); }

.side-foot { padding: 16px; border-top: 1px solid rgba(246,242,233,.1); display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.side-foot a:hover { color: var(--pb-300); }
.side-foot button { text-align: left; color: #E88; }

.admin-main { padding: 30px 34px 60px; max-width: 1500px; }
.pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.pane-head h1 { font-size: 34px; }
.pane-head p { color: var(--muted); margin: 4px 0 0; font-size: 14px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.panel h3 { font-size: 20px; margin-bottom: 16px; color: var(--pg-700); }

/* ----------------------------------------------------------------- stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.stat::after {
  content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px;
  border-radius: 50%; background: var(--peacock-grad-soft);
}
.stat b { display: block; font-family: var(--display); font-size: 36px; line-height: 1.1; color: var(--pg-700); }
.stat span { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat.warn b { color: #C0392B; }
.stat.gold b { color: #A8791B; }

/* ---------------------------------------------------------------- upload */
.upload-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }

.colour-row { display: flex; align-items: center; gap: 12px; }
.colour-row input[type=color] {
  width: 56px; height: 40px; padding: 3px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); cursor: pointer;
}

.discount-preview {
  padding: 12px 15px; border-radius: 11px; background: var(--peacock-grad-soft);
  font-size: 13.5px; margin-bottom: 14px; color: var(--pg-700); font-weight: 500;
}

.switch { display: flex; align-items: center; gap: 11px; padding: 9px 0; cursor: pointer; font-size: 14px; }
.switch input { width: 18px; height: 18px; accent-color: var(--pg-600); cursor: pointer; }

.thumb-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.thumb {
  position: relative; width: 66px; height: 84px; border-radius: 9px; overflow: hidden;
  border: 1.5px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border-radius: 50%;
  background: rgba(4,34,43,.78); color: #fff; font-size: 12px; display: grid; place-items: center; line-height: 1;
}

/* ----------------------------------------------------------------- table */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar input, .filter-bar select {
  padding: 11px 15px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--surface); outline: none;
}
.filter-bar input { flex: 1; min-width: 220px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--pb-500); }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: auto; box-shadow: var(--shadow-sm); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 940px; }
.admin-table th {
  text-align: left; padding: 14px 16px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); background: #FAF8F3; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2;
}
.admin-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FBFAF6; }
.t-prod { display: flex; align-items: center; gap: 12px; }
.t-prod img { width: 44px; height: 56px; object-fit: cover; border-radius: 7px; }
.t-prod b { display: block; font-size: 14px; }
.t-prod small { color: var(--muted); font-size: 11.5px; }
.stock-input {
  width: 68px; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 9px; text-align: center; outline: none;
}
.stock-input:focus { border-color: var(--pb-500); }
.stock-input.out { border-color: #E4A19A; background: #FDF3F2; color: #A5281B; }
.mini-btn {
  padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); font-size: 12px; transition: all .18s;
}
.mini-btn:hover { border-color: var(--pb-500); color: var(--pb-700); }
.mini-btn.danger:hover { border-color: #E4A19A; color: #A5281B; background: #FDF3F2; }
.pill { padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.pill.live { background: rgba(14,124,88,.12); color: var(--pg-700); }
.pill.out { background: #FDECEA; color: #A5281B; }
.pill.low { background: #FFF3E3; color: #A85A08; }

/* --------------------------------------------------------------- orders */
.ord {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.ord-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.ord-head b { font-family: var(--display); font-size: 20px; }
.ord-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 18px; margin-top: 14px; }
.ord-grid h5 { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 7px; font-family: var(--sans); font-weight: 600; }
.ord-grid p { margin: 0; font-size: 13px; line-height: 1.65; }
.ord-items { display: flex; gap: 8px; flex-wrap: wrap; }
.ord-items img { width: 42px; height: 54px; object-fit: cover; border-radius: 6px; }
.status-select { padding: 9px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); outline: none; }
.status-select:focus { border-color: var(--pb-500); }

/* ------------------------------------------------------------- discounts */
.range-row { display: flex; align-items: center; gap: 16px; }
.range-row input[type=range] { flex: 1; accent-color: var(--pg-600); }
.range-row b { font-family: var(--display); font-size: 27px; color: var(--pg-700); min-width: 70px; text-align: right; }
.coupon-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 15px; border: 1px dashed var(--line); border-radius: 11px; margin-bottom: 9px;
}
.coupon-row b { font-family: var(--sans); letter-spacing: .1em; color: var(--pg-700); }
.coupon-row span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .upload-grid { grid-template-columns: 1fr; }
  .ord-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-nav button { white-space: nowrap; }
  .admin-main { padding: 20px 16px 50px; }
  .pane-head h1 { font-size: 27px; }
}
