/* ============================================================
   BRILAZ ADMIN v2 — Modern Panel
   ============================================================ */

/* ─── Tokens (solo admin — no tocar :root global de la tienda) ─── */
html.admin-page,
body.login-body {
  --br-coral:       #2563eb;
  --br-coral-dark:  #1d4ed8;
  --br-coral-light: #dbeafe;
  --br-primary:     #2563eb;
  --br-dark:        #18181b;
  --br-mid:         #71717a;
  --br-muted:       #a1a1aa;
  --br-text-muted:  #71717a;
  --br-border:      #e4e4e7;
  --br-cream:       #fafaf9;
  --br-cream2:      #f5f5f4;

  --a-font:         'Plus Jakarta Sans', system-ui, sans-serif;
  --a-font-brand:   'Instrument Serif', Georgia, serif;
  --a-font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --a-sidebar-w:    268px;
  --a-topbar-h:     64px;

  --a-sidebar-bg:   #ffffff;
  --a-sidebar-border:#e4e4e7;
  --a-content-bg:   #f4f4f5;
  --a-card:         #ffffff;
  --a-text:         #18181b;
  --a-text-2:       #52525b;
  --a-text-3:       #a1a1aa;
  --a-accent:       #2563eb;
  --a-accent-hover: #1d4ed8;
  --a-accent-soft:  #eff6ff;
  --a-accent-ring:  rgba(37, 99, 235, 0.14);

  --a-r:            14px;
  --a-r-md:         10px;
  --a-r-sm:         8px;
  --a-r-xs:         6px;

  --a-shadow-xs:    0 1px 2px rgba(0,0,0,0.04);
  --a-shadow:       0 1px 3px rgba(0,0,0,0.05), 0 4px 20px rgba(0,0,0,0.04);
  --a-shadow-md:    0 4px 24px rgba(0,0,0,0.08);
  --a-shadow-lg:    0 12px 40px rgba(0,0,0,0.1);

  --a-ease:         cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }

body.admin-body,
body:has(.admin-layout),
body.login-body {
  margin: 0;
  padding: 0 !important;
  background: var(--a-content-bg);
  font-family: var(--a-font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--a-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.login-body {
  background: #18181b;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-turnstile {
  display: flex;
  justify-content: center;
  margin: 8px 0 18px;
}

body.admin-body .marquee-strip,
body.admin-body .site-header,
body.admin-body .site-footer,
body:has(.admin-layout) .marquee-strip,
body:has(.admin-layout) .site-header,
body:has(.admin-layout) .site-footer { display: none !important; }

/* ─── Layout shell ─── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-main {
  flex: 1;
  margin-left: var(--a-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ─── Sidebar ─── */
.admin-sidebar {
  width: var(--a-sidebar-w);
  background: var(--a-sidebar-bg);
  border-right: 1px solid var(--a-sidebar-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: #d4d4d8 transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 5px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 99px; }

.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 20px;
  text-decoration: none;
  border-bottom: 1px solid var(--a-sidebar-border);
}
.admin-sidebar__brand .logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(145deg, var(--a-accent) 0%, #3b82f6 100%);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}
.admin-sidebar__brand .logo-icon svg { display: block; }
.admin-brand-name {
  font-family: var(--a-font-brand);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--a-text);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.admin-brand-sub {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--a-text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
}

.admin-nav {
  padding: 16px 12px;
  flex: 1;
}
.admin-nav__section {
  padding: 18px 10px 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--a-text-3);
}
.admin-nav__section:first-child { padding-top: 4px; }

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--a-text-2);
  text-decoration: none;
  border-radius: var(--a-r-sm);
  transition: background 0.15s var(--a-ease), color 0.15s var(--a-ease);
  position: relative;
}
.admin-nav a:hover {
  background: #f4f4f5;
  color: var(--a-text);
}
.admin-nav a.active {
  background: var(--a-accent-soft);
  color: var(--a-accent);
  font-weight: 600;
}
.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--a-r-xs);
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--a-text-2);
  transition: background 0.15s, color 0.15s;
}
.admin-nav a:hover .nav-icon {
  background: #e4e4e7;
  color: var(--a-text);
}
.admin-nav a.active .nav-icon {
  background: rgba(37, 99, 235, 0.12);
  color: var(--a-accent);
}
.nav-icon svg { display: block; }

