/* ==========================================================================
   Flowprise — admin console
   Dark rail, cream canvas, gold accents (matches the storefront).
   ========================================================================== */

:root {
  --ink: #14140f;
  --ink-2: #1e1e18;
  --ink-3: #2a2a22;
  --gold: #dc9814;
  --gold-dark: #b87a08;
  --gold-soft: #fdf3dc;
  --cream: #f4f1e8;
  --paper: #ffffff;
  --line: #e6e2d7;
  --line-soft: #efebe1;
  --muted: #726f66;
  --muted-2: #96938a;
  --green: #2f9e44;
  --green-soft: #e8f6ea;
  --red: #c0392b;
  --red-soft: #fdecea;
  --blue: #2f6fca;
  --blue-soft: #eaf1fc;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 44px -26px rgba(20, 20, 15, 0.35);
  --shadow-sm: 0 6px 18px -12px rgba(20, 20, 15, 0.3);
  --font-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --rail-w: 252px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 15px;
  height: 15px;
}

/* ------------------------------------------------------------------ login */

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cream);
}

.login__art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  color: #fff;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(220, 152, 20, 0.35), transparent 60%),
    radial-gradient(700px 420px at 100% 110%, rgba(59, 181, 74, 0.18), transparent 60%),
    var(--ink);
}

.login__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 40%, #000 30%, transparent 78%);
  pointer-events: none;
}

.login__brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
}

.login__mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  background: linear-gradient(145deg, var(--gold), var(--gold-dark));
  box-shadow: 0 10px 24px -10px rgba(220, 152, 20, 0.9);
}

