/* ============================================================
   BIOE - Admin Panel Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=Raleway:wght@300;400;500;600;700&display=swap');

:root {
  --ivory:      #F8F6F0;
  --gold:       #C9A84C;
  --gold-light: #F0E4B8;
  --gold-dark:  #A8862E;
  --sage:       #C8D8C5;
  --dark:       #1C1C1C;
  --gray-med:   #6B6B6B;
  --gray-light: #D4D4D4;
  --white:      #FFFFFF;

  --sidebar-w:  260px;
  --header-h:   64px;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Raleway', 'Helvetica Neue', Arial, sans-serif;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  --shadow-sm:  0 2px 8px rgba(28,28,28,0.06);
  --shadow-md:  0 8px 24px rgba(28,28,28,0.10);
  --shadow-lg:  0 16px 48px rgba(28,28,28,0.14);

  --trans-base: 0.25s ease;

  --success:    #27ae60;
  --danger:     #e74c3c;
  --warning:    #f39c12;
  --info:       #3498db;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-body);
  background: #F0EDEA;
  color: var(--dark);
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: var(--font-body); cursor: pointer; }
input, textarea, select { font-family: var(--font-body); font-size: inherit; }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ivory) 0%, var(--gold-light) 60%, var(--sage) 100%);
  padding: 2rem;
}

.admin-login__card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.admin-login__logo {
  height: 52px;
  width: auto;
  margin: 0 auto 1.5rem;
  object-fit: contain;
}

.admin-login__logo-fallback {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.admin-login__title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.admin-login__subtitle {
  font-size: 0.85rem;
  color: var(--gray-med);
  margin-bottom: 2rem;
}

.admin-login__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.admin-login__error {
  background: rgba(231,76,60,0.08);
  border: 1px solid rgba(231,76,60,0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--danger);
  display: none;
}

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

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-layout {
  display: none;
  min-height: 100vh;
}

.admin-layout.show { display: flex; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.admin-sidebar__brand {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-sidebar__logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.admin-sidebar__logo-text {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--ivory);
  line-height: 1.2;
}

.admin-sidebar__logo-sub {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

.admin-nav {
  flex: 1;
  padding: 1.25rem 0;
}

.admin-nav__section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 0.75rem 1.5rem 0.4rem;
}

.admin-nav__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(248,246,240,0.65);
  cursor: pointer;
  transition: all var(--trans-base);
  border-left: 3px solid transparent;
  position: relative;
}

.admin-nav__item:hover {
  color: var(--ivory);
  background: rgba(255,255,255,0.05);
}

.admin-nav__item.active {
  color: var(--gold);
  background: rgba(201,168,76,0.1);
  border-left-color: var(--gold);
}

.admin-nav__item svg,
.admin-nav__item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-sidebar__footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-sidebar__footer-user {
  font-size: 0.8rem;
  color: rgba(248,246,240,0.5);
}

.admin-sidebar__footer-user strong {
  display: block;
  color: var(--ivory);
  font-weight: 600;
}

.admin-logout-btn {
  background: none;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  transition: all var(--trans-base);
}

.admin-logout-btn:hover {
  background: var(--gold);
  color: var(--white);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.admin-header__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--dark);
}

.admin-header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-header__date {
  font-size: 0.8rem;
  color: var(--gray-med);
}

.admin-content {
  padding: 2rem;
  flex: 1;
}

.admin-panel {
  display: none;
  animation: fade-in 0.3s ease;
}

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

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

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  transition: box-shadow var(--trans-base), transform var(--trans-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-card__icon--gold { background: rgba(201,168,76,0.15); }
.stat-card__icon--sage { background: rgba(200,216,197,0.3); }
.stat-card__icon--blue { background: rgba(52,152,219,0.12); }
.stat-card__icon--green{ background: rgba(39,174,96,0.12); }

.stat-card__info {}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--dark);
}

.stat-card__label {
  font-size: 0.78rem;
  color: var(--gray-med);
  font-weight: 500;
  margin-top: 0.2rem;
}

.stat-card__change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.4rem;
}

.stat-card__change--up { color: var(--success); }
.stat-card__change--down { color: var(--danger); }

/* ============================================================
   ADMIN CARDS / SECTIONS
   ============================================================ */
.admin-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
}

.admin-card__header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-card__header h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--dark);
}

.admin-card__body {
  padding: 1.75rem;
}

