/* ==========================================================================
   LOUIS VAREN - HOMME ATELIER
   Luxury Admin Portal Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Color Palette */
  --admin-sidebar-bg: #12100E;
  --admin-sidebar-surface: #1A1714;
  --admin-sidebar-border: #29241F;
  --admin-sidebar-text: #BDB7AB;
  --admin-sidebar-active: #F5EFEB;

  --gold-primary: #C59B27;
  --gold-light: #E0BA55;
  --gold-dark: #9A7416;
  --gold-subtle: rgba(197, 155, 39, 0.12);

  --brand-cognac: #8A4A28;
  --brand-saddle: #A05A32;

  --bg-main: #F8F6F1;
  --bg-card: #FFFFFF;
  --bg-subtle: #F2EFE8;

  --border-light: #E8E2D8;
  --border-strong: #D5CCC0;

  --text-primary: #181513;
  --text-secondary: #615B54;
  --text-muted: #968F85;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(22, 19, 17, 0.08);
  --shadow-lg: 0 12px 30px rgba(22, 19, 17, 0.14);

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Admin Layout Structure
   ========================================================================== */

.admin-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 270px;
  background: var(--admin-sidebar-bg);
  color: var(--admin-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--admin-sidebar-border);
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.8rem 1.5rem 1.4rem;
  border-bottom: 1px solid var(--admin-sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #F8F5F0;
}

.sidebar-brand-sub {
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 500;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #6C665D;
  padding: 0.6rem 0.8rem 0.3rem;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--admin-sidebar-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  opacity: 0.85;
  transition: var(--transition);
}

.sidebar-link:hover {
  background: var(--admin-sidebar-surface);
  color: #FFFFFF;
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(197, 155, 39, 0.22), rgba(138, 74, 40, 0.2));
  color: #FFFFFF;
  border-left: 3px solid var(--gold-primary);
  font-weight: 600;
}

.sidebar-link.active svg {
  color: var(--gold-primary);
  opacity: 1;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--gold-primary);
  color: #12100E;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 1.2rem;
  border-top: 1px solid var(--admin-sidebar-border);
  background: rgba(0, 0, 0, 0.2);
}

.store-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-sidebar-border);
  border-radius: var(--radius-sm);
  color: #F0ECE4;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.store-link-btn:hover {
  background: var(--gold-primary);
  color: #12100E;
  border-color: var(--gold-primary);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-main);
  overflow-y: auto;
}

/* Top Header */
.admin-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
  cursor: pointer;
  color: var(--text-primary);
}

.topbar-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.system-status-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #E8F5E9;
  border: 1px solid #C8E6C9;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #2E7D32;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2E7D32;
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #181513;
  color: #FFFFFF;
  border: 1px solid #181513;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary-action:hover {
  background: var(--brand-cognac);
  border-color: var(--brand-cognac);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(138, 74, 40, 0.25);
}

/* Content Body */
.admin-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ==========================================================================
   KPI Metrics Grid
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold-primary);
}

.metric-card.accent-cognac::after { background: var(--brand-cognac); }
.metric-card.accent-emerald::after { background: #2E7D32; }
.metric-card.accent-amber::after { background: #E65100; }

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 600;
}

.metric-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.metric-icon-box.gold {
  background: var(--gold-subtle);
  color: var(--gold-dark);
}

.metric-value {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Data Sections & Cards
   ========================================================================== */

.data-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title-group h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-title-group p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Filter & Search Toolbar */
.toolbar-bar {
  padding: 1rem 1.5rem;
  background: #FCFAF7;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  min-width: 260px;
  flex: 1;
  max-width: 400px;
}

.search-input-wrap svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.4rem;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.55rem 0.85rem;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus {
  border-color: var(--gold-primary);
}

.tab-pills {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.tab-pill {
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.tab-pill:hover {
  color: var(--text-primary);
}

.tab-pill.active {
  background: #FFFFFF;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Data Tables
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table th {
  background: #F8F5F0;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-primary);
}

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

.admin-table tr:hover td {
  background-color: #FAFAF7;
}

/* Product Row Specifics */
.product-cell {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.product-thumb {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #EAE6DF;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.product-info-name {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.product-info-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-id-badge {
  font-size: 0.68rem;
  font-family: monospace;
  background: var(--bg-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--text-secondary);
  margin-right: 0.3rem;
}

/* Category Badge */
.category-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Stock Indicator */
.stock-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
}

.stock-btn {
  background: none;
  border: none;
  padding: 0.25rem 0.55rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.stock-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.stock-number {
  min-width: 32px;
  text-align: center;
  font-weight: 600;
  font-size: 0.84rem;
}

.stock-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  margin-top: 4px;
}

.stock-badge.in-stock {
  background: #E8F5E9;
  color: #2E7D32;
}

.stock-badge.low-stock {
  background: #FFF3E0;
  color: #E65100;
}

.stock-badge.out-of-stock {
  background: #FFEBEE;
  color: #C62828;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.pending {
  background: #FFF8E1;
  color: #B78103;
  border: 1px solid #FFE082;
}

.status-badge.processing {
  background: #E3F2FD;
  color: #1565C0;
  border: 1px solid #90CAF9;
}

.status-badge.shipped {
  background: #EDE7F6;
  color: #5E35B1;
  border: 1px solid #D1C4E9;
}

.status-badge.delivered {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.status-badge.cancelled {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-icon.danger:hover {
  background: #FFEBEE;
  color: #C62828;
  border-color: #FFCDD2;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 16, 14, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  transform: translateY(15px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-card.modal-lg {
  max-width: 860px;
}

.modal-card.modal-sm {
  max-width: 460px;
}

.modal-header {
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAF8F5;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  background: #FAF8F5;
}

/* Form Controls inside Modal */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

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

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

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

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: #FFFFFF;
  outline: none;
  transition: var(--transition);
}

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

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

/* ==========================================================================
   Image Upload & Media Selector Component
   ========================================================================== */

.image-upload-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.image-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.image-source-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  gap: 2px;
}

.img-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.img-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.6);
}

.img-tab-btn.active {
  background: #FFFFFF;
  color: var(--brand-cognac);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.image-panel {
  display: none;
}

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

/* Luxury Image Dropzone */
.image-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: #FAF8F5;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
}

.image-dropzone:hover,
.image-dropzone.dragover {
  border-color: var(--gold-primary);
  background: rgba(197, 155, 39, 0.05);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.dropzone-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold-subtle);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.image-dropzone:hover .dropzone-icon-circle {
  transform: translateY(-2px);
  background: rgba(197, 155, 39, 0.2);
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dropzone-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.btn-browse-file {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-browse-file:hover {
  background: var(--bg-subtle);
  border-color: var(--gold-primary);
  color: var(--brand-cognac);
}

/* Upload Status / Progress Bar */
.upload-status-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding: 0.55rem 0.85rem;
  background: rgba(197, 155, 39, 0.12);
  border: 1px solid rgba(197, 155, 39, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--gold-dark);
  font-weight: 600;
}

.upload-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(154, 116, 22, 0.25);
  border-top-color: var(--gold-dark);
  border-radius: 50%;
  animation: adminSpin 0.75s linear infinite;
}

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

/* Active Selected Image Preview Card */
.active-image-preview-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
}

.preview-img-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.preview-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-img-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.preview-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--gold-dark);
  background: var(--gold-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}

.preview-file-size {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.preview-image-path {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: monospace;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-preview-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-preview-action:hover {
  background: var(--bg-subtle);
  color: var(--brand-cognac);
  border-color: var(--border-strong);
}

/* Multi-Photo Gallery Manager */
.product-gallery-manager {
  margin-top: 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.gallery-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gallery-count-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-cognac);
  background: rgba(138, 74, 40, 0.1);
  padding: 3px 9px;
  border-radius: 12px;
}

.gallery-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.gallery-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.65rem;
}

.gallery-item-card {
  position: relative;
  background: #FFFFFF;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.gallery-item-card.is-cover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-subtle);
}

.gallery-item-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: #ECE8E1;
  overflow: hidden;
  position: relative;
}

