/* =========================================================
   PAIRÉE STORE ADMIN
   Premium Monochrome UI — visual language shared with Public Store
   ========================================================= */

:root {
  --admin-bg: #f5f5f3;
  --admin-surface: #ffffff;
  --admin-surface-soft: #ececea;

  --admin-black: #121212;
  --admin-charcoal: #2c2c2c;
  --admin-grey: #757067;
  --admin-inox: #bcbab9;

  --admin-border: rgb(222, 221, 218);
  --admin-border-dark: #c8c6c2;

  --admin-text: #121212;
  --admin-muted: #757067;

  --admin-danger: #a33b32;
  --admin-danger-bg: #f7ece9;
  --admin-success: #3d6b52;
  --admin-success-bg: #e9f1ec;

  --admin-sidebar-width: 270px;
  --admin-topbar-height: 68px;

  --admin-radius: 10px;
  --admin-radius-small: 7px;

  --admin-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 6px 22px rgba(0, 0, 0, 0.035);

  /* legacy aliases kept so any un-migrated rule below still resolves */
  --black: var(--admin-black);
  --white: var(--admin-surface);
  --off-white: var(--admin-bg);
  --line: var(--admin-border);
  --muted: var(--admin-muted);
  --danger: var(--admin-danger);
  --success: var(--admin-success);
  --sidebar-width: var(--admin-sidebar-width);
  --header-height: var(--admin-topbar-height);
  --radius: var(--admin-radius);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--admin-surface-soft);
  color: var(--admin-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

/* =========================================================
   GENERIC
   ========================================================= */

.eyebrow,
.header-label {
  margin: 0 0 8px;
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--admin-black);
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
}

.plain-btn,
.text-btn,
.back-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.text-btn,
.back-btn {
  font-size: 11px;
  letter-spacing: 0.06em;
}

.text-btn {
  border-bottom: 1px solid currentColor;
}

.back-btn {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--admin-muted);
}

.back-btn:hover,
.text-btn:hover {
  color: var(--admin-black);
}

.primary-btn,
.secondary-btn,
.danger-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--admin-radius-small);
  padding: 0 16px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease;
}

.primary-btn {
  border: 1px solid var(--admin-black);
  background: var(--admin-black);
  color: #ffffff;
}

.primary-btn:hover {
  background: var(--admin-charcoal);
  border-color: var(--admin-charcoal);
}

.secondary-btn {
  min-height: 38px;
  border: 1px solid var(--admin-border-dark);
  background: var(--admin-surface);
  color: var(--admin-black);
}

.secondary-btn:hover {
  border-color: var(--admin-black);
  background: var(--admin-surface-soft);
}

.danger-btn {
  border: 1px solid #d8bfba;
  background: var(--admin-surface);
  color: var(--admin-danger);
}

.danger-btn:hover {
  border-color: var(--admin-danger);
  background: var(--admin-danger-bg);
}

.full-btn {
  width: 100%;
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 32px;
  border: 1px dashed var(--admin-border-dark);
  border-radius: var(--admin-radius);
  color: var(--admin-muted);
  text-align: center;
  background: var(--admin-surface);
}

.empty-state p {
  margin: 0;
  font-size: 12px;
}

/* =========================================================
   AUTH
   ========================================================= */

.auth-page {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--admin-bg);
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: var(--admin-surface);
  padding: 40px;
  box-shadow: var(--admin-shadow);
}

.auth-brand {
  margin-bottom: 40px;
  text-align: center;
}

.auth-brand h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  letter-spacing: 0.06em;
}

.auth-brand p {
  margin: 8px 0 0;
  color: var(--admin-muted);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading h2 {
  font-size: 28px;
}

.auth-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 16px 0 22px;
  font-size: 11px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  accent-color: var(--admin-black);
}

.form-message {
  min-height: 18px;
  margin: 0 0 14px;
  color: var(--admin-danger);
  font-size: 11px;
}

/* =========================================================
   ADMIN SHELL
   ========================================================= */