/* ============================================================
   PRODUCT TABLE
   ============================================================ */
.product-table {
  width: 100%;
  border-collapse: collapse;
}

.product-table th {
  text-align: left;
  padding: 0.875rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-med);
  background: #FAFAFA;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  white-space: nowrap;
}

.product-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  vertical-align: middle;
  color: var(--dark);
}

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

.product-table tbody tr {
  transition: background var(--trans-base);
}

.product-table tbody tr:hover { background: #FAFAFA; }

.product-table__thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  overflow: hidden;
  flex-shrink: 0;
}

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

.product-table__name {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.product-table__id {
  font-size: 0.72rem;
  color: var(--gray-med);
  font-family: monospace;
}

.table-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: capitalize;
}

.table-badge--viso      { background: rgba(201,168,76,0.15); color: var(--gold-dark); }
.table-badge--corpo     { background: rgba(200,216,197,0.4); color: #5a8c57; }
.table-badge--occhi     { background: rgba(52,152,219,0.12); color: #2980b9; }
.table-badge--trattamenti { background: rgba(155,130,200,0.15); color: #6c5ce7; }

.table-stock {
  font-weight: 600;
}

.table-stock--low { color: var(--danger); }
.table-stock--ok  { color: var(--success); }

.table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.table-btn {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  transition: all var(--trans-base);
}

.table-btn--edit {
  background: rgba(201,168,76,0.12);
  color: var(--gold-dark);
}
.table-btn--edit:hover {
  background: var(--gold);
  color: var(--white);
}

.table-btn--delete {
  background: rgba(231,76,60,0.1);
  color: var(--danger);
}
.table-btn--delete:hover {
  background: var(--danger);
  color: var(--white);
}

/* Empty state */
.table-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--gray-med);
}

.table-empty__icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

/* ============================================================
   UPLOAD AREA
   ============================================================ */
.upload-area {
  border: 2.5px dashed var(--gray-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--trans-base);
  background: #FAFAFA;
  position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--gold);
  background: rgba(201,168,76,0.04);
}

.upload-area.has-image {
  border-color: var(--gold);
  background: rgba(201,168,76,0.04);
  padding: 1rem;
}

.upload-area__icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.upload-area__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.upload-area__subtitle {
  font-size: 0.8rem;
  color: var(--gray-med);
  margin-bottom: 1rem;
}

.upload-area__formats {
  font-size: 0.72rem;
  color: var(--gray-light);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-preview {
  display: none;
  position: relative;
}

.upload-area.has-image .upload-preview {
  display: block;
}

.upload-area.has-image .upload-area__placeholder {
  display: none;
}

.upload-preview__img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.upload-preview__remove {
  position: absolute;
  top: -8px;
  right: calc(50% - 88px);
  width: 24px;
  height: 24px;
  background: var(--danger);
  color: var(--white);
  border-radius: 50%;
  border: none;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform var(--trans-base);
}

.upload-preview__remove:hover { transform: scale(1.1); }

/* ============================================================
   AI GENERATOR
   ============================================================ */
.ai-generator {
  border: 1.5px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 1.25rem;
  background: linear-gradient(135deg, rgba(248,246,240,0.8) 0%, rgba(240,228,184,0.3) 100%);
}

.ai-generator__header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(201,168,76,0.08);
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.ai-generator__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gold-dark);
}

.ai-generator__body {
  padding: 1.25rem;
}

.ai-generator__desc {
  font-size: 0.8rem;
  color: var(--gray-med);
  margin-bottom: 1rem;
}

/* AI Loading Spinner */
.ai-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
}

.ai-loading.show { display: flex; }

.ai-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(201,168,76,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.ai-loading__text {
  font-size: 0.85rem;
  color: var(--gray-med);
}

.ai-loading__dots {
  display: inline-flex;
  gap: 4px;
}

.ai-loading__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: dot-pulse 1.2s ease infinite;
}

.ai-loading__dot:nth-child(2) { animation-delay: 0.2s; }
.ai-loading__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* AI Result Box */
.ai-result {
  display: none;
  background: var(--white);
  border: 1px solid rgba(39,174,96,0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.ai-result.show { display: block; }

.ai-result__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 0.75rem;
}

.ai-result__preview {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--gray-med);
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 0.75rem;
  max-height: 120px;
  overflow-y: auto;
}

