/* ==========================================================================
   MỘC PHOTO LAB — Admin Management Dashboard Stylesheet
   Clean, modern studio operations UI harmonizing with brand palette
   ========================================================================== */

:root {
  --canvas: #f8f8f4;
  --surface: #ffffff;
  --surface-subtle: #f3f3ec;
  --sage-soft: #dff0e0;
  --sage-mid: #b7d9ba;
  --sage-dark: #2e7d4f;
  --sage-dark-hover: #23633d;
  --ink: #2d2b28;
  --ink-secondary: #5e5a54;
  --ink-muted: #8a847c;
  --border: #e6e3da;
  --border-strong: #d5d1c5;

  /* Status palette */
  --st-new-bg: #e7f0ff;
  --st-new-fg: #1d4ed8;
  --st-printing-bg: #fff3db;
  --st-printing-fg: #b45309;
  --st-packing-bg: #f1e9ff;
  --st-packing-fg: #6d28d9;
  --st-shipping-bg: #dff4f7;
  --st-shipping-fg: #0e7490;
  --st-completed-bg: #dff0e0;
  --st-completed-fg: #2e7d4f;
  --st-cancelled-bg: #fde8e8;
  --st-cancelled-fg: #b91c1c;

  --warn-bg: #fef3c7;
  --warn-fg: #92400e;
  --danger: #c0392b;
  --danger-bg: #fef2f2;

  --font-display: 'Oswald', system-ui, sans-serif;
  --font-body: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(45, 43, 40, 0.05);
  --shadow-sm: 0 4px 12px rgba(45, 43, 40, 0.06);
  --shadow-lg: 0 18px 48px rgba(45, 43, 40, 0.16);
  --sidebar-w: 256px;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.hidden {
  display: none !important;
}

.text-right {
  text-align: right;
}

/* ==================== BUTTONS & INPUTS ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.1s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--sage-dark);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--sage-dark-hover);
}

.btn-soft {
  background: var(--sage-soft);
  color: var(--sage-dark);
  border-color: #cbe4cd;
}

.btn-soft:hover:not(:disabled) {
  background: #cfe8d1;
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-subtle);
  color: var(--ink);
}

.btn-chip {
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
}

.btn-chip:hover {
  background: var(--sage-soft);
  color: var(--sage-dark);
  border-color: var(--sage-mid);
}

.btn-link-danger {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-link-danger:hover {
  text-decoration: underline;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-subtle);
}

.icon-btn-light {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.icon-btn-light:hover {
  background: rgba(255, 255, 255, 0.24);
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 3px rgba(46, 125, 79, 0.14);
}

.textarea {
  resize: vertical;
  min-height: 76px;
}

.form-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

/* ==================== LOGIN VIEW ==================== */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(223, 240, 224, 0.7), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(223, 240, 224, 0.55), transparent 40%),
    var(--canvas);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--sage-soft);
  color: var(--sage-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark-sm {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.15;
}

.brand-title-sm {
  font-size: 17px;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.brand-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--sage-dark);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.password-field {
  position: relative;
}

.password-field .input {
  padding-right: 42px;
}

.icon-btn-inline {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.icon-btn-inline:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.login-divider {
  position: relative;
  text-align: center;
  margin: 20px 0 16px;
}

.login-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}

.login-divider span {
  position: relative;
  background: var(--surface);
  padding: 0 12px;
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
}

.login-footer {
  margin-top: 20px;
  text-align: center;
}

.back-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.back-link:hover {
  color: var(--sage-dark);
}

/* ==================== APP SHELL & SIDEBAR ==================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.storefront-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--canvas);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.storefront-link:hover {
  background: var(--sage-soft);
  color: var(--sage-dark);
  border-color: var(--sage-mid);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.nav-item.active {
  background: var(--sage-soft);
  color: var(--sage-dark);
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--sage-dark);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

.mode-live {
  background: var(--sage-soft);
  color: var(--sage-dark);
}

.mode-demo {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(45, 43, 40, 0.42);
  z-index: 35;
}

/* ==================== MAIN COLUMN & TOPBAR ==================== */

.main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 248, 244, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.page-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.date-chip {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}

.mobile-only {
  display: none;
}

.demo-banner {
  margin: 16px 28px 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #fff8e7;
  border: 1px solid #f2d59b;
  color: #7c4a03;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
}

.content {
  padding: 24px 28px 40px;
  max-width: 1440px;
  width: 100%;
}

/* ==================== CARDS & KPI GRID ==================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.card-desc {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-xs);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-mint { background: var(--sage-soft); color: var(--sage-dark); }
.kpi-icon-amber { background: #fff3db; color: #b45309; }
.kpi-icon-blue { background: #e7f0ff; color: #1d4ed8; }
.kpi-icon-green { background: #dcfce7; color: #15803d; }

.kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2;
  margin: 4px 0 2px;
  color: var(--ink);
}

.kpi-hint {
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* ==================== DASHBOARD CHART & STATUS ==================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.swatch-rev { background: var(--sage-dark); }
.swatch-ord { background: #f59e0b; border-radius: 50%; }

.chart-container {
  padding: 6px 18px 18px;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-bar {
  transition: opacity 0.15s ease;
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.82;
}

.status-stacked-bar {
  margin: 0 20px 14px;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-subtle);
  overflow: hidden;
  display: flex;
  gap: 2px;
}

.status-bar-seg {
  height: 100%;
  min-width: 4px;
  transition: width 0.25s ease;
}

.status-breakdown-grid {
  padding: 0 20px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.status-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--canvas);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, background-color 0.15s ease;
  text-align: left;
}

.status-tile:hover {
  border-color: var(--sage-dark);
  background: var(--surface);
  transform: translateY(-1px);
}

.status-tile-count {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

/* ==================== STATUS PILLS ==================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-new { background: var(--st-new-bg); color: var(--st-new-fg); }
.pill-printing { background: var(--st-printing-bg); color: var(--st-printing-fg); }
.pill-packing { background: var(--st-packing-bg); color: var(--st-packing-fg); }
.pill-shipping { background: var(--st-shipping-bg); color: var(--st-shipping-fg); }
.pill-completed { background: var(--st-completed-bg); color: var(--st-completed-fg); }
.pill-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled-fg); }

.pill-paid { background: var(--st-completed-bg); color: var(--st-completed-fg); }
.pill-unpaid { background: var(--surface-subtle); color: var(--ink-secondary); }
.pill-refunded { background: var(--st-cancelled-bg); color: var(--st-cancelled-fg); }
.pill-warn { background: var(--warn-bg); color: var(--warn-fg); }

/* ==================== TABLES & ORDERS TOOLBAR ==================== */

.orders-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.status-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  border-color: var(--sage-mid);
  color: var(--ink);
}