.admin-shell {
  width: min(1560px, calc(100vw - 48px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  display: grid;
  grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(18, 18, 18, 0.08);
}

.admin-shell.auth-locked {
  visibility: hidden;
}

.sidebar {
  position: relative;
  z-index: 60;
  width: auto;
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #121212 0%, #191919 100%);
  color: #ececea;
  padding: 24px 16px;
}

.sidebar-brand {
  padding: 4px 10px 22px;
  border-bottom: 1px solid rgba(236, 236, 234, 0.12);
}

.sidebar-brand h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.sidebar-brand span {
  display: block;
  margin-top: 9px;
  color: rgba(236, 236, 234, 0.55);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0;
}

.nav-item {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ececea;
  padding: 0 14px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.01em;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

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

.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(236, 236, 234, 0.12);
}

.sidebar-footer .secondary-btn {
  border-color: rgba(236, 236, 234, 0.3);
  background: transparent;
  color: #ececea;
}

.sidebar-footer .secondary-btn:hover {
  border-color: #ececea;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.logout-btn {
  min-height: 38px;
  color: rgba(236, 236, 234, 0.7);
  text-align: left;
  font-size: 12px;
}

.logout-btn:hover {
  color: #ffffff;
}

.admin-main {
  min-width: 0;
  margin-left: 0;
  min-height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--admin-bg);
}

.admin-header {
  position: sticky;
  z-index: 40;
  top: 0;
  width: 100%;
  min-height: var(--admin-topbar-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.96);
  padding: 0 30px;
  backdrop-filter: blur(12px);
}

.admin-header h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.admin-user {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.admin-user span {
  font-size: 12px;
  font-weight: 600;
}

.admin-user small {
  margin-top: 2px;
  color: var(--admin-muted);
  font-size: 10px;
  text-transform: capitalize;
}

.mobile-topbar {
  display: none;
}

/* =========================================================
   PAGES
   ========================================================= */

.admin-page {
  display: none;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 30px 48px;
}

.admin-page.active {
  display: block;
}

.page-heading,
.form-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
}

.form-page-header {
  align-items: flex-start;
}

.form-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

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

.stat-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
  padding: 20px 22px;
  box-shadow: var(--admin-shadow);
}

.stat-card > span {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card strong {
  margin-top: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--admin-black);
}

.stat-card small {
  margin-top: 12px;
  color: var(--admin-muted);
  font-size: 10px;
}

#dashboardPage .page-heading {
  margin-bottom: 26px;
}

#dashboardPage .page-heading .eyebrow {
  font-size: 10px;
}

#dashboardPage .page-heading h1 {
  font-size: 34px;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.85fr);
  gap: 14px;
  margin-top: 14px;
}

.panel-card,
.form-card {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow);
}

.panel-card {
  min-width: 0;
  padding: 18px 20px 20px;
}

.panel-heading,
.form-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 20px;
}

.panel-heading h2,
.form-card-heading h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--admin-black);
}

.form-card-heading p:last-child {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--admin-muted);
  font-size: 11px;
}

.panel-heading .eyebrow {
  font-size: 9px;
}

.panel-heading .text-btn {
  font-size: 10px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(145px, auto));
  gap: 10px;
  margin-bottom: 16px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  padding: 10px;
}

.toolbar input,
.toolbar select {
  width: 100%;
}

/* =========================================================
   FORMS
   ========================================================= */

.form-card {
  margin-bottom: 14px;
  padding: 22px;
}

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

.field {
  display: block;
  min-width: 0;
}

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

.field > span,
.option-label {
  display: block;
  margin-bottom: 8px;
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  outline: 0;
  background: var(--admin-surface);
  padding: 10px 13px;
  color: var(--admin-text);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.field textarea {
  resize: vertical;
  min-height: unset;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--admin-grey);
  box-shadow: 0 0 0 3px rgba(18, 18, 18, 0.05);
}

.password-field {
  position: relative;
}

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