.ai-error {
  display: none;
  background: rgba(231,76,60,0.06);
  border: 1px solid rgba(231,76,60,0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--danger);
  margin-top: 1rem;
}

.ai-error.show { display: block; }

/* ============================================================
   ADMIN FORM STYLES
   ============================================================ */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row--3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-med);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--dark);
  background: var(--white);
  outline: none;
  transition: all var(--trans-base);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

.form-input.error,
.form-select.error {
  border-color: var(--danger);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--gray-med);
}

.form-error-msg {
  font-size: 0.72rem;
  color: var(--danger);
}

/* Price input with currency prefix */
.input-prefix-wrap {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: var(--gray-med);
  font-weight: 600;
}

.input-prefix-wrap .form-input {
  padding-left: 2rem;
}

/* Checkboxes group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.875rem;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--trans-base);
  font-size: 0.8rem;
  font-weight: 500;
  user-select: none;
}

.checkbox-chip:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.06);
}

.checkbox-chip input[type="checkbox"] {
  accent-color: var(--gold);
}

.checkbox-chip:has(input:checked) {
  border-color: var(--gold);
  background: rgba(201,168,76,0.1);
  color: var(--gold-dark);
}

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle__track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--gray-light);
  transition: background var(--trans-base);
}

.toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--trans-base);
}

.toggle input:checked ~ .toggle__track { background: var(--gold); }
.toggle input:checked ~ .toggle__thumb { transform: translateX(20px); }

.toggle__label {
  font-size: 0.875rem;
  font-weight: 500;
}

/* ============================================================
   ADMIN BUTTONS
   ============================================================ */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--trans-base);
  white-space: nowrap;
}

.admin-btn--primary {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
}

.admin-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.4);
}

.admin-btn--secondary {
  background: var(--ivory);
  color: var(--dark);
  border: 1.5px solid rgba(0,0,0,0.1);
}

.admin-btn--secondary:hover {
  background: var(--gold-light);
  border-color: var(--gold);
}

.admin-btn--danger {
  background: rgba(231,76,60,0.1);
  color: var(--danger);
  border: 1px solid rgba(231,76,60,0.2);
}

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

.admin-btn--ai {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(102,126,234,0.3);
}

.admin-btn--ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

.admin-btn--ai:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.admin-btn--sm {
  padding: 0.45rem 1rem;
  font-size: 0.72rem;
}

.admin-btn--full { width: 100%; }

/* Form footer actions */
.form-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 0.5rem;
}

/* ============================================================
   SETTINGS PANEL
   ============================================================ */
.settings-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  margin-bottom: 1.5rem;
}

.settings-section__title {
  font-size: 1rem;
  font-family: var(--font-heading);
  margin-bottom: 0.4rem;
}

.settings-section__desc {
  font-size: 0.8rem;
  color: var(--gray-med);
  margin-bottom: 1.5rem;
}

.api-key-input-wrap {
  position: relative;
}

.api-key-input-wrap .form-input {
  padding-right: 3.5rem;
  font-family: monospace;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.api-key-toggle {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-med);
  font-size: 1rem;
  transition: color var(--trans-base);
}

.api-key-toggle:hover { color: var(--gold); }

.api-key-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.8rem;
  color: var(--gold-dark);
  margin-top: 0.75rem;
}

.api-key-note svg { flex-shrink: 0; margin-top: 0.1rem; }

/* ============================================================
   TOAST NOTIFICATIONS (Admin)
   ============================================================ */
.admin-toast-container {
  position: fixed;
  top: calc(var(--header-h) + 1rem);
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.admin-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 260px;
  border-left: 3px solid var(--gold);
  animation: toast-in 0.3s ease;
  pointer-events: all;
}

.admin-toast--success { border-left-color: var(--success); }
.admin-toast--error   { border-left-color: var(--danger); }
.admin-toast--info    { border-left-color: var(--info); }

.admin-toast.removing {
  animation: toast-out 0.3s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.admin-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,28,28,0.55);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  display: none;
}

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

.admin-confirm-dialog {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.admin-confirm-dialog__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.admin-confirm-dialog h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.admin-confirm-dialog p {
  font-size: 0.875rem;
  color: var(--gray-med);
  margin-bottom: 1.5rem;
}

.admin-confirm-dialog__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform var(--trans-base);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 1.25rem; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row--3 { grid-template-columns: 1fr; }
}
