/* ==========================================================================
   MAWRUT SHOWROOM — PROFESSIONAL COMPACT DESIGN SYSTEM
   Refined: Dense layout, Inter font, sharp radii, muted neutrals
   ========================================================================== */

:root, [data-theme="light"] {
  /* REFINED NEUTRAL PALETTE */
  --bg-primary: #F5F4F1;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #EEEDEA;
  --bg-surface-glass: rgba(255, 255, 255, 0.94);
  
  /* ACCENT — WARM BRASS / AMBER */
  --gold-primary: #8B6914;
  --gold-brass: #A37D1F;
  --gold-light: #3F3010;
  --gold-badge-bg: #F5EDD8;
  --gold-glow: rgba(139, 105, 20, 0.10);
  
  /* SECONDARY — TERRACOTTA / COPPER */
  --copper-primary: #8F4E1B;
  --terracotta: #B35427;
  --terracotta-light: #943F18;
  --terracotta-badge-bg: #FDF1EB;
  
  /* TERTIARY — TEAL / GREEN */
  --emerald-zellige: #1A7A45;
  --emerald-light: #147A3A;
  --emerald-badge-bg: #E6F5EC;
  --emerald-glow: rgba(26, 122, 69, 0.12);
  
  /* BORDERS & LINES */
  --border-subtle: #DEDCD7;
  --border-brass: #C9B88A;
  --border-highlight: #A37D1F;
  
  /* TEXT HIERARCHY */
  --text-primary: #1A1816;
  --text-secondary: #4A453C;
  --text-muted: #8A8379;
  
  /* STATUS */
  --danger: #CC2233;
  --warning: #C06B00;
  --success: #1A7A45;

  /* TYPOGRAPHY — Inter for clean density */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* LAYOUT — Tighter radii for pro look */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  /* SHADOWS — Subtle, almost flat */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-gold: 0 2px 8px rgba(139, 105, 20, 0.15);
}