.password-field .plain-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--admin-muted);
  font-size: 10px;
}

.toggle-list {
  display: grid;
  gap: 10px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  padding: 14px 16px;
  background: var(--admin-surface);
}

.toggle-row > div {
  display: grid;
  gap: 3px;
}

.toggle-row strong {
  font-size: 12px;
}

.toggle-row span {
  color: var(--admin-muted);
  font-size: 10px;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--admin-black);
}

.form-bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.form-bottom-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* =========================================================
   MEMBERSHIP
   ========================================================= */

.color-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-field input[type="color"] {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 3px;
  cursor: pointer;
}

.color-field input[type="text"] {
  width: 100%;
}

.membership-color-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--admin-border-dark);
  border-radius: 999px;
}

.membership-tier-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 2px solid transparent;
  background: var(--admin-surface-soft);
  color: var(--admin-text);
}

.membership-tier-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 160px;
  border-radius: var(--admin-radius);
  padding: 24px;
  text-align: center;
  background: #111111;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.membership-tier-preview-eyebrow {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}

.membership-tier-preview-name {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  letter-spacing: 0.04em;
}

.membership-tier-preview-points-label {
  margin: 10px 0 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

.membership-tier-preview-points {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 600;
}

/* =========================================================
   IMAGE UPLOAD
   ========================================================= */

.image-upload-zone {
  min-height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed var(--admin-border-dark);
  border-radius: var(--admin-radius);
  background: var(--admin-bg);
  padding: 24px;
  text-align: center;
}

.image-upload-zone p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 10px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.image-preview-card {
  overflow: hidden;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-surface);
}

.image-preview-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px 6px 0 0;
}

.image-preview-meta {
  display: grid;
  gap: 8px;
  padding: 10px;
}

/* =========================================================
   TABLES
   ========================================================= */

.table-wrap,
.variants-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow);
}

.data-table,
.variants-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--admin-surface);
}

.data-table thead,
.variants-table thead {
  background: #f7f7f5;
}

.data-table th,
.data-table td,
.variants-table th,
.variants-table td {
  border-bottom: 1px solid var(--admin-surface-soft);
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
}

.data-table th,
.variants-table th {
  color: var(--admin-muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.data-table td,
.variants-table td {
  font-size: 11px;
  color: var(--admin-text);
}

.data-table tbody tr:hover,
.variants-table tbody tr:hover {
  background: #f7f7f5;
}

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

.variants-table input,
.variants-table select {
  width: 100%;
  min-width: 92px;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  padding: 9px 10px;
  background: var(--admin-surface);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-action-btn {
  min-height: 30px;
  border: 1px solid var(--admin-border-dark);
  border-radius: 7px;
  background: var(--admin-surface);
  padding: 0 11px;
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.table-action-btn:hover {
  border-color: var(--admin-black);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-badge.active,
.status-badge.paid,
.status-badge.completed,
.status-badge.delivered {
  background: var(--admin-success-bg);
  color: var(--admin-success);
}

.status-badge.draft,
.status-badge.pending,
.status-badge.unpaid {
  background: var(--admin-surface-soft);
  color: var(--admin-grey);
}

.status-badge.cancelled,
.status-badge.failed {
  background: var(--admin-danger-bg);
  color: var(--admin-danger);
}

.status-badge.outline {
  background: transparent;
  color: var(--admin-black);
  border: 1px solid var(--admin-black);
}

/* =========================================================
   DASHBOARD PANEL DETAIL — RECENT ORDERS / LOW STOCK
   ========================================================= */

#dashboardRecentOrders.table-wrap {
  border: 0;
  box-shadow: none;
}

#dashboardRecentOrders .data-table thead tr {
  height: 40px;
}

#dashboardRecentOrders .data-table th {
  font-size: 10px;
  padding: 12px 14px;
}

#dashboardRecentOrders .data-table td {
  font-size: 11px;
  padding: 14px;
}

#dashboardRecentOrders .data-table tbody tr {
  min-height: 48px;
}

