/* Admin Panel stylesheet -- intentionally small and self-contained (own
   :root tokens, not an import of the storefront's style.css, which carries
   a large amount of product-card/checkout-specific CSS with no meaning
   here). Duplicated deliberately rather than shared with the storefront,
   so the two stay fully independent -- a future admin-panel redesign can
   never accidentally affect the storefront's stylesheet or vice versa.

   2026-10-25 "premium theme" pass: color/visual refinement only, per
   explicit instruction -- no markup, layout, route, or functionality
   change. The requested palette (deep Ayurvedic green primary, warm
   cream/pale-green background, muted gold accent, "deep green sidebar
   with readable text/active-menu styling") is applied to every element
   that actually exists in Phase 1's markup; there is no sidebar yet (that
   structural element doesn't exist until later phases add real
   navigation), so the "deep green chrome, light readable text" treatment
   is applied to .admin-header instead -- the one persistent nav-like
   chrome element Phase 1 actually has. The --sidebar-* tokens below are
   defined now so a real sidebar component, whenever it's built, picks up
   this same approved look with zero new color decisions. */
:root {
  /* Deep Ayurvedic green -- primary brand color. */
  --primary-green: #1E6B45;
  --primary-green-dark: #154A30;
  --primary-green-deep: #0F3322;

  /* Warm cream with a soft green tint, not flat white/grey. */
  --bg-main: #F7F5EC;
  --bg-tint: #EEF4EA;

  --surface: #FFFFFF;
  --surface-alt: #FBF9F2;

  --text: #22291E;
  --text-on-dark: #F5F7EF;
  --muted: #6A7568;
  --muted-on-dark: rgba(245, 247, 239, 0.68);

  --border: #E4DFC9;
  --border-soft: rgba(30, 107, 69, 0.14);

  /* Elegant muted gold -- accent only, never the dominant color. */
  --gold: #B68A3C;
  --gold-soft-bg: rgba(182, 138, 60, 0.12);
  --gold-soft-border: rgba(182, 138, 60, 0.35);

  /* Status colors -- distinct, legible, not neon. */
  --status-done-bg: rgba(30, 107, 69, 0.1);
  --status-done-text: var(--primary-green-dark);
  --status-done-border: rgba(30, 107, 69, 0.28);
  --status-pending-bg: rgba(182, 138, 60, 0.1);
  --status-pending-text: #8A6526;
  --status-pending-border: rgba(182, 138, 60, 0.28);

  /* Reserved for the real sidebar component (not yet built) -- same
     chrome treatment as .admin-header below. */
  --sidebar-bg: var(--primary-green-deep);
  --sidebar-text: var(--text-on-dark);
  --sidebar-active-bg: rgba(255, 255, 255, 0.1);
  --sidebar-active-border: var(--gold);

  --shadow-card: 0 1px 2px rgba(15, 51, 34, 0.04), 0 4px 16px rgba(15, 51, 34, 0.06);
  --shadow-card-hover: 0 2px 4px rgba(15, 51, 34, 0.06), 0 8px 24px rgba(15, 51, 34, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Soft warm cream to a faint green tint -- a single, subtle diagonal
     wash, not a loud multi-stop gradient ("do not... use too many
     gradients" -- this is the one deliberate use, fixed and restrained). */
  background: linear-gradient(165deg, var(--bg-main) 0%, var(--bg-tint) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header (deep-green chrome; see file header comment) ──────────────── */

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--primary-green-deep);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 10px rgba(15, 51, 34, 0.18);
}

.admin-header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-header-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9px;
  background: linear-gradient(155deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 2px 6px rgba(0, 0, 0, 0.25);
}

.admin-header-brand strong {
  display: block;
  color: var(--text-on-dark);
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.admin-header-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-on-dark);
}

/* Unobtrusive by design -- this is a note about the URL being temporary,
   not a "this panel isn't finished yet" signal, so it's deliberately
   quieter than the gold/amber pill treatment used for real alerts
   elsewhere (e.g. .admin-banner-locked). */
.admin-header-env {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted-on-dark);
  border: 1px solid rgba(245, 247, 239, 0.22);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-logout-form {
  margin: 0;
}

.admin-logout-btn {
  background: transparent;
  color: rgba(245, 247, 239, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-logout-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

/* ─── Main content ───────────────────────────────────────────────────── */

.admin-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s ease;
}

.admin-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.admin-card h1 {
  margin: 0 0 0.5rem;
  color: var(--primary-green-deep);
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

.admin-card h2 {
  margin: 0 0 0.9rem;
  color: var(--primary-green-deep);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Several sub-sections inside one long product-edit <form> (Product
   Information / Price & Stock / Publishing & Display) -- .admin-card h2
   already gives each its own left-bar heading; this just adds breathing
   room above every one after the first so they read as distinct groups,
   not one undifferentiated form. */
.form-section-heading {
  margin-top: 1.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.form-section-heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.admin-card h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.05rem;
  border-radius: 2px;
  background: var(--gold);
}

.admin-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.admin-main code {
  background: var(--gold-soft-bg);
  color: var(--primary-green-dark);
  padding: 0.12rem 0.45rem;
  border-radius: 5px;
  font-size: 0.9em;
  font-weight: 600;
}

/* ─── Dashboard ──────────────────────────────────────────────────────── */

.dashboard-intro {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dashboard-intro h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary-green-deep);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.stat-tile:hover,
a.stat-tile:focus-visible {
  border-color: var(--primary-green);
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-green-deep);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-tile-warn .stat-value {
  color: #8A6526;
}

.stat-tile-warn {
  background: var(--status-pending-bg);
  border-color: var(--status-pending-border);
}

.dashboard-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

/* ─── Footer ─────────────────────────────────────────────────────────── */

.admin-footer {
  text-align: center;
  padding: 1.1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ─── Shared, forward-looking component styles ──────────────────────────
   Not yet used by any Phase 1 markup -- defined now so later phases
   (buttons in Phase 2+, a real sidebar) inherit this approved look
   without a fresh color decision each time. Purely additive; nothing
   above depends on these. */

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.admin-btn-primary {
  background: var(--primary-green);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 51, 34, 0.15);
}

.admin-btn-primary:hover {
  background: var(--primary-green-dark);
  box-shadow: 0 4px 12px rgba(15, 51, 34, 0.22);
}

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

.admin-sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}

.admin-sidebar-link {
  display: block;
  padding: 0.65rem 1rem;
  border-left: 3px solid transparent;
  color: var(--muted-on-dark);
  text-decoration: none;
  border-radius: 0 8px 8px 0;
}

.admin-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-on-dark);
}

.admin-sidebar-link.active {
  background: var(--sidebar-active-bg);
  border-left-color: var(--sidebar-active-border);
  color: var(--text-on-dark);
  font-weight: 600;
}

/* ─── Mobile ──────────────────────────────────────────────────────────── */

@media (max-width: 560px) {
  .admin-header {
    padding: 0.75rem 1rem;
  }

  .admin-header-env {
    font-size: 0.65rem;
    padding: 0.25rem 0.55rem;
  }

  .admin-main {
    padding: 1.1rem 0.9rem 2.25rem;
    gap: 1rem;
  }

  .admin-card {
    padding: 1.1rem 1.15rem;
    border-radius: 12px;
  }

  .admin-card h1 {
    font-size: 1.2rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-intro h1 {
    font-size: 1.3rem;
  }
}

/* ─── Phase 2: nav, banners, buttons, table, form, images ──────────────
   Additive only -- everything above (Phase 1 layout/theme) is unchanged. */

.admin-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.admin-nav a {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.admin-nav a:hover {
  background: var(--gold-soft-bg);
  color: var(--primary-green-dark);
}

.admin-nav a[aria-current="page"] {
  background: var(--status-done-bg);
  color: var(--primary-green-dark);
}

.admin-banner {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  border: 1px solid transparent;
}

.admin-banner-locked {
  background: var(--status-pending-bg);
  border-color: var(--status-pending-border);
  color: var(--status-pending-text);
}

.admin-banner-success {
  background: var(--status-done-bg);
  border-color: var(--status-done-border);
  color: var(--status-done-text);
}

.admin-btn-secondary {
  background: var(--surface);
  color: var(--primary-green-dark);
  border: 1px solid var(--border-soft);
}

.admin-btn-secondary:hover {
  background: var(--status-done-bg);
}

.admin-btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
}

.admin-btn-ghost:hover {
  color: var(--primary-green-dark);
  border-color: var(--border-soft);
}

.admin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.admin-card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.admin-card-head-row h1 {
  margin: 0;
  color: var(--primary-green-deep);
  font-size: 1.35rem;
}

.admin-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.admin-filter-form input[type="search"] {
  flex: 1 1 220px;
}

.admin-filter-form input,
.admin-filter-form select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}

.admin-card-table {
  padding: 0.75rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}

.admin-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: var(--bg-tint);
}

