/* ==============================================================================
   FATTO A MANO — LUXURY ADMIN DASHBOARD STYLESHEET
   Dark Luxury & Radiant Copper Glow (Warm Metallics Exclusive)
   ============================================================================== */

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

:root {
  --bg-deep: #08080a;
  --bg-surface: #101014;
  --bg-card: #15151b;
  --bg-card-hover: #1c1c24;
  --bg-input: #0c0c0f;

  --copper-primary: #c87d55;
  --copper-light: #e69870;
  --copper-dark: #8c4a2a;
  --copper-glow: rgba(200, 125, 85, 0.18);
  --copper-glow-strong: rgba(200, 125, 85, 0.35);

  --text-primary: #f5f0eb;
  --text-secondary: #c2bcb5;
  --text-muted: #78726c;

  --border-subtle: rgba(200, 125, 85, 0.15);
  --border-light: rgba(200, 125, 85, 0.3);
  --border-focus: #c87d55;

  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;

  --font-serif: 'Cinzel', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 8px 30px rgba(200, 125, 85, 0.12);
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==============================================================================
   1. AUTHENTICATION GATE & PIN KEYPAD
   ============================================================================== */
.auth-gate-wrapper {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, #181514 0%, #08080a 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: auto;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--copper-primary), transparent);
}

.auth-brand {
  margin-bottom: 1.5rem;
}

.auth-logo-badge {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--copper-primary), var(--copper-dark));
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 0 20px var(--copper-glow-strong);
  margin-bottom: 0.75rem;
}

