:root {
  --gold: #a65d32;
  --gold-soft: #e4c4a4;
  --gold-deep: #6e3c1f;
  --leaf: #4f5d2c;
  --ink: #2a231c;
  --ivory: #f7f1e6;
  --cream: #faf6ee;
  --muted: #7d7368;
  --line: rgba(79, 93, 44, 0.22);
  --white: #fffdf8;
  --font-display: "Cormorant Garamond", serif;
  --font-body: "Outfit", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

body.admin-body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.admin-body a {
  color: var(--gold-deep);
  text-decoration: none;
}

.admin-body a:hover { color: var(--gold); }

.admin-body img {
  max-width: 100%;
  height: auto;
}

.admin-wrap {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--ink);
  color: var(--ivory);
  padding: 20px 14px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.desk-brand {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  color: var(--ivory);
  padding: 0 4px 10px;
  text-decoration: none;
}

.desk-brand:hover { color: var(--ivory); }

.desk-mark {
  display: grid;
  place-items: center;
  background: var(--ivory);
  border-radius: 18px;
  padding: 8px 10px;
}

.desk-mark img {
  width: 112px;
  height: auto;
  display: block;
}

.desk-brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-transform: uppercase;
  text-align: center;
}

.nav-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8a8175;
  padding: 14px 10px 4px;
}

.sidebar a.side-link {
  display: flex;
  align-items: center;
  color: #c9c0b4;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar a.side-link:hover,
.sidebar a.side-link.active {
  background: rgba(196, 165, 116, 0.16);
  color: var(--gold-soft);
}

.admin-main {
  padding: 28px 32px 48px;
  min-width: 0;
  overflow-x: hidden;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  margin: 0;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.user-chip {
  font-size: 13px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}

.stat-card,
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(12, 11, 9, 0.04);
}

.stat-card { padding: 18px 20px; }

.stat-card .label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card h3 {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--gold-deep);
  margin: 6px 0 0;
  font-weight: 500;
}

.panel { padding: 20px; }

.panel h5 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 14px;
}

.chart-frame {
  position: relative;
  height: 240px;
}

.chart-frame-wide { height: 250px; }

.chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}

.admin-body .form-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-body .form-control,
.admin-body .form-select {
  background: var(--ivory);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 14px;
}

.admin-body .form-control:focus,
.admin-body .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(166, 93, 50, 0.18);
  background: #fff;
}

.admin-body .table {
  color: var(--ink);
  margin: 0;
}

.admin-body .table thead th {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  background: var(--ivory);
}

.admin-body .table td,
.admin-body .table th {
  border-color: rgba(166, 93, 50, 0.14);
  vertical-align: middle;
  padding: 12px 14px;
}

.admin-body .table tbody tr:hover {
  background: rgba(247, 241, 230, 0.7);
}

.btn-gold {
  background: var(--gold);
  color: var(--ivory) !important;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
}

.btn-gold:hover {
  background: var(--gold-deep);
  color: var(--ivory) !important;
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink) !important;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  display: inline-block;
}

.btn-ghost:hover { background: var(--ivory); color: var(--ink) !important; }

.btn-danger-quiet {
  color: #9a3b32 !important;
  text-decoration: none;
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.badge-status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: capitalize;
  background: var(--ivory);
  color: var(--gold-deep);
}

.badge-live, .badge-delivered, .badge-active { background: #e8f0e6; color: #3d5c38; }
.badge-pending { background: #f4ead4; color: #7a5a22; }
.badge-processing, .badge-shipped { background: #ece7f6; color: #4d3f72; }
.badge-cancelled, .badge-hidden { background: #f3e4e2; color: #8a3b32; }

.thumb {
  width: 48px;
  height: 58px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--ivory);
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
}

.pager-meta { color: var(--muted); font-size: 13px; }

.pager-nav { display: flex; gap: 6px; }

.page-pill {
  min-width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink) !important;
  text-decoration: none;
  font-size: 13px;
}

.page-pill.is-active,
.page-pill:hover {
  background: var(--ink);
  color: var(--gold-soft) !important;
  border-color: var(--ink);
}

.filter-bar {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px 18px;
  margin-bottom: 22px;
  box-shadow: 0 10px 30px rgba(12, 11, 9, 0.04);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink) !important;
  text-decoration: none;
}

.preset-pill.is-active,
.preset-pill:hover {
  background: var(--ink);
  color: var(--gold-soft) !important;
  border-color: var(--ink);
}

.filter-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
}

.alert { border: 0; border-radius: 14px; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--cream);
}

.login-card {
  width: min(440px, 92vw);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 24px 60px rgba(42, 35, 28, 0.08);
}

.login-logo {
  display: block;
  width: min(220px, 100%);
  margin: 0 auto 8px;
}

.login-card h1 {
  font-family: var(--font-display);
  letter-spacing: 0.28em;
  font-size: 28px;
  color: var(--gold-deep);
}

@media (max-width: 960px) {
  .admin-wrap { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; }
  .admin-main { padding: 20px; }
  .chart-frame,
  .chart-frame-wide { height: 220px; }
}