.login__brand b {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.login__brand span {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.login__pitch {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.login__pitch h1 {
  font-size: clamp(28px, 3vw, 40px);
  margin-bottom: 14px;
}

.login__pitch h1 em {
  font-style: normal;
  color: var(--gold);
}

.login__pitch p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 15px;
}

.login__bullets {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13.5px;
}

.login__bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login__bullets .icon {
  color: var(--gold);
}

.login__foot {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

.login__panel {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.login__card {
  width: 100%;
  max-width: 380px;
}

.login__card h2 {
  font-size: 26px;
  margin-bottom: 6px;
}

.login__card > p {
  color: var(--muted);
  margin-bottom: 26px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.field > label,
.field__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.field__hint {
  font-size: 12px;
  color: var(--muted-2);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(220, 152, 20, 0.16);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.pw-wrap {
  position: relative;
}

.pw-wrap .input {
  padding-right: 44px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.pw-toggle:hover {
  background: var(--line-soft);
  color: var(--ink);
}

.alert {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: #8f2b21;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert[hidden] {
  display: none;
}

.login__card .btn {
  margin-top: 6px;
}

.login__note {
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
}

@media (max-width: 900px) {
  .login {
    grid-template-columns: 1fr;
  }

  .login__art {
    display: none;
  }
}

/* ------------------------------------------------------------- app layout */

.admin {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 18px;
  color: #cfccc2;
  background: var(--ink);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  background: linear-gradient(145deg, var(--gold), var(--gold-dark));
  box-shadow: 0 8px 20px -9px rgba(220, 152, 20, 0.85);
}

.sidebar__text {
  min-width: 0;
}

.sidebar__text b {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__text small {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.side-nav {
  display: grid;
  gap: 3px;
}

.side-nav__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  padding: 16px 12px 6px;
}

.side-nav__label:first-child {
  padding-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #cbc8be;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item .icon {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item:hover .icon {
  color: var(--gold);
}

.nav-item.is-active {
  background: linear-gradient(90deg, rgba(220, 152, 20, 0.2), rgba(220, 152, 20, 0.05));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--gold);
}

.nav-item.is-active .icon {
  color: var(--gold);
}

.nav-item__badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar__foot {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin__main {
  margin-left: var(--rail-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 30px;
  background: rgba(244, 241, 232, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar__title {
  min-width: 0;
}

.topbar__title h1 {
  font-size: 21px;
}

.topbar__title p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
}

.topbar__burger {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.topbar__user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: var(--ink-3);
}

.topbar__userinfo {
  line-height: 1.25;
}

.topbar__userinfo b {
  display: block;
  font-size: 12.5px;
}

.topbar__userinfo span {
  display: block;
  font-size: 10.5px;
  text-transform: capitalize;
  color: var(--muted);
}

.view {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 30px 64px;
}

/* ---------------------------------------------------------------- modules */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-head h2 {
  font-size: 19px;
}

.page-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.card__head h3 {
  font-size: 15px;
}

.card__head a,
.card__head button.link {
  border: 0;
  background: none;
  color: var(--gold-dark);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.card__head a:hover {
  text-decoration: underline;
}

.card__body {
  padding: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  position: relative;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--gold-soft);
  opacity: 0.55;
}

.stat__icon {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  margin-bottom: 12px;
  color: var(--gold-dark);
  background: var(--gold-soft);
}

.stat__icon--green {
  color: var(--green);
  background: var(--green-soft);
}

.stat__icon--blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat__icon--ink {
  color: var(--ink);
  background: #ecebe4;
}

.stat__label {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__value {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 2px;
}

.stat__note {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 2px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
  align-items: start;
}

.grid-2 + .grid-2 {
  margin-top: 18px;
}

.stack {
  display: grid;
  gap: 18px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-action {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fbfaf6;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quick-action:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.quick-action .icon {
  color: var(--gold-dark);
}

/* ------------------------------------------------------------------ table */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: #fbfaf6;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: #fcfbf7;
}

.ta-r {
  text-align: right !important;
}

.cell-title {
  font-weight: 600;
  color: var(--ink);
}

.cell-sub {
  font-size: 11.5px;
  color: var(--muted-2);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-thumb {
  width: 58px;
}

.thumb {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--cream);
  border: 1px solid var(--line-soft);
  display: block;
}

.thumb--lg {
  width: 76px;
  height: 76px;
  border-radius: 12px;
}

.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--line-soft);
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--line-soft);
  color: var(--muted);
  text-transform: capitalize;
}

.badge--gold {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.badge--green,
.badge--paid,
.badge--fulfilled {
  background: var(--green-soft);
  color: var(--green);
}

.badge--refunded,
.badge--cancelled {
  background: var(--red-soft);
  color: var(--red);
}

.badge--blue {
  background: var(--blue-soft);
  color: var(--blue);
}

/* ---------------------------------------------------------------- toolbar */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar__search {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
}

.toolbar__search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
}

.toolbar__search .input {
  padding-left: 38px;
}

.toolbar .select {
  width: auto;
  min-width: 150px;
}

.toolbar__spacer {
  flex: 1;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.tab b {
  font-weight: 600;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--line-soft);
}

.tab:hover {
  border-color: #d8d3c4;
  color: var(--ink);
}

.tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tab.is-active b {
  background: rgba(255, 255, 255, 0.16);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.btn--gold {
  color: #1c1608;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  box-shadow: 0 10px 22px -14px rgba(184, 122, 8, 0.9);
}

.btn--gold:hover {
  box-shadow: 0 12px 26px -12px rgba(184, 122, 8, 0.95);
}

.btn--dark {
  color: #fff;
  background: var(--ink);
}

.btn--dark:hover {
  background: var(--ink-3);
}

.btn--ghost {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: #cfc9b9;
  background: #fbfaf6;
}

.btn--danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f6d7d2;
}

.btn--danger:hover {
  background: #fbded9;
}

.btn--sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn--block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--line-soft);
  color: var(--ink);
}

/* ------------------------------------------------------------------ forms */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .field--full {
  grid-column: 1 / -1;
}

.field__row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}

.field__row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold-dark);
}

.form-section {
  padding: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.form-section:last-child {
  border-bottom: 0;
}

.form-section__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  background: #fbfaf6;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius) var(--radius);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

/* ------------------------------------------------------------------ modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(20, 20, 15, 0.55);
  backdrop-filter: blur(4px);
  animation: fade-in 0.16s ease;
}

.modal__panel {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.5);
  animation: pop-in 0.18s ease;
}

.modal__panel--wide {
  max-width: 720px;
}

.modal__panel form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.modal__head h2 {
  font-size: 18px;
}

.modal__head p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.modal__body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 20px 22px;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
  background: #fbfaf6;
  border-radius: 0 0 18px 18px;
}

.image-picker {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.image-picker__preview {
  width: 92px;
  height: 92px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--cream);
}

.image-picker__body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.file-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
}

.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-status {
  font-size: 11.5px;
  color: var(--muted-2);
}

.order-items {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.order-item__body {
  flex: 1;
  min-width: 0;
}

.order-item__title {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-item__meta {
  font-size: 11.5px;
  color: var(--muted-2);
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  font-size: 13px;
  margin-top: 14px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-weight: 500;
}

/* ------------------------------------------------------------------ empty */

.empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 54px 20px;
  text-align: center;
  color: var(--muted);
}

.empty .icon {
  width: 30px;
  height: 30px;
  color: var(--muted-2);
}

.empty h3 {
  font-size: 15px;
  color: var(--ink);
}

.empty p {
  font-size: 12.5px;
}

.loading {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 70px 20px;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  animation: spin 0.7s linear infinite;
}

/* ------------------------------------------------------------------ toast */

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}

.toast--error {
  background: #8f2b21;
}

.toast--success .icon {
  color: var(--gold);
}

.toast.is-leaving {
  animation: toast-out 0.2s ease forwards;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1120px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.3);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(20, 20, 15, 0.45);
  }

  .admin__main {
    margin-left: 0;
  }

  .topbar {
    padding: 12px 16px;
  }

  .topbar__burger {
    display: grid;
  }

  .view {
    padding: 20px 16px 56px;
  }

  .topbar__userinfo {
    display: none;
  }

  .topbar__user {
    padding: 4px;
    border: 0;
    background: none;
  }
}

@media (max-width: 620px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    padding: 14px;
  }

  .stat__value {
    font-size: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 10px;
  }

  .modal__panel {
    max-height: calc(100vh - 20px);
  }

  .topbar__title h1 {
    font-size: 18px;
  }

  .topbar__title p {
    display: none;
  }
}

