/* =============================================
   ADMIN BASE LAYOUT
   ============================================= */

:root {
  --admin-bg: #f4f5f7;
  --admin-panel: #ffffff;
  --admin-ink: #15171a;
  --admin-muted: #68707d;
  --admin-line: #e4e7ec;
  --admin-sidebar: #111318;
  --admin-sidebar-muted: #a7afbd;
  --admin-sidebar-active: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--admin-bg);
  color: var(--admin-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background: var(--admin-sidebar);
  color: #fff;
}

.admin-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-brand:hover {
  color: #fff;
}

.admin-brand-badge {
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  color: var(--admin-sidebar-muted);
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-nav {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-nav a,
.admin-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--admin-sidebar-muted);
  font-weight: 550;
  text-decoration: none;
}

.admin-nav a:hover,
.admin-sidebar-footer a:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.admin-nav a.active {
  background: #fff;
  color: #111318;
}

.admin-nav i,
.admin-sidebar-footer i {
  width: 20px;
  text-align: center;
}

.admin-sidebar-footer {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--admin-line);
  backdrop-filter: blur(12px);
}

.admin-demo-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: #526071;
  font-size: .74rem;
  font-weight: 550;
}

.admin-demo-status i {
  color: #075fcc;
}

.admin-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: 0;
}

.admin-content {
  width: 100%;
  padding: 26px 28px 44px;
}

.card {
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--admin-line);
}

.kpi-card {
  min-height: 118px;
}

.kpi-card .card-body {
  display: grid;
  align-content: center;
  gap: 8px;
}

.kpi-label {
  margin: 0;
  color: var(--admin-muted);
  font-size: .82rem;
  font-weight: 750;
  text-transform: uppercase;
}

.kpi-value {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 850;
}

.kpi-card--warn {
  border-color: #f6d58f;
}

