/* ═══════════════════════════════════════════════════
   ADMIN PANEL — Premium Dark Theme
   ═══════════════════════════════════════════════════ */

:root {
  --blue: #1e3a8a;
  --blue-mid: #2563eb;
  --blue-glow: rgba(37, 99, 235, 0.4);
  --red: #e11d48;
  --red-glow: rgba(225, 29, 72, 0.4);
  --grad-red: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  --grad-blue: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  --shadow-red: 0 4px 14px var(--red-glow);
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --white: #ffffff;
}

/* ── Override body for admin ── */
body.admin-body {
  background: linear-gradient(180deg, #111827 0%, #171E2E 50%, #0F172A 100%);
  min-height: 100vh;
  color-scheme: dark;
}

body.admin-body header {
  background: rgba(15, 23, 42, .85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

body.admin-body nav ul li a {
  color: rgba(255, 255, 255, .6);
}

body.admin-body nav ul li a:hover,
body.admin-body nav ul li a.active {
  background: rgba(225, 29, 72, .12);
  color: var(--red);
}

/* Branding - Logo + Text sync with site */
.logo {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.logo-img {
  height: 42px;
  width: auto;
  border-radius: 8px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: .9;
  font-family: 'Outfit', sans-serif;
}
.brand-main {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
}
.brand-sub {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
}

.nav-bar { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: flex; align-items: center; gap: 1rem; }
.brand img { height: 52px; width: auto; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1)); }

/* ── Shell ── */
.admin-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Hero ── */
.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.admin-hero h1 {
  color: #fff;
  font-size: 1.8rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.admin-hero p {
  color: rgba(255, 255, 255, .8);
  font-size: .92rem;
}

.admin-hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.admin-button {
  border: none;
  border-radius: var(--radius-full);
  padding: .8rem 1.2rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.admin-button.primary {
  background: var(--grad-red);
  color: #fff;
  box-shadow: 0 4px 15px rgba(225, 29, 72, .25);
}

.admin-button.primary:hover {
  box-shadow: var(--shadow-red);
  transform: translateY(-2px);
}

.admin-button.secondary {
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .1);
}

.admin-button.secondary:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .2);
}

.admin-button[disabled] {
  opacity: .5;
  cursor: wait;
}

/* ── KPI Cards ── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.admin-card {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  color: #fff;
}

.admin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-blue);
  opacity: 0;
  transition: opacity .3s;
}

.admin-card:hover::before {
  opacity: 1;
}

.admin-card:hover {
  background: rgba(255, 255, 255, .07);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
}

.admin-card small {
  color: rgba(255, 255, 255, .6);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  font-size: .75rem;
  display: block;
}

.admin-card .value {
  font-size: 2rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  background: var(--grad-red);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: .35rem;
}

/* ── Reports UI ── */
.report-card {
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.report-card:hover {
  transform: scale(1.02);
  background: rgba(255, 255, 255, 0.08);
}

.report-card i {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: #60A5FA; /* Brighter blue */
}

.report-card h4 {
  color: #fff;
  margin-bottom: 0.25rem;
}

.report-card p {
  color: rgba(255, 255, 255, .7);
  font-size: 0.85rem;
}

/* ── Layout ── */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: start;
}

/* ── Sidebar ── */
.admin-sidebar {
  position: sticky;
  top: 100px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius);
  padding: 1rem;
}

.admin-menu {
  list-style: none;
  display: grid;
  gap: .3rem;
}

.admin-menu button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: .8rem .9rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  color: rgba(255, 255, 255, .45);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .88rem;
}

.admin-menu button i {
  width: 18px;
  text-align: center;
}

.admin-menu button:hover {
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .8);
}

.admin-menu button.active {
  background: rgba(225, 29, 72, .12);
  color: var(--red);
  box-shadow: inset 3px 0 0 var(--red);
}

/* ── Content Sections ── */
.admin-content {
  display: grid;
  gap: 1rem;
}