[data-theme="dark"] {
  --bg-primary: #0F0E0D;
  --bg-surface: #1A1918;
  --bg-surface-elevated: #232220;
  --bg-surface-glass: rgba(26, 25, 24, 0.90);
  
  --gold-primary: #D4AF37;
  --gold-brass: #C5A059;
  --gold-light: #EBD59B;
  --gold-badge-bg: rgba(212, 175, 55, 0.14);
  --gold-glow: rgba(212, 175, 55, 0.12);
  
  --copper-primary: #B87333;
  --terracotta: #C06B3E;
  --terracotta-light: #DE885B;
  --terracotta-badge-bg: rgba(192, 107, 62, 0.14);
  
  --emerald-zellige: #2E8B57;
  --emerald-light: #3CB371;
  --emerald-badge-bg: rgba(46, 139, 87, 0.14);
  --emerald-glow: rgba(46, 139, 87, 0.14);
  
  --border-subtle: #2A2826;
  --border-brass: rgba(197, 160, 89, 0.28);
  --border-highlight: rgba(212, 175, 55, 0.5);
  
  --text-primary: #F5F3EE;
  --text-secondary: #B8B2A8;
  --text-muted: #7A756D;
  
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1120px;
  margin: 0 auto;
  padding-bottom: 72px;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.icon-xs { width: 14px; height: 14px; vertical-align: middle; }
.icon-sm { width: 18px; height: 18px; vertical-align: middle; }
.icon-md { width: 24px; height: 24px; vertical-align: middle; }
.text-gold { color: var(--gold-primary); }
.text-gold-sm { color: var(--gold-primary); font-size: 0.78rem; font-weight: 600; }
.text-terracotta { color: var(--terracotta); }
.text-emerald { color: var(--emerald-zellige); }
.text-muted { color: var(--text-muted); }
.text-muted-sm { color: var(--text-muted); font-size: 0.75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* ==========================================================================
   HEADER — Compact dark top bar
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px;
}

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

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-logo-emblem {
  width: 32px;
  height: 32px;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.emblem-svg {
  width: 100%;
  height: 100%;
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.arabic-sub {
  font-size: 0.85rem;
  color: var(--gold-primary);
  font-family: inherit;
  opacity: 0.8;
}

.brand-subtitle {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 500;
}

.header-primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.header-actions .user-profile-badge,
.header-actions #openAddUserBtn,
.header-actions #logoutBtn,
.header-actions #themeToggleBtn {
  display: none !important;
}

.mobile-menu-label {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mobile-menu-trigger {
  display: none;
}

.role-badge-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.role-badge-toggle:hover {
  border-color: var(--gold-primary);
}

.role-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--emerald-zellige);
  box-shadow: 0 0 4px var(--emerald-zellige);
}

.btn-icon-theme, .btn-icon-gold {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-gold {
  background: var(--gold-badge-bg);
  border-color: var(--border-brass);
  color: var(--gold-primary);
}

.btn-icon-gold:hover {
  background: var(--gold-primary);
  color: #FFFFFF;
}

.btn-icon-theme:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.btn-header-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 32px;
}

.btn-header-nav:hover,
.btn-header-nav.active {
  background: var(--gold-badge-bg);
  color: var(--gold-primary);
  border-color: var(--gold-brass);
}

.btn-header-emphasis {
  background: var(--gold-badge-bg);
  border-color: var(--border-brass);
  color: var(--gold-primary);
}

.mobile-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mobile-menu-grid button {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 700;
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.mobile-menu-grid .mobile-menu-primary {
  display: none;
}

.sortie-picker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sortie-picker-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
}

.sortie-picker-row img {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.sortie-picker-row span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.sortie-picker-actions {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   MAIN VIEW TABS
   ========================================================================== */
.app-main {
  flex: 1;
  padding: 14px 14px 92px;
}

.tab-view {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.tab-view.active {
  display: block;
}

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

/* ==========================================================================
   VIEW 1: DASHBOARD
   ========================================================================== */
.showroom-banner {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 20px 18px;
  background: linear-gradient(135deg, rgba(27, 26, 24, 0.94), rgba(45, 41, 36, 0.90)), url('/assets/showroom.jpg') center/cover;
  border: 1px solid var(--border-brass);
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(18, 17, 16, 0.94) 40%, rgba(18, 17, 16, 0.6));
  z-index: 1;
}

.banner-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.badge-showroom {
  display: inline-block;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #FFF;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.banner-content h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: #FFFFFF;
  margin-bottom: 4px;
  font-weight: 700;
}

.banner-content p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
}

.banner-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* KPI Cards Grid — Compact */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease;
}

.kpi-card:hover {
  border-color: var(--border-brass);
}

.kpi-card.highlight-terracotta {
  border-left: 3px solid var(--terracotta);
  background: linear-gradient(160deg, var(--bg-surface) 75%, var(--terracotta-badge-bg));
}

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

.kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.kpi-icon-wrapper {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-brass { background: var(--gold-badge-bg); color: var(--gold-primary); }
.icon-terracotta { background: var(--terracotta-badge-bg); color: var(--terracotta); }
.icon-gold { background: var(--gold-badge-bg); color: var(--gold-primary); }
.icon-emerald { background: var(--emerald-badge-bg); color: var(--emerald-zellige); }

.kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-value .unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.kpi-subtext {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Sections — Tighter */
.section-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.section-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Artisan Pending Cards */
.artisan-pending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.artisan-pending-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--terracotta);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.artisan-pending-info h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.artisan-pending-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.artisan-pending-due {
  text-align: right;
}

.artisan-pending-due strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--terracotta);
}

/* ==========================================================================
   TABLES & AUDIT LOGS — Compact data-dense
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
  background: var(--bg-surface);
}

.data-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-weight: 700;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: rgba(139, 105, 20, 0.03);
}

.badge-flow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-flow.entree { background: var(--emerald-badge-bg); color: var(--emerald-zellige); }
.badge-flow.vente { background: var(--gold-badge-bg); color: var(--gold-primary); }
.badge-flow.restitution { background: var(--terracotta-badge-bg); color: var(--terracotta); }
.badge-flow.inventaire { background: var(--bg-surface-elevated); color: var(--text-secondary); }

/* ==========================================================================
   VIEW 2: STOCK / INVENTORY
   ========================================================================== */
.view-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.view-header-row h2 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 768px) {
  .filter-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
}

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