.auth-brand h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.auth-sub {
  font-size: 0.8rem;
  color: var(--copper-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-shield {
  background: rgba(200, 125, 85, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.auth-shield i {
  color: var(--copper-primary);
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.auth-shield h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.auth-shield p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pin-display-group {
  margin-bottom: 1.25rem;
}

.pin-display-group input {
  width: 100%;
  height: 52px;
  background: var(--bg-input);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 1.8rem;
  letter-spacing: 0.5em;
  color: var(--copper-light);
  font-weight: 700;
  outline: none;
  transition: all 0.2s;
}

.pin-display-group input:focus {
  border-color: var(--copper-primary);
  box-shadow: 0 0 15px var(--copper-glow);
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.key-btn {
  height: 50px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.key-btn:hover {
  background: rgba(200, 125, 85, 0.15);
  border-color: var(--copper-primary);
  color: var(--copper-light);
  transform: translateY(-1px);
}

.key-btn:active {
  transform: translateY(1px);
}

.key-clear {
  color: var(--text-muted);
  font-size: 1rem;
}

.key-back {
  color: var(--copper-light);
  font-size: 1rem;
}

.auth-error-msg {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.auth-footer-note {
  margin-top: 1.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* ==============================================================================
   2. BUTTONS & CONTROLS
   ============================================================================== */
.btn-admin-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  background: linear-gradient(135deg, var(--copper-primary) 0%, var(--copper-dark) 100%);
  border: 1px solid var(--copper-light);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(200, 125, 85, 0.3);
  text-decoration: none;
}

.btn-admin-primary:hover {
  background: linear-gradient(135deg, var(--copper-light) 0%, var(--copper-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200, 125, 85, 0.45);
}

.btn-admin-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-admin-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--copper-primary);
  color: var(--text-primary);
}

.btn-admin-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-admin-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
}

/* ==============================================================================
   3. DASHBOARD LAYOUT & HEADER
   ============================================================================== */
.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  height: 68px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.admin-logo-icon {
  font-size: 1.4rem;
  color: var(--copper-primary);
  filter: drop-shadow(0 0 8px var(--copper-glow));
}

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

.admin-subtitle {
  font-size: 0.7rem;
  color: var(--copper-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.status-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.green {
  background-color: var(--color-success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==============================================================================
   4. BODY & SIDEBAR
   ============================================================================== */
.admin-body {
  display: flex;
  flex: 1;
}

.admin-sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
}

.admin-tabs-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  position: relative;
}

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

.tab-btn.active {
  background: rgba(200, 125, 85, 0.12);
  border-color: var(--border-subtle);
  color: var(--copper-light);
  font-weight: 600;
}

.tab-btn i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.tab-badge {
  margin-left: auto;
  background: rgba(200, 125, 85, 0.2);
  color: var(--copper-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.operator-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
}

.operator-badge i {
  color: var(--copper-primary);
  font-size: 1.1rem;
}

.operator-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.operator-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==============================================================================
   5. MAIN CONTENT AREA & PANELS
   ============================================================================== */
.admin-content {
  flex: 1;
  padding: 2rem;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

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

.admin-tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.panel-header h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--text-primary);
}

.panel-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(200, 125, 85, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--copper-primary);
  font-size: 1.2rem;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Filter Bar */
.catalog-filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 1rem 0 2.5rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--copper-primary);
}

.filter-select-group {
  display: flex;
  gap: 0.5rem;
}

.filter-select-group select {
  height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 1rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

/* Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.9rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--copper-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(200, 125, 85, 0.03);
}

.table-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #000;
}

.category-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pill-pronta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(200, 125, 85, 0.15);
  border: 1px solid var(--copper-primary);
  color: var(--copper-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.pill-misura {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.action-btn-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-action-label,
.btn-action-label-delete {
  display: none;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon-action:hover {
  background: var(--copper-glow);
  border-color: var(--copper-primary);
  color: var(--copper-light);
}

.btn-icon-action.delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--color-danger);
  color: #fca5a5;
}

/* ==============================================================================
   6. BANNER SETTINGS TAB
   ============================================================================== */
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 1.5rem;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-icon {
  font-size: 1.3rem;
  color: var(--copper-primary);
  margin-top: 0.2rem;
}

.card-head h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-head p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-field {
  margin-bottom: 1.15rem;
}

.form-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.admin-input, .admin-textarea, .admin-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s;
}

.admin-input:focus, .admin-textarea:focus, .admin-select:focus {
  border-color: var(--copper-primary);
  box-shadow: 0 0 10px var(--copper-glow);
}

.form-row {
  display: flex;
  gap: 1rem;
}

/* Toggle Switches */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.toggle-label input {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  position: relative;
  transition: all 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.2s;
}

.toggle-label input:checked + .toggle-slider {
  background: var(--copper-primary);
  border-color: var(--copper-light);
}

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

.toggle-text {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.live-preview-box {
  background: #000;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.top-announcement-bar-preview {
  background: linear-gradient(90deg, #120e0c 0%, #1f140e 50%, #120e0c 100%);
  border: 1px solid rgba(200, 125, 85, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  color: var(--copper-light);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
}

/* ==============================================================================
   7. DIAGNOSTICS CARDS
   ============================================================================== */
.diag-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.diag-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.diag-card h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.diag-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.diag-status {
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: monospace;
  color: var(--copper-light);
}

/* ==============================================================================
   8. MODAL STYLES (PRODUCT CRUD)
   ============================================================================== */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-modal-card {
  width: 100%;
  max-width: 780px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), var(--shadow-glow);
  position: relative;
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  margin: auto;
}

.modal-head {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.modal-head h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Modal form flex container - ensures footer never gets pushed off screen */
.modal-edit-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-body-grid {
  padding: 1.5rem 1.75rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.75rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.photo-upload-section {
  display: flex;
  flex-direction: column;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.drop-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.4);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.drop-zone:hover {
  border-color: var(--copper-primary);
  background: rgba(200, 125, 85, 0.05);
}

.drop-icon {
  font-size: 2rem;
  color: var(--copper-primary);
  margin-bottom: 0.5rem;
}

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

.drop-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.btn-clear-photo {
  margin-top: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-clear-photo:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #ffffff;
}

.modal-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: var(--bg-surface);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

/* ==============================================================================
   9. TOAST NOTIFICATIONS
   ============================================================================== */
.admin-toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 420px;
}

.admin-toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--copper-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.25s ease-out;
}

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

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

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

/* ==============================================================================
   10. MASTER RESPONSIVE BREAKPOINTS (DARK LUXURY MOBILE COMPATIBILITY)
   ============================================================================== */
@media (max-width: 900px) {
  .admin-body {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem 0.5rem;
  }
  .admin-tabs-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.35rem;
  }
  .admin-tabs-nav::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
  }
  .sidebar-footer {
    display: none;
  }
  .admin-content {
    padding: 1.25rem 1rem;
  }
  .modal-body-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .settings-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-header {
    height: 60px;
    padding: 0 1rem;
  }
  .admin-header-center {
    display: none;
  }
  .admin-brand {
    gap: 0.5rem;
  }
  .admin-logo-icon {
    font-size: 1.2rem;
  }
  .admin-title {
    font-size: 0.92rem;
  }
  .admin-subtitle {
    font-size: 0.62rem;
  }
  .header-btn-text {
    display: none;
  }
  .btn-admin-secondary.header-btn-shop,
  .btn-admin-danger.header-btn-logout {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
  }
  .panel-actions {
    width: 100%;
  }
  .panel-actions .btn-admin-primary {
    width: 100%;
    min-height: 48px;
    font-size: 0.95rem;
    font-weight: 700;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(200, 125, 85, 0.4);
  }
  .catalog-filter-bar {
    flex-direction: column;
    gap: 0.75rem;
  }
  .search-box input {
    font-size: 16px; /* Prevents iOS auto-zoom */
    height: 46px;
  }
  .filter-select-group {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  .filter-select-group select {
    flex: 1;
    min-width: 0;
    height: 46px;
    font-size: 16px; /* Prevents iOS auto-zoom */
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  .stat-card {
    padding: 0.9rem;
  }
  .stat-val {
    font-size: 1.2rem;
  }

  /* ============================================================================
     RESPONSIVE TABLE -> MOBILE LUXURY CARDS TRANSFORMATION
     Rende la lista articoli e i pulsanti modifica 100% visibili ed accessibili
     senza alcuno scroll orizzontale su smartphone e tablet
     ============================================================================ */
  .table-card {
    background: transparent;
    border: none;
    overflow-x: visible;
    box-shadow: none;
  }

  .admin-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border: none;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tbody {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  #catalogTableBody tr {
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-areas:
      "thumb title"
      "category price"
      "pronta stock"
      "actions actions";
    gap: 0.75rem 0.9rem;
    align-items: center;
    padding: 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    width: 100%;
    box-sizing: border-box;
  }

  #catalogTableBody tr td {
    padding: 0;
    border: none;
    vertical-align: middle;
  }

  #catalogTableBody tr td:nth-child(1) {
    grid-area: thumb;
  }

  #catalogTableBody tr td:nth-child(1) .table-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
  }

  #catalogTableBody tr td:nth-child(2) {
    grid-area: title;
  }

  #catalogTableBody tr td:nth-child(3) {
    grid-area: category;
  }

  #catalogTableBody tr td:nth-child(4) {
    grid-area: price;
    text-align: right;
  }

  #catalogTableBody tr td:nth-child(5) {
    grid-area: pronta;
  }

  #catalogTableBody tr td:nth-child(6) {
    grid-area: stock;
    text-align: right;
  }

  #catalogTableBody tr td:nth-child(7) {
    grid-area: actions;
    width: 100%;
    padding-top: 0.85rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Accessible Touch Action Buttons */
  .action-btn-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    justify-content: stretch;
  }

  .btn-icon-action.btn-edit-action {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 0 1.25rem;
    border-radius: var(--radius-sm);
    background: rgba(200, 125, 85, 0.16);
    border: 1px solid var(--copper-primary);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(200, 125, 85, 0.25);
  }

  .btn-icon-action.btn-edit-action:hover,
  .btn-icon-action.btn-edit-action:active {
    background: var(--copper-primary);
    color: #ffffff;
    box-shadow: 0 0 16px var(--copper-glow-strong);
  }

  .btn-action-label {
    display: inline-block;
  }

  .btn-icon-action.btn-delete-action {
    width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  /* Orders Tab Mobile Card */
  #ordersTableBody tr {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    width: 100%;
    box-sizing: border-box;
  }

  #ordersTableBody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
  }

  #ordersTableBody tr td:last-child {
    border-bottom: none;
  }

  /* ============================================================================
     MOBILE POPUP / MODAL CONFIGURAZIONE PRODOTTO (FULL TOUCH USABILITY)
     Garantisce testata fissa, scroll fluido senza tagli e footer bloccato
     ============================================================================ */
  .admin-modal-backdrop {
    padding: 0;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .admin-modal-card {
    width: 100%;
    max-width: 100%;
    height: 94vh;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
    margin: 0;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9);
  }

  .modal-head {
    position: sticky;
    top: 0;
    z-index: 25;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
  }

  .modal-head h3 {
    font-size: 1.1rem;
  }

  .modal-close-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  .modal-edit-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .modal-body-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
    padding: 1.25rem 1.15rem 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
  }

  .drop-zone {
    min-height: 125px;
    padding: 1rem;
  }

  .drop-icon {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
  }

  .admin-input, .admin-select, .admin-textarea {
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    min-height: 44px;
    padding: 0.65rem 0.85rem;
  }

  .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 25;
    padding: 0.95rem 1.25rem;
    background: rgba(18, 18, 24, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 0.75rem;
  }

  .modal-footer button {
    min-height: 48px;
    font-size: 0.95rem;
    font-weight: 700;
    width: 100%;
    justify-content: center;
    border-radius: var(--radius-sm);
  }
}

@media (max-width: 480px) {
  .auth-gate-wrapper {
    padding: 0.75rem;
  }
  .auth-card {
    padding: 1.75rem 1.25rem;
  }
  .pin-display-group input {
    height: 48px;
    font-size: 1.6rem;
  }
  .key-btn {
    height: 50px;
    font-size: 1.15rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  .admin-modal-card {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .modal-footer {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .modal-footer button {
    min-height: 48px;
    font-size: 0.95rem;
  }
  .admin-toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }
  .admin-toast {
    font-size: 0.82rem;
    padding: 0.75rem 1rem;
  }
}