.admin-section {
  display: none;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.admin-section.active {
  display: block;
  animation: fadeInUp .4s ease both;
}

.admin-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.admin-panel-title h3 {
  color: #fff;
  font-size: 1.15rem;
}

/* ── Grid helpers ── */
.admin-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: .9rem;
}

.span-12 {
  grid-column: span 12;
}

.span-8 {
  grid-column: span 8;
}

.span-6 {
  grid-column: span 6;
}

.span-4 {
  grid-column: span 4;
}

.span-3 {
  grid-column: span 3;
}

.span-2 {
  grid-column: span 2;
}

/* ── Forms ── */
.admin-form {
  display: grid;
  gap: .85rem;
}

.admin-form label {
  display: grid;
  gap: .35rem;
  font-size: .86rem;
  color: rgba(255, 255, 255, .45);
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  outline: none;
  transition: var(--transition);
}

select option {
  background-color: #0F172A;
  color: #fff;
}

.admin-form select option {
  background-color: #0c1527;
  color: #fff;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px var(--blue-glow);
  background: rgba(255, 255, 255, .06);
}

.admin-form input::placeholder {
  color: rgba(255, 255, 255, .25);
}

.admin-form textarea {
  min-height: 110px;
  resize: vertical;
}

.admin-form input.is-invalid,
.admin-form select.is-invalid,
.admin-form textarea.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.field-hint {
  font-size: .78rem;
  color: rgba(255, 255, 255, .3);
}

/* ── Specifications Editor ── */
.spec-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
}

.spec-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  animation: fadeInSpec 0.3s ease-out;
}

@keyframes fadeInSpec {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.spec-row select,
.spec-row input {
  flex: 1;
  padding: 0.65rem 1rem !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-radius: var(--radius-sm);
  outline: none;
}

.spec-row input.spec-value {
  flex: 2;
}

.spec-row .remove-btn {
  background: rgba(225, 29, 72, 0.1);
  border: 1px solid rgba(225, 29, 72, 0.2);
  color: var(--red);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.spec-row .remove-btn:hover {
  background: var(--red);
  color: #fff;
  transform: scale(1.05);
}

.add-spec-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
  padding: 0.8rem;
  width: 100%;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.add-spec-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--blue-mid);
  color: #fff;
}

/* ── Preview ── */
.preview-card {
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(255, 255, 255, .02);
  display: grid;
  gap: .75rem;
}

.preview-card strong {
  color: rgba(255, 255, 255, .6);
}

.preview-card img {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .2);
}

#product-preview-gallery img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .2);
}

.preview-meta {
  display: grid;
  gap: .35rem;
}

/* ── Toolbar ── */
.admin-toolbar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.admin-toolbar input,
.admin-toolbar select {
  padding: .75rem 1rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .04);
  color: #fff;
  outline: none;
  transition: var(--transition);
}

.admin-toolbar select option {
  background-color: #0c1527;
  color: #fff;
}

.admin-toolbar input:focus,
.admin-toolbar select:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

/* ── Tables ── */
.admin-table-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.admin-table th,
.admin-table td {
  padding: .85rem .75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.admin-table thead th {
  background: rgba(255, 255, 255, .06);
  padding: 1rem;
  font-family: 'Outfit', sans-serif;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .8);
  border-bottom: 2px solid rgba(255, 255, 255, .1);
}

.admin-table tbody td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  vertical-align: middle;
  color: rgba(255, 255, 255, .9);
}

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

/* ── Actions & Buttons ── */
.admin-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.icon-btn {
  border: none;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-sm);
  padding: .55rem .7rem;
  cursor: pointer;
  color: rgba(255, 255, 255, .5);
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(37, 99, 235, .15);
  color: var(--blue-mid);
}

/* ── Charts ── */
.chart-list {
  display: grid;
  gap: .7rem;
}

.chart-item {
  display: grid;
  gap: .35rem;
}

.chart-item span {
  color: rgba(255, 255, 255, .5);
  font-size: .85rem;
}