.admin-table th {
  color: var(--admin-muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-table td,
.admin-table th {
  padding: 14px 16px;
  vertical-align: middle;
}

.form-control,
.form-select,
.btn {
  border-radius: 7px;
}

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

  .admin-sidebar {
    position: static;
    height: auto;
    gap: 14px;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-topbar {
    position: static;
    min-height: auto;
    padding: 18px;
  }

  .admin-demo-status {
    max-width: 190px;
    text-align: right;
  }

  .admin-content {
    padding: 18px;
  }
}

/* =============================================
   ADMIN UI REFINEMENTS
   ============================================= */

/* Override Bootstrap danger → charcoal (btn-danger e folosit ca primary CTA) */
.btn-danger {
  background-color: #111 !important;
  border-color: #111 !important;
  color: #fff !important;
}
.btn-danger:hover,
.btn-danger:focus-visible {
  background-color: #2c2c2c !important;
  border-color: #2c2c2c !important;
  color: #fff !important;
}
.btn-danger:focus-visible {
  box-shadow: 0 0 0 .2rem rgba(17,17,17,.3) !important;
}

/* =============================================
   ICON BUTTONS (tabel desktop)
   ============================================= */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  font-size: .87rem;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
  text-decoration: none;
  padding: 0;
  line-height: 1;
}

.adm-btn--edit {
  color: #2563eb;
}
.adm-btn--edit:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.adm-btn--activate {
  color: #15803d;
}
.adm-btn--activate:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.adm-btn--deactivate {
  color: #b45309;
}
.adm-btn--deactivate:hover {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.adm-btn--delete {
  color: #dc2626;
}
.adm-btn--delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.adm-btn--hot {
  color: #d97706;
}
.adm-btn--hot:hover {
  background: #fffbeb;
  border-color: #fbbf24;
  color: #b45309;
}

.adm-btn--hot-active {
  background: #111318;
  border-color: #111318;
  color: #fff;
}
.adm-btn--hot-active:hover {
  background: #2f343d;
  border-color: #2f343d;
  color: #fff;
}

/* =============================================
   PRODUCTS LIST PAGE
   ============================================= */
.products-command-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.products-eyebrow {
  color: var(--admin-muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.products-page-heading {
  font-size: 1.4rem;
  font-weight: 850;
  letter-spacing: 0;
}

.products-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.products-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
}

.products-stat span {
  color: var(--admin-muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.products-stat strong {
  font-size: 1.55rem;
  line-height: 1;
}

.products-stat--warn {
  border-color: #f6d58f;
  background: #fffbeb;
}

.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.products-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  color: var(--admin-muted);
}

.products-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--admin-ink);
  font: inherit;
}

.products-filter-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.products-filter {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font-size: .78rem;
  font-weight: 750;
}

.products-filter:hover,
.products-filter.is-active {
  border-color: #111318;
  background: #111318;
  color: #fff;
}

.products-list-card {
  overflow: hidden;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.product-thumb {
  display: inline-flex;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #f8fafc;
  color: #94a3b8;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.product-meta-line {
  margin-top: 2px;
  color: var(--admin-muted);
  font-size: .78rem;
}

.product-hot-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: .68rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.product-attribute-group {
  width: 100%;
}

.dynamic-attributes-empty {
  padding: 14px 16px;
  border: 1px dashed var(--admin-line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--admin-muted);
  font-size: .88rem;
}

.product-type-attributes {
  display: grid;
  gap: 14px;
}

.product-type-attribute-row {
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
}

.product-type-attribute-options {
  display: block;
}

.min-w-0 {
  min-width: 0;
}

/* =============================================
   CATEGORIES LIST PAGE
   ============================================= */
.category-command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.category-stats-grid .products-stat strong {
  font-size: 1.35rem;
}

.category-title {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.category-title small {
  max-width: 420px;
  color: var(--admin-muted);
  font-size: .78rem;
  line-height: 1.35;
}

.category-form-shell {
  width: min(980px, 100%);
}

/* =============================================
   SETTINGS PAGES
   ============================================= */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.settings-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: start;
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  color: var(--admin-ink);
  text-decoration: none;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}

.settings-card:hover {
  border-color: #cbd5e1;
  color: var(--admin-ink);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.settings-card__icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f8fafc;
  color: #111318;
  font-size: 1.15rem;
}

.settings-card__body {
  display: grid;
  gap: 8px;
}

.settings-card__body strong {
  font-size: 1rem;
  font-weight: 850;
}

.settings-card__body small {
  min-height: 42px;
  color: var(--admin-muted);
  font-size: .82rem;
  line-height: 1.4;
}

.settings-card__body em {
  color: var(--admin-muted);
  font-size: .74rem;
  font-style: normal;
  font-weight: 700;
}

.settings-card__arrow {
  margin-top: 11px;
  color: #94a3b8;
}

.settings-progress {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.settings-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #111318;
}

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

.settings-detail-form {
  width: 100%;
}

.settings-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(244,245,247,0), var(--admin-bg) 40%);
}

.settings-image-preview {
  display: block;
  margin-top: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.settings-image-preview--logo {
  max-width: 180px;
  max-height: 64px;
  padding: 8px;
  object-fit: contain;
}

.settings-image-preview--hero {
  width: 100%;
  max-height: 180px;
}

.settings-color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.settings-color-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fff;
}

.settings-color-field span {
  color: #475569;
  font-size: .8rem;
  font-weight: 700;
}

.settings-color-field input {
  flex: 0 0 auto;
}

/* =============================================
   ANNEXES PAGES
   ============================================= */
.annex-grid .settings-card {
  min-height: 160px;
}

.annex-editor-form {
  width: 100%;
}

.annex-editor {
  min-height: 58vh;
  resize: vertical;
  line-height: 1.65;
}

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

  .settings-grid,
  .settings-color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .products-toolbar,
  .products-command-bar,
  .settings-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .category-command-actions {
    justify-content: flex-start;
  }

  .products-filter-pills {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .products-stats-grid {
    grid-template-columns: 1fr;
  }

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

  .products-stat {
    min-height: 62px;
  }
}

/* =============================================
   CARD BUTTONS (mobile / versiunea card)
   ============================================= */
.adm-card-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  font-size: .78rem;
  font-weight: 500;
  border-radius: 5px;
  border: 1px solid;
  cursor: pointer;
  transition: background .14s, border-color .14s;
  text-decoration: none;
  line-height: 1.6;
  font-family: inherit;
  white-space: nowrap;
  background: transparent;
}