#dashboardRecentOrders .data-table td:first-child {
  font-weight: 500;
}

#dashboardLowStockList .empty-state {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
}

#dashboardLowStockList .empty-state p {
  font-size: 11px;
  color: var(--admin-muted);
}

/* =========================================================
   DETAILS
   ========================================================= */

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

.summary-list,
.detail-list {
  display: grid;
  gap: 12px;
}

.summary-list > div,
.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--admin-surface-soft);
  padding-bottom: 11px;
}

.summary-list span,
.detail-list span {
  color: var(--admin-muted);
  font-size: 11px;
}

.summary-list strong,
.detail-list strong {
  text-align: right;
  font-size: 11px;
}

.summary-total {
  border-bottom: 0 !important;
  padding-top: 6px;
}

.summary-total strong {
  font-size: 18px;
}

/* =========================================================
   CONTENT MANAGEMENT
   ========================================================= */

.page-heading-description {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--admin-muted);
  font-size: 12px;
}

.content-field-group {
  margin-top: 18px;
}

.content-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 4px;
  overflow-x: auto;
}

.content-section-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-surface);
  color: var(--admin-text);
  padding: 0 16px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.content-section-tab:hover:not(:disabled) {
  border-color: var(--admin-black);
}

.content-section-tab.active {
  border-color: var(--admin-black);
  background: var(--admin-black);
  color: #ffffff;
}

.content-section-tab:disabled {
  cursor: not-allowed;
  color: var(--admin-inox);
}

.content-tab-badge {
  border-radius: 999px;
  background: var(--admin-surface-soft);
  color: var(--admin-grey);
  padding: 3px 7px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content-section-tab.active .content-tab-badge {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.content-section-panel[hidden] {
  display: none;
}

.page-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-surface);
  color: var(--admin-text);
  padding: 0 16px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.page-tab:hover:not(:disabled) {
  border-color: var(--admin-black);
}

.page-tab.active {
  border-color: var(--admin-black);
  background: var(--admin-black);
  color: #ffffff;
}

.page-tab:disabled {
  cursor: not-allowed;
  color: var(--admin-inox);
}

.page-tab.active .content-tab-badge {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.page-tab-panel[hidden] {
  display: none;
}

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

.hero-image-field {
  display: grid;
  gap: 10px;
}

.hero-image-hint {
  margin: -4px 0 0;
  color: var(--admin-muted);
  font-size: 10px;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--admin-muted);
  font-size: 10px;
}

.hero-image-preview {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg);
}

.hero-image-preview.desktop {
  aspect-ratio: 2.1 / 1;
}

.hero-image-preview.mobile {
  aspect-ratio: 4 / 5;
}

.hero-image-preview.editorial {
  aspect-ratio: 5 / 3;
}

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

.hero-image-preview .empty-state {
  min-height: 0;
  height: 100%;
  border: 1px dashed var(--admin-border-dark);
  border-radius: 8px;
}

.header-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-width: 260px;
  height: 90px;
  margin-bottom: 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
}

.header-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.header-logo-preview .empty-state {
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 1px dashed var(--admin-border-dark);
  border-radius: 8px;
}

.bestseller-category-list {
  display: grid;
  gap: 16px;
}

.bestseller-card {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-bg);
  padding: 16px;
}

.bestseller-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.bestseller-card-index {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bestseller-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bestseller-card-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
}

.collection-item-list {
  display: grid;
  gap: 16px;
}

.collection-card {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-bg);
  padding: 16px;
}

.collection-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.collection-card-index {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.collection-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.collection-card-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
}

.faq-item-list {
  display: grid;
  gap: 16px;
}

.faq-card {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-bg);
  padding: 16px;
}

.faq-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.faq-card-index {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.faq-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.follow-link-list {
  display: grid;
  gap: 16px;
}

.follow-link-card {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-bg);
  padding: 16px;
}