.nav-badge {
  margin-left: auto;
  background: var(--a-accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

.a-nav-sep {
  margin: 10px 12px;
  border: none;
  border-top: 1px solid var(--a-sidebar-border);
}

.a-sidebar-footer {
  padding: 16px 12px 20px;
  border-top: 1px solid var(--a-sidebar-border);
}
.a-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--a-sidebar-border);
  border-radius: var(--a-r-sm);
  color: var(--a-text-2);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s var(--a-ease);
  text-align: left;
}
.a-logout:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* ─── Topbar ─── */
.admin-topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 32px;
  height: var(--a-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--a-sidebar-border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--a-text-3);
}
.breadcrumb a {
  color: var(--a-text-3);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--a-text-2); }
.breadcrumb span { color: #d4d4d8; }
.admin-topbar__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--a-text);
  margin-top: 1px;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.admin-topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 99px;
  border: 1px solid var(--a-sidebar-border);
  background: #fff;
}
.admin-topbar__avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--a-accent), #93c5fd);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}
.admin-topbar__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--a-text);
  line-height: 1.2;
}
.admin-topbar__role {
  font-size: 0.68rem;
  color: var(--a-text-3);
  font-weight: 500;
}

/* ─── Content ─── */
.admin-content {
  padding: 28px 32px 48px;
  flex: 1;
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--a-text);
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.admin-page-desc {
  font-size: 0.86rem;
  color: var(--a-text-2);
  margin-top: 4px;
}

/* ─── Stats ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--a-card);
  border-radius: var(--a-r);
  padding: 20px;
  box-shadow: var(--a-shadow-xs);
  border: 1px solid var(--a-sidebar-border);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.2s var(--a-ease), transform 0.2s var(--a-ease);
}
.stat-card:hover {
  box-shadow: var(--a-shadow);
  transform: translateY(-1px);
}
.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--a-r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card__body { min-width: 0; }
.stat-card__value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--a-text);
  line-height: 1;
  letter-spacing: -0.04em;
}
.stat-card__label {
  font-size: 0.76rem;
  color: var(--a-text-2);
  margin-top: 5px;
  font-weight: 500;
}

/* ─── Cards ─── */
.card,
.admin-card,
.a-card {
  background: var(--a-card);
  border-radius: var(--a-r);
  box-shadow: var(--a-shadow-xs);
  border: 1px solid var(--a-sidebar-border);
  overflow: hidden;
}
.card-header,
.admin-card-header,
.a-card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--a-sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fafafa;
}
.card-header h3,
.admin-card-title,
.a-card-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--a-text);
  margin: 0;
  letter-spacing: -0.01em;
}
.card-body,
.admin-card-body,
.a-card-body { padding: 22px; }
.admin-card-body--flush { padding: 0; }

/* ─── Grid layouts ─── */
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}
.admin-grid-split {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
  align-items: start;
}
.admin-order-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.field-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--br-text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}
@media (max-width: 1100px) {
  .admin-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .admin-grid-split { grid-template-columns: 1fr; }
  .admin-order-grid { grid-template-columns: 1fr; }
}

/* ─── Tables ─── */
.data-table,
.admin-table,
.a-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.data-table th,
.admin-table th,
.a-table th {
  padding: 11px 20px;
  background: #fafafa;
  border-bottom: 1px solid var(--a-sidebar-border);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--a-text-3);
  text-align: left;
  white-space: nowrap;
}
.data-table td,
.admin-table td,
.a-table td {
  padding: 14px 20px;
  border-bottom: 1px solid #f4f4f5;
  color: var(--a-text);
  vertical-align: middle;
}
.data-table tr:last-child td,
.admin-table tr:last-child td,
.a-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td,
.admin-table tbody tr:hover td,
.a-table tbody tr:hover td { background: #fafafa; }

/* ─── Forms ─── */
.admin-form-card,
.a-form-section {
  background: var(--a-card);
  border-radius: var(--a-r);
  box-shadow: var(--a-shadow-xs);
  border: 1px solid var(--a-sidebar-border);
  padding: 26px 28px;
  margin-bottom: 20px;
  max-width: 720px;
}
.sb-title,
.a-form-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--a-text-3);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--a-sidebar-border);
}
.form-group,
.a-field { margin-bottom: 18px; }
.form-group:last-child,
.a-field:last-child { margin-bottom: 0; }
.form-label,
.a-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--a-text);
  margin-bottom: 7px;
}
.form-control,
.form-input,
.a-input,
.a-textarea,
.a-select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: #fff;
  border: 1.5px solid var(--a-sidebar-border);
  border-radius: var(--a-r-sm);
  font-size: 0.86rem;
  color: var(--a-text);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus,