.adm-card-btn--edit {
  color: #2563eb;
  border-color: #bfdbfe;
  background: #eff6ff;
}
.adm-card-btn--edit:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.adm-card-btn--activate {
  color: #15803d;
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.adm-card-btn--activate:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.adm-card-btn--deactivate {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}
.adm-card-btn--deactivate:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.adm-card-btn--delete {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}
.adm-card-btn--delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* =============================================
   ORDER STATUS BADGES
   ============================================= */
.order-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.order-badge--lg {
  padding: 6px 14px;
  font-size: .8rem;
}

.badge-order-new        { background: #eff6ff; color: #1d4ed8; }
.badge-order-paid       { background: #f0fdf4; color: #16a34a; }
.badge-order-processing { background: #fffbeb; color: #d97706; }
.badge-order-shipped    { background: #e0f2fe; color: #0369a1; }
.badge-order-delivered  { background: #f0fdf4; color: #16a34a; }
.badge-order-cancelled  { background: #fef2f2; color: #dc2626; }
.badge-order-failed     { background: #fef2f2; color: #dc2626; }
.badge-order-pending    { background: #fffbeb; color: #d97706; }
.badge-order-refunded   { background: #fdf4ff; color: #9333ea; }
.badge-order-default    { background: #f1f5f9; color: #64748b; }

/* =============================================
   ORDERS LIST PAGE
   ============================================= */
.order-num-link {
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .01em;
  color: var(--admin-ink);
  text-decoration: none;
}
.order-num-link:hover { color: #2563eb; }

.pay-method-label {
  font-size: .82rem;
  font-weight: 600;
}

.pay-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 600;
}
.pay-status--paid    { color: #16a34a; }
.pay-status--pending { color: #d97706; }
.pay-status--failed  { color: #dc2626; }

.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.6;
}
.doc-chip--awb     { background: #eff6ff; color: #1d4ed8; }
.doc-chip--invoice { background: #f0fdf4; color: #16a34a; }
.doc-chip--invoice:hover { background: #dcfce7; color: #15803d; }

/* =============================================
   DASHBOARD
   ============================================= */

.dashboard {
  --dashboard-blue: #075fcc;
  --dashboard-blue-dark: #043b88;
  --dashboard-cyan: #23c7f3;
  --dashboard-green: #15803d;
  --dashboard-amber: #b45309;
  display: grid;
  gap: 22px;
}

.dashboard-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 2px;
}

.dashboard-eyebrow,
.dashboard-panel__eyebrow {
  margin: 0 0 5px;
  color: var(--dashboard-blue);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: 0;
}

.dashboard-intro h2,
.dashboard-panel__header h3 {
  margin: 0;
  color: var(--admin-ink);
  letter-spacing: 0;
}

.dashboard-intro h2 {
  font-size: 1.65rem;
  font-weight: 650;
}

.dashboard-intro > div > p:last-child {
  margin: 7px 0 0;
  color: var(--admin-muted);
  font-size: .9rem;
}

.dashboard-intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--dashboard-blue);
  border-radius: 5px;
  background: var(--dashboard-blue);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.dashboard-action:hover {
  border-color: var(--dashboard-blue-dark);
  background: var(--dashboard-blue-dark);
  color: #fff;
}

.dashboard-action--secondary {
  border-color: var(--admin-line);
  background: #fff;
  color: var(--admin-ink);
}

.dashboard-action--secondary:hover {
  border-color: #cbd2dc;
  background: #f8fafc;
  color: var(--admin-ink);
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: var(--admin-panel);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .04);
}

.dashboard-metric {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 142px;
  align-content: space-between;
  gap: 10px;
  padding: 20px 22px;
  border-right: 1px solid var(--admin-line);
}

.dashboard-metric:last-child {
  border-right: 0;
}

.dashboard-metric::after {
  position: absolute;
  right: 22px;
  bottom: 0;
  left: 22px;
  height: 3px;
  background: #dce8f8;
  content: "";
}

.dashboard-metric--revenue::after {
  background: var(--dashboard-cyan);
}

.dashboard-metric--warning::after {
  background: #f59e0b;
}

.dashboard-metric__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--admin-muted);
  font-size: .72rem;
  font-weight: 600;
}

.dashboard-metric__top i {
  color: var(--dashboard-blue);
  font-size: 1rem;
}

.dashboard-metric > strong {
  overflow-wrap: anywhere;
  color: var(--admin-ink);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.dashboard-metric > strong span {
  color: var(--admin-muted);
  font-size: .8rem;
  font-weight: 500;
}

.dashboard-metric > small {
  color: var(--admin-muted);
  font-size: .75rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .72fr);
  gap: 18px;
  align-items: start;
}

.dashboard-panel {
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: var(--admin-panel);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .035);
}

.dashboard-panel__header {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--admin-line);
}

.dashboard-panel__header h3 {
  font-size: 1rem;
  font-weight: 650;
}

.dashboard-icon-link {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--admin-line);
  border-radius: 5px;
  color: var(--admin-ink);
  text-decoration: none;
}

.dashboard-icon-link:hover {
  border-color: var(--dashboard-blue);
  background: var(--dashboard-blue);
  color: #fff;
}

.dashboard-order-list {
  display: grid;
}

.dashboard-order {
  display: grid;
  grid-template-columns: minmax(160px, 1.25fr) minmax(110px, .8fr) auto minmax(125px, .75fr) 18px;
  gap: 16px;
  align-items: center;
  min-height: 82px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--admin-line);
  color: var(--admin-ink);
  text-decoration: none;
  transition: background-color .16s ease;
}

.dashboard-order:last-child {
  border-bottom: 0;
}

.dashboard-order:hover {
  background: #f8fbff;
  color: var(--admin-ink);
}

.dashboard-order__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.dashboard-order__identity > span:last-child,
.dashboard-order__payment,
.dashboard-order__total {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dashboard-order__identity strong,
.dashboard-order__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-order__identity strong,
.dashboard-order__total strong {
  font-size: .82rem;
  font-weight: 600;
}

.dashboard-order__identity small,
.dashboard-order__payment small,
.dashboard-order__total small {
  color: var(--admin-muted);
  font-size: .69rem;
}

.dashboard-order__avatar {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f2ff;
  color: var(--dashboard-blue-dark);
  font-size: .76rem;
  font-weight: 650;
}

.dashboard-payment {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .74rem;
  font-weight: 600;
}

.dashboard-payment.is-paid {
  color: var(--dashboard-green);
}

.dashboard-payment.is-pending {
  color: var(--dashboard-amber);
}

.dashboard-order__status {
  display: inline-flex;
  width: max-content;
  max-width: 110px;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: .67rem;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-order__total {
  justify-items: end;
  text-align: right;
}

.dashboard-order__arrow {
  color: #a5adba;
  font-size: .75rem;
}

.dashboard-empty {
  display: grid;
  min-height: 260px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--admin-muted);
}

.dashboard-empty i {
  font-size: 1.5rem;
}

.dashboard-empty p {
  margin: 0;
  font-size: .85rem;
}

.dashboard-side {
  display: grid;
  gap: 18px;
}

.dashboard-health {
  padding-bottom: 18px;
}

.dashboard-health__item {
  display: grid;
  gap: 9px;
  padding: 18px 20px 0;
}

.dashboard-health__item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .78rem;
}

.dashboard-health__item span {
  color: var(--admin-muted);
}

.dashboard-health__item strong {
  font-size: .8rem;
}

.dashboard-progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  background: #e7edf5;
}

.dashboard-progress span {
  display: block;
  height: 100%;
  background: var(--dashboard-blue);
}

.dashboard-progress--stock span {
  background: var(--dashboard-green);
}

.dashboard-health__summary {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 20px 20px 0;
  padding: 13px;
  border-left: 3px solid var(--dashboard-cyan);
  background: #f4f9ff;
}

.dashboard-health__summary > i {
  margin-top: 1px;
  color: var(--dashboard-blue);
}

.dashboard-health__summary p {
  display: grid;
  gap: 3px;
  margin: 0;
}

.dashboard-health__summary strong {
  font-size: .76rem;
}

.dashboard-health__summary span {
  color: var(--admin-muted);
  font-size: .69rem;
}

.dashboard-shortcuts > a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  gap: 11px;
  align-items: center;
  min-height: 64px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--admin-line);
  color: var(--admin-ink);
  text-decoration: none;
}

.dashboard-shortcuts > a:last-child {
  border-bottom: 0;
}

.dashboard-shortcuts > a:hover {
  background: #f8fbff;
  color: var(--admin-ink);
}

.dashboard-shortcuts > a > i:first-child {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: #e8f2ff;
  color: var(--dashboard-blue);
}

.dashboard-shortcuts > a > i:last-child {
  color: #a5adba;
  font-size: .75rem;
}

.dashboard-shortcuts span {
  display: grid;
  gap: 2px;
}

.dashboard-shortcuts strong {
  font-size: .78rem;
}

.dashboard-shortcuts small {
  color: var(--admin-muted);
  font-size: .68rem;
}

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

  .dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard {
    gap: 16px;
  }

  .dashboard-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-intro__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metric {
    min-height: 126px;
    padding: 17px;
  }

  .dashboard-metric:nth-child(2) {
    border-right: 0;
  }

  .dashboard-metric:nth-child(-n+2) {
    border-bottom: 1px solid var(--admin-line);
  }

  .dashboard-order {
    grid-template-columns: minmax(0, 1fr) auto 16px;
    gap: 10px;
  }

  .dashboard-order__payment,
  .dashboard-order__status {
    display: none;
  }

  .dashboard-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .dashboard-intro__actions {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-metric,
  .dashboard-metric:nth-child(2) {
    min-height: 116px;
    border-right: 0;
    border-bottom: 1px solid var(--admin-line);
  }

  .dashboard-metric:last-child {
    border-bottom: 0;
  }

  .dashboard-order {
    padding: 13px 14px;
  }

  .dashboard-order__avatar {
    display: none;
  }

  .dashboard-order__total small {
    display: none;
  }
}

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

.order-view {
  --order-blue: #075fcc;
  --order-blue-dark: #043b88;
  --order-green: #15803d;
  --order-amber: #b45309;
  display: grid;
  gap: 18px;
}

.order-view__hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 0 4px;
}

.order-view__heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.order-view__back,
.order-icon-command {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--admin-line);
  border-radius: 5px;
  background: #fff;
  color: var(--admin-ink);
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.order-view__back:hover,
.order-icon-command:hover {
  border-color: var(--order-blue);
  background: var(--order-blue);
  color: #fff;
}

.order-view__eyebrow,
.order-surface__header p {
  margin: 0 0 4px;
  color: var(--order-blue);
  font-size: .68rem;
  font-weight: 600;
}

.order-view__title-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.order-view__title-row h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: 0;
}

.order-view__heading > div > p:last-child {
  margin: 5px 0 0;
  color: var(--admin-muted);
  font-size: .78rem;
}

.order-view__status {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  white-space: nowrap;
}

.order-view__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.order-command {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--admin-line);
  border-radius: 5px;
  font-size: .76rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.order-command--primary {
  border-color: var(--order-blue);
  background: var(--order-blue);
  color: #fff;
}

.order-command--primary:hover {
  border-color: var(--order-blue-dark);
  background: var(--order-blue-dark);
  color: #fff;
}

.order-command--secondary {
  background: #fff;
  color: var(--admin-ink);
}

.order-command--secondary:hover {
  border-color: #b9c5d3;
  background: #f8fafc;
  color: var(--admin-ink);
}

.order-command:disabled,
.order-command.is-complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  cursor: default;
  opacity: 1;
}

.order-view__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #fff;
}