.gallery-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-cover-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--gold-primary);
  color: #12100E;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.gallery-item-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(18, 16, 14, 0.75);
  color: #FFFFFF;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  transition: var(--transition);
}

.gallery-item-remove-btn:hover {
  background: #C62828;
  transform: scale(1.1);
}

.gallery-item-actions {
  padding: 4px 6px;
  background: #FAF8F5;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
}

.btn-set-cover {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-set-cover:hover {
  color: var(--brand-cognac);
  background: rgba(197, 155, 39, 0.15);
}

.gallery-add-card {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.74rem;
  font-weight: 600;
}

.gallery-add-card:hover {
  border-color: var(--gold-primary);
  color: var(--brand-cognac);
  background: #FFFFFF;
}

/* Visual Image Selector inside Product Modal */
.image-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
  padding: 0.4rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.image-option {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

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

.image-option:hover {
  border-color: var(--gold-light);
  transform: scale(1.03);
}

.image-option.selected {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px rgba(197, 155, 39, 0.4);
}

.image-option.selected::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--gold-primary);
  color: #12100E;
  font-size: 0.65rem;
  font-weight: bold;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Color Variant Chips */
.color-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.color-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.78rem;
}

.color-tag-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.color-tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.color-tag-remove:hover {
  color: #C62828;
}

/* Switch / Checkbox Row */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

/* ==========================================================================
   Invoice / Order Details View (Modal)
   ========================================================================== */

.invoice-header-box {
  background: linear-gradient(135deg, #181513, #2E1C14);
  color: #FFFFFF;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.invoice-order-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  color: #FFFFFF;
}

.invoice-date {
  font-size: 0.8rem;
  color: #C5BDB3;
  margin-top: 3px;
}

.invoice-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.invoice-info-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
}

.invoice-info-card h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.invoice-info-card p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.invoice-items-table th {
  background: var(--bg-subtle);
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.invoice-items-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.invoice-totals-box {
  max-width: 320px;
  margin-left: auto;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.invoice-total-row.grand-total {
  border-top: 1px dashed var(--border-strong);
  padding-top: 0.5rem;
  margin-top: 0.3rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand-cognac);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.admin-toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 2000;
}

.admin-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #181513;
  color: #FFFFFF;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  border-left: 3px solid var(--gold-primary);
  animation: toastSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-toast.toast-error {
  border-left-color: #C62828;
}

.admin-toast.toast-out {
  animation: toastSlideOut 0.25s forwards;
}

@keyframes toastSlideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(50px); opacity: 0; }
}

/* ==========================================================================
   Print Styles for Invoice
   ========================================================================== */

@media print {
  body * {
    visibility: hidden;
  }
  #order-details-modal, #order-details-modal * {
    visibility: visible;
  }
  #order-details-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #FFFFFF !important;
  }
  .modal-header, .modal-footer, .admin-sidebar, .admin-topbar {
    display: none !important;
  }
  .modal-card {
    border: none !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 992px) {
  .admin-sidebar {
    position: fixed;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .admin-sidebar.mobile-active {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: block;
  }
  .menu-toggle-btn {
    display: block;
  }
  .admin-content {
    padding: 1.25rem;
  }
  .admin-topbar {
    padding: 0.85rem 1.25rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .invoice-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar-right .system-status-pill {
    display: none;
  }
  .toolbar-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input-wrap {
    max-width: 100%;
  }
}