.filter-pills {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pill.active, .pill:hover {
  background: var(--gold-badge-bg);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.filter-dropdowns {
  display: flex;
  gap: 6px;
}

.form-select-sm {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: inherit;
}

/* Products Cards Grid — Denser */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.stock-value-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.stock-value-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 2px;
}

.stock-value-card span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stock-value-card strong {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.stock-value-card.highlight {
  border-color: var(--border-brass);
  background: var(--gold-badge-bg);
}

.stock-value-card.highlight strong {
  color: var(--gold-dark);
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.product-card:hover {
  border-color: var(--border-brass);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.product-image-wrap {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: #ECEAE4;
}

.product-image-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.03);
}

.image-view-chip {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: rgba(26, 25, 24, 0.72);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.product-image-button:hover .image-view-chip,
.product-image-button:focus-visible .image-view-chip {
  opacity: 1;
  transform: translateY(0);
}

.product-image-button:focus-visible {
  outline: 3px solid var(--gold-primary);
  outline-offset: -3px;
}

@media (hover: none) {
  .image-view-chip {
    opacity: 1;
    transform: none;
  }
}

.product-tag-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #1A1816;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.tag-badge.sku {
  background: var(--gold-primary);
  color: #FFFFFF;
  border: none;
}

.tag-badge.status-sold {
  background: var(--danger);
  color: #FFFFFF;
}

.tag-badge.status-instock {
  background: var(--emerald-zellige);
  color: #FFFFFF;
}

.product-card-body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-category-title {
  font-size: 0.62rem;
  text-transform: uppercase;
  color: var(--gold-primary);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.product-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.product-artisan-line {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.product-formula-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 600;
  width: fit-content;
}

.product-stock-value-row {
  margin-top: 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0 8px;
  padding: 7px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
}

.product-stock-value-row span,
.product-stock-value-row small {
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.product-stock-value-row strong {
  color: var(--gold-dark);
  font-size: 0.82rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.product-stock-value-row small {
  grid-column: 1 / -1;
}

.product-prices-row {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.price-item-target {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-primary);
}

.price-item-cost {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.product-card-actions {
  padding: 7px 10px 9px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   VIEW 3: SCANNER QR
   ========================================================================== */
.scanner-page-container {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scanner-header-card {
  text-align: center;
  padding: 8px 10px;
}

.scanner-header-card h2 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.scanner-header-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.scanner-viewport-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--gold-brass);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.camera-stream {
  width: 100% !important;
  height: 100% !important;
}

.scanner-overlay-aim {
  position: absolute;
  inset: 15%;
  pointer-events: none;
  z-index: 10;
}

.aim-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #D4AF37;
  border-style: solid;
}

.aim-corner.top-left { top: 0; left: 0; border-width: 2.5px 0 0 2.5px; }
.aim-corner.top-right { top: 0; right: 0; border-width: 2.5px 2.5px 0 0; }
.aim-corner.bottom-left { bottom: 0; left: 0; border-width: 0 0 2.5px 2.5px; }
.aim-corner.bottom-right { bottom: 0; right: 0; border-width: 0 2.5px 2.5px 0; }

.aim-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #D4AF37, transparent);
  box-shadow: 0 0 8px #D4AF37;
  animation: scanLaser 2.2s ease-in-out infinite;
}

@keyframes scanLaser {
  0% { top: 0; opacity: 0.3; }
  50% { top: 100%; opacity: 1; }
  100% { top: 0; opacity: 0.3; }
}

.scanner-controls-row {
  display: flex;
  justify-content: center;
}

.manual-code-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
}

.manual-code-card label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-with-button {
  display: flex;
  gap: 6px;
}

/* ==========================================================================
   VIEW 4: NEW ARTICLE FORM — Compact
   ========================================================================== */
.form-container {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.form-header {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.form-header h2 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ==========================================================================
   STEPPER NAVIGATION
   ========================================================================== */
.stepper-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin-bottom: 16px;
}

.stepper-tab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.stepper-tab:hover {
  background: rgba(139, 105, 20, 0.06);
}

.stepper-tab.active {
  background: var(--bg-surface);
  border-color: var(--gold-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all 0.15s;
  flex-shrink: 0;
}

.stepper-tab.active .step-num {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #FFFFFF;
}

.step-meta {
  display: flex;
  flex-direction: column;
}

.step-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.step-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.stepper-arrow {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  user-select: none;
}

.stepper-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stepper-section.hidden {
  display: none !important;
}

.stepper-section-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(139, 105, 20, 0.05);
  border: 1px solid rgba(139, 105, 20, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 4px;
}

.banner-badge {
  background: var(--gold-primary);
  color: #FFFFFF;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.stepper-section-banner h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.text-muted-xs {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.stepper-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.tag-brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-primary);
}

.mawrut-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.input-currency {
  position: relative;
  display: flex;
  align-items: center;
}

.input-currency input {
  width: 100%;
  padding-right: 38px;
}

.currency-tag {
  position: absolute;
  right: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.helper-text {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.input-group-badge {
  position: relative;
}

.input-group-badge .form-input {
  width: 100%;
  padding-right: 72px;
}

.badge-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Segmented Control */
.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.segment-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s;
}

.segment-btn small {
  font-size: 0.62rem;
  opacity: 0.7;
}

.segment-btn.active {
  background: var(--gold-primary);
  color: #FFFFFF;
}

/* Formula Selection */
.formula-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.formula-box-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: block;
}

.formula-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 640px) {
  .formula-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.formula-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.formula-card:hover {
  border-color: var(--border-brass);
}

.formula-card.active {
  border-color: var(--gold-primary);
  background: var(--gold-badge-bg);
}

.formula-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gold-primary);
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}

.formula-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.formula-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.formula-pills {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.formula-pills span {
  font-size: 0.6rem;
  background: var(--bg-surface-elevated);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-muted);
}

/* Customizable Percentages */
.custom-pct-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.pct-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pct-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pct-total-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--emerald-badge-bg);
  color: var(--emerald-zellige);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.pct-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pct-input-group label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pct-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pct-input {
  width: 100%;
  padding-right: 22px !important;
  font-size: 0.78rem !important;
  font-weight: 700;
  text-align: right;
  background: var(--bg-surface);
}

.pct-symbol {
  position: absolute;
  right: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Simulator Bar */
.pricing-card-container {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.simulator-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.simulator-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.simulator-header strong {
  color: var(--emerald-zellige);
  font-weight: 800;
}

.sim-bar-wrapper {
  height: 8px;
  background: #DEDCD7;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  margin-bottom: 8px;
}

.sim-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.segment-artisan { background: var(--terracotta); }
.segment-owner { background: var(--gold-primary); }
.segment-manager { background: var(--emerald-zellige); }

.sim-breakdown-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.72rem;
}

.sim-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sim-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-artisan { background: var(--terracotta); }
.dot-owner { background: var(--gold-primary); }
.dot-manager { background: var(--emerald-zellige); }

/* Photo & Camera Component */
.photo-action-box {
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-brass);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  text-align: center;
  transition: all 0.15s ease;
}

.photo-action-box:hover {
  border-color: var(--gold-primary);
  background: rgba(139, 105, 20, 0.03);
}

.photo-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-camera-trigger,
.btn-gallery-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-camera-trigger {
  background: var(--gold-primary);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-camera-trigger:hover {
  background: var(--gold-brass);
  transform: translateY(-1px);
}

.btn-gallery-trigger {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-gallery-trigger:hover {
  background: var(--border-subtle);
  border-color: var(--border-brass);
}

.photo-upload-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 0;
}

/* Photo Preview Box */
.photo-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  box-shadow: var(--shadow-card);
}

.preview-thumbnail {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: #111;
}

.preview-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.preview-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-meta {
  font-size: 0.7rem;
  color: var(--emerald-zellige);
  font-weight: 600;
}

.btn-remove-preview {
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-remove-preview:hover {
  background: #F87171;
  color: #FFFFFF;
}

.edit-item-photo-preview {
  align-items: center;
}

.edit-item-preview-thumbnail {
  width: 88px;
  height: 88px;
  background: var(--bg-surface-elevated);
}

/* Webcam Modal Viewport */
.webcam-viewport-box {
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.webcam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   VIEW 5: ARTISANS
   ========================================================================== */
.artisans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.artisan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.artisan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.artisan-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.artisan-card-header p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.artisan-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  gap: 4px;
}

.artisan-stat-item span {
  font-size: 0.62rem;
  color: var(--text-muted);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.artisan-stat-item strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.artisan-stat-item strong.due-amount {
  color: var(--terracotta);
}

.artisan-formula-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold-badge-bg);
  border: 1px solid var(--border-brass);
  color: var(--gold-primary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.artisan-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.artisan-actions-row button {
  flex: 1;
}

/* ==========================================================================
   VIEW 6: FORMULES & RÉPARTITION FINANCIÈRE
   ========================================================================== */
.formulas-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 14px;
}

@media (min-width: 992px) {
  .formulas-page-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.formulas-mgmt-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.formula-mgmt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: all 0.15s ease;
}

.formula-mgmt-card:hover {
  border-color: var(--border-brass);
}

.formula-mgmt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.formula-mgmt-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.formula-mgmt-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.formula-rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  background: var(--bg-surface-elevated);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.rate-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rate-item label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.rate-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.rate-input-wrap input {
  width: 100%;
  padding: 5px 18px 5px 8px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: #FFFFFF;
}

.rate-input-wrap span {
  position: absolute;
  right: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
}

.card-glass-simulator {
  background: var(--bg-surface);
  border: 1px solid var(--border-brass);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 70px;
}

.simulator-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-badge-bg);
  border: 1px solid var(--border-brass);
  color: var(--gold-primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.simulator-intro {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.sandbox-results-panel {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.sandbox-margin-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sandbox-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sandbox-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sandbox-stat-card .stat-role {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sandbox-stat-card.card-artisan .stat-role { color: var(--terracotta); }
.sandbox-stat-card.card-owner .stat-role { color: var(--gold-primary); }
.sandbox-stat-card.card-manager .stat-role { color: var(--emerald-zellige); }

.sandbox-stat-card strong {
  font-size: 0.88rem;
  font-weight: 800;
}

.sandbox-stat-card small {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.empty-state-mini {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-mini svg {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  opacity: 0.4;
}

.empty-state-mini p {
  font-size: 0.82rem;
  margin: 0;
}

/* ==========================================================================
   BUTTONS — Compact, professional
   ========================================================================== */
.btn-gold {
  background: var(--gold-primary);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow: 0 1px 4px rgba(139, 105, 20, 0.15);
}

.btn-gold:hover {
  background: var(--gold-brass);
  box-shadow: var(--shadow-gold);
}

.btn-gold-sm {
  background: var(--gold-primary);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-family: inherit;
}

.btn-gold-lg {
  background: var(--gold-primary);
  color: #FFFFFF;
  border: none;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  width: 100%;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(139, 105, 20, 0.18);
}

.btn-gold-lg:hover {
  background: var(--gold-brass);
  box-shadow: var(--shadow-gold);
}

.btn-brass {
  background: var(--gold-brass);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}

.btn-glass {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-glass:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.btn-glass-sm {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-family: inherit;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  transition: all 0.15s;
}

.btn-outline:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.btn-text-gold {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-link {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* Auth button styles */
.btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  font-weight: 700;
  transition: all 0.15s;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
}

.btn.btn-gold {
  background: var(--gold-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(139, 105, 20, 0.18);
}

.btn.btn-gold:hover {
  background: var(--gold-brass);
}

.btn.btn-brass:hover {
  background: var(--gold-dark);
}

.btn-danger-sm {
  background: rgba(192, 57, 43, 0.08);
  color: #c0392b;
  border: 1px solid rgba(192, 57, 43, 0.25);
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-danger-sm:hover {
  background: #c0392b;
  color: #FFFFFF;
}

.btn-outline-sm {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-outline-sm:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-brass);
}

.formula-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

/* ==========================================================================
   BOTTOM NAVIGATION — Compact
   ========================================================================== */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px 8px 6px;
  z-index: 999;
  max-width: 1120px;
  margin: 0 auto;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  min-width: 52px;
}

.nav-icon {
  width: 20px;
  height: 20px;
}

.nav-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-item.active {
  color: var(--gold-primary);
}

/* Center Scanner FAB */
.nav-center-scanner {
  position: relative;
  top: -10px;
}

.scanner-btn-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C5A059, #8B6914);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(139, 105, 20, 0.3);
  border: 2.5px solid var(--bg-primary);
  transition: transform 0.15s;
}

.scanner-icon {
  width: 20px;
  height: 20px;
}

.nav-center-scanner:hover .scanner-btn-circle {
  transform: scale(1.06);
}

/* ==========================================================================
   MODALS — Clean, sharp
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: fadeIn 0.15s ease;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.modal-sm { max-width: 400px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 780px; }

.item-editor-card {
  max-height: min(92dvh, 980px);
}

.item-editor-card #editItemForm {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.item-editor-card .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.item-editor-card .modal-footer {
  flex: 0 0 auto;
}

.stock-image-card {
  max-width: min(920px, calc(100vw - 24px));
}

.stock-image-body {
  gap: 12px;
}

.stock-image-preview-wrap {
  width: 100%;
  max-height: 68dvh;
  min-height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stock-image-preview-wrap img {
  width: 100%;
  height: 100%;
  max-height: 68dvh;
  object-fit: contain;
  display: block;
}

.stock-image-details {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.stock-image-details strong {
  font-size: 1rem;
}

.action-sheet {
  max-width: 520px;
  align-self: flex-end;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  animation: slideUp 0.2s ease-out;
}

@media (min-width: 768px) {
  .action-sheet {
    align-self: center;
    border-radius: var(--radius-md);
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  background: var(--bg-surface);
}

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.action-sheet-pill {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}

.btn-close-modal {
  background: var(--bg-surface-elevated);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-close-modal:hover {
  background: var(--border-subtle);
}

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-surface);
}

.modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-surface-elevated);
}

/* ==========================================================================
   LIVE FINANCE + CATEGORY MANAGEMENT
   ========================================================================== */
.finance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.finance-panels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.finance-panel,
.category-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.finance-panel h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.finance-row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finance-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.86rem;
}

.finance-row:last-child {
  border-bottom: 0;
}

.categories-manager-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-manager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
}

.category-manager-row > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.category-manager-row span,
.category-manager-row small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.formula-card.locked {
  cursor: default;
  border-style: solid;
}

#pctConfigBox input[readonly] {
  background: var(--bg-surface-elevated);
  cursor: not-allowed;
}

button,
.btn-gold,
.btn-gold-sm,
.btn-gold-lg,
.btn-glass,
.btn-glass-sm,
.btn-brass,
.btn-outline,
.btn-outline-sm,
.btn-danger-sm,
.btn-link {
  min-height: 44px;
  touch-action: manipulation;
}

.product-card-actions .btn-glass-sm,
.product-card-actions .btn-gold-sm,
.product-card-actions .btn-danger-sm {
  min-height: 34px;
  justify-content: center;
  padding: 4px 6px;
  gap: 3px;
  font-size: 0.66rem;
  line-height: 1;
}

.product-card-actions .icon-xs {
  width: 12px;
  height: 12px;
}

@media (hover: none) {
  .product-card-actions .btn-glass-sm,
  .product-card-actions .btn-gold-sm,
  .product-card-actions .btn-danger-sm {
    min-height: 44px;
  }
}

.btn-danger-sm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .header-primary-nav {
    display: none;
  }

  .desktop-menu-label {
    display: none;
  }

  .mobile-menu-label {
    display: inline;
  }

  .mobile-menu-grid .mobile-menu-primary {
    display: block;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  }

  .header-content {
    gap: 8px;
  }

  .brand-group {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }

  .brand-logo-emblem {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-title {
    font-size: 0.88rem;
    letter-spacing: 0.08em;
  }

  .brand-subtitle {
    display: none;
  }

  .header-actions {
    flex: 0 0 auto;
    gap: 4px;
  }

  .header-actions .user-profile-badge,
  .header-actions #openAddUserBtn,
  .header-actions #logoutBtn,
  .header-actions #themeToggleBtn,
  .header-actions #headerFinanceBtn {
    display: none !important;
  }

  .btn-header-nav,
  .btn-icon-gold {
    height: 44px;
    min-height: 44px;
  }

  .btn-icon-gold {
    width: 44px;
  }

  .app-main {
    padding-bottom: 92px;
  }

  .view-header-row,
  .section-header,
  .banner-actions,
  .filter-bar,
  .filter-dropdowns,
  .modal-footer,
  .stepper-actions-bar,
  .scanner-controls-row,
  .input-with-button,
  .input-group-badge,
  .artisan-actions-row,
  .product-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-pills {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .filter-pills .pill {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .pointage-pricing-strip,
  .pointage-action-tabs,
  .sandbox-cards-grid,
  .finance-kpi-grid,
  .finance-panels-grid,
  .stock-value-strip {
    grid-template-columns: 1fr;
  }

  .stock-value-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 8px;
  }

  .modal-card {
    max-height: calc(100dvh - 16px);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
  }

  .modal-body {
    padding: 12px;
  }

  .category-manager-row,
  .finance-row,
  .sortie-picker-row {
    flex-direction: column;
    align-items: stretch;
  }

  .sortie-picker-row {
    display: flex;
  }

  .sortie-picker-row img {
    width: 100%;
    height: 130px;
  }

  .sortie-picker-actions {
    flex-direction: column;
  }

  .mobile-menu-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 720px;
  }

  .app-bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .nav-item {
    min-width: 48px;
    padding-left: 6px;
    padding-right: 6px;
  }
}

/* Item Summary in Pointage */
.item-summary-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pointage-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.badge-sku {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--gold-badge-bg);
  color: var(--gold-primary);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.badge-artisan {
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--gold-badge-bg);
  color: var(--gold-primary);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pointage-pricing-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--bg-surface-elevated);
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  gap: 6px;
}

.strip-label {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.pointage-pricing-strip strong {
  font-size: 0.92rem;
  font-weight: 800;
}

/* Action Tabs in Modal */
.pointage-action-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.action-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 4px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all 0.15s;
}

.action-tab-btn.active {
  background: var(--gold-primary);
  color: #FFFFFF;
}

.split-preview-card {
  background: var(--gold-badge-bg);
  border: 1px solid var(--border-brass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.split-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-brass);
  padding-bottom: 4px;
}

.split-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
}

.split-row {
  display: flex;
  justify-content: space-between;
}

.text-artisan { color: var(--terracotta); font-weight: 700; }
.text-owner { color: var(--gold-primary); font-weight: 700; }
.text-manager { color: var(--emerald-zellige); font-weight: 700; }

.sale-custom-pct-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.sale-custom-pct-header {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.sale-custom-pct-inputs {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.form-group-xs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.form-group-xs label {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.form-input-sm {
  padding: 5px 7px !important;
  font-size: 0.75rem !important;
}

.alert-warning {
  background: #FFF7ED;
  border: 1px solid var(--warning);
  color: var(--warning);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  margin-top: 4px;
}

.alert-info {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-brass);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

/* ==========================================================================
   ARTISAN STATEMENT MODAL
   ========================================================================== */
.artisan-balance-banner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--bg-surface-elevated);
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  gap: 8px;
}

.balance-item span {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.balance-item strong {
  font-size: 1rem;
  font-weight: 800;
}

.balance-item.highlight strong {
  color: var(--terracotta);
}

.statement-section {
  margin-top: 8px;
}

.statement-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.statement-section h4,
.statement-section-header h4 {
  font-size: 0.85rem;
  font-weight: 700;
}

.settlement-action-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.settlement-action-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.align-end {
  display: flex;
  align-items: flex-end;
}

.max-height-table {
  max-height: 400px;
  overflow-y: auto;
}

/* ==========================================================================
   PRINTABLE QR TAG
   ========================================================================== */
.printable-tag {
  width: 260px;
  margin: 0 auto;
  background: #FFFFFF;
  color: #1A1816;
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid #DEDCD7;
}

.tag-brand-header {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.tag-brand {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tag-arabic {
  font-size: 0.88rem;
}

.tag-sku {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 800;
  background: #1A1816;
  color: #FFFFFF;
  padding: 2px 10px;
  border-radius: 3px;
  letter-spacing: 0.06em;
}

.tag-qr-img-wrapper {
  margin: 4px 0;
  padding: 4px;
  background: #FFF;
}

.tag-qr-image {
  width: 120px;
  height: 120px;
}

.tag-product-title {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.tag-price-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: #8B6914;
}

.tag-footer-info {
  font-size: 0.58rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Settlement Receipt */
.printable-receipt {
  background: #FFFFFF;
  color: #1A1816;
  padding: 20px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.82rem;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #1A1816;
  padding-bottom: 10px;
}

.receipt-brand h2 {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.receipt-brand p {
  font-size: 0.72rem;
  color: #666;
}

.receipt-meta {
  text-align: right;
}

.receipt-meta h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
}

.receipt-partner-box {
  background: #F5F4F1;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 3px solid var(--gold-brass);
}

.partner-title {
  font-size: 0.68rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.partner-name {
  font-size: 0.95rem;
  font-weight: 800;
}

.partner-city {
  font-size: 0.72rem;
  color: #666;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.receipt-table th {
  background: #EEEDEA;
  color: #1A1816;
  font-weight: 700;
  padding: 6px 8px;
  border-bottom: 1px solid #CCC;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.receipt-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #EEEDEA;
}

.receipt-total-amount {
  font-size: 1.05rem;
  color: #8B6914;
}

.receipt-mode-box {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 6px 0;
}

.receipt-notes {
  font-size: 0.72rem;
  color: #888;
}

.receipt-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px dashed #CCC;
}

.sig-box p {
  font-size: 0.72rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 36px;
}

.sig-line {
  border-bottom: 1px solid #222;
  width: 80%;
}

/* ==========================================================================
   PRINT MEDIA
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  
  .printable-tag, .printable-tag *,
  .printable-receipt, .printable-receipt * {
    visibility: visible;
  }

  .printable-tag {
    position: absolute;
    left: 0;
    top: 0;
    box-shadow: none;
  }

  .printable-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
  }

  .no-print {
    display: none !important;
  }
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 75px;
  right: 12px;
  left: 12px;
  max-width: 380px;
  margin: 0 auto;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease-out;
  border-left: 3px solid var(--border-brass);
}

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

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

/* ==========================================================================
   AUTHENTICATION LAYER (Minimal & Clean Aesthetic)
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: #F8F8F6;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.auth-overlay::before {
  display: none;
}

.auth-overlay.hidden {
  display: none !important;
}

.auth-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #E6E5E0;
  border-radius: 14px;
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  width: 100%;
  max-width: 400px;
  padding: 44px 36px 40px;
  animation: authCardIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.auth-card::before {
  display: none;
}

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

.auth-brand {
  text-align: center;
  padding: 0;
  margin-bottom: 28px;
}

.auth-emblem {
  display: none;
}

.auth-title {
  font-family: var(--font-sans);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #1A1816;
  margin: 0 0 6px 0;
  padding-left: 0.22em;
}

.auth-subtitle {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  color: #7A756D;
  letter-spacing: 0.01em;
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0;
  margin: 0;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form .form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2D2B28;
  letter-spacing: -0.01em;
  text-transform: none;
}

.auth-form .form-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.9rem;
  color: #1A1816;
  background: #FFFFFF;
  border: 1px solid #D8D6D0;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.auth-form .form-input:focus {
  outline: none;
  border-color: #C0751A;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(192, 117, 26, 0.14);
}

.auth-form .form-input::placeholder {
  color: #A8A49C;
  font-size: 0.85rem;
}

/* Full-width auth button */
.auth-form .btn.btn-gold.btn-block.btn-lg,
.auth-form button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  background: #C0751A;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  margin-top: 6px;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.auth-form .btn.btn-gold.btn-block.btn-lg:hover,
.auth-form button[type="submit"]:hover {
  background: #AD660E;
  box-shadow: 0 4px 12px rgba(192, 117, 26, 0.25);
  transform: translateY(-1px);
}

.auth-form .btn.btn-gold.btn-block.btn-lg:active,
.auth-form button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.auth-badge-notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F8F5EE;
  border: 1px solid #E5DFD1;
  color: #8B6914;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 8px;
  align-self: flex-start;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C0751A;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.auth-instructions {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #666157;
  margin-bottom: 12px;
}

.auth-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.auth-alert.error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.auth-alert.success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}

.auth-alert.hidden {
  display: none !important;
}

/* User Profile Badge */
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}

.role-pill {
  background: var(--gold-badge-bg);
  color: var(--gold-primary);
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.btn-icon-secondary {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon-secondary:hover {
  background: var(--border-subtle);
  color: var(--gold-primary);
  border-color: var(--gold-brass);
}

/* Add User Modal (different class names) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.modal-sheet .modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-sheet .modal-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-manager-sheet {
  max-width: 760px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.permission-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.permission-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.permission-checks.compact {
  margin-top: 8px;
}

.users-manager-section {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border-subtle);
}

.users-manager-list {
  display: grid;
  gap: 10px;
}

.user-manager-row {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--bg-surface-elevated);
}

.user-manager-row.is-disabled {
  opacity: 0.62;
}

.user-manager-topline,
.user-manager-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.user-manager-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.user-manager-grid label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.user-manager-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .user-manager-grid {
    grid-template-columns: 1fr;
  }

  .user-manager-topline,
  .user-manager-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.modal-close {
  background: var(--bg-surface-elevated);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  opacity: 0.4;
}

.empty-state h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Final responsive header guardrails */
.app-header .btn-header-nav,
.app-header .btn-icon-theme,
.app-header .btn-icon-gold,
.app-header .btn-icon-secondary {
  min-height: 36px;
  height: 36px;
}

.app-header .btn-icon-theme,
.app-header .btn-icon-gold,
.app-header .btn-icon-secondary {
  width: 36px;
}

@media (max-width: 640px) {
  .app-header {
    width: 100%;
    overflow: hidden;
  }

  .app-header .btn-header-nav,
  .app-header .btn-icon-gold {
    min-height: 44px;
    height: 44px;
  }

  .app-header .btn-icon-gold {
    width: 44px;
  }
}