.order-view__metrics > div {
  display: grid;
  min-width: 0;
  min-height: 96px;
  align-content: center;
  gap: 8px;
  padding: 17px 20px;
  border-right: 1px solid var(--admin-line);
}

.order-view__metrics > div:last-child {
  border-right: 0;
}

.order-view__metrics span {
  color: var(--admin-muted);
  font-size: .7rem;
  font-weight: 550;
}

.order-view__metrics strong {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--admin-ink);
  font-size: 1.12rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.order-view__metrics strong small {
  color: var(--admin-muted);
  font-size: .7rem;
  font-weight: 500;
}

.order-view__metrics strong.is-success {
  color: var(--order-green);
}

.order-view__metrics strong.is-warning {
  color: var(--order-amber);
}

.order-view__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .72fr);
  gap: 18px;
  align-items: start;
}

.order-view__primary,
.order-view__sidebar {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.order-surface {
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(16, 24, 40, .03);
}

.order-surface__header {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--admin-line);
}

.order-surface__header h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: 0;
}

.order-surface__header > span {
  color: var(--admin-muted);
  font-size: .7rem;
}

.order-surface__header-icon {
  color: var(--order-blue);
  font-size: 1rem;
}

.order-product-list {
  display: grid;
}

.order-product {
  display: grid;
  grid-template-columns: 34px minmax(170px, 1fr) minmax(70px, .42fr) minmax(66px, .35fr) minmax(130px, .65fr);
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-line);
}