/* -------------------------------------------------------------- animation */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Mobile polish (admin)
   ========================================================================== */

.sidebar__close {
  display: none;
  position: absolute;
  top: 14px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.sidebar__close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.pw-toggle {
  width: 40px;
  height: 40px;
  right: 4px;
}

@media (max-width: 900px) {
  .sidebar__close {
    display: grid;
  }

  .sidebar__brand {
    padding-right: 44px;
  }

  .nav-item {
    min-height: 44px;
    padding: 11px 12px;
  }

  .sidebar__link {
    min-height: 42px;
  }

  .topbar__burger {
    width: 42px;
    height: 42px;
  }

  .tabs .tab {
    min-height: 40px;
    padding: 9px 14px;
  }
}

@media (max-width: 720px) {
  .table-wrap {
    overflow: visible;
  }

  .table {
    display: block;
    font-size: 13px;
  }

  .table thead {
    display: none;
  }

  .table tbody {
    display: block;
  }

  .table tbody tr {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
  }

  .table tbody tr:last-child {
    border-bottom: 0;
  }

  .table tbody tr:hover {
    background: #fcfbf7;
  }

  .table td {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    width: 100%;
    padding: 4px 0;
    border: 0;
    text-align: left !important;
  }

  .table td::before {
    content: attr(data-label);
    grid-column: 1;
    grid-row: 1;
    padding-top: 2px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
  }

  /* Cells often contain a title plus a subtitle. Keep both in the value
     column instead of letting the subtitle wrap under the label. */
  .table td > * {
    grid-column: 2;
  }

  .table td > .chip,
  .table td > .badge,
  .table td > .select {
    justify-self: start;
  }

  .table td[data-label=""] {
    display: none;
  }

  .table td.ta-r {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table td.ta-r::before {
    content: attr(data-label);
  }

  .table td > * {
    min-width: 0;
  }

  .table td .cell-sub {
    max-width: none;
    white-space: normal;
  }

  .table td .btn--sm {
    min-height: 40px;
    padding: 8px 12px;
  }

  .table td .icon-btn {
    width: 38px;
    height: 38px;
  }

  .modal__head .icon-btn {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }

  .table td input,
  .table td select {
    min-height: 40px;
  }

  .toolbar .input,
  .toolbar .select,
  .toolbar .btn {
    min-height: 42px;
  }

  .form-actions,
  .modal__foot {
    flex-direction: column-reverse;
  }

  .form-actions .btn,
  .modal__foot .btn {
    width: 100%;
  }

  .field__row input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .topbar {
    gap: 10px;
    padding: 10px 14px;
  }

  .view {
    padding: 16px 14px 48px;
  }

  .modal {
    padding: 6px;
  }

  .modal__panel {
    max-height: calc(100vh - 12px);
    border-radius: 14px;
  }

  .modal__head,
  .modal__body,
  .modal__foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .image-picker {
    gap: 10px;
  }

  .image-picker__preview {
    width: 72px;
    height: 72px;
  }
}