.chart-bar-track {
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--grad-red);
}

/* ── Split Panels ── */
.split-panels {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 1rem;
}

.split-panels>div {
  min-width: 0;
}

.split-panels h4 {
  color: rgba(255, 255, 255, .6);
  margin-bottom: .75rem;
}

/* ── Status ── */
.admin-status {
  margin-top: .85rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  display: none;
}

.admin-status.show {
  display: block;
}

.admin-status.success {
  background: rgba(22, 163, 74, .12);
  color: #4ade80;
}

.admin-status.error {
  background: rgba(225, 29, 72, .12);
  color: #fb7185;
}

/* ── Misc ── */
.empty-state {
  padding: 1.5rem;
  border: 1px dashed rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  text-align: center;
  color: rgba(255, 255, 255, .3);
}

.mini-muted {
  color: rgba(255, 255, 255, .35);
  font-size: .82rem;
}

.order-items {
  display: grid;
  gap: .25rem;
}

/* ── Gallery ── */
.gallery-manager {
  display: grid;
  gap: .75rem;
}

.gallery-dropzone {
  border: 2px dashed rgba(255, 255, 255, .1);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, .02);
  color: rgba(255, 255, 255, .3);
  transition: var(--transition);
}

.gallery-dropzone.dragover {
  border-color: var(--red);
  background: rgba(225, 29, 72, .05);
  color: var(--red);
}

.gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: .75rem;
}

.gallery-item {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-sm);
  padding: .5rem;
  background: rgba(255, 255, 255, .03);
  display: grid;
  gap: .45rem;
}

.gallery-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
}

.gallery-item.is-cover {
  box-shadow: 0 0 0 2px rgba(225, 29, 72, .3);
}

.gallery-item .mini-actions {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.mini-btn {
  border: none;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  padding: .35rem .5rem;
  font-size: .72rem;
  cursor: pointer;
  color: rgba(255, 255, 255, .5);
  transition: var(--transition);
}

.mini-btn:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.mini-btn.primary {
  background: rgba(225, 29, 72, .12);
  color: var(--red);
}

/* ── Loading ── */
.admin-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.admin-loading-overlay.show {
  display: flex;
}

.admin-loading-card {
  min-width: 280px;
  max-width: 92vw;
  background: rgba(30, 41, 59, .95);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: center;
  gap: .9rem;
}

.admin-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(225, 29, 72, .15);
  border-top-color: var(--red);
  animation: spin .8s linear infinite;
  flex: 0 0 auto;
}

.loading-label {
  font-weight: 700;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

body.admin-busy .admin-content {
  pointer-events: none;
  opacity: .6;
}

/* ── Tabs for Form ── */
.admin-form-container {
  background: rgba(255, 255, 255, .02);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: var(--radius-lg);
  padding: 2rem;
  animation: slideUp .4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.admin-tabs {
  display: flex;
  gap: .5rem;
  border-bottom: 2px solid rgba(255, 255, 255, .05);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.admin-menu a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-size: .88rem;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  padding: .75rem 1.25rem;
  color: rgba(255, 255, 255, .6);
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
}

.admin-tab-btn:hover {
  color: rgba(255, 255, 255, .8);
}

.admin-tab-btn.active {
  color: var(--blue-mid);
  border-bottom-color: var(--blue-mid);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
  animation: fadeIn .4s ease both;
}

.file-input-premium {
  padding: 1.5rem !important;
  border: 2px dashed rgba(255, 255, 255, .1) !important;
  text-align: center;
  background: rgba(255, 255, 255, .02) !important;
  cursor: pointer;
}

.file-input-premium:hover {
  border-color: rgba(255, 255, 255, .3) !important;
}

.sticky-preview {
  position: sticky;
  top: 100px;
}

/* ── Ficha Técnica ── */
.spec-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  animation: fadeIn 0.3s ease;
}
.spec-row input, .spec-row select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s ease;
}
.spec-row input:focus, .spec-row select:focus {
  border-color: var(--red);
  background: rgba(255, 0, 0, 0.05);
  outline: none;
}
.spec-row .remove-btn {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.2);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.spec-row .remove-btn:hover {
  background: #f44336;
  color: #fff;
  transform: scale(1.05);
}
.add-spec-btn {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #aaa;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}
.add-spec-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
  color: #fff;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .admin-sidebar {
    position: static;
  }

  .split-panels {
    grid-template-columns: 1fr;
  }

  .span-8,
  .span-6,
  .span-4,
  .span-3,
  .span-2 {
    grid-column: span 12;
  }
}