.order-product:last-child {
  border-bottom: 0;
}

.order-product__index {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: #eef5ff;
  color: var(--order-blue-dark);
  font-size: .68rem;
  font-weight: 650;
}

.order-product__name,
.order-product__variant,
.order-product__quantity,
.order-product__price {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.order-product__name strong {
  overflow: hidden;
  font-size: .8rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-product__name small,
.order-product__variant span,
.order-product__quantity span,
.order-product__price span {
  color: var(--admin-muted);
  font-size: .66rem;
}

.order-product__variant strong,
.order-product__quantity strong,
.order-product__price strong {
  font-size: .76rem;
  font-weight: 600;
}

.order-product__price {
  justify-items: end;
  text-align: right;
}

.order-totals {
  display: flex;
  justify-content: flex-end;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--admin-line);
  background: #fbfcfd;
}

.order-totals dl {
  display: grid;
  width: min(320px, 100%);
  gap: 8px;
  margin: 0;
}

.order-totals dl > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--admin-muted);
  font-size: .74rem;
}

.order-totals dt {
  font-weight: 500;
}

.order-totals dd {
  margin: 0;
  color: var(--admin-ink);
  font-weight: 550;
}

.order-totals .order-totals__grand {
  margin-top: 4px;
  padding-top: 11px;
  border-top: 1px solid var(--admin-line);
  color: var(--admin-ink);
  font-size: .92rem;
}