.follow-link-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.follow-link-card-index {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.follow-link-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bank-account-list {
  display: grid;
  gap: 16px;
}

.bank-account-card {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-bg);
  padding: 16px;
}

.bank-account-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.bank-account-card-index {
  color: var(--admin-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.voucher-type-toggle {
  display: flex;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  overflow: hidden;
}

.voucher-type-option {
  flex: 1;
  min-height: 44px;
  border: 0;
  background: var(--admin-surface);
  color: var(--admin-text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.voucher-type-option + .voucher-type-option {
  border-left: 1px solid var(--admin-border);
}

.voucher-type-option:hover:not(.active) {
  background: var(--admin-surface-soft);
}

.voucher-type-option.active {
  background: var(--admin-black);
  color: #ffffff;
}

.earning-method-toggle {
  display: flex;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  overflow: hidden;
}

.earning-method-option {
  flex: 1;
  min-height: 44px;
  border: 0;
  background: var(--admin-surface);
  color: var(--admin-text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.earning-method-option + .earning-method-option {
  border-left: 1px solid var(--admin-border);
}

.earning-method-option:hover:not(.active) {
  background: var(--admin-surface-soft);
}

.earning-method-option.active {
  background: var(--admin-black);
  color: #ffffff;
}

.membership-benefit-checklist {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  padding: 12px;
  background: var(--admin-surface);
}

.membership-benefit-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.membership-benefit-checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--admin-black);
}

/* =========================================================
   MODAL
   ========================================================= */

.modal-overlay {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 18, 18, 0.38);
}

.modal-card {
  width: min(460px, 100%);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: var(--admin-surface);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(18, 18, 18, 0.18);
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.modal-heading h2 {
  font-size: 24px;
}

.modal-heading .plain-btn {
  font-size: 22px;
  line-height: 1;
  color: var(--admin-muted);
}

.modal-card > p {
  margin: 16px 0 22px;
  color: var(--admin-muted);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.toast {
  position: fixed;
  z-index: 400;
  top: 22px;
  right: 22px;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 44px));
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: var(--admin-black);
  color: #ffffff;
  padding: 12px 16px;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  box-shadow: var(--admin-shadow);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--admin-danger);
}

.toast-icon {
  font-weight: 700;
}

/* =========================================================
   GLOBAL LOADING
   ========================================================= */

.global-loading {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(5px);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--admin-surface-soft);
  border-top-color: var(--admin-black);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* =========================================================
   EVENTS — CHECK-IN + GUEST LIST
   ========================================================= */

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

.event-checkin-panel {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.event-checkin-panel .field {
  flex: 1;
  min-width: 220px;
}

.event-checkin-panel input {
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.event-checkin-panel .primary-btn {
  min-height: 44px;
  white-space: nowrap;
}

.event-checkin-result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-surface);
}

.event-checkin-result-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.event-checkin-result-success {
  border-color: var(--admin-success);
  background: var(--admin-success-bg);
}

.event-checkin-result-warning {
  border-color: var(--admin-danger);
  background: var(--admin-danger-bg);
}

.event-checkin-result-error {
  border-color: var(--admin-danger);
  background: var(--admin-danger-bg);
}

.event-checkin-result-detail {
  margin: 0;
  color: var(--admin-muted);
  font-size: 11px;
}

@media (max-width: 768px) {
  .event-checkin-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .event-checkin-panel .field {
    min-width: 0;
  }

  .event-checkin-panel .primary-btn {
    width: 100%;
  }
}

.event-media-field {
  margin-bottom: 20px;
}

.event-media-field:last-child {
  margin-bottom: 0;
}

.event-media-field .table-actions {
  flex-wrap: wrap;
  margin-top: 10px;
}

.event-banner-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-width: 420px;
  height: 160px;
  margin-top: 8px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-small);
  background: var(--admin-surface);
}

.event-banner-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.event-banner-preview .empty-state {
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 1px dashed var(--admin-border-dark);
  border-radius: var(--admin-radius-small);
}

.event-brochure-state {
  margin-top: 8px;
}