.tab-btn.active {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: #ffffff;
}

.tab-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(45, 43, 40, 0.08);
}

.tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.search-box {
  position: relative;
  width: 300px;
  max-width: 100%;
}

.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--canvas);
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.search-input:focus {
  background: var(--surface);
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 3px rgba(46, 125, 79, 0.12);
}

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

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

.data-table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: var(--canvas);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

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

.data-table tbody tr:hover {
  background: #fafaf6;
}

.order-code-cell {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--sage-dark);
  white-space: nowrap;
}

.cell-primary {
  font-weight: 700;
  color: var(--ink);
}

.cell-secondary {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.amount-cell {
  font-weight: 700;
  white-space: nowrap;
}

.empty-cell {
  text-align: center;
  padding: 36px 20px !important;
  color: var(--ink-muted);
  font-weight: 600;
}

/* ==================== PRICING & CATALOG ==================== */

.pricing-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pricing-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.catalog-card-head {
  padding: 16px 18px;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.catalog-cat-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
}

.catalog-table th {
  text-align: left;
  padding: 9px 14px;
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
}

.catalog-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.catalog-table tr:last-child td {
  border-bottom: none;
}

.price-input {
  width: 112px;
  padding: 7px 9px;
  text-align: right;
  font-weight: 700;
}

.px-input {
  width: 84px;
  padding: 7px 9px;
  text-align: right;
}

/* ==================== ORDER DETAIL DRAWER ==================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(45, 43, 40, 0.45);
  z-index: 60;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(920px, 96vw);
  background: var(--canvas);
  z-index: 70;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--border);
}

.drawer-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}

.drawer-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-code {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.drawer-meta {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 16px;
}

.drawer-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.panel-heading {
  margin: 0 0 12px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.info-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.info-list > div {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 8px;
  font-size: 13.5px;
}

.info-list dt {
  color: var(--ink-muted);
  font-weight: 600;
}

.info-list dd {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.phone-link {
  color: var(--sage-dark);
}

.phone-link:hover {
  text-decoration: underline;
}

.amount-highlight {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--sage-dark) !important;
}

.customer-note-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fff8e7;
  border: 1px solid #f2d59b;
  font-size: 13px;
}

.customer-note-box p {
  margin: 4px 0 0;
  font-weight: 600;
}

.control-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.control-field {
  margin-bottom: 12px;
}

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

.danger-zone {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  text-align: right;
}

/* ==================== PRINT QUEUE / PHOTO ITEMS ==================== */

.print-queue-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.queue-header .panel-heading {
  margin-bottom: 2px;
}

.order-items-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.item-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.item-group-head {
  padding: 12px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.item-group-title {
  font-weight: 700;
  font-size: 14px;
}

.item-group-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.meta-tag-addon {
  background: var(--sage-soft);
  border-color: var(--sage-mid);
  color: var(--sage-dark);
}

.photo-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.photo-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--canvas);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.photo-card.is-low-res {
  border-color: #f59e0b;
  background: #fffdf5;
}

.photo-thumb-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eceae2;
  overflow: hidden;
  cursor: zoom-in;
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-qty-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(45, 43, 40, 0.86);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.photo-qty-badge.qty-multi {
  background: var(--sage-dark);
}

.photo-dpi-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-size: 11.5px;
  font-weight: 700;
}

.photo-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.photo-filename {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-specs {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
}

.photo-caption {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  font-size: 12px;
  font-style: italic;
  color: var(--ink);
}

.photo-download-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sage-dark);
  transition: background-color 0.15s ease;
}

.photo-download-link:hover {
  background: var(--sage-soft);
  border-color: var(--sage-mid);
}

/* ==================== LIGHTBOX ==================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(24, 23, 21, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-inner {
  width: min(900px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #ffffff;
}

.lightbox-title {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-stage {
  background: #141311;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 75vh;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

.lightbox-meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  text-align: center;
}

/* ==================== TOAST ==================== */

.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  max-width: 360px;
  animation: toastIn 0.18s ease;
}

.toast-success { background: var(--sage-dark); }
.toast-error { background: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== RESPONSIVE ==================== */

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

@media (max-width: 860px) {
  .mobile-only {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .topbar {
    padding: 12px 16px;
  }
  .content {
    padding: 18px 16px 32px;
  }
  .demo-banner {
    margin: 12px 16px 0;
  }
  .date-chip {
    display: none;
  }
  .drawer-top-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .status-breakdown-grid {
    grid-template-columns: 1fr;
  }
  .control-row-2 {
    grid-template-columns: 1fr;
  }
  .search-box {
    width: 100%;
  }
}