.order-totals__grand dt,
.order-totals__grand dd {
  font-weight: 650;
}

.order-timeline__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 22px 18px 24px;
  list-style: none;
}

.order-timeline__list li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 7px;
  text-align: center;
}

.order-timeline__list li::before,
.order-timeline__list li::after {
  position: absolute;
  top: 17px;
  width: 50%;
  height: 2px;
  background: #e5eaf0;
  content: "";
}

.order-timeline__list li::before {
  left: 0;
}

.order-timeline__list li::after {
  right: 0;
}

.order-timeline__list li:first-child::before,
.order-timeline__list li:last-child::after {
  display: none;
}

.order-timeline__list li.is-complete::before,
.order-timeline__list li.is-complete::after,
.order-timeline__list li.is-current::before {
  background: var(--order-blue);
}

.order-timeline__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 35px;
  height: 35px;
  align-items: center;
  justify-content: center;
  border: 2px solid #dfe5ec;
  border-radius: 50%;
  background: #fff;
  color: #8b96a5;
  font-size: .8rem;
}

.order-timeline__list li.is-complete .order-timeline__icon {
  border-color: var(--order-blue);
  background: var(--order-blue);
  color: #fff;
}

.order-timeline__list li.is-current .order-timeline__icon {
  border-color: var(--order-blue);
  color: var(--order-blue);
  box-shadow: 0 0 0 4px #e8f2ff;
}

.order-timeline__list strong,
.order-timeline__list small {
  display: block;
  overflow-wrap: anywhere;
}

.order-timeline__list strong {
  font-size: .7rem;
  font-weight: 600;
}

.order-timeline__list small {
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: .62rem;
  line-height: 1.35;
}

.order-info__avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f2ff;
  color: var(--order-blue-dark) !important;
  font-size: .72rem !important;
  font-weight: 650;
}

.order-info__body {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.order-info__lead {
  display: grid;
  gap: 4px;
}

.order-info__lead strong {
  color: var(--admin-ink);
  font-size: .8rem;
  font-weight: 600;
}

.order-info__lead span {
  color: var(--admin-muted);
  font-size: .72rem;
  line-height: 1.55;
}

.order-info__body > a {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: #4b5563;
  font-size: .73rem;
  text-decoration: none;
}

.order-info__body > a:hover {
  color: var(--order-blue);
}

.order-info__body > a i {
  color: var(--order-blue);
}

.order-info__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--admin-line);
  font-size: .72rem;
}

.order-info__meta span {
  color: var(--admin-muted);
}

.order-info__meta strong {
  max-width: 65%;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.order-payment-state {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .65rem !important;
  font-weight: 600;
}

.order-payment-state.is-paid {
  background: #f0fdf4;
  color: #166534;
}

.order-payment-state.is-pending {
  background: #fffbeb;
  color: #92400e;
}

.order-inline-action {
  display: inline-flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #bbf7d0;
  border-radius: 5px;
  background: #f0fdf4;
  color: #166534;
  font-size: .73rem;
  font-weight: 600;
}

.order-documents__body {
  display: grid;
}

.order-document {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--admin-line);
}