/* ═══ ADMIN LOGIN ═══ */
.admin-login-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #0B1120 0%, #1E3A8A 50%, #0F172A 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  position: relative;
  overflow: hidden;
}

.admin-login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 30%, rgba(225, 29, 72, .1) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(37, 99, 235, .15) 0%, transparent 60%);
}

.admin-login-card {
  width: min(100%, 440px);
  position: relative;
  z-index: 1;
  background: rgba(30, 41, 59, .8);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
  padding: 2.5rem;
  animation: scaleIn .5s cubic-bezier(.16, 1, .3, 1) both;
}

.admin-login-card .login-logo {
  display: block;
  max-height: 56px;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .3));
}

.admin-login-card h1 {
  margin: 0 0 .35rem;
  font-size: 1.8rem;
  color: #fff;
  text-align: center;
}

.admin-login-card>p {
  margin: 0 0 2rem;
  color: rgba(255, 255, 255, .45);
  text-align: center;
  font-size: .92rem;
}

.admin-login-card form {
  display: grid;
  gap: 1rem;
}

.admin-login-card label {
  display: grid;
  gap: .4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .45);
  font-size: .88rem;
}

.admin-login-card input {
  width: 100%;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-sm);
  font: inherit;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  outline: none;
  transition: var(--transition);
}

.admin-login-card input::placeholder {
  color: rgba(255, 255, 255, .25);
}

.admin-login-card input:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px var(--blue-glow);
  background: rgba(255, 255, 255, .08);
}

.admin-login-card button[type="submit"] {
  width: 100%;
  border: none;
  border-radius: var(--radius-full);
  padding: 1rem;
  background: var(--grad-red);
  color: #fff;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  font-size: .95rem;
  box-shadow: 0 4px 20px rgba(225, 29, 72, .3);
}

.admin-login-card button[type="submit"]:hover {
  box-shadow: var(--shadow-red);
  transform: translateY(-2px);
}

.admin-login-status {
  display: none;
  margin-top: 1rem;
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
}

.admin-login-status.show {
  display: block;
}

.admin-login-status.error {
  background: rgba(225, 29, 72, .12);
  color: #fb7185;
}

.admin-login-status.info {
  background: rgba(37, 99, 235, .12);
  color: #93c5fd;
}

.admin-login-help {
  margin-top: 1.25rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, .3);
  text-align: center;
}

/* ── Utility Classes (Fixing Inline Styles) ── */
.u-mb-1 {
  margin-bottom: 1rem !important;
}

.u-mb-2 {
  margin-bottom: 2rem !important;
}

.u-mt-0 {
  margin-top: 0 !important;
}

.u-hide {
  display: none !important;
}

.u-show {
  display: block !important;
}

.u-flex {
  display: flex !important;
  align-items: center;
  gap: .5rem;
}

.u-flex-between {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.u-text-white {
  color: #fff !important;
}

.u-text-red {
  color: var(--red) !important;
}

.u-text-orange {
  color: #f97316 !important;
}

.u-no-decoration {
  text-decoration: none !important;
}

.u-w-full {
  width: 100% !important;
}

.u-max-w-400 {
  max-width: 400px !important;
}

.u-min-h-120 {
  min-height: 120px !important;
}

.u-bg-blue {
  background: var(--blue) !important;
}

.u-gap-1 {
  gap: 1rem !important;
}

.section-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 1rem;
  padding-top: 1rem;
}