@media (max-width: 768px) {
  .event-banner-preview {
    max-width: 100%;
  }

  .event-media-field .table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .event-media-field .table-actions a,
  .event-media-field .table-actions button {
    width: 100%;
    text-align: center;
  }
}

.global-loading p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* =========================================================
   PRE-ORDERS — PRODUCTION RECAP
   ========================================================= */

.preorder-produced-input {
  width: 90px;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--admin-surface);
  font: inherit;
}

.preorder-shortage-value {
  color: var(--admin-danger);
  font-weight: 700;
}

#preorderCompleteConfirmPanel {
  margin-top: 20px;
}

@media (max-width: 768px) {
  .preorder-produced-input {
    width: 100%;
    min-width: 72px;
  }

  #preorderCompleteConfirmPanel {
    margin-top: 18px;
  }
}

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

/* =========================================================
   LARGE DESKTOP
   ========================================================= */

@media (min-width: 1600px) {
  .admin-page {
    padding: 34px 38px 54px;
  }
}

@media (min-width: 1700px) {
  .admin-shell {
    width: min(1560px, calc(100vw - 80px));
  }
}

@media (max-width: 1600px) {
  .admin-shell {
    width: calc(100vw - 32px);
    margin: 16px auto;
  }
}

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

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

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

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

  .image-preview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  :root {
    --admin-topbar-height: 58px;
  }

  body {
    background: var(--admin-surface);
  }

  .admin-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    display: block;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .admin-main {
    margin-left: 0;
    min-height: 100vh;
    max-height: none;
    overflow-y: visible;
    padding-top: 58px;
  }

  .mobile-topbar {
    position: fixed;
    z-index: 65;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 1px solid var(--admin-border);
    background: var(--admin-surface);
    padding: 0 16px;
  }

  .mobile-topbar strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    justify-self: center;
  }

  .mobile-topbar > :last-child {
    justify-self: end;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(280px, 88vw);
    min-height: 100vh;
    transform: translateX(-102%);
    transition: transform 0.26s ease;
  }

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

  .sidebar-overlay {
    position: fixed;
    z-index: 55;
    inset: 0;
    background: rgba(18, 18, 18, 0.4);
  }

  .admin-header {
    display: none;
  }

  .admin-page {
    padding: 20px 18px 50px;
  }

  .page-heading,
  .form-page-header {
    align-items: flex-start;
  }

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

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

  .field-full {
    grid-column: auto;
  }

  .bestseller-card-body {
    grid-template-columns: 1fr;
  }

  .collection-card-body {
    grid-template-columns: 1fr;
  }

  .image-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body {
    background: var(--admin-bg);
  }

  .admin-shell {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .admin-main {
    width: 100%;
  }

  .admin-page {
    padding: 18px 14px 36px;
  }

  .content-section-nav {
    flex-wrap: nowrap;
  }

  .hero-image-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 28px 20px;
  }

  .auth-brand {
    margin-bottom: 32px;
  }

  .auth-brand h1 {
    font-size: 30px;
  }

  .auth-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading,
  .form-page-header {
    flex-direction: column;
  }

  .form-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .form-header-actions > * {
    flex: 1 1 calc(50% - 8px);
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    min-height: 120px;
    padding: 16px;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn {
    min-height: 40px;
  }

  .stat-card strong {
    font-size: 24px;
  }

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

  .form-card,
  .panel-card {
    padding: 16px;
  }

  .form-bottom-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-bottom-actions > div {
    width: 100%;
    justify-content: stretch;
  }

  .form-bottom-actions button {
    flex: 1 1 auto;
  }

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

  .toggle-row {
    align-items: flex-start;
  }

  .modal-card {
    max-width: calc(100vw - 24px);
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .toast {
    top: 14px;
    right: 14px;
    left: 14px;
    min-width: 0;
    max-width: none;
  }
}

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

  .form-header-actions > * {
    flex-basis: 100%;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn {
    min-height: 44px;
  }
}