.order-document:last-child {
  border-bottom: 0;
}

.order-document > i {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: #eef5ff;
  color: var(--order-blue);
}

.order-document > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.order-document > div span {
  color: var(--admin-muted);
  font-size: .65rem;
}

.order-document > div strong {
  overflow: hidden;
  font-size: .72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-document__state {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: .62rem;
  font-weight: 600;
}

.order-document.is-empty > i {
  background: #f3f4f6;
  color: #7b8491;
}

.order-document.is-empty .order-document__state {
  background: #f3f4f6;
  color: #68707d;
}

.order-note > p {
  margin: 0;
  padding: 16px 18px 18px;
  color: #4b5563;
  font-size: .75rem;
  line-height: 1.6;
}

.order-demo-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  max-width: min(390px, calc(100vw - 32px));
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 5px;
  background: #f0fdf4;
  box-shadow: 0 16px 38px rgba(16, 24, 40, .18);
  color: #166534;
  font-size: .76rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}

.order-demo-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .order-view__layout {
    grid-template-columns: 1fr;
  }

  .order-view__sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .order-view__actions {
    justify-content: flex-start;
  }

  .order-view__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-view__metrics > div:nth-child(2) {
    border-right: 0;
  }

  .order-view__metrics > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--admin-line);
  }

  .order-product {
    grid-template-columns: 32px minmax(0, 1fr) minmax(100px, auto);
  }

  .order-product__variant,
  .order-product__quantity {
    display: none;
  }

  .order-timeline__list {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 16px 18px;
  }

  .order-timeline__list li {
    grid-template-columns: 35px minmax(0, 1fr);
    justify-items: start;
    gap: 12px;
    min-height: 62px;
    padding: 0;
    text-align: left;
  }

  .order-timeline__list li::before,
  .order-timeline__list li::after {
    top: auto;
    right: auto;
    left: 17px;
    width: 2px;
    height: 50%;
  }

  .order-timeline__list li::before {
    top: 0;
  }

  .order-timeline__list li::after {
    top: 35px;
  }

  .order-timeline__list li > div {
    padding-top: 5px;
  }
}

@media (max-width: 620px) {
  .order-view__title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .order-view__title-row h2 {
    font-size: 1.28rem;
  }

  .order-view__actions {
    display: grid;
    grid-template-columns: 1fr 1fr 40px;
  }

  .order-command {
    padding-right: 9px;
    padding-left: 9px;
  }

  .order-view__sidebar {
    grid-template-columns: 1fr;
  }

  .order-product {
    padding-right: 14px;
    padding-left: 14px;
  }

  .order-surface__header {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 430px) {
  .order-view__heading {
    align-items: flex-start;
  }

  .order-view__back {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .order-view__metrics {
    grid-template-columns: 1fr;
  }

  .order-view__metrics > div {
    min-height: 78px;
    border-right: 0;
    border-bottom: 1px solid var(--admin-line);
  }

  .order-view__metrics > div:last-child {
    border-bottom: 0;
  }

  .order-product {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .order-product__price {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }
}

@media print {
  .admin-sidebar,
  .admin-topbar,
  .order-view__back,
  .order-view__actions,
  .order-demo-toast {
    display: none !important;
  }

  .admin-wrapper {
    display: block;
  }

  .admin-content {
    padding: 0;
  }

  .order-view__layout {
    grid-template-columns: 1.5fr .8fr;
  }

  .order-surface,
  .order-view__metrics {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* =============================================
   ORDER DETAIL PAGE
   ============================================= */
.info-section-label {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--admin-muted);
  margin-bottom: 4px;
}

.order-notes-box {
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: .85rem;
  color: #78350f;
}

.order-dl         { display: grid; gap: 8px; }
.order-dl-row     { display: grid; grid-template-columns: 130px 1fr; gap: 8px; align-items: start; }
.order-dl-row dt  { font-size: .78rem; color: var(--admin-muted); font-weight: 600; }
.order-dl-row dd  { margin: 0; font-size: .82rem; word-break: break-all; }

.size-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
  color: #475569;
}

.order-items-table tfoot .order-total-row td {
  border-top: 2px solid var(--admin-line) !important;
  padding-top: 14px;
}

/* Misc utilities */
.w-fit  { width: fit-content; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