.form-input:focus,
.a-input:focus,
.a-textarea:focus,
.a-select:focus {
  border-color: var(--a-accent);
  box-shadow: 0 0 0 3px var(--a-accent-ring);
}
.form-control.is-invalid,
.form-input.is-invalid { border-color: #ef4444; }
textarea.form-control,
.a-textarea { resize: vertical; min-height: 88px; }
.form-hint,
.a-hint,
.form-text {
  font-size: 0.74rem;
  color: var(--a-text-2);
  margin-top: 6px;
  display: block;
}
.form-error {
  font-size: 0.74rem;
  color: #dc2626;
  margin-top: 5px;
}
.form-row,
.fg-2,
.a-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.a-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) {
  .form-row, .fg-2, .a-grid-2, .a-grid-3 { grid-template-columns: 1fr; }
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  cursor: pointer;
  color: var(--a-text);
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--a-accent);
  cursor: pointer;
}

/* ─── Buttons ─── */
.btn,
.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--a-r-sm);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: all 0.15s var(--a-ease);
  white-space: nowrap;
  line-height: 1.2;
}
.btn-primary,
.a-btn-primary {
  background: var(--a-accent);
  color: #fff;
  border-color: var(--a-accent);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover,
.a-btn-primary:hover {
  background: var(--a-accent-hover);
  border-color: var(--a-accent-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-outline,
.a-btn-outline {
  background: #fff;
  color: var(--a-text);
  border-color: var(--a-sidebar-border);
}
.btn-outline:hover,
.a-btn-outline:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}
.btn-ghost,
.a-btn-ghost {
  background: transparent;
  color: var(--a-text-2);
  border-color: transparent;
}
.btn-ghost:hover,
.a-btn-ghost:hover { background: #f4f4f5; color: var(--a-text); }
.btn-danger,
.a-btn-danger {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}
.btn-danger:hover,
.a-btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-sm, .a-btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg, .a-btn-lg { padding: 12px 22px; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn-icon, .a-btn-icon {
  padding: 8px;
  width: 34px;
  height: 34px;
  justify-content: center;
}

/* ─── Badges ─── */
.badge,
.a-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-pending    { background: #fef3c7; color: #92400e; }
.badge-confirmed  { background: #d1fae5; color: #065f46; }
.badge-shipped    { background: #dbeafe; color: #1e40af; }
.badge-delivered  { background: #d1fae5; color: #065f46; }
.badge-cancelled  { background: #fee2e2; color: #991b1b; }
.badge-active     { background: #dcfce7; color: #166534; }
.badge-inactive   { background: #f4f4f5; color: #71717a; }
.a-badge-green  { background: #dcfce7; color: #166534; }
.a-badge-yellow { background: #fef9c3; color: #854d0e; }
.a-badge-red    { background: #fee2e2; color: #991b1b; }
.a-badge-blue   { background: #dbeafe; color: #1e40af; }
.a-badge-gray   { background: #f4f4f5; color: #52525b; }

.stock-pill {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 600;
}
.sku-tag {
  display: inline-block;
  margin-top: 3px;
  background: #f4f4f5;
  color: #52525b;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--a-r-xs);
  font-family: var(--a-font-mono);
}

/* ─── Alerts ─── */
.a-alert,
.alert {
  padding: 12px 16px;
  border-radius: var(--a-r-sm);
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.a-alert-success,
.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}
.a-alert-error,
.alert-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #b91c1c;
}
.a-alert-warning,
.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

/* ─── Tabs ─── */
.a-tabs,
.admin-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--a-sidebar-border);
  margin-bottom: 28px;
  padding-bottom: 0;
}
.a-tab,
.admin-tab {
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--a-text-2);
  text-decoration: none;
  border-radius: var(--a-r-sm) var(--a-r-sm) 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s var(--a-ease);
}
.a-tab:hover,
.admin-tab:hover {
  color: var(--a-text);
  background: #fafafa;
}
.a-tab.active,
.admin-tab.active {
  color: var(--a-accent);
  font-weight: 600;
  border-bottom-color: var(--a-accent);
  background: var(--a-accent-soft);
}

/* ─── Toolbar / search ─── */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-search {
  display: flex;
  gap: 10px;
  align-items: center;
}
.admin-search__wrap {
  position: relative;
}
.admin-search__wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--a-text-3);
  pointer-events: none;
}
.admin-search__input {
  width: 280px;
  padding-left: 38px !important;
}

/* ─── Empty state ─── */
.admin-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--a-text-2);
  font-size: 0.86rem;
}

.admin-table-wrap {
  background: var(--a-card);
  border-radius: var(--a-r);
  box-shadow: var(--a-shadow-xs);
  border: 1px solid var(--a-sidebar-border);
  overflow: hidden;
}
.fg-3 {
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .fg-3 { grid-template-columns: 1fr; }
}

/* ─── Utilities ─── */
.text-muted { color: var(--br-text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: var(--a-font-mono); font-size: 0.8rem; }
.flex-row { display: flex; gap: 12px; align-items: center; }
.flex-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.admin-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.btn-delete { background: none !important; border: 1.5px solid #fca5a5 !important; color: #ef4444 !important; }
.btn-sale { background: #fff7ed !important; border: 1.5px solid #fed7aa !important; color: #c2410c !important; }
.btn-inactive { background: #f4f4f5 !important; color: var(--br-text-muted) !important; border-color: var(--br-border) !important; }
.stock-input { width: 60px; padding: 4px 8px; border: 1.5px solid var(--br-border); border-radius: var(--a-r-xs); font-size: 0.8rem; text-align: center; font-family: inherit; }
.user-avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: var(--br-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 600; flex-shrink: 0; }
.discount-tag { display: inline-block; margin-top: 3px; background: #dcfce7; color: #16a34a; font-size: 0.68rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.price-old { font-size: 0.75rem; color: var(--a-text-3); text-decoration: line-through; margin-top: 2px; }

.pagination { margin-top: 20px; }
.pagination .pagination-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.pagination .page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--a-r-sm);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1.5px solid var(--a-sidebar-border);
  color: var(--a-text-2);
  background: var(--a-surface);
  text-decoration: none;
  transition: var(--a-transition);
}
.pagination .page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--br-primary);
  color: var(--br-primary);
}
.pagination .page-btn.active {
  background: var(--br-primary);
  border-color: var(--br-primary);
  color: #fff;
}
.pagination .page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Images ─── */
.a-img-preview,
.a-thumb {
  border-radius: var(--a-r-sm);
  border: 1px solid var(--a-sidebar-border);
}
.a-thumb { width: 48px; height: 48px; object-fit: cover; }
.a-slide-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: var(--a-r-sm); border: 1px solid var(--a-sidebar-border); }
.product-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: var(--a-r-xs);
  border: 1px solid var(--a-sidebar-border);
}
.product-thumb--empty {
  width: 42px;
  height: 42px;
  background: #f4f4f5;
  border-radius: var(--a-r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* ─── Toggle ─── */
.a-toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.a-toggle input { opacity: 0; width: 0; height: 0; }
.a-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d4d4d8;
  border-radius: 99px;
  transition: 0.2s;
}
.a-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.a-toggle input:checked + .a-toggle-slider { background: #22c55e; }
.a-toggle input:checked + .a-toggle-slider::before { transform: translateX(18px); }

/* ─── Code editor ─── */
.a-code {
  width: 100%;
  box-sizing: border-box;
  background: #18181b;
  color: #e4e4e7;
  border: 1.5px solid #3f3f46;
  border-radius: var(--a-r-sm);
  font-family: var(--a-font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  padding: 16px 18px;
  resize: vertical;
  min-height: 340px;
  outline: none;
  tab-size: 2;
}
.a-code:focus {
  border-color: var(--a-accent);
  box-shadow: 0 0 0 3px var(--a-accent-ring);
}

/* ─── Settings helpers ─── */
.settings-benefit-box {
  background: var(--br-cream);
  border-radius: var(--a-r-md);
  padding: 18px 20px;
  margin-bottom: 14px;
  border: 1px solid var(--a-sidebar-border);
}
.settings-benefit-box__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--a-text-2);
  margin-bottom: 12px;
}
.settings-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--a-sidebar-border);
  display: flex;
  gap: 12px;
  align-items: center;
}
.settings-footer__hint {
  font-size: 0.78rem;
  color: var(--a-text-2);
  margin-left: 4px;
}

/* ─── Page editor (shared) ─── */
.pe-wrap {
  display: grid;
  grid-template-columns: 260px 1fr 380px;
  height: calc(100vh - var(--a-topbar-h));
  margin: -28px -32px -48px;
  overflow: hidden;
}
.pe-sidebar {
  background: #fff;
  border-right: 1px solid var(--a-sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pe-sidebar-top {
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--a-sidebar-border);
  flex-shrink: 0;
}
.pe-sidebar-top h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--a-text);
  margin: 0 0 2px;
  letter-spacing: -0.02em;
}
.pe-sidebar-top p {
  font-size: 0.72rem;
  color: var(--a-text-3);
  margin: 0;
}
.pe-sections {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  scrollbar-width: thin;
}
.pe-sec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--a-r-sm);
  cursor: pointer;
  transition: background 0.12s;
  border: 1.5px solid transparent;
}
.pe-sec-item:hover { background: #fafafa; }
.pe-sec-item.active {
  background: var(--a-accent-soft);
  border-color: rgba(37, 99, 235, 0.18);
}
.pe-sec-ico {
  width: 32px;
  height: 32px;
  border-radius: var(--a-r-xs);
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--a-text-2);
}
.pe-sec-item.active .pe-sec-ico {
  background: rgba(37, 99, 235, 0.12);
  color: var(--a-accent);
}
.pe-sec-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--a-text);
}
.pe-sec-item.active .pe-sec-label { color: var(--a-accent); }
.pe-sec-preview {
  font-size: 0.68rem;
  color: var(--a-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.pe-canvas {
  background: #e4e4e7;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
}
.pe-page-frame {
  background: #fff;
  border-radius: var(--a-r-md);
  overflow: hidden;
  box-shadow: var(--a-shadow-lg);
  font-family: var(--a-font);
  width: 100%;
  max-width: 920px;
}
.pe-panel {
  background: #fff;
  border-left: 1px solid var(--a-sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pe-panel-header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--a-sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.pe-panel-ico {
  width: 36px;
  height: 36px;
  border-radius: var(--a-r-sm);
  background: var(--a-accent-soft);
  color: var(--a-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pe-panel-title { font-size: 0.9rem; font-weight: 700; color: var(--a-text); }
.pe-panel-sub { font-size: 0.72rem; color: var(--a-text-3); margin-top: 2px; }
.pe-panel-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.pe-panel-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--a-sidebar-border);
  background: #fafafa;
  display: flex;
  gap: 10px;
}

/* ─── Login page ─── */
body.login-body .login-wrap { width: 100%; max-width: 420px; }
.login-brand { text-align: center; margin-bottom: 36px; }
.login-brand__name {
  font-family: var(--a-font-brand);
  font-size: 2.4rem;
  font-weight: 400;
  color: #fafafa;
  letter-spacing: -0.02em;
  line-height: 1;
}
.login-brand__sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: #71717a;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 8px;
}
.login-card {
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: var(--a-r);
  padding: 36px 32px;
  box-shadow: var(--a-shadow-lg);
}
.login-card h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fafafa;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.login-card__sub {
  font-size: 0.84rem;
  color: #a1a1aa;
  margin-bottom: 28px;
}
.login-field { margin-bottom: 18px; }
.login-field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #a1a1aa;
  margin-bottom: 7px;
}
.login-field input {
  width: 100%;
  background: #18181b;
  border: 1.5px solid #3f3f46;
  border-radius: var(--a-r-sm);
  color: #fafafa;
  font-size: 0.92rem;
  font-family: inherit;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-field input:focus {
  border-color: var(--a-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.login-field input.invalid { border-color: #ef4444; }
.login-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--a-r-sm);
  color: #fca5a5;
  font-size: 0.84rem;
  padding: 10px 14px;
  margin-bottom: 20px;
}
.login-flash-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--a-r-sm);
  color: #86efac;
  font-size: 0.84rem;
  padding: 10px 14px;
  margin-bottom: 20px;
}
.login-submit {
  width: 100%;
  background: var(--a-accent);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: var(--a-r-sm);
  padding: 13px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.login-submit:hover {
  background: var(--a-accent-hover);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}
.login-back {
  display: block;
  text-align: center;
  margin-top: 24px;
  font-size: 0.8rem;
  color: #52525b;
  text-decoration: none;
  transition: color 0.15s;
}
.login-back:hover { color: #a1a1aa; }

/* ─── a-* aliases (layout compat) ─── */
.a-layout { display: flex; min-height: 100vh; }

/* Map a-* to admin equivalents */
.a-sidebar { width: var(--a-sidebar-w); background: var(--a-sidebar-bg); border-right: 1px solid var(--a-sidebar-border); flex-shrink: 0; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 200; }
.a-main { flex: 1; margin-left: var(--a-sidebar-w); display: flex; flex-direction: column; min-height: 100vh; background: var(--a-content-bg); }
.a-topbar { background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); padding: 0 32px; height: var(--a-topbar-h); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--a-sidebar-border); position: sticky; top: 0; z-index: 100; }
.a-content { padding: 28px 32px 48px; flex: 1; }
.a-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 28px; }
.a-stat { background: var(--a-card); border-radius: var(--a-r); padding: 20px; border: 1px solid var(--a-sidebar-border); display: flex; align-items: flex-start; gap: 14px; }
.a-stat-val { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.a-stat-lbl { font-size: 0.76rem; color: var(--a-text-2); margin-top: 5px; }
.a-table-wrap { background: var(--a-card); border-radius: var(--a-r); border: 1px solid var(--a-sidebar-border); overflow: hidden; }
.a-table-head { padding: 16px 22px; border-bottom: 1px solid var(--a-sidebar-border); display: flex; align-items: center; justify-content: space-between; background: #fafafa; }
.a-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.a-table th { padding: 11px 20px; background: #fafafa; border-bottom: 1px solid var(--a-sidebar-border); font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--a-text-3); text-align: left; }
.a-table td { padding: 14px 20px; border-bottom: 1px solid #f4f4f5; vertical-align: middle; }
.a-table tr:last-child td { border-bottom: none; }
.a-table tr:hover td { background: #fafafa; }
.a-page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.a-page-header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.a-page-header p { font-size: 0.86rem; color: var(--a-text-2); margin: 4px 0 0; }
.a-nav-label { padding: 18px 10px 6px; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--a-text-3); }
.a-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 2px; font-size: 0.84rem; font-weight: 500; color: var(--a-text-2); text-decoration: none; border-radius: var(--a-r-sm); transition: background 0.15s, color 0.15s; }
.a-nav a:hover { background: #f4f4f5; color: var(--a-text); }
.a-nav a.active { background: var(--a-accent-soft); color: var(--a-accent); font-weight: 600; }
.a-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 20px; text-decoration: none; border-bottom: 1px solid var(--a-sidebar-border); }
.a-brand-name { font-family: var(--a-font-brand); font-size: 1.35rem; color: var(--a-text); }
.a-brand-sub { font-size: 0.65rem; font-weight: 600; color: var(--a-text-3); letter-spacing: 0.14em; text-transform: uppercase; }
.a-brand-icon { width: 38px; height: 38px; background: linear-gradient(145deg, var(--a-accent), #3b82f6); border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; }
.a-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--a-text-3); }
.a-page-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.025em; }
.a-user { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 99px; border: 1px solid var(--a-sidebar-border); background: #fff; }
.a-user-avatar { width: 34px; height: 34px; background: linear-gradient(135deg, var(--a-accent), #93c5fd); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; color: #fff; }
.a-user-name { font-size: 0.82rem; font-weight: 600; }
.a-user-role { font-size: 0.68rem; color: var(--a-text-3); }
.a-box { background: var(--br-cream); border: 1px solid var(--a-sidebar-border); border-radius: var(--a-r-sm); padding: 16px 18px; margin-bottom: 14px; }
.a-box-title { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--a-text-2); margin-bottom: 12px; }
.a-empty { padding: 48px 24px; text-align: center; color: var(--a-text-2); }
.a-empty-ico { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .pe-wrap { grid-template-columns: 1fr; height: auto; margin: 0; }
  .pe-panel { border-left: none; border-top: 1px solid var(--a-sidebar-border); height: 480px; }
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.25s var(--a-ease); }
  .admin-sidebar.open { transform: translateX(0); box-shadow: var(--a-shadow-lg); }
  .admin-main { margin-left: 0; }
  .admin-topbar { padding: 0 16px; }
  .admin-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-search__input { width: 100%; }
}