.header-divider {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1rem;
}

.login-icon {
  margin-right: .4rem;
  color: var(--blue-mid);
}

.p-preview-desc {
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Print Styles ── */
@media print {
  @page { margin: 1cm; }
  
  body.admin-body {
    background: #fff !important;
    color: #000 !important;
  }
  
  header, 
  nav,
  .admin-sidebar, 
  .admin-hero, 
  .admin-grid,
  .admin-toolbar, 
  .admin-actions, 
  #report-filters,
  .admin-panel-title p,
  .admin-tabs,
  .admin-hero-actions,
  button,
  .icon-btn,
  .admin-button,
  #admin-auth-guard,
  .admin-loading-overlay {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .admin-layout {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .admin-shell {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    display: block !important;
  }

  .admin-content {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .admin-section {
    display: none !important;
  }

  .admin-section.active {
    display: block !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #report-view-container {
    display: block !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
  }

  .admin-table-wrap {
    border: none !important;
    overflow: visible !important;
  }

  .admin-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .admin-table th, .admin-table td {
    border-bottom: 1px solid #ddd !important;
    color: #000 !important;
  }

  .admin-card {
    background: #f9f9f9 !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ═══════════════════════════════════════════════════
   AI MAGIC & PREMIUM TWEAKS
   ═══════════════════════════════════════════════════ */
.ai-magic-toggle {
  display: flex !important;
  align-items: center;
  padding: 0.75rem;
  background: rgba(225, 29, 72, 0.05);
  border: 1px dashed rgba(225, 29, 72, 0.2);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.switch-premium {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 0.75rem;
  -webkit-user-select: none;
  user-select: none;
}

.switch-premium input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-premium .slider {
  position: relative;
  width: 42px;
  height: 22px;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 34px;
}

.switch-premium .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.switch-premium input:checked + .slider {
  background-color: var(--red);
}

.switch-premium input:checked + .slider:before {
  transform: translateX(20px);
}

.switch-premium .label-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(225, 29, 72, 0.3);
}

.ai-processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: inherit;
  z-index: 10;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.ai-spinner {
  width: 32px;
  height: 32px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.sticky-preview {
  position: sticky;
  top: 100px;
}

/* ── Promo Preview ── */
#promo-image-preview {
  display: none;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

#promo-image-preview-img {
  max-width: 100%;
  max-height: 140px;
  display: block;
}

/* ── SKU Manager & Field Utilities ── */
.label-bold { font-weight: 700; }
.btn-blue-outline { color: var(--blue-mid); border-color: var(--blue-mid); }

.sku-manager-card {
  display: none;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.th-w-120 { width: 120px; }
.th-w-100 { width: 100px; }
.th-w-250 { width: 250px; }
.th-w-60 { width: 60px; }
/* -- CSV Import UI -- */
.csv-upload-zone { border: 2px dashed rgba(255, 255, 255, 0.1); border-radius: var(--radius); padding: 2rem; text-align: center; background: rgba(255, 255, 255, 0.02); color: rgba(255, 255, 255, 0.4); cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.csv-upload-zone:hover, .csv-upload-zone.dragover { border-color: var(--blue-mid); background: rgba(37, 99, 235, 0.05); color: #fff; }
.csv-upload-zone i { font-size: 2.5rem; opacity: 0.5; }
.admin-modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.8); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fadeIn 0.3s ease; }
.admin-modal-card { background: #111827; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius-lg); width: 90%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.admin-modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); display: flex; justify-content: space-between; align-items: center; }
.admin-modal-header h3 { margin: 0; font-size: 1.25rem; }
.admin-modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.admin-modal-footer { padding: 1.25rem 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.06); display: flex; justify-content: flex-end; gap: 0.75rem; }
.close-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; opacity: 0.5; transition: 0.2s; }
.close-btn:hover { opacity: 1; }
.progress-bar-container { width: 100%; height: 8px; background: rgba(255, 255, 255, 0.05); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--grad-red); width: 0%; transition: width 0.3s ease; }
.admin-table.mini th, .admin-table.mini td { padding: 0.5rem; font-size: 0.8rem; }
.u-max-h-300 { max-height: 300px; overflow-y: auto; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Barcode Scanner Modal ── */
.barcode-modal-card { max-width: 440px; }
.barcode-viewfinder { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; }
#barcode-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.barcode-aim-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.barcode-aim-frame { width: 65%; height: 30%; border: 3px solid rgba(99, 179, 237, 0.9); border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); position: relative; }
.barcode-aim-corner { position: absolute; width: 20px; height: 20px; }
.barcode-aim-corner--tl { top: -2px; left: -2px; border-top: 4px solid #63b3ed; border-left: 4px solid #63b3ed; border-radius: 4px 0 0 0; }
.barcode-aim-corner--tr { top: -2px; right: -2px; border-top: 4px solid #63b3ed; border-right: 4px solid #63b3ed; border-radius: 0 4px 0 0; }
.barcode-aim-corner--bl { bottom: -2px; left: -2px; border-bottom: 4px solid #63b3ed; border-left: 4px solid #63b3ed; border-radius: 0 0 0 4px; }
.barcode-aim-corner--br { bottom: -2px; right: -2px; border-bottom: 4px solid #63b3ed; border-right: 4px solid #63b3ed; border-radius: 0 0 4px 0; }
.barcode-scan-line { position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: rgba(99, 179, 237, 0.8); box-shadow: 0 0 8px #63b3ed; animation: barcode-scan-line 1.6s ease-in-out infinite; }
@keyframes barcode-scan-line { 0%, 100% { transform: translateY(-120%); } 50% { transform: translateY(120%); } }
.barcode-status { margin: 8px 0 4px; text-align: center; }
.barcode-manual-row { display: flex; gap: 8px; margin-top: 12px; }
.barcode-manual-row input { flex: 1; }
.modal-header-subtitle { margin: 0; }

/* ══════════════════════════════════════════════════════════
   SCANNER FÍSICO — Toast de Feedback + Badge de Modo Ativo
══════════════════════════════════════════════════════════ */

.scanner-toast-overlay {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.scanner-toast-overlay.scanner-toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.scanner-toast-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem 1.5rem;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04);
  min-width: 280px;
  max-width: 360px;
  overflow: hidden;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.scanner-toast-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  transition: background 0.3s, color 0.3s;
}

.scanner-toast--success .scanner-toast-icon {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  animation: scanner-icon-pop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.scanner-toast--not-found .scanner-toast-icon {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.scanner-toast--searching .scanner-toast-icon {
  animation: scanner-pulse 1s ease-in-out infinite;
}

@keyframes scanner-icon-pop {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes scanner-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.scanner-toast-content {
  flex: 1;
  min-width: 0;
}

.scanner-toast-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.2rem;
}

.scanner-toast--success .scanner-toast-title { color: #4ade80; }
.scanner-toast--not-found .scanner-toast-title { color: #fbbf24; }

.scanner-toast-code {
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  color: #94a3b8;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scanner-toast-product {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 600;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scanner-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: #2563eb;
  border-radius: 0 0 16px 16px;
}

.scanner-toast--success .scanner-toast-progress { background: #16a34a; }
.scanner-toast--not-found .scanner-toast-progress { background: #d97706; }

/* ── Scanner Mode Badge (indicador fixo) ── */
.scanner-mode-badge {
  position: fixed;
  top: 70px;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #60a5fa;
  z-index: 1500;
  animation: scanner-badge-pulse 1.2s ease-in-out infinite;
  pointer-events: none;
}

.scanner-mode-badge i {
  font-size: 0.7rem;
  animation: scanner-wifi-pulse 1s ease-in-out infinite;
}

@keyframes scanner-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
}

@keyframes scanner-wifi-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