.admin-table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-table .col-action {
  text-align: right;
}

.admin-table .col-name a {
  color: var(--primary-green-dark);
  font-weight: 600;
  text-decoration: none;
}

.admin-table .col-name a:hover {
  text-decoration: underline;
}

.admin-table .row-id {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.admin-table .empty-row {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem;
}

.admin-table-count {
  margin: 0.75rem 0.25rem 0.25rem;
}

/* ─── Product card grid ──────────────────────────────────────────────── */

.product-card-count {
  margin: 0.75rem 0.25rem 0.75rem;
}

.product-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.product-card:hover,
.product-card:focus-visible {
  border-color: var(--primary-green);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.product-card-image {
  aspect-ratio: 4 / 3;
  background: var(--bg-tint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card-no-image {
  font-size: 0.78rem;
  color: var(--muted);
}

.product-card-body {
  padding: 0.85rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.product-card-name {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.3;
}

.product-card-category {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.product-card-price {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-green-deep);
}

.product-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.product-card-stock {
  font-size: 0.78rem;
  color: var(--muted);
}

.product-card-stock-low {
  color: #8A6526;
  font-weight: 600;
}

.product-card-edit {
  margin: 0.6rem 1rem 1rem;
  align-self: flex-start;
  pointer-events: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.status-badge.status-published {
  background: var(--status-done-bg);
  color: var(--status-done-text);
  border-color: var(--status-done-border);
}

.status-badge.status-draft {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
  border-color: var(--status-pending-border);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 1rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.form-row input,
.form-row select,
.form-row textarea {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 1px;
  border-color: var(--primary-green);
}

.form-row input:disabled,
.form-row select:disabled,
.form-row textarea:disabled {
  background: var(--bg-tint);
  color: var(--muted);
  cursor: not-allowed;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.field-error {
  margin: 0;
  color: #A3341C;
  font-size: 0.8rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.image-tile {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-tint);
}

.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-tile-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: none;
  background: rgba(15, 51, 34, 0.75);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.image-tile-remove:hover {
  background: #A3341C;
}

.image-tile-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ─── Banner slide editor ────────────────────────────────────────────── */

.banner-slide-card h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.banner-image-preview {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-tint);
  margin: 0.5rem 0 0.75rem;
}

.banner-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-upload-label {
  cursor: pointer;
}

.admin-note-error {
  color: #A3341C;
  font-weight: 600;
}

@media (max-width: 560px) {
  .admin-nav {
    padding: 0.4rem 0.9rem;
  }

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

  .admin-card-head-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
}

/* ─── Phase 3: marketplace links ───────────────────────────────────── */

.marketplace-row-admin {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.marketplace-row-admin:last-of-type {
  border-bottom: none;
}

.marketplace-row-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.marketplace-row-admin input[type="url"] {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--text);
}

.marketplace-row-admin input[type="url"]:disabled {
  background: var(--bg-tint);
  color: var(--muted);
}

.marketplace-enable-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.marketplace-row-admin .field-error {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  .marketplace-row-admin {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* ─── Phase 4: product videos ───────────────────────────────────────── */

.video-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.video-row-admin {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
}

.video-row-form {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto 80px auto;
  align-items: center;
  gap: 0.5rem;
}

.video-row-delete-form {
  margin-top: 0.4rem;
}

.video-row-form input[type="text"],
.video-row-form input[type="url"],
.video-row-form input[type="number"] {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
}

.video-row-form input:disabled {
  background: var(--bg-tint);
  color: var(--muted);
}

.video-add-heading {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--primary-green-deep);
}

@media (max-width: 720px) {
  .video-row-form {
    grid-template-columns: 1fr;
  }
}

/* ─── Phase 5: orders ────────────────────────────────────────────────── */

.order-filter-form input[type="date"] {
  padding: 0.52rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
}

.order-status-row {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

/* Order-fulfillment statuses -- a neutral progression (grey -> gold ->
   green), with the two terminal "stopped" states (rejected/cancelled) in
   the same warm red used for form field-errors elsewhere in this file. */
.status-badge.order-status-pending_payment,
.status-badge.order-status-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
  border-color: var(--status-pending-border);
}

.status-badge.order-status-confirmed,
.status-badge.order-status-processing {
  background: var(--gold-soft-bg);
  color: #8A6526;
  border-color: var(--gold-soft-border);
}

.status-badge.order-status-shipped,
.status-badge.order-status-delivered {
  background: var(--status-done-bg);
  color: var(--status-done-text);
  border-color: var(--status-done-border);
}

.status-badge.order-status-rejected,
.status-badge.order-status-cancelled {
  background: rgba(163, 52, 28, 0.1);
  color: #A3341C;
  border-color: rgba(163, 52, 28, 0.28);
}

.status-badge.payment-status-created,
.status-badge.payment-status-failed {
  background: rgba(163, 52, 28, 0.1);
  color: #A3341C;
  border-color: rgba(163, 52, 28, 0.28);
}

.status-badge.payment-status-paid {
  background: var(--status-done-bg);
  color: var(--status-done-text);
  border-color: var(--status-done-border);
}

.status-badge.payment-status-refund_pending {
  background: var(--gold-soft-bg);
  color: #8A6526;
  border-color: var(--gold-soft-border);
}

.status-badge.payment-status-refunded {
  background: var(--bg-tint);
  color: var(--muted);
  border-color: var(--border);
}

.order-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.order-status-action-form {
  display: inline-flex;
}

.order-line-items {
  margin-bottom: 0.75rem;
}

.order-total {
  font-size: 1.05rem;
  margin: 0.5rem 0 0.25rem;
}

.order-total strong {
  color: var(--primary-green-deep);
}

@media (max-width: 560px) {
  .order-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  /* Bug found during Phase 6 regression testing (real screenshot, not
     assumed): .admin-filter-form input[type="search"]'s flex: 1 1 220px
     sets its flex-basis along the MAIN axis -- harmless in the default
     row layout (that axis is horizontal, so 220px sizes its width), but
     once this rule switches the form to flex-direction: column above, the
     main axis becomes vertical, so that same 220px became the search
     box's HEIGHT instead, rendering it as a giant box. Reset to a normal
     auto-height, full-width field here, scoped to this breakpoint only. */
  .order-filter-form input[type="search"] {
    flex: none;
    width: 100%;
  }
}

/* ─── Phase 7: authentication screens ───────────────────────────────── */

.auth-body {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(165deg, var(--bg-main) 0%, var(--bg-tint) 100%);
  background-attachment: fixed;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-card-hover);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.auth-brand strong {
  display: block;
  color: var(--deep-forest-green, var(--primary-green-deep));
  font-size: 1rem;
}

/* .admin-header-sub is reused here (the "Admin Panel" subtitle), but its
   base rule sets color: var(--muted-on-dark) -- a near-white tone meant
   for the dark .admin-header bar. On this light .auth-card surface that
   renders as near-invisible, barely-contrasting text. Override to the
   light-surface muted token. */
.auth-brand .admin-header-sub {
  color: var(--muted);
}

.auth-card h1 {
  margin: 0 0 0.4rem;
  color: var(--primary-green-deep);
  font-size: 1.3rem;
}

.auth-card .admin-form {
  margin-top: 1.1rem;
}

.auth-link-row {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.85rem;
}

.auth-link-row a {
  color: var(--primary-green-dark);
  font-weight: 600;
  text-decoration: none;
}

.auth-link-row a:hover {
  text-decoration: underline;
}

.auth-resend-form {
  margin-top: 0.75rem;
  text-align: center;
}
