/* =============================================================
   GourmetRevient — Professional Recipe Cost Calculator
   Premium Design System
   ============================================================= */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&family=Pinyon+Script&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors - Pastry Luxury Palette */
  --primary: #1a1b1e;
  --primary-light: #2c2d30;
  --primary-dark: #000000;
  --accent: #c5a55a; /* Champagne / Gold */
  --accent-light: #d4ba7a;
  --accent-dark: #a6883e;
  --accent-glow: rgba(197, 165, 90, 0.2);

  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;

  /* Surfaces - Elevated Glassmorphism */
  --bg: #faf9f6; /* Soft Cream */
  --bg-alt: #f1f0ea;
  --surface: #ffffff;
  --surface-hover: #fcfcfc;
  --surface-border: rgba(26, 27, 30, 0.05);
  --surface-shadow: rgba(0, 0, 0, 0.04);

  /* Text - High Contrast / Editorial */
  --text: #1a1b1e;
  --text-secondary: #4a4b4f;
  --text-muted: #8e8f93;
  --text-inverse: #ffffff;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Spacing & Sizing */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Advanced Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 12px 48px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.12);
  --shadow-accent: 0 8px 30px rgba(197, 165, 90, 0.25);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --max-width: 1360px;
  --header-h: 70px;

  /* Composite Glass Surfaces */
  --bg-card: #ffffff;
  --surface-shadow-inset: rgba(255, 255, 255, 0.8);
  --surface-glass: rgba(255, 255, 255, 0.75);
  --surface-border-glass: rgba(255, 255, 255, 0.4);
}

.dark-theme {
  --primary: #ecf0f1;
  --primary-light: #bdc3c7;
  --primary-dark: #ffffff;
  --accent: #f39c12;
  --accent-light: #fbc531;
  --accent-dark: #d35400;
  --accent-glow: rgba(243, 156, 18, 0.2);

  --bg: #000000;
  --bg-alt: #080808;
  --surface: #121212;
  --surface-hover: #1e1e1e;
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-shadow: rgba(0, 0, 0, 0.6);

  --text: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #8b949e;
  --text-inverse: #000000;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.8);

  --bg-card: #0a0a0a;
  --surface-shadow-inset: rgba(0, 0, 0, 0.2);
  --surface-glass: rgba(0, 0, 0, 0.5);
  --surface-border-glass: rgba(255, 255, 255, 0.05);

  /* Dash system dark mode */
  --dash-bg: #000000;
  --dash-primary: #818cf8;
  --dash-success: #22c55e;
  --dash-warning: #f59e0b;
  --dash-danger: #ef4444;
  --dash-border: #334155;
  --dash-text: #f8fafc;
  --dash-text-muted: #94a3b8;
}

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

/* Global overflow protection */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* Subtle Mesh Gradient Background Layer */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 10%, rgba(197, 165, 90, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.02) 0%, transparent 50%);
  animation: meshFlow 20s ease-in-out infinite alternate;
}

@keyframes meshFlow {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.1) translate(20px, -20px); }
  100% { transform: scale(1) translate(-20px, 20px); }
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font-family: var(--font);
}

a {
  text-decoration: none;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--primary);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

/* ---------- Header ---------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 1000;
  gap: 0.8rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-accent);
}

.header-brand h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 0;
  height: 36px;
  line-height: 36px;
  display: flex;
  align-items: center;
}

.header-brand h1 span {
  color: var(--accent);
}

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

/* ---------- Main Content ---------- */
.app-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--header-h) + 1.5rem) 1.5rem 3rem;
}

/* Auth blocking */
body.auth-pending .app-header,
body.auth-pending .app-main {
  display: none !important;
}

/* ---------- Auth Overlay ---------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(238, 240, 245, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4rem 1.5rem;
  overflow-y: auto;
  transition: var(--transition-slow);
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  border: 1px solid var(--surface-border);
  text-align: center;
  animation: fadeUp 0.6s ease-out;
}

.auth-tabs {
  display: flex;
  background: var(--bg-alt);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  margin-bottom: 2rem;
}

.auth-tab {
  flex: 1;
  padding: 0.7rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border: none;
  background: none;
  cursor: pointer;
}

.auth-tab:hover:not(.active) {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.5);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.device-notice {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  text-align: left;
  animation: fadeIn 0.8s ease-out;
}

.notice-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.device-notice p {
  margin-bottom: 0 !important;
  font-size: 0.82rem !important;
  line-height: 1.4 !important;
  color: var(--text-secondary);
}

.auth-card .form-input {
  -webkit-appearance: none;
  appearance: none;
  border-radius: var(--radius-sm);
}

.info-box {
  display: flex;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent);
  color: var(--accent-dark);
  font-size: 0.85rem;
  line-height: 1.4;
}

.info-icon {
  font-size: 1.2rem;
}

.auth-logo {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: float 4s ease-in-out infinite;
}

.auth-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.auth-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.auth-card .form-group {
  text-align: left;
  margin-bottom: 1.25rem;
}

.auth-card .form-input {
  padding: 0.8rem 1rem;
  font-size: 1rem;
  background: var(--bg-alt);
}

.auth-card .form-input:focus {
  background: var(--surface);
}

.auth-card .btn-primary {
  padding: 0.9rem;
  font-size: 1.05rem;
  border-radius: var(--radius);
}

.auth-error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--danger-light);
  border-radius: var(--radius-sm);
  animation: shake 0.4s ease-in-out;
}

.badge-notif {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 10px;
  border: 2px solid var(--surface);
  line-height: 1;
}

.notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  margin-top: 10px;
  z-index: 1000;
  overflow: hidden;
  animation: fadeUp 0.3s ease-out;
}

.notif-header {
  padding: 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--surface-border);
  background: var(--bg-alt);
}

.notif-list {
  max-height: 350px;
  overflow-y: auto;
}

.notif-item {
  padding: 1rem;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.85rem;
  transition: background 0.2s;
}

.notif-item:hover {
  background: var(--surface-hover);
}

.notif-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Pending Leaves in Dashboard */
.pending-leaves-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.leave-request-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--warning);
}

.lr-info {
  flex: 1;
}

.lr-name {
  font-weight: 700;
  font-size: 0.9rem;
  display: block;
}

.lr-dates {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.lr-actions {
  display: flex;
  gap: 0.5rem;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.ac-suggestion {
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ac-suggestion:hover {
  background: var(--bg-alt);
  color: var(--primary);
}

.ac-suggestion:last-child {
  border-bottom: none;
}

.form-input-inline {
  border: 1px solid transparent;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  transition: all 0.2s;
  color: var(--text);
  font-weight: 600;
}

.form-input-inline:hover {
  background: var(--surface-border);
}

.form-input-inline:focus {
  background: var(--surface);
  border-color: var(--primary);
  outline: none;
}

/* Team Hover Actions */
.team-member {
  position: relative;
  transition: all 0.2s;
}

.team-member .remove-member {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--danger);
  background: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  border: 1px solid var(--surface-border);
}

.team-member:hover {
  background: var(--bg-alt);
}

.team-member:hover .remove-member {
  opacity: 1;
  visibility: visible;
}

.remove-member:hover {
  background: var(--danger) !important;
  color: white !important;
  transform: translateY(-50%) scale(1.1);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

/* ---------- Skeleton Screens (Shimmer) ---------- */
.skeleton {
  background: var(--bg-alt);
  background: linear-gradient(90deg,
      var(--bg-alt) 25%,
      var(--surface-hover) 50%,
      var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
  min-height: 1em;
  border: none !important;
  pointer-events: none;
}

.skeleton-card {
  height: 180px;
  width: 100%;
  border-radius: var(--radius);
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text {
  height: 20px;
  width: 70%;
  margin-bottom: 12px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ---------- Glassmorphism Enhancements ---------- */
.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--surface-border-glass);
  box-shadow: var(--shadow-lg);
}

.modal-content,
.card-premium {
  background: var(--surface-glass) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--surface-border-glass) !important;
}

.app-header {
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--surface-border-glass);
}

.navbar-bottom {
  background: var(--surface-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--surface-border-glass);
}

/* ---------- Hero / Onboarding ---------- */
.hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  animation: fadeUp 0.6s ease-out;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  background: var(--accent-glow);
  color: var(--accent-dark);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
}

.hero h2 {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
}

.hero h2 .accent {
  color: var(--accent);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--text-inverse);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(230, 126, 34, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 2px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--surface-border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1.5px solid transparent;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #219a52;
  transform: translateY(-1px);
}

/* ---------- Step Indicator ---------- */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 1.5rem 0 2rem;
  margin-bottom: 0.5rem;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
}

.step-dot .dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
  z-index: 2;
}

.step-dot.active .dot {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(230, 126, 34, 0.3);
  transform: scale(1.1);
}

.step-dot.completed .dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-dot .step-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  max-width: 80px;
  text-align: center;
  line-height: 1.3;
  transition: color var(--transition);
}

.step-dot.active .step-label {
  color: var(--accent);
}

.step-dot.completed .step-label {
  color: var(--success);
}

.step-line {
  width: 60px;
  height: 3px;
  background: var(--surface-border);
  border-radius: 2px;
  margin: 0 0.3rem;
  margin-bottom: 1.8rem;
  transition: background var(--transition);
}

.step-line.active {
  background: var(--success);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

/* ---------- Form Elements ---------- */
.form-group {
  margin-bottom: 1rem;
}

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

.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface);
}

.form-input::placeholder {
  color: var(--text-muted);
}

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

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235d6d7e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* ---------- Ingredient Table ---------- */
.ingredients-section {
  margin-top: 1rem;
}

.ing-header {
  display: grid;
  grid-template-columns: 2fr 1fr 0.8fr 1fr 0.8fr 40px;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--surface-border);
}

.ing-row {
  display: grid;
  grid-template-columns: 2fr 1fr 0.8fr 1fr 0.8fr 40px;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  align-items: center;
  border-bottom: 1px solid rgba(44, 62, 80, 0.04);
  transition: background var(--transition);
  animation: fadeIn 0.3s ease-out;
}

.ing-row:hover {
  background: var(--surface-hover);
}

.ing-row-icon {
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.ing-row:hover .ing-row-icon {
  transform: scale(1.1);
  background: var(--surface);
}

.ing-row .ing-name {
  display: flex !important;
  align-items: center;
  gap: 10px;
  position: relative;
}

.ing-row .form-input {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  background: transparent;
  border-color: transparent;
}

.ing-row .form-input:focus {
  background: var(--bg);
  border-color: var(--accent);
}

.ing-row .ing-cost {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85rem;
  text-align: right;
}

.ing-row .btn-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all var(--transition);
}

.ing-row .btn-remove:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.ing-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.7rem;
  border-top: 2px solid var(--surface-border);
  margin-top: 0.5rem;
}

.ing-total .total-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

.ing-total .total-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

/* Autocomplete */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  max-height: 180px;
  overflow-y: auto;
  display: none;
}

.autocomplete-list.show {
  display: block;
}

.autocomplete-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  transition: background 0.15s;
}

.autocomplete-item:hover {
  background: var(--accent-glow);
}

.autocomplete-item .ac-price {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Procedure Steps ---------- */
.procedure-step {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(44, 62, 80, 0.04);
  animation: fadeIn 0.3s ease-out;
}

.procedure-step .step-num {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.procedure-step .form-input {
  flex: 1;
}

.procedure-step .btn-remove {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 0.35rem;
  transition: all var(--transition);
}

.procedure-step .btn-remove:hover {
  background: var(--danger-light);
  color: var(--danger);
}

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

.kpi-card {
  padding: 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

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

.kpi-card .kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.kpi-card .kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.kpi-card.accent .kpi-value {
  color: var(--accent);
}

.kpi-card.success .kpi-value {
  color: var(--success);
}

.kpi-card.warning .kpi-value {
  color: var(--warning);
}

.kpi-card .kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ---------- Donut Chart ---------- */
.chart-container {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1rem 0;
}

.donut-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}

.donut-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-wrap circle {
  fill: none;
  stroke-width: 35;
  transition: stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center .dc-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.donut-center .dc-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-item .legend-pct {
  margin-left: auto;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

/* ---------- Batch Scaling ---------- */
.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.batch-card {
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  text-align: center;
}

.batch-card .batch-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.batch-card .batch-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.batch-card .batch-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ---------- Margin Slider ---------- */
.margin-slider-wrap {
  padding: 1rem 0;
}

.margin-slider-wrap label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.margin-slider-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--danger), var(--warning), var(--success));
  outline: none;
  margin: 0.8rem 0 0.4rem;
}

.margin-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow);
  cursor: grab;
}

.margin-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow);
  cursor: grab;
}

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

.margin-display .margin-val {
  font-weight: 700;
  color: var(--accent);
}

/* ---------- Summary ---------- */
.summary-section {
  margin-bottom: 1.5rem;
}

.summary-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--surface-border);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.summary-table th {
  text-align: left;
  padding: 0.55rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--surface-border);
}

.summary-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid rgba(44, 62, 80, 0.04);
  color: var(--text-secondary);
}

.summary-table tfoot td {
  font-weight: 700;
  color: var(--accent);
  border-top: 2px solid var(--surface-border);
  border-bottom: none;
}

.summary-procedures ol {
  padding-left: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.summary-procedures li {
  padding: 0.3rem 0;
}

.summary-financials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.fin-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
}

.fin-row .fin-label {
  color: var(--text-secondary);
}

.fin-row .fin-value {
  font-weight: 700;
  color: var(--primary);
}

.fin-row.highlight {
  background: var(--accent-glow);
}

.fin-row.highlight .fin-value {
  color: var(--accent);
}

/* ---------- Saved Recipes ---------- */
.saved-recipes-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--surface-border);
}

.saved-recipes-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.saved-card {
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
}

.saved-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.saved-card .sc-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.saved-card .sc-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.saved-card .sc-cost {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.saved-card .sc-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

/* ---------- Step Navigation ---------- */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--surface-border);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.8rem 1.3rem;
  background: var(--primary);
  color: var(--text-inverse);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: toastIn 0.3s ease-out;
}

.toast.toast-success {
  background: var(--success);
}

.toast.toast-error {
  background: var(--danger);
}

/* ---------- Step Content Wrapper ---------- */
.step-content {
  display: none;
  animation: fadeUp 0.4s ease-out;
}

.step-content.active {
  display: block;
}

/* ---------- Footer ---------- */
.app-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--surface-border);
  margin-top: 2rem;
}

.app-footer strong {
  color: var(--text-secondary);
}

/* ---------- Export Buttons ---------- */
.export-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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

/* Navigation Visibility Defaults (Safety) */
.mobile-nav-bar, .mobile-more-menu {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-nav-bar {
    display: flex !important;
  }
}

/* ---------- Responsive Tablet ---------- */
@media (max-width: 1024px) {
  .hero h2 {
    font-size: 2rem;
  }

  .ing-header,
  .ing-row {
    grid-template-columns: 1.8fr 0.9fr 0.7fr 0.9fr 0.7fr 36px;
    font-size: 0.78rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-financials {
    grid-template-columns: 1fr;
  }
}

/* ---------- Responsive Mobile ---------- */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  html {
    font-size: 14px;
  }

  .app-main {
    padding: calc(var(--header-h) + 1rem) 1rem 80px;
    /* Space for bottom bar */
  }

  .header-nav {
    display: none !important;
  }

  .mobile-nav-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    height: 100%;
  }

  .mobile-nav-item .icon {
    font-size: 1.4rem;
  }

  .mobile-nav-item.active {
    color: var(--accent);
  }

  .mobile-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 8px;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
  }

  .mobile-nav-item:active {
    transform: scale(0.92);
  }

  .mobile-more-menu {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 2100;
    display: none;
    align-items: flex-end;
  }

  .mobile-more-menu.show {
    display: flex !important;
  }

  .more-menu-content {
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 2rem 1.5rem 3rem;
    background: var(--surface);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  }

  .mobile-more-menu.show .more-menu-content {
    transform: translateY(0);
  }

  .more-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
  }

  .more-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
  }

  .menu-item .icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: 16px;
    transition: all 0.3s;
  }

  .app-header {
    padding: 0 0.8rem;
    gap: 0.5rem;
  }

  .header-brand h1 span {
    display: none;
    /* Hide 'Revient' to save space */
  }

  .header-brand h1 {
    font-size: 1.1rem;
  }

  #headerLangSwitcher {
    margin-left: 0 !important;
    gap: 0.3rem;
  }

  #headerLangSwitcher .lang-flag-img {
    width: 32px;
    height: 22px;
  }

  #headerLangSwitcher .lang-switcher-btn {
    padding: 2px;
  }

  .hero {
    padding: 2rem 0.5rem 1.5rem;
  }

  .hero h2 {
    font-size: 1.7rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero-ctas .btn {
    width: 100%;
    max-width: 300px;
  }

  .step-indicator {
    gap: 0;
    overflow-x: auto;
    padding: 1rem 0;
  }

  .step-line {
    width: 30px;
  }

  .step-dot .step-label {
    font-size: 0.6rem;
    max-width: 55px;
  }

  .step-dot .dot {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
  }

  .card {
    padding: 1.2rem;
    border-radius: var(--radius);
  }

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

  /* Ingredient rows → stacked cards on mobile */
  .ing-header {
    display: none;
  }

  .ing-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.9rem 0.7rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid var(--surface-border);
  }

  .ing-row .form-input {
    background: var(--surface);
    border-color: var(--surface-border);
  }

  .ing-row .ing-name {
    flex: 1 1 100%;
  }

  .ing-row .ing-qty {
    flex: 1 1 30%;
  }

  .ing-row .ing-unit {
    flex: 1 1 25%;
  }

  .ing-row .ing-price {
    flex: 1 1 30%;
  }

  .ing-row .ing-cost {
    flex: 1 1 100%;
    text-align: left;
    padding-top: 0.3rem;
    font-size: 0.9rem;
  }

  .ing-row .btn-remove {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
  }

  .ing-row {
    position: relative;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .kpi-card .kpi-value {
    font-size: 1.3rem;
  }

  .chart-container {
    flex-direction: column;
  }

  .donut-wrap {
    width: 170px;
    height: 170px;
  }

  .batch-grid {
    grid-template-columns: 1fr;
  }

  .saved-grid {
    grid-template-columns: 1fr;
  }

  .step-nav {
    flex-direction: column;
    gap: 0.8rem;
  }

  .step-nav .btn {
    width: 100%;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    text-align: center;
  }

  /* Responsive bio & nav */
  .bio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .bio-header {
    flex-direction: column;
    text-align: center;
  }

  .header-nav {
    gap: 10px !important;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    justify-content: flex-start !important;
  }

  .bio-card {
    padding: 1.5rem !important;
  }

  .nav-link {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    flex-shrink: 0;
  }
}

@media (max-width: 400px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .step-indicator {
    justify-content: flex-start;
  }
}

/* ---------- À Propos Styles ---------- */
.apropos-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--text);
  margin: 3.5rem 0 0.8rem;
  position: relative;
  padding-left: 1.2rem;
}

.apropos-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Portfolio Styles ---------- */
.bio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.bio-card {
  padding: 2.3rem;
  background: var(--bg-card);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--surface-border);
  position: relative;
  overflow: hidden;
}

.bio-card::after {
  content: "🍰";
  position: absolute;
  bottom: -20px;
  right: -10px;
  font-size: 8rem;
  opacity: 0.03;
  transform: rotate(-15deg);
}

.timeline-simple {
  border-left: 2px solid var(--surface-border);
  padding-left: 1.5rem;
  position: relative;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.82rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  z-index: 1;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.2rem;
}

.timeline-content strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.timeline-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.portfolio-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  background: #f8fafc;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-img.dezoom {
  object-fit: contain !important;
  background: #ffffff;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.08));
}

.portfolio-item:hover .portfolio-img {
  transform: scale(1.08);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem 1.5rem;
  color: white;
  opacity: 1;
  transition: background 0.3s;
}

.portfolio-item:hover .portfolio-overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%);
}

.portfolio-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.portfolio-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
  text-transform: none;
}

/* ---------- Dashboard / Hub Enhancement ---------- */
.dashboard-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.dash-welcome {
  margin-bottom: 2.5rem;
  padding: 3rem;
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.dash-welcome::after {
  content: "🥐";
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 10rem;
  opacity: 0.05;
  transform: rotate(15deg);
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-avatar-large {
  width: 70px;
  height: 70px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: var(--shadow);
}

.dash-greeting {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  margin: 0;
}

.dash-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 0.2rem;
}

.dash-badge-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dash-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.dash-badge.pulse {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  animation: softPulse 2s infinite;
}

.dash-badge.info {
  background: var(--bg-alt);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
}

@keyframes softPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

.dash-main-grid {
  display: grid;
  grid-template-columns: minmax(250px, 320px) 1fr;
  gap: 2rem;
}

.dash-widget {
  padding: 1.8rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
}

.widget-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.quick-btns {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-btn {
  padding: 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: all 0.2s;
}

.dash-btn.primary {
  background: var(--primary);
  color: white;
}

.dash-btn.primary:hover {
  background: var(--primary-dark);
  transform: translateX(4px);
}

.dash-btn.outline {
  border: 1px solid var(--surface-border);
  color: var(--primary);
}

.dash-btn.outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.gender-btn.active,
.gender-btn-profile.active {
  background: var(--accent) !important;
  color: white !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 10px var(--accent-glow);
}

.gender-btn:hover,
.gender-btn-profile:hover {
  background: var(--accent-glow);
  transform: translateY(-2px);
}

.financial-summary {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.fin-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fin-stat .label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.fin-stat .value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

.fin-stat .value.highlight {
  color: var(--accent);
  font-size: 1.2rem;
}

.fin-stat .value.success {
  color: var(--success);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.widget-header .widget-title {
  margin-bottom: 0;
}

.text-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-recipe-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  transition: transform 0.2s;
  cursor: pointer;
}

.recent-recipe-item:hover {
  transform: translateX(6px);
  background: var(--surface-hover);
  border: 1px solid var(--accent-glow);
}

.rr-info h4 {
  margin: 0;
  font-size: 0.95rem;
}

.rr-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rr-cost {
  font-weight: 700;
  color: var(--accent);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.check-item.done {
  background: var(--success-light);
  border-color: rgba(39, 174, 96, 0.25);
}

.check-box {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.done .check-box {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.check-text {
  font-size: 0.9rem;
  font-weight: 500;
}

.done .check-text {
  text-decoration: line-through;
  opacity: 0.6;
}

.dash-tip-bar {
  margin-top: 1rem;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background: linear-gradient(to right, rgba(230, 126, 34, 0.05), transparent);
  border-left: 5px solid var(--accent);
}

.tip-icon {
  font-size: 2rem;
}

.tip-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .dash-main-grid {
    grid-template-columns: 1fr;
  }
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.hub-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  color: inherit;
}

.hub-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.hub-card-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  width: 60px;
  height: 60px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background 0.3s;
}

.hub-card:hover .hub-card-icon {
  background: rgba(255, 107, 0, 0.1);
}

.hub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.hub-stat-item {
  display: flex;
  flex-direction: column;
}

.hub-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-heading);
}

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

@media (max-width: 768px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Print ---------- */
/* ---------- Profile Dropdown ---------- */
.profile-dropdown {
  position: relative;
  display: inline-block;
}

.btn-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  transition: all 0.2s;
  cursor: pointer;
}

.btn-profile:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.btn-profile .avatar {
  font-size: 1.2rem;
}

.btn-profile .user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  z-index: 2000;
  padding: 0.5rem;
  overflow: hidden;
  animation: fadeUp 0.2s ease-out;
}

.dropdown-content.show {
  display: block;
}

.dropdown-content button {
  width: 100%;
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-xs);
  transition: background 0.2s, color 0.2s;
  color: var(--text);
  border: none;
  background: none;
}

.dropdown-content button:hover {
  background: var(--bg);
  color: var(--accent);
}

.dropdown-content .logout-link {
  border-top: 1px solid var(--surface-border);
  margin-top: 0.3rem;
  padding-top: 0.8rem;
  color: var(--danger);
  border-radius: 0;
}

.dropdown-content .logout-link:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* ---------- Modals (General) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 62, 80, 0.4);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeUp 0.4s ease-out;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--primary);
}

.modal-header button {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.modal-header button:hover {
  color: var(--danger);
}

.modal-body {
  padding: 2rem;
}

@media print {

  .app-header,
  .step-indicator,
  .step-nav,
  .hero,
  .saved-recipes-section,
  .export-actions,
  .btn {
    display: none !important;
  }

  .step-content {
    display: block !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}

/* ============================================================================
   Navigation Header Hub & Lab Configurator
============================================================================ */
.header-nav {
  display: flex;
  flex: 1;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0 1rem;
}

/* Allow dropdowns to pop out on desktop */
@media (min-width: 769px) {
  .header-nav {
    overflow: visible !important;
  }
}

/* Horizontal scroll only on mobile */
@media (max-width: 768px) {
  .header-nav {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .header-nav::-webkit-scrollbar {
    display: none;
  }
}

/* Center on very wide screens if not overflowing */
@media (min-width: 1600px) {
  .header-nav {
    justify-content: center;
    gap: 1rem;
  }
}

@media (max-width: 1440px) {
  .header-nav {
    justify-content: flex-start;
  }
}

.nav-link {
  background: transparent;
  border: none;
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-md);
  transition: all 0.3s;
  flex-shrink: 0;
}

.nav-link:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.lab-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--surface-border);
}

.lab-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

/* ============================================================================
   Carousel / Recipe Library
============================================================================ */
.carousel-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-right: 1rem;
}

.carousel-btns {
  display: flex;
  gap: 0.8rem;
}

.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
}

.carousel-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.1);
}

.carousel-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0.5rem 0.5rem 1.5rem 0.5rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.carousel-track::-webkit-scrollbar {
  height: 6px;
}

.carousel-track::-webkit-scrollbar-thumb {
  background: var(--surface-border);
  border-radius: 10px;
}

.carousel-track:hover::-webkit-scrollbar-thumb {
  background: var(--accent-glow);
}

.carousel-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  padding: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.carousel-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.carousel-card-img-wrapper {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 1.2rem;
  background: transparent;
  /* Removed the gray background */
  /* Light backdrop for contained images */
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-card-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.12));
  /* Adds depth to the photo */
}

.carousel-card:hover .carousel-card-img {
  transform: scale(1.08);
}

.carousel-card-img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  font-size: 3rem;
}

.carousel-card:hover .carousel-card-img-placeholder {
  background: var(--accent-glow);
}

.carousel-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--bg-alt);
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.carousel-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.carousel-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.carousel-pdf-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: white;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center !important;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.carousel-pdf-btn:hover {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ---------- Planning & Annual Calendar Styles ---------- */
.planning-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 2.5rem;
}

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

.planning-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Leave Form */
.leave-widget {
  padding-bottom: 1.2rem;
}

.leave-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.leave-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.leave-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.btn-accent {
  background: var(--accent);
  color: white;
  border: none;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-accent:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.leave-list-container {
  margin-top: 1.2rem;
  max-height: 260px;
  overflow-y: auto;
  border-top: 1px solid var(--surface-border);
  padding-top: 1rem;
}

.leave-list-container::-webkit-scrollbar {
  width: 4px;
}

.leave-list-container::-webkit-scrollbar-thumb {
  background: var(--accent-light);
  border-radius: 4px;
}

.leave-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: rgba(139, 92, 246, 0.06);
  border-left: 3px solid #8b5cf6;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.leave-card:hover {
  background: rgba(139, 92, 246, 0.12);
}

.leave-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.leave-card-dates {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.leave-card-days {
  font-weight: 700;
  color: #7c3aed;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}

.member-main-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  flex: 1;
}

.team-member:hover .member-main-content {
  transform: translateX(-65px);
  /* Se décale vers la gauche */
}

.member-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  display: inline-block;
}

.member-info h4 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.member-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.member-actions-group {
  position: absolute;
  right: -80px;
  /* Hidden initially */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.5rem;
  transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding-right: 1rem;
}

.team-member:hover .member-actions-group {
  right: 0px;
  /* Slides in from the right */
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
}

.action-btn.edit-btn:hover {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

.action-btn.remove-btn:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
  transform: scale(1.1);
}

.action-btn.remove-btn {
  color: var(--danger-light);
  color: var(--danger);
}

.annual-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.month-view {
  background: white;
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-border);
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 1rem;
}

.month-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 850;
  color: var(--primary);
  text-align: left;
  margin: 0;
  text-transform: capitalize;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(31, 1fr);
  gap: 2px;
}

.day-header {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 5px;
  text-transform: uppercase;
}

.day-cell {
  height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: 4px;
  color: var(--text-secondary);
  position: relative;
  cursor: default;
  background: var(--bg-alt);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.day-cell .wd-mini {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 2px;
}

.day-cell .d-num {
  font-weight: 800;
  font-size: 1.1rem;
}

.day-cell:hover:not(.empty) {
  background: white;
  border-color: var(--accent);
  transform: translateY(-2px);
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

.day-cell.empty {
  visibility: hidden;
}

.day-cell:not(.empty):hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.95);
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

.day-cell-mini {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

/* Day Types */
.event-day {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

/* Highlight for chocolate/cakes days */
.holiday-day {
  background: #ffedd5;
  border: 1px dashed var(--accent);
}

/* Toulouse holidays */
.sunday-day {
  background: #f1f5f9;
  color: var(--text-muted);
}

/* Weekends */
.today-day {
  border: 2px solid var(--accent);
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
}

/* Staff Leave Day */
.leave-active-day {
  background: #ede9fe !important;
  border: 1px solid #8b5cf6 !important;
}

.leave-dots {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.5rem;
  color: #7c3aed;
  line-height: 1;
  letter-spacing: -1px;
}

/* ---------- PDF Fiche Technique Specific Styles ---------- */
.pdf-export-mode {
  padding: 40px !important;
  background: white !important;
  color: #1a202c !important;
  width: 800px !important;
  position: relative !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.pdf-export-mode .card-title {
  color: #1a202c !important;
  font-size: 24px !important;
  border-bottom: 3px solid var(--primary) !important;
  padding-bottom: 10px !important;
  margin-bottom: 5px !important;
}

.pdf-export-mode .card-subtitle {
  font-size: 14px !important;
  color: #4a5568 !important;
  margin-bottom: 20px !important;
}

.pdf-export-mode .summary-sections-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 25px !important;
  align-items: start !important;
}

.pdf-export-mode .summary-section h3 {
  background: #f8fafc !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  color: #2d3748 !important;
  font-size: 14px !important;
}

.pdf-export-mode .summary-table {
  font-size: 11px !important;
}

.pdf-export-mode .summary-table th {
  background: #f1f5f9 !important;
  color: #475569 !important;
  padding: 6px 8px !important;
}

.pdf-export-mode .summary-table td {
  padding: 5px 8px !important;
  border-bottom: 1px solid #edf2f7 !important;
}

.pdf-export-mode .summary-procedures ol {
  font-size: 11px !important;
  padding-left: 20px !important;
}

.pdf-export-mode .summary-financials {
  grid-template-columns: 1fr !important;
  gap: 4px !important;
  background: #f8fafc !important;
  padding: 10px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
}

.pdf-export-mode .fin-row {
  padding: 4px 0 !important;
  font-size: 12px !important;
  display: flex !important;
  justify-content: space-between !important;
}

.pdf-export-mode .fin-row.highlight {
  background: white !important;
  padding: 6px 8px !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  border: 1px solid #e2e8f0 !important;
}

.pdf-footer-credits {
  margin-top: 30px;
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
}

/* ---------- Roadmap Widget ---------- */
.roadmap-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.roadmap-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.roadmap-item.active {
  border-color: var(--accent);
  background: white;
  box-shadow: var(--shadow-sm);
}

.roadmap-item.done {
  opacity: 0.7;
}

.roadmap-item.done .roadmap-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.status-tag {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: #dfe6e9;
  color: #636e72;
  min-width: 70px;
  text-align: center;
}

.status-tag.done {
  background: #dcfce7;
  color: #166534;
}

.status-tag.active {
  background: #fff3e0;
  color: #e67e22;
}

.roadmap-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- Team Thanks Section ---------- */
.team-thanks-section {
  margin-top: 4rem;
  padding: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.8s ease-out;
}

.team-thanks-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.thanks-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  justify-content: center;
}

.thanks-image-wrap {
  flex-shrink: 0;
  width: 550px;
  height: 750px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 30px 60px -12px rgba(44, 62, 80, 0.25), 0 18px 36px -18px rgba(44, 62, 80, 0.3);
  transform: rotate(-1.5deg);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 10px solid var(--surface);
  background: var(--surface);
}

.thanks-image-wrap:hover {
  transform: rotate(0deg) scale(1.03);
}

.thanks-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
  filter: contrast(1.18) brightness(1.04) saturate(1.15) contrast(1.1);
  /* Simulation Ultra HD */
  transition: filter var(--transition-slow);
}

.thanks-image-wrap:hover .thanks-img {
  filter: contrast(1.08) brightness(1.06) saturate(1.2);
}

.thanks-text {
  flex: 1;
  min-width: 350px;
  max-width: 600px;
  text-align: left;
  padding: 1rem;
}

.thanks-text h3 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

.thanks-text p {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.thanks-sig {
  margin-top: 3rem;
  font-family: 'Pinyon Script', cursive;
  font-size: 3.5rem;
  /* Larger for better readability with this script */
  font-weight: 400;
  /* Often better for these flowy fonts */
  color: #3d2b1f;
  /* Dark Chocolate */
  text-align: right;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.05);
  transform: rotate(-1deg);
  display: block;
}

@media (max-width: 768px) {
  .team-thanks-section {
    padding: 1.5rem;
    margin-top: 2rem;
  }

  .thanks-content {
    gap: 1.5rem;
  }

  .thanks-image-wrap {
    width: 100%;
    height: 300px;
    transform: none;
  }

  .thanks-text {
    text-align: center;
  }
}

/* ---------- Language Switcher ---------- */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
}

.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.lang-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

.lang-switcher-btn.active {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(230, 126, 34, 0.2);
  transform: translateY(-1px);
}

.lang-switcher-btn.active .lang-flag-img {
  box-shadow: 0 0 0 2px var(--accent-light);
}

.lang-switcher-btn .lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-switcher-btn .lang-code {
  display: none;
}

.lang-flag-img {
  width: 32px;
  height: 22px;
  display: block;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Auth card language switcher */
.auth-card>.lang-switcher {
  justify-content: center;
  margin-bottom: 1.2rem;
  background: transparent;
  border: none;
  gap: 0.3rem;
}

.auth-card>.lang-switcher .lang-switcher-btn {
  padding: 0.4rem 0.7rem;
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
}

.auth-card>.lang-switcher .lang-switcher-btn.active {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.15);
}

/* Header language switcher */
#headerLangSwitcher {
  margin-left: 0.8rem;
  margin-right: 0;
  order: revert;
  /* Let natural flow place it after Brand */
  flex-shrink: 0;
  background: transparent;
  border: none;
  gap: 0.5rem;
}

#headerLangSwitcher .lang-switcher-btn {
  padding: 2px;
  border-radius: 6px;
  border: 2px solid transparent;
}

#headerLangSwitcher .lang-switcher-btn.active {
  border-color: var(--accent);
  background: transparent;
}

#headerLangSwitcher .lang-flag-img {
  width: 52px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

@media (max-width: 768px) {
  .lang-switcher-btn .lang-code {
    display: none;
  }

  .lang-switcher-btn {
    padding: 0.3rem 0.45rem;
  }

  #headerLangSwitcher {
    margin-left: 0;
  }
}

/* ---------- SEO Public Marketing Section ---------- */
.public-marketing-container {
  width: 100%;
  max-width: 900px;
  margin-top: 5rem;
  padding-bottom: 5rem;
  animation: fadeUp 0.8s ease-out 0.2s both;
}

.marketing-intro {
  text-align: center;
}

.marketing-intro h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.marketing-intro p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 3rem auto;
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.marketing-item {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: left;
}

.marketing-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.marketing-item .m-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.marketing-item h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: var(--primary);
}

.marketing-item p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 768px) {
  .marketing-intro h2 {
    font-size: 1.8rem;
  }

  .marketing-intro p {
    font-size: 1rem;
  }

  .public-marketing-container {
    margin-top: 3rem;
  }
}

/* ============================================================================
   MODERN DASHBOARD REDESIGN (Premium UI)
   ============================================================================ */

.dash-hero-banner {
  margin-bottom: 2.5rem;
  perspective: 1000px;
}

.hero-glass-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}

.hero-glass-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.hero-main-info {
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.user-avatar-premium {
  width: 90px;
  height: 90px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: var(--shadow-md);
  border: 4px solid white;
}

.hero-text h2 {
  font-size: 2.4rem;
  margin-bottom: 0.2rem;
  letter-spacing: -0.03em;
}

.hero-text .dash-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.dash-date-tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.hero-stats-row {
  display: flex;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
}

.hero-stat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.5);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.3s;
}

.hero-stat-item:hover {
  transform: translateY(-5px);
  background: white;
}

.stat-icon {
  font-size: 1.8rem;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

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

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

/* Modern Grid */
.dashboard-grid-modern {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.dash-grid-col {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Glass Widgets */
.glass-widget {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-widget:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}

.widget-title-modern {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Action Tiles */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.action-tile {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  background: var(--bg-alt);
  text-align: left;
  transition: all 0.3s;
  width: 100%;
}

.action-tile:hover {
  transform: scale(1.02);
  background: white;
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.tile-icon {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.action-tile.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.action-tile.primary .tile-icon {
  background: var(--accent);
}

.action-tile.primary .tile-desc {
  color: rgba(255, 255, 255, 0.7);
}

.tile-text {
  display: flex;
  flex-direction: column;
}

.tile-title {
  font-weight: 800;
  font-size: 1rem;
}

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

/* Featured Recipe */
.featured-recipe-widget {
  background: linear-gradient(135deg, #fff 0%, #fff7ed 100%);
  border-left: 6px solid var(--accent);
}

.badge-featured {
  padding: 0.3rem 0.6rem;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 4px;
}

.featured-content {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.featured-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.featured-info h4 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.featured-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Recent Activity Modern */
.recent-list-modern {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.recent-item-premium {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
}

.recent-item-premium:hover {
  background: white;
  box-shadow: var(--shadow-sm);
  transform: translateX(5px);
}

.text-link-premium {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

/* Today Team */
.today-team-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.today-member {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem;
}

.member-avatar-mini {
  width: 32px;
  height: 32px;
  background: var(--bg-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border: 2px solid white;
}

/* Roadmap Steps Vertical */
.roadmap-steps-vertical {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-left: 1rem;
  border-left: 2px dashed var(--surface-border);
  margin-left: 0.5rem;
}

.road-step {
  position: relative;
}

.road-dot {
  position: absolute;
  left: -21px;
  top: 5px;
  width: 12px;
  height: 12px;
  background: var(--surface-border);
  border-radius: 50%;
  border: 2px solid white;
}

.road-step.done .road-dot {
  background: var(--success);
}

.road-step.active .road-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.road-info {
  display: flex;
  flex-direction: column;
}

.road-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.road-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Interactive Tips */
.dash-footer-tips {
  margin-top: 3rem;
}

.tip-card-interactive {
  background: var(--primary);
  color: white;
  padding: 2rem;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.tip-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.15;
}

.tip-icon-large {
  font-size: 3rem;
  filter: drop-shadow(0 0 15px var(--accent));
}

.tip-content {
  flex: 1;
}

.tip-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.tip-text {
  font-size: 1.1rem;
  line-height: 1.5;
}

.tip-refresh {
  background: rgba(255, 255, 255, 0.1);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.tip-refresh:hover {
  background: var(--accent);
  transform: rotate(180deg);
}

@media (max-width: 900px) {
  .hero-glass-card {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .dashboard-grid-modern {
    grid-template-columns: 1fr;
  }

  .hero-main-info {
    flex-direction: column;
  }

  .hero-stats-row {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
}

.stat-illustration {
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.stat-illustration svg {
  width: 22px;
  height: 22px;
}

.stat-illustration.staff-icon {
  background: var(--primary-glow);
  color: var(--primary);
}

.stat-illustration.pulse-icon {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.pulse-icon svg {
  animation: pulseSvg 2s infinite ease-in-out;
}

@keyframes pulseSvg {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

.stat-value.active {
  color: var(--success) !important;
}

.featured-meta {
  display: flex;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.today-member {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.today-member:hover {
  transform: translateX(8px);
}

.presence-indicator {
  box-shadow: 0 0 8px var(--success);
  animation: breathe 2s infinite alternate ease-in-out;
}

@keyframes breathe {
  from {
    opacity: 0.6;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

.road-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid white;
}

.road-step.done .road-dot {
  background: var(--success);
}

.road-step.active .road-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.road-info {
  display: flex;
  flex-direction: column;
}

.road-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.road-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Interactive Tips */
.dash-footer-tips {
  margin-top: 3rem;
}

.tip-card-interactive {
  background: var(--primary);
  color: white;
  padding: 2rem;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.tip-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.15;
}

.tip-icon-large {
  font-size: 3rem;
  filter: drop-shadow(0 0 15px var(--accent));
}

.tip-content {
  flex: 1;
}

.tip-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.tip-text {
  font-size: 1.1rem;
  line-height: 1.5;
}

.tip-refresh {
  background: rgba(255, 255, 255, 0.1);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.tip-refresh:hover {
  background: var(--accent);
  transform: rotate(180deg);
}

@media (max-width: 900px) {
  .hero-glass-card {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .dashboard-grid-modern {
    grid-template-columns: 1fr;
  }

  .hero-main-info {
    flex-direction: column;
  }

  .hero-stats-row {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
}

.stat-illustration {
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.stat-illustration svg {
  width: 22px;
  height: 22px;
}

.stat-illustration.staff-icon {
  background: var(--primary-glow);
  color: var(--primary);
}

.stat-illustration.pulse-icon {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.pulse-icon svg {
  animation: pulseSvg 2s infinite ease-in-out;
}

@keyframes pulseSvg {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

.stat-value.active {
  color: var(--success) !important;
}

.featured-meta {
  display: flex;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.today-member {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.today-member:hover {
  transform: translateX(8px);
}

.presence-indicator {
  box-shadow: 0 0 8px var(--success);
  animation: breathe 2s infinite alternate ease-in-out;
}

@keyframes breathe {
  from {
    opacity: 0.6;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* ==========================================================================
   INVENTORY PREMIUM UI
   ========================================================================== */

.inv-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.inv-stat-box {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.inv-stat-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.inv-stat-box.warning::before {
  background: var(--warning);
}

.inv-stat-box.dangerous::before {
  background: var(--danger);
}

.inv-stat-box.success::before {
  background: var(--success);
}

.inv-stat-box:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.inv-stat-icon-bg {
  width: 56px;
  height: 56px;
  background: var(--bg-body);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: transform 0.3s;
}

.inv-stat-box:hover .inv-stat-icon-bg {
  transform: rotate(-10deg) scale(1.1);
}

.inv-stat-val {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-main);
}

.inv-stat-lab {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Inventory Table & Items */
.premium-table-container {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  overflow: hidden;
  overflow-x: auto;
}

.premium-table th {
  background: var(--bg-body) !important;
  color: var(--text-main) !important;
  font-weight: 800 !important;
  border-bottom: 2px solid var(--surface-border) !important;
}

.row-alert {
  background: rgba(239, 68, 68, 0.05) !important;
}

.row-alert:hover {
  background: rgba(239, 68, 68, 0.08) !important;
}

/* Stock Health Bar */
.stock-health-container {
  width: 100%;
  height: 6px;
  background: var(--bg-body);
  border-radius: 10px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
}

.stock-health-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease;
}

.health-ok {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.health-low {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.health-critical {
  background: linear-gradient(90deg, #ef4444, #f87171);
  animation: pulseBar 1.5s infinite;
}

@keyframes pulseBar {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }

  100% {
    opacity: 1;
  }
}

.stock-control {
  background: var(--bg-body);
  padding: 4px;
  border-radius: 8px;
  display: inline-flex;
  border: 1px solid var(--surface-border);
}

.btn-stock {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: white;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  transition: all 0.2s;
}

.btn-stock:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.btn-stock.minus:hover {
  background: var(--danger);
}

.btn-stock.plus:hover {
  background: var(--success);
}

/* Modal Premium */
.modal-overlay {
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.4);
}

.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Dashboard Integration */
.header-main-info {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
}

.search-bar-premium input {
  background: white;
  border: 1px solid var(--surface-border);
  padding: 0.8rem 1.2rem;
  font-size: 0.95rem;
  border-radius: 12px;
  width: 350px;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.search-bar-premium input:focus {
  width: 450px;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.header-actions {
  display: flex;
  gap: 0.8rem;
}

.badge {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.65rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 800;
}

.status-ok {
  background: #d1fae5;
  color: #065f46;
}

.status-critical {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

/* Inventory & Modal UI Clean */
.inventory-full-table {
  width: 100%;
  padding: 0 1rem;
}

.wide-table {
  width: 100% !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: white;
  margin-top: 1rem;
}

.modal-overlay {
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
}

.glass-card {
  background: #ffffff !important;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
  overflow: hidden;
}

.premium-modal-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--surface-border);
  padding: 1.2rem 1.5rem;
  position: relative;
}

.close-btn-premium {
  position: absolute;
  right: 1.2rem;
  top: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.close-btn-premium:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  transform: rotate(90deg);
}

.modal-body.restock-form-premium {
  padding: 1.5rem;
}

.restock-form-premium label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.restock-form-premium .form-input,
.form-select-premium {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 1rem center;
  background-size: 1.2rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 2.5rem 0.8rem 1.2rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  min-width: 200px;
}

.form-select-premium:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  transform: translateY(-1px);
}

.form-select-premium:hover {
  background-color: var(--bg-alt);
  border-color: var(--text-muted);
}

.restock-form-premium .form-select {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: var(--bg-body);
  font-size: 1rem;
  height: auto;
}

.restock-form-premium .btn-full {
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  margin-top: 1.5rem;
}

#appInventaire .container-premium,
#appLabeling .container-premium {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
}

/* ---------- Labeling Section ---------- */
.labeling-form-card {
  padding: 2.5rem;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--surface-border);
}

.autocomplete-dropdown {
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: white;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 250px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--bg-body);
  transition: background 0.2s;
}

.autocomplete-item:hover {
  background: var(--bg-alt);
}

.autocomplete-item strong {
  font-size: 0.95rem;
  color: var(--primary);
}

.autocomplete-item small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.autocomplete-item.disabled {
  color: var(--text-muted);
  font-style: italic;
  pointer-events: none;
}

/* Specific Label Printing */
@media print {

  body.printing-label .app-header,
  body.printing-label #mainNav,
  body.printing-label section.premium-hero,
  body.printing-label .labeling-form-card,
  body.printing-label .widget-title,
  body.printing-label .labeling-preview-col button,
  body.printing-label .app-footer,
  body.printing-label #userProfileArea {
    display: none !important;
  }

  body.printing-label .labeling-container {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.printing-label aside.labeling-preview-col {
    position: static !important;
    width: 100% !important;
  }

  body.printing-label #labelCaptureArea {
    border: none !important;
    box-shadow: none !important;
    width: 100mm;
    height: 100mm;
    margin: 0 auto;
    padding: 10mm;
  }
}

/* ============================================================================ */
/* HACCP / HYGIÈNE MODULE                                                       */
/* ============================================================================ */

/* Container */
#appHygiene {
  padding-bottom: 3rem !important;
}

#appHygiene .container-premium {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
}

/* Tabs */
.haccp-tabs {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.haccp-tabs .tab-btn {
  padding: 0.9rem 2rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid var(--surface-border);
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.haccp-tabs .tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.haccp-tabs .tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* View cards */
.haccp-view .glass-widget {
  padding: 2rem 2.5rem !important;
}

/* Tables full-width and readable */
.haccp-view .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.haccp-view .premium-table {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  background: white;
  font-size: 0.95rem;
}

.haccp-view .premium-table th {
  background: linear-gradient(135deg, var(--bg-body), var(--bg-alt)) !important;
  color: var(--text) !important;
  font-weight: 800 !important;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 1rem 1.2rem !important;
  border-bottom: 2px solid var(--surface-border) !important;
  white-space: nowrap;
}

.haccp-view .premium-table td {
  padding: 1rem 1.2rem !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  vertical-align: middle;
  color: var(--text);
}

.haccp-view .premium-table tbody tr {
  transition: background 0.2s ease;
}

.haccp-view .premium-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.03);
}

.haccp-view .premium-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status badges */
.haccp-view .badge.status-ok {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  font-size: 0.72rem;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: 1px solid rgba(6, 95, 70, 0.12);
}

.haccp-view .badge.status-critical {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  font-size: 0.72rem;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: 1px solid rgba(153, 27, 27, 0.15);
  animation: pulseWarn 2s infinite;
}

@keyframes pulseWarn {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.75;
  }
}

/* Cleaning Grid */
#cleaningChecklistArea {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 1.2rem !important;
}

#cleaningChecklistArea .glass-widget {
  padding: 1.6rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 1.2rem !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 2px solid transparent;
  min-height: 80px;
}

#cleaningChecklistArea .glass-widget:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
  border-color: var(--primary);
}

#cleaningChecklistArea .glass-widget.cleaned {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(52, 211, 153, 0.08)) !important;
}

#cleaningChecklistArea .glass-widget.cleaned h4 {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Widget title */
.haccp-view .widget-title-modern {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

/* Button round */
.btn-round {
  border-radius: 50% !important;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  #appHygiene .container-premium {
    padding: 0 1rem;
  }

  .haccp-tabs {
    gap: 0.5rem;
  }

  .haccp-tabs .tab-btn {
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
  }

  .haccp-view .glass-widget {
    padding: 1.5rem !important;
  }

  .haccp-view .premium-table th,
  .haccp-view .premium-table td {
    padding: 0.7rem 0.8rem !important;
    font-size: 0.85rem;
  }

  #cleaningChecklistArea {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================================ */
/* PRODUCTION MODE MODAL                                                       */
/* ============================================================================ */
.production-header {
  background: var(--bg-alt);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--surface-border);
}

.production-body {
  display: flex;
  height: calc(85vh - 80px);
}

.production-sidebar {
  width: 320px;
  background: #f8fafc;
  border-right: 1px solid var(--surface-border);
  padding: 1.5rem;
  overflow-y: auto;
}

.production-main {
  flex: 1;
  padding: 2.5rem;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.prod-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1rem;
}

.prod-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: white;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  cursor: pointer;
}

.prod-check-item input:checked+label {
  text-decoration: line-through;
  opacity: 0.6;
}

.prod-step-slide {
  animation: fadeIn 0.4s ease-out;
}

.prod-step-number {
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.prod-step-content {
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.4;
  color: #1e293b;
}

.production-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--surface-border);
}

#prodStepIndicator {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* SUPPLIER MANAGEMENT REDESIGN - BOLD & PREMIUM                                */
/* ============================================================================ */

.filter-pill {
  padding: 8px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 10px rgba(230, 126, 34, 0.25);
}

.rating-stars {
  color: #f1c40f;
  font-size: 0.85rem;
  margin-top: 4px;
}

.suppliers-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) 1fr;
  gap: 2.5rem;
  margin-top: 1rem;
}

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

@media (max-width: 900px) {
  .suppliers-main-grid {
    grid-template-columns: 1fr !important;
  }
}

.supplier-filters {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.supplier-search-wrap {
  position: relative;
  margin-bottom: 1.8rem;
}

.supplier-search-wrap i {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 1.1rem;
}

.supplier-search-input {
  width: 100%;
  padding: 1.1rem 1rem 1.1rem 3.2rem;
  border-radius: 16px;
  border: 2px solid var(--surface-border);
  background: white;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s;
  color: var(--primary);
}

.supplier-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.supplier-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 10px 25px rgba(230, 126, 34, 0.15);
  background: white;
}

.suppliers-grid {
  display: grid;
  grid-template-columns: repeat(min(3, 3), 1fr);
  gap: 2.5rem;
}

@media (max-width: 1280px) {
  .suppliers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .suppliers-grid {
    grid-template-columns: 1fr;
  }
}

.supplier-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  border-radius: 24px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.supplier-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.1);
}

.supplier-card-header {
  padding: 1.5rem 1.8rem;
  background: linear-gradient(135deg, #ffffff, #fcfdfe);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.supplier-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.supplier-info-main h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.supplier-info-main span {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.supplier-card-body {
  padding: 1.8rem;
  flex-grow: 1;
}

.supplier-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.supplier-contact-row i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: 6px;
  color: var(--primary);
  font-size: 0.9rem;
}

.supplier-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.2rem;
}

.tag-supplier {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--accent-glow);
  color: var(--accent-dark);
  border: 1px solid rgba(230, 126, 34, 0.2);
}

.supplier-card-footer {
  padding: 1rem 1.8rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--surface-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Suggested Orders Premium Table - BOLDER */
.order-premium-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.order-premium-table th {
  text-align: left;
  padding: 1.2rem 1rem;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.order-row {
  transition: all 0.2s;
}

.order-row:hover {
  background: rgba(230, 126, 34, 0.04);
}

.order-row td {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--surface-border);
  vertical-align: middle;
}

.order-item-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: capitalize;
}

.order-qty-pill {
  padding: 6px 16px;
  background: var(--primary);
  color: white;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.order-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 10px;
}

.order-status-dot.critical {
  background: var(--danger);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.order-status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.4);
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface-border);
  background: white;
  font-size: 1.2rem;
  transition: all 0.3s;
}

.btn-icon:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-4px) rotate(5deg);
}

.btn-full-bold {
  padding: 1.2rem !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
}

/* ==========================================================================
   SUPPLIERS PREMIUM STYLES
   ========================================================================== */
.suppliers-hero {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d) !important;
  /* Premium sunset gradient */
  background-size: 200% 200% !important;
  animation: gradientMove 15s ease infinite !important;
  color: white !important;
  border-radius: 0 0 60px 60px;
  padding: 6rem 2rem 10rem !important;
  margin-bottom: 0;
  position: relative;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.suppliers-hero h2 {
  color: white !important;
  font-size: 3.5rem !important;
  margin: 1.5rem 0 1rem !important;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.suppliers-hero .accent {
  color: #fff !important;
  text-decoration: underline wavy var(--accent);
  text-underline-offset: 8px;
}

.suppliers-hero .hero-badge {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
  backdrop-filter: blur(10px);
  padding: 0.6rem 1.4rem !important;
  font-size: 0.9rem !important;
  letter-spacing: 2px !important;
}

.supplier-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.supplier-search-wrap i {
  position: absolute;
  left: 1.2rem;
  font-style: normal;
  font-size: 1.2rem;
  opacity: 0.6;
}

.supplier-search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3.5rem !important;
  border-radius: 14px !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.3s;
}

.supplier-search-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.1) !important;
}

@media (max-width: 1100px) {
  .suppliers-main-grid {
    grid-template-columns: 1fr !important;
  }

  .supplier-filters aside {
    position: static !important;
  }
}

/* ==========================================================================
   SUPPLIERS REFINED STYLES
   ========================================================================== */
.suppliers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 2rem;
}

@media (max-width: 1400px) {
  .suppliers-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 900px) {
  .suppliers-grid {
    grid-template-columns: 1fr !important;
  }
}

.supplier-card {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.supplier-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

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

.supplier-avatar {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--accent-glow);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
}

.supplier-info-main h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
  color: var(--primary);
}

.supplier-info-main span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.supplier-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-supplier {
  background: #f0f2f5;
  color: #555;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
}

.supplier-contact-row {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.supplier-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

/* Supplier Alert Styles */
.supplier-card.alert-active {
  border: 2px solid var(--warning) !important;
  background: linear-gradient(180deg, rgba(243, 156, 18, 0.03) 0%, #ffffff 100%) !important;
  position: relative;
}


.supplier-crit-list {
  margin-top: 0.5rem;
  padding: 0.8rem;
  background: var(--warning-light);
  border-radius: 10px;
  border: 1px dashed var(--warning);
}

.supplier-crit-item {
  font-size: 0.8rem;
  color: #a05a00;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ======================================================== */
/* PREMIUM DASHBOARD CORE STYLES (RESTORED)                     */
/* ======================================================== */

.dashboard-container {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.premium-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.premium-greeting {
  display: flex;
  align-items: center;
  gap: 16px;
}

.premium-avatar {
  font-size: 2.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.premium-greeting h2 {
  font-size: 1.5rem;
  margin: 0 0 4px 0;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

#dashDateHeader {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
}

.premium-status-group {
  display: flex;
  gap: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--surface-border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

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

.health-status-dot.ok {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.health-status-dot.warn {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.health-status-dot.err {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* --- KPIs ROW --- */
.premium-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-mini-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.kpi-mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.kpi-mini-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-mini-trend {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.kpi-mini-trend.up {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.kpi-mini-trend.down {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.kpi-mini-trend.neutral {
  background: var(--bg-alt);
  color: var(--text-secondary);
}

.kpi-mini-card canvas {
  width: 100% !important;
  height: 40px !important;
  margin-top: auto;
  opacity: 0.8;
}

/* --- 3 COLUMNS BENTO GRID --- */
.premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.premium-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.premium-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.premium-card.pc-full {
  flex: 1;
}

.premium-card.pc-top {
  flex: 0.6;
  min-height: 125px;
}

.premium-card.pc-bot {
  flex: 0.55;
  min-height: 170px;
}

.premium-card-header {
  padding: 10px 15px;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-glow {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--bg-alt);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.premium-card-header h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.2px;
}

.premium-card-body {
  padding: 12px 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* PRODUCTION ITEMS */
.prod-item {
  padding: 12px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: var(--bg-alt);
  transition: all 0.2s ease;
}

.prod-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: var(--surface);
}

.prod-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.prod-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text);
}

.prod-status-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.prod-progress-bar {
  height: 6px;
  background: var(--surface-border);
  border-radius: 4px;
  overflow: hidden;
}

.prod-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* BUSINESS STATS */
.premium-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.premium-stat-val {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -1px;
}

.recipe-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px dotted var(--surface-border);
}

.recipe-row:last-child {
  border-bottom: none;
}

.recipe-label-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* AI SUGGEST BUTTONS */
.sugg-btn {
  background: var(--surface);
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.sugg-btn:hover {
  background: var(--primary);
  color: white;
}

/* LOGISTICS ALERTS */
.alert-item {
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.alert-item.warning {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.05), transparent);
  border-left: 3px solid #f59e0b;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .premium-kpi-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .premium-grid {
    grid-template-columns: 1fr;
  }

  .premium-kpi-bar {
    grid-template-columns: 1fr 1fr;
  }

  .premium-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
}


/* ---------- Tip Card Interactive ---------- */
.dash-footer-tips {
  margin-top: 2rem;
  animation: fadeUp 0.8s ease-out 0.4s both;
}

.tip-card-interactive {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--surface-border);
  padding: 2.3rem;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  gap: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.dark-theme .tip-card-interactive {
  background: var(--surface);
  border-color: var(--surface-border);
}

.tip-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}

.tip-icon-large {
  font-size: 3rem;
  color: var(--accent);
  filter: drop-shadow(0 0 15px var(--accent-glow));
}

.tip-content {
  flex: 1;
}

.tip-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
  letter-spacing: 1px;
}

.tip-text {
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 0;
  color: var(--text);
}

.tip-refresh {
  background: var(--bg-alt);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
}

.tip-refresh:hover {
  background: var(--accent-glow);
  color: var(--accent);
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .tip-card-interactive {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    gap: 1rem;
  }
}

/* =============================================================
   STATISTICS & PERFORMANCE V2
   ============================================================= */
.stats-container-v2 {
  background: var(--bg);
  min-height: calc(100vh - var(--header-h));
  padding: 0 0 4rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.dark-theme .stats-container-v2 {
  background: var(--bg-alt);
}

/* Dashboard system vars */
:root {
  --dash-bg: #f8fafc;
  --dash-primary: #6366f1;
  --dash-success: #22c55e;
  --dash-warning: #f59e0b;
  --dash-danger: #ef4444;
  --dash-border: rgba(0, 0, 0, 0.06);
  --dash-text: #1e293b;
  --dash-text-muted: #64748b;
  --dash-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --dash-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark-theme {
  --dash-bg: #0f172a;
  --dash-primary: #818cf8;
  --dash-border: rgba(255, 255, 255, 0.1);
  --dash-text: #f8fafc;
  --dash-text-muted: #94a3b8;
}

/* Filter Bar */
.stats-filter-bar {
  width: 98%;
  max-width: 1800px;
  margin: -2.5rem auto 3rem;
  padding: 0;
  position: relative;
  z-index: 10;
}

.stats-filter-card {
  background: var(--surface);
  padding: 1.5rem 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.stats-filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.stats-filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* KPI Cards V2 */
.kpi-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  max-width: 98%;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}

.kpi-card-v2 {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 1.25rem;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.kpi-card-v2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--dash-primary);
  opacity: 0.7;
}

.kpi-card-v2:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.kpi-icon-v2 {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.kpi-label-v2 {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value-v2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.05em;
}

/* Main Grid */
.stats-main-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  max-width: 98%;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

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

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

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

.dash-card {
  background: var(--surface);
  border-radius: 1.5rem;
  border: 1px solid var(--surface-border);
  padding: 2rem;
  box-shadow: var(--shadow);
  height: 100%;
  transition: all 0.3s ease;
}

.dash-card:hover {
  box-shadow: var(--shadow-md);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.dash-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Alert Cards */
.alert-recipe-card {
  background: var(--bg-alt);
  border-left: 5px solid var(--warning);
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s;
}

.alert-recipe-card:hover {
  transform: translateX(5px);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.alert-recipe-card.danger {
  border-left-color: var(--danger);
  background: rgba(239, 68, 68, 0.03);
}

.alert-title {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.05rem;
}

.alert-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.alert-suggestion {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6366F1;
  margin-top: 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: inline-block;
}

/* Progress Bar Table */
.progress-bar-container {
  width: 100px;
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Insight Box */
.insight-box {
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
  color: white;
  padding: 1.5rem 2rem;
  margin-top: 60px;
  margin-bottom: 40px;
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.insight-icon {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.1);
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.insight-text h4 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: white;
  letter-spacing: -0.3px;
}

.insight-text p {
  font-size: 0.95rem;
  opacity: 0.85;
  line-height: 1.6;
}

#statsCategoryFilters::-webkit-scrollbar {
  display: none;
}

/* Toggle Styles */
.stats-toggle-group {
  display: flex;
  background: var(--bg-alt);
  padding: 0.3rem;
  border-radius: 10px;
}

.stats-toggle-btn {
  padding: 0.6rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s;
  white-space: nowrap;
}

.stats-toggle-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Modern Table V2 */
.modern-table-v2 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.modern-table-v2 th {
  padding: 1.25rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  border-bottom: 2px solid var(--surface-border);
}

.modern-table-v2 td {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.95rem;
  color: var(--text);
  transition: all 0.2s;
}

.modern-table-v2 tr:hover td {
  background: var(--bg-alt);
}

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

/* RESPONSIVE */
@media (max-width: 992px) {

  .col-span-8,
  .col-span-4 {
    grid-column: span 12;
  }
}

@media (max-width: 768px) {

  .insight-box {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
}

/* =============================================================
   COMPREHENSIVE DARK MODE OVERRIDES
   ============================================================= */

/* --- Header --- */
.dark-theme .app-header {
  background: rgba(26, 26, 26, 0.92);
  border-bottom-color: var(--surface-border);
}

/* --- Auth --- */
.dark-theme .auth-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
}

/* --- General cards & surfaces --- */
.dark-theme .card,
.dark-theme .glass-card {
  background: var(--surface) !important;
  color: var(--text);
  border-color: var(--surface-border) !important;
}

/* --- Planning / Calendar --- */
.dark-theme .month-view {
  background: var(--surface);
  color: var(--text);
}

.dark-theme .day-cell:hover:not(.empty) {
  background: var(--surface-hover);
}

/* --- Roadmap / About --- */
.dark-theme .roadmap-item.active {
  background: var(--surface);
}

/* --- Dashboard Hero Stats --- */
.dark-theme .hero-stat-item:hover {
  background: var(--surface-hover);
}

/* --- Action Tiles --- */
.dark-theme .action-tile:hover {
  background: var(--surface-hover);
}

.dark-theme .tile-icon {
  background: var(--bg-alt);
}

/* --- Recent items --- */
.dark-theme .recent-item-premium:hover {
  background: var(--surface-hover);
}

/* --- Inventory --- */
.dark-theme .inv-stat-box {
  background: var(--surface);
  border-color: var(--surface-border);
}

.dark-theme .premium-table-container {
  background: var(--surface);
}

.dark-theme .btn-stock {
  background: var(--bg-alt);
  color: var(--text);
  border-color: var(--surface-border);
}

.dark-theme .search-bar-premium input {
  background: var(--bg-alt);
  color: var(--text);
  border-color: var(--surface-border);
}

.dark-theme .wide-table {
  background: var(--surface);
}

.dark-theme .wide-table th {
  background: var(--bg-alt);
  color: var(--text-secondary);
}

.dark-theme .wide-table td {
  color: var(--text);
  border-color: var(--surface-border);
}

.dark-theme .wide-table tr:hover td {
  background: var(--surface-hover);
}

/* --- Labeling --- */
.dark-theme .labeling-form-card {
  background: var(--surface);
  color: var(--text);
}

/* --- Production --- */
.dark-theme .production-main {
  background: var(--surface);
}

.dark-theme .prod-check-item {
  background: var(--bg-alt);
  color: var(--text);
}

/* --- Suppliers --- */
.dark-theme .supplier-search-input {
  background: var(--bg-alt) !important;
  color: var(--text) !important;
  border-color: var(--surface-border) !important;
}

.dark-theme .supplier-card {
  background: var(--surface);
  color: var(--text);
  border-color: var(--surface-border);
}

.dark-theme .supplier-card-body {
  color: var(--text-secondary);
}

.dark-theme .tag-supplier {
  background: var(--bg-alt);
  color: var(--text-secondary);
}

/* --- Forms and Inputs --- */
.dark-theme .form-input,
.dark-theme input[type="text"],
.dark-theme input[type="number"],
.dark-theme input[type="email"],
.dark-theme input[type="password"],
.dark-theme textarea,
.dark-theme select {
  background: var(--bg-alt);
  color: var(--text);
  border-color: var(--surface-border);
}

/* --- Modals --- */
.dark-theme .modal-content,
.dark-theme .modal-card {
  background: var(--surface);
  color: var(--text);
}

/* --- Carousel PDF --- */
.dark-theme .carousel-pdf-btn {
  background: var(--surface);
}

/* --- Dropdowns & Profiles --- */
.dark-theme .dropdown-content,
.dark-theme .profile-dropdown .dropdown-content {
  background: var(--surface);
  border-color: var(--surface-border);
}

.dark-theme .dropdown-content button {
  color: var(--text);
}

.dark-theme .dropdown-content button:hover {
  background: var(--surface-hover);
}

/* --- Notifications --- */
.dark-theme .notif-dropdown {
  background: var(--surface);
  border-color: var(--surface-border);
}

/* --- Stats V2 Alerts card inline bg fix --- */
.dark-theme .dash-card[style*="F1F5F9"],
.dark-theme .dash-card[style*="f1f5f9"] {
  background: var(--bg-alt) !important;
}

/* --- KPI cards --- */
.dark-theme .kpi-card-v2 {
  background: var(--surface);
}

.dark-theme .kpi-card-v2::before {
  background: var(--accent);
}

/* --- Stats alerts panel --- */
.dark-theme .alert-recipe-card {
  background: var(--bg-alt);
}

.dark-theme .alert-recipe-card.danger {
  background: rgba(239, 68, 68, 0.08);
}

/* --- Modern Table V2 --- */
.dark-theme .modern-table-v2 th {
  color: var(--text-muted);
  border-bottom-color: var(--surface-border);
}

.dark-theme .modern-table-v2 td {
  border-bottom-color: var(--surface-border);
  color: var(--text);
}

.dark-theme .modern-table-v2 tr:hover td {
  background: var(--surface-hover);
}

/* --- Stats filter bar --- */
.dark-theme .stats-filter-card {
  background: var(--surface);
  border-color: var(--surface-border);
}

.dark-theme .stats-toggle-btn {
  color: var(--text-muted);
}

.dark-theme .stats-toggle-btn.active {
  background: var(--bg-alt);
  color: var(--accent);
}

.dark-theme .stats-toggle-group {
  background: var(--surface);
}

/* --- Dash cards --- */
.dark-theme .dash-card {
  background: var(--surface);
  border-color: var(--surface-border);
}

/* --- Saved Recipes Modal --- */
.dark-theme .saved-recipe-card {
  background: var(--surface);
  border-color: var(--surface-border);
}

/* --- Body BG override --- */
.dark-theme .app-main {
  background: var(--bg);
}

/* --- HACCP / Hygiene --- */
.dark-theme .haccp-table th,
.dark-theme .haccp-table td {
  border-color: var(--surface-border);
  color: var(--text);
}

.dark-theme .haccp-card {
  background: var(--surface);
  border-color: var(--surface-border);
}

.dark-theme .clean-row {
  background: var(--surface);
  border-color: var(--surface-border);
}

/* --- Hero section --- */
.dark-theme .hero {
  background: var(--bg);
}

/* --- Carousel --- */
.dark-theme .carousel-card {
  background: var(--surface);
  border-color: var(--surface-border);
}

/* --- Fix Status tag --- */
.dark-theme .status-tag.active {
  background: rgba(243, 156, 18, 0.15);
  color: var(--accent);
}

/* --- Fix inline label preview (should stay white for print) --- */

/* --- Portfolio --- */
.dark-theme .portfolio-card {
  background: var(--surface);
  border-color: var(--surface-border);
}

/* --- Restock modal etc --- */
.dark-theme .modal-overlay>div,
.dark-theme [class*="modal"]>.card {
  background: var(--surface);
  color: var(--text);
}

/* --- Filter pills --- */
.dark-theme .filter-pill {
  background: var(--bg-alt);
  color: var(--text-muted);
  border-color: var(--surface-border);
}

.dark-theme .filter-pill.active {
  background: var(--accent);
  color: white;
}

/* --- Rating stars --- */
.dark-theme .rating-stars span {
  color: var(--text-muted);
}

/* --- Progress bars in tables --- */
.dark-theme .progress-bar-container {
  background: var(--surface-border);
}

/* --- Nav bar links --- */
.dark-theme .nav-link {
  color: var(--text-secondary);
}

.dark-theme .nav-link:hover,
.dark-theme .nav-link.active {
  color: var(--accent);
}

/* --- Premium header --- */
.dark-theme .premium-header {
  background: var(--surface);
  border-color: var(--surface-border);
}

/* --- Scrollbar in dark mode --- */
.dark-theme ::-webkit-scrollbar-track {
  background: var(--bg-alt);
}

.dark-theme ::-webkit-scrollbar-thumb {
  background: var(--surface-border);
}

/* --- OmniSearch Spotlight Modal --- */
.omni-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 4000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  display: flex;
}

.omni-card {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--surface-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.omni-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--surface-border);
  background: var(--surface);
}

.omni-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-right: 1rem;
}

.omni-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.2rem;
  color: var(--text);
  padding: 0.5rem 0;
}

.omni-input::placeholder {
  color: var(--text-muted);
}

.omni-shortcut-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  background: var(--bg-alt);
  border-radius: 4px;
  border: 1px solid var(--surface-border);
  font-family: monospace;
}

.omni-body {
  max-height: 50vh;
  overflow-y: auto;
}

.omni-results-list {
  display: flex;
  flex-direction: column;
}

.omni-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--surface-border);
  cursor: pointer;
  transition: background 0.2s;
}

.omni-item:last-child {
  border-bottom: none;
}

.omni-item:hover,
.omni-item.active {
  background: var(--bg-alt);
}

.omni-item-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  width: 30px;
  text-align: center;
}

.omni-item-content {
  flex: 1;
}

.omni-item-title {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.omni-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.omni-item-action {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.omni-item:hover .omni-item-action,
.omni-item.active .omni-item-action {
  opacity: 1;
}

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  color: var(--text);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 1rem;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  min-width: 300px;
  max-width: 400px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.removing {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  font-size: 1.5rem;
}

.toast-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

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

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

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

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

/* ---------- Empty States ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--surface-border);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ---------- Micro-Animations ---------- */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }

  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }

  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

.btn:active::after {
  animation: ripple 0.6s ease-out;
}

/* =============================================================
   GESTION PRO — PREMIUM MODULE STYLES
   ============================================================= */

/* --- Mgmt Hero Section (Standardized with site DA) --- */
.hero-mgmt-overlap {
  margin-top: -2rem;
  position: relative;
  z-index: 10;
}

/* --- Mgmt KPI Row --- */
.mgmt-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 2;
}

.mgmt-kpi-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mgmt-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.mgmt-kpi-card.kpi-accent::before { background: linear-gradient(90deg, var(--accent), #f59e0b); }
.mgmt-kpi-card.kpi-success::before { background: linear-gradient(90deg, #10b981, #34d399); }
.mgmt-kpi-card.kpi-danger::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.mgmt-kpi-card.kpi-info::before { background: linear-gradient(90deg, #6366f1, #818cf8); }

.mgmt-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.mgmt-kpi-icon {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  display: block;
}

.mgmt-kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.2;
}

.mgmt-kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 0.3rem;
}

/* --- Mgmt Tabs (Pill Style) --- */
.mgmt-tabs-premium {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.4rem;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  border: 1px solid var(--surface-border);
  flex-wrap: wrap;
}

.mgmt-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  background: transparent;
  white-space: nowrap;
}

.mgmt-tab-pill:hover {
  color: var(--text);
  background: rgba(255,255,255,0.5);
}

.mgmt-tab-pill.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.dark-theme .mgmt-tab-pill.active {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mgmt-tab-pill .tab-pill-emoji {
  font-size: 1.1rem;
}

.mgmt-tab-pill .tab-pill-badge {
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 100px;
  line-height: 1;
}

/* --- Mgmt Container --- */
.mgmt-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Mgmt Glass Cards --- */
.mgmt-glass-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.mgmt-glass-card:hover {
  box-shadow: var(--shadow-md);
}

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

.mgmt-card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mgmt-card-title .title-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.mgmt-card-title .title-icon.icon-orange {
  background: rgba(230,126,34,0.1);
}
.mgmt-card-title .title-icon.icon-green {
  background: rgba(16,185,129,0.1);
}
.mgmt-card-title .title-icon.icon-red {
  background: rgba(239,68,68,0.1);
}
.mgmt-card-title .title-icon.icon-purple {
  background: rgba(99,102,241,0.1);
}
.mgmt-card-title .title-icon.icon-blue {
  background: rgba(59,130,246,0.1);
}

.mgmt-card-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text);
  font-family: var(--font-heading);
}

.mgmt-card-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

/* --- Centered Card Header variant --- */
.mgmt-card-header.header-centered {
  flex-direction: column;
  text-align: center;
  justify-content: center;
}

.mgmt-card-header.header-centered .mgmt-card-title {
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.mgmt-card-header.header-centered .mgmt-card-title > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Shopping Grid --- */
.mgmt-shopping-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .mgmt-shopping-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Shopping Recipe Row --- */
.shopping-row-premium {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  transition: all 0.2s ease;
  animation: fadeUp 0.3s ease-out;
}

.shopping-row-premium:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.shopping-row-premium select {
  flex: 2;
}

.shopping-row-premium input {
  width: 80px;
  text-align: center;
  font-weight: 700;
}

.shopping-row-premium .remove-row-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.shopping-row-premium .remove-row-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* --- Shopping Result Table --- */
.mgmt-result-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.mgmt-result-table thead th {
  background: var(--bg-alt);
  padding: 0.8rem 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--surface-border);
  text-align: left;
}

.mgmt-result-table thead th:last-child,
.mgmt-result-table thead th:nth-child(n+2) {
  text-align: right;
}

.mgmt-result-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--surface-border);
  vertical-align: middle;
}

.mgmt-result-table tbody td:last-child,
.mgmt-result-table tbody td:nth-child(n+2) {
  text-align: right;
}

.mgmt-result-table tbody tr:hover {
  background: var(--surface-hover);
}

.mgmt-result-table .buy-needed {
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.8rem;
}

.mgmt-result-table .buy-needed.critical {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}

.mgmt-result-table .buy-needed.ok {
  background: rgba(16,185,129,0.1);
  color: #10b981;
}

.mgmt-result-table tfoot td {
  padding: 1rem;
  font-weight: 800;
  background: var(--bg-alt);
  border-top: 2px solid var(--surface-border);
}

/* --- Allergen Matrix Premium --- */
.allergen-matrix-premium {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.allergen-matrix-premium thead th {
  background: var(--bg-alt);
  padding: 0.8rem 0.5rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 2px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 5;
  min-width: 55px;
}

.allergen-matrix-premium thead th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 10;
  min-width: 150px;
}

.allergen-matrix-premium tbody td {
  padding: 0.6rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--surface-border);
  vertical-align: middle;
}

.allergen-matrix-premium tbody td:first-child {
  text-align: left;
  font-weight: 700;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 3;
}

.allergen-matrix-premium tbody tr:hover td {
  background: var(--surface-hover);
}

.allergen-matrix-premium tbody tr:hover td:first-child {
  background: var(--surface-hover);
}

.allergen-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  transition: all 0.2s;
}

.allergen-badge.present {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
}

.allergen-badge.absent {
  opacity: 0.15;
  color: var(--text-muted);
}

/* --- Allergen Legend --- */
.allergen-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--surface-border);
  flex-wrap: wrap;
}

.allergen-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* --- Waste Section --- */
.mgmt-waste-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .mgmt-waste-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Waste Stats Grid --- */
.waste-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

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

.waste-stat-card {
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  text-align: center;
  transition: all 0.2s;
}

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

.waste-stat-card .ws-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.waste-stat-card .ws-value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1.2;
}

.waste-stat-card .ws-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 0.2rem;
}

/* --- Waste History Items --- */
.waste-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--surface-border);
  transition: background 0.2s;
}

.waste-entry:last-child {
  border-bottom: none;
}

.waste-entry:hover {
  background: var(--surface-hover);
}

.waste-entry-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.waste-entry-icon.reason-invendu { background: rgba(245,158,11,0.1); }
.waste-entry-icon.reason-casse { background: rgba(239,68,68,0.1); }
.waste-entry-icon.reason-degustation { background: rgba(99,102,241,0.1); }
.waste-entry-icon.reason-peremption { background: rgba(107,114,128,0.1); }

.waste-entry-info {
  flex: 1;
  min-width: 0;
}

.waste-entry-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 2px;
}

.waste-entry-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.waste-entry-amount {
  text-align: right;
  flex-shrink: 0;
}

.waste-entry-loss {
  font-weight: 800;
  color: var(--danger);
  font-size: 0.9rem;
}

.waste-entry-qty {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --- Waste Chart Container --- */
.waste-chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 200px;
}

.waste-chart-container canvas {
  max-width: 100% !important;
  max-height: 220px !important;
}

/* --- Waste Declare Form --- */
.waste-declare-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.waste-declare-form .form-group {
  margin-bottom: 0;
}

/* --- Cost Objectives --- */
.mgmt-objectives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.objective-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--surface-border);
  transition: all 0.2s;
}

.objective-card:hover {
  border-color: var(--accent);
}

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

.objective-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.objective-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.objective-badge.on-track {
  background: rgba(16,185,129,0.1);
  color: #10b981;
}

.objective-badge.warning {
  background: rgba(245,158,11,0.1);
  color: #f59e0b;
}

.objective-badge.critical {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}

.objective-progress-bar {
  height: 6px;
  background: var(--surface-border);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.objective-progress-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.5s ease;
}

.objective-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.objective-stats strong {
  color: var(--text);
}

/* --- Summary Export Bar --- */
.mgmt-export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  margin-top: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.mgmt-export-bar .export-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.mgmt-export-bar .export-summary strong {
  color: var(--text);
}

.mgmt-export-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- Empty State Mgmt --- */
.mgmt-empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

.mgmt-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.mgmt-empty-state h4 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.mgmt-empty-state p {
  font-size: 0.85rem;
  max-width: 350px;
  margin: 0 auto;
  line-height: 1.5;
}

/* --- Mgmt Section Transitions --- */
.mgmt-view {
  animation: fadeUp 0.4s ease-out;
}

@media (max-width: 768px) {
  .mgmt-hero-premium h2 {
    font-size: 1.8rem;
  }

  .mgmt-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .mgmt-tabs-premium {
    gap: 0.3rem;
    padding: 0.3rem;
  }

  .mgmt-tab-pill {
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
  }

  .waste-stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .mgmt-objectives-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Dropdown Navigation System --- */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all 0.3s;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
}

.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown.active .nav-dropdown-trigger {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--surface);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid var(--surface-border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.6rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1100;
  margin-top: 0;
}

/* Invisible bridge */
.nav-dropdown-content::after {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  height: 15px;
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown.active .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(5px);
}

.nav-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  transition: all 0.2s;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.nav-dropdown-link:hover {
  background: var(--accent-glow);
  color: var(--accent);
  transform: translateX(4px);
}

.nav-dropdown-link.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 800;
}

.nav-arrow {
  font-size: 0.7rem;
  opacity: 0.5;
  transition: transform 0.3s;
}

.nav-dropdown:hover .nav-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

/* Mobile adjustments for dropdowns (simplified) */
@media (max-width: 768px) {
  .nav-dropdown-content {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding-left: 1rem;
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  
  .nav-dropdown.active .nav-dropdown-content {
    display: block;
  }
}

/* ============================================================================
   PRO FEATURES STYLES — v4.0
   ============================================================================ */

/* --- Pro Tools Grid --- */
.protools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.protools-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: relative;
  overflow: hidden;
}

.protools-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  opacity: 0;
  transition: opacity 0.3s;
}

.protools-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

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

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

.protools-card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.protools-card-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.protools-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--surface-border);
}

.protools-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 3px 10px;
  border-radius: 100px;
}

.protools-arrow {
  font-size: 1.2rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.3s;
}

.protools-card:hover .protools-arrow {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 768px) {
  .protools-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }
}

/* --- Modal Overlay (reusable) --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  padding: 1rem;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease-out;
}

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

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

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

/* --- OCR Scanner --- */
.ocr-preview-container {
  margin-bottom: 1rem;
}

.ocr-upload-zone {
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--bg-alt);
}

.ocr-upload-zone:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.ocr-upload-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.ocr-upload-zone p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.ocr-preview-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--surface-border);
}

.ocr-status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(99, 102, 241, 0.05);
  border-radius: var(--radius);
  color: #6366f1;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 1rem 0;
}

.spinner-ocr {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.ocr-results-header h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.ocr-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ocr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  background: var(--bg-alt);
  transition: all 0.2s;
}

.ocr-item.matched {
  border-left: 3px solid #10b981;
}

.ocr-item.applied {
  opacity: 0.5;
  background: rgba(16, 185, 129, 0.05);
}

.ocr-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.ocr-match-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 100px;
  display: inline-block;
  margin-top: 2px;
}

.ocr-no-match-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: inline-block;
  margin-top: 2px;
}

.ocr-item-price {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 4px;
}

.ocr-old-price {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.ocr-actions-bar {
  margin-top: 1.5rem;
}

.ocr-no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.ocr-raw-text {
  text-align: left;
  font-size: 0.75rem;
  background: var(--bg-alt);
  padding: 1rem;
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 1rem;
}

/* --- INCO Labels --- */
.inco-preview-container {
  margin: 0;
}

.inco-label {
  background: #ffffff;
  color: #1a1a1a;
  border: 2px solid #333;
  border-radius: 4px;
  padding: 12px 14px;
  font-family: 'Arial', sans-serif;
  font-size: 7.5pt;
  line-height: 1.4;
  max-width: 226px;
  margin: 0 auto;
}

.inco-label-name {
  font-size: 10pt;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.inco-label-section {
  margin-bottom: 6px;
}

.inco-label-title {
  font-weight: 900;
  font-size: 7pt;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.inco-label-text {
  font-size: 6.5pt;
  line-height: 1.35;
}

.inco-allergens strong {
  font-weight: 900;
  text-decoration: underline;
}

.inco-label-footer {
  display: flex;
  justify-content: space-between;
  font-size: 6.5pt;
  padding-top: 6px;
  border-top: 1px solid #999;
  margin-top: 6px;
}

.inco-label-legal {
  font-size: 5.5pt;
  color: #666;
  margin-top: 4px;
  font-style: italic;
  text-align: center;
}

/* --- Foisonnement --- */
.fois-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fois-kpi {
  text-align: center;
  padding: 1.2rem 0.5rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
}

.fois-kpi-val {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--accent);
  line-height: 1.2;
}

.fois-kpi-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-top: 0.3rem;
}

.fois-quality {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.fois-quality.fois-dense {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.fois-quality.fois-medium {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.fois-quality.fois-light {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.fois-quality.fois-ultra {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.fois-quality-icon {
  font-size: 1.5rem;
}

.fois-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.fois-error {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

@media (max-width: 500px) {
  .fois-results-grid {
    grid-template-columns: 1fr;
  }
}

/* --- BCG Matrix --- */
.bcg-legend-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bcg-quadrant-group {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.bcg-quadrant-group:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-color: var(--accent) !important;
}

.bcg-item {
  padding: 0.8rem 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.bcg-item:hover {
  background: var(--surface-hover);
}

.bcg-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.bcg-item-margin {
  font-family: var(--font-heading);
  font-weight: 800;
}

.bcg-item-action {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Inflation Simulation --- */
.inflation-slider-container {
  padding: 1.5rem 0 2rem;
}

.inflation-summary {
  display: flex;
  gap: 15px;
  margin-bottom: 2rem;
  justify-content: center;
}

.summary-pill {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
}

.summary-pill.danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.summary-pill.safe { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.summary-pill.info { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

#inflationResults {
  min-height: 400px; /* Stabilizes scroll during updates */
  contain: layout;
}

.inflation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 15px;
  min-height: 200px;
}

.inflation-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1.2rem;
  border-bottom: 4px solid #eee;
  transition: transform 0.2s;
}

.inflation-card:hover { transform: translateY(-5px); }

.inflation-card.status-danger { border-color: var(--cockpit-danger); background: rgba(239, 68, 68, 0.02); }
.inflation-card.status-warning { border-color: var(--cockpit-accent); }
.inflation-card.status-ok { border-color: var(--cockpit-success); }

.inflation-card-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 1rem;
}

.inflation-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-item .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.stat-item .val { font-size: 1.1rem; font-weight: 800; }
.stat-item .val.highlighted { color: var(--accent); }

.inflation-impact-bar {
  height: 6px;
  background: rgba(0,0,0,0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.impact-fill { height: 100%; transition: width 0.3s ease; }

.inflation-diff {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: right;
  color: var(--cockpit-danger);
}

.inflation-slider-value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: #ef4444;
}

.inflation-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 100px;
  background: linear-gradient(90deg, #10b981, #f59e0b 50%, #ef4444);
  outline: none;
  cursor: pointer;
}

.inflation-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid #ef4444;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.2s;
}

.inflation-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.inflation-slider-marks {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.inflation-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.inflation-kpi {
  text-align: center;
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  transition: all 0.3s;
}

.inflation-kpi.critical {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
}

.inflation-kpi.warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}

.inflation-kpi.ok {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

.inflation-kpi-val {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1;
}

.inflation-kpi.critical .inflation-kpi-val { color: #ef4444; }
.inflation-kpi.warning .inflation-kpi-val { color: #f59e0b; }
.inflation-kpi.ok .inflation-kpi-val { color: #10b981; }

.inflation-kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
}

.inflation-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
}

.inflation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.inflation-table thead th {
  background: var(--bg-alt);
  padding: 0.8rem 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 2px solid var(--surface-border);
}

.inflation-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--surface-border);
}

.inflation-table tbody tr:hover {
  background: var(--surface-hover);
}

.inflation-table tbody tr.row-critical {
  background: rgba(239, 68, 68, 0.04);
}

.inflation-table tbody tr.row-warning {
  background: rgba(245, 158, 11, 0.04);
}

.badge-crisis {
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.badge-warn {
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.badge-ok {
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .inflation-summary {
    grid-template-columns: 1fr;
  }
}

/* --- Cloud Sync --- */
.cloud-status-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
}

.cloud-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cloud-status-dot.connected {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulse-dot 2s infinite;
}

.cloud-status-dot.disconnected {
  background: var(--text-muted);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Client QR Code --- */
.client-qr-card {
  background: #ffffff;
  color: #1a1a1a;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.client-qr-header {
  margin-bottom: 1.2rem;
}

.client-qr-logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.client-qr-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
  color: #1e293b;
}

.client-qr-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.client-qr-price-badge {
  display: inline-block;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  margin-bottom: 1.2rem;
}

.client-qr-code-box {
  margin: 1rem auto;
  display: flex;
  justify-content: center;
}

.client-qr-code-box canvas,
.client-qr-code-box img {
  border-radius: 8px;
}

.client-qr-details {
  text-align: left;
  max-width: 300px;
  margin: 1rem auto 0;
}

.client-qr-section {
  margin-bottom: 0.8rem;
}

.client-qr-section strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.3rem;
  color: #475569;
}

.client-qr-text {
  font-size: 0.82rem;
  color: #1e293b;
  line-height: 1.5;
  margin: 0;
}

/* --- Glass Panel --- */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* --- Hero Mgmt Overlap (for Pro Tools to match Mgmt style) --- */
.hero-mgmt-overlap {
  margin-top: -2rem;
  position: relative;
  z-index: 10;
}

/* --- Title icon color for red --- */
.mgmt-card-title .title-icon.icon-red {
  background: rgba(239, 68, 68, 0.1);
}

/* CAP Exam Simulator Timeline */
.exam-timeline-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 20px;
  margin-top: 2rem;
}

.exam-timeline-grid::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--surface-border);
}

.exam-task-row {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  position: relative;
}

.exam-task-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--surface);
  position: absolute;
  left: -26px;
  top: 6px;
  z-index: 2;
  transition: var(--transition);
}

.exam-task-row.active .exam-task-dot {
  background: var(--primary);
  transform: scale(1.3);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.exam-task-row.done .exam-task-dot {
  background: var(--success);
}

.exam-task-time {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary);
  min-width: 60px;
  font-size: 0.9rem;
}

.exam-task-card {
  flex: 1;
  background: var(--bg-alt);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  transition: var(--transition);
}

.exam-task-row.active .exam-task-card {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.exam-task-row.done .exam-task-card {
  opacity: 0.6;
  filter: grayscale(0.5);
}

.exam-task-title {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.exam-task-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.exam-duration-badge {
  font-size: 0.75rem;
  background: rgba(0,0,0,0.05);
  padding: 2px 8px;
  border-radius: 4px;
}

/* --- Exam Builder Custom Styles --- */
.custom-exam-check-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.check-container {
  display: block;
  position: relative;
  padding-left: 35px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
  color: var(--text);
  line-height: 24px;
}

.check-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 22px;
  width: 22px;
  background-color: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  transition: all 0.2s;
}

.check-container:hover input ~ .checkmark {
  background-color: #eee;
}

.check-container input:checked ~ .checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.check-container input:checked ~ .checkmark:after {
  display: block;
}

.check-container .checkmark:after {
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
/* CAP Exam Simulator Custom Styles */
.exam-selection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
}

.exam-selection-row .check-container {
  margin: 0;
  flex: 1;
}

.exam-recipe-select {
  flex: 1;
  max-width: 180px;
  padding: 0.4rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--surface-border);
  font-size: 0.8rem;
  background: var(--bg);
  cursor: pointer;
}

.exam-recipe-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.custom-exam-check-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* ==========================================================================
   COCKPIT HUB — SaaS MODERN DESIGN (V2)
   ========================================================================== */

:root {
  --cockpit-bg: #f8fafc;
  --cockpit-card-bg: #ffffff;
  --cockpit-border: rgba(0, 0, 0, 0.08);
  --cockpit-accent: #6366f1;
  --cockpit-success: #10b981;
  --cockpit-warning: #f59e0b;
  --cockpit-danger: #ef4444;
  --cockpit-text-main: #1e293b;
  --cockpit-text-muted: #64748b;
  --cockpit-radius: 16px;
  --cockpit-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.dark-theme {
  --cockpit-bg: #000000;
  --cockpit-card-bg: #0a0a0a;
  --cockpit-border: rgba(255, 255, 255, 0.08);
  --cockpit-text-main: #ffffff;
  --cockpit-text-muted: #8b949e;
}

#hubSection {
  background: var(--cockpit-bg);
  min-height: calc(100vh - var(--header-h));
  padding: 2rem;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--cockpit-text-main);
  transition: background 0.3s;
}

/* --- Morning Briefing --- */
.morning-briefing {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 2rem;
}

.briefing-user {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-avatar-premium {
  width: 64px;
  height: 64px;
  background: var(--cockpit-card-bg);
  border: 2px solid var(--cockpit-accent);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: var(--cockpit-shadow);
}

.user-info h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}

.briefing-date {
  color: var(--cockpit-text-muted);
  font-size: 1rem;
  margin-top: 4px;
}

.briefing-stats {
  display: flex;
  gap: 1.5rem;
}

.briefing-stat-item {
  background: var(--cockpit-card-bg);
  padding: 0.75rem 1.25rem;
  border-radius: var(--cockpit-radius);
  border: 1px solid var(--cockpit-border);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  min-width: 160px;
}

.stat-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--bg-alt);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.briefing-stat-item.warning .stat-icon { background: rgba(245, 158, 11, 0.1); }
.briefing-stat-item.success .stat-icon { background: rgba(16, 185, 129, 0.1); }

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--cockpit-text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* --- Cockpit Grid V2 --- */
.cockpit-grid-v2 {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
}

.col-actions {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.col-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* --- Cards --- */
.cockpit-card {
  background: var(--cockpit-card-bg);
  border-radius: var(--cockpit-radius);
  border: 1px solid var(--cockpit-border);
  box-shadow: var(--cockpit-shadow);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.card-header-premium {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.header-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-p {
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  background: var(--bg-alt);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-header-premium h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.badge-new {
  background: var(--cockpit-accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

/* --- Priority List --- */
.priority-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.priority-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem;
  background: var(--bg-alt);
  border-radius: 12px;
  border-left: 4px solid transparent;
}

.priority-item.urgent { border-left-color: var(--cockpit-danger); }
.priority-item.warning { border-left-color: var(--cockpit-warning); }
.priority-item.info { border-left-color: var(--cockpit-accent); }

.p-icon { font-size: 1.2rem; }
.p-content { flex: 1; }
.p-title { font-weight: 700; font-size: 0.9rem; }
.p-desc { font-size: 0.75rem; color: var(--cockpit-text-muted); }

.p-action-btn {
  background: var(--cockpit-card-bg);
  border: 1px solid var(--cockpit-border);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.p-action-btn:hover {
  background: var(--cockpit-accent);
  color: white;
  border-color: var(--cockpit-accent);
}

/* --- AI Assistant --- */
.ai-bubble {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  padding: 1.25rem;
  border-radius: 12px 12px 12px 0;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.ai-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.ai-tip {
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* --- Production Timeline --- */
.production-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  min-height: 200px;
}

.timeline-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--cockpit-text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

.prod-pill-v2 {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-alt);
  border-radius: var(--cockpit-radius);
  transition: transform 0.2s;
}

.prod-pill-v2:hover { transform: translateX(5px); background: var(--surface-hover); }

.prod-progress-circle {
  width: 48px;
  height: 48px;
  position: relative;
}

.prod-info-v2 h4 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.prod-info-v2 p { margin: 4px 0 0; font-size: 0.85rem; color: var(--cockpit-text-muted); font-weight: 500; }

.header-tabs {
  display: flex;
  background: var(--bg-alt);
  padding: 4px;
  border-radius: 100px;
}

.h-tab {
  border: none;
  background: none;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--cockpit-text-muted);
}

.h-tab.active {
  background: var(--cockpit-card-bg);
  color: var(--cockpit-accent);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- Bottom Stats Grid --- */
.bottom-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.perf-stats-mini {
  display: flex;
  justify-content: space-between;
}

.mini-kpi {
  display: flex;
  flex-direction: column;
}

.k-label { font-size: 0.65rem; color: var(--cockpit-text-muted); text-transform: uppercase; font-weight: 700; }
.k-value { font-size: 1rem; font-weight: 800; }

.team-summary-mini {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.radar-compact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radar-item-mini {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .cockpit-grid-v2 { grid-template-columns: 1fr; }
  .morning-briefing { flex-direction: column; align-items: flex-start; }
  .briefing-stats { width: 100%; overflow-x: auto; padding-bottom: 10px; }
}

@media (max-width: 768px) {
  .bottom-stats-grid { grid-template-columns: 1fr; }
}
/* ---------- Library Hub Styles ---------- */
.library-hub-container {
  margin-top: 3rem;
  text-align: left;
}

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

.library-header h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--text);
  margin: 0;
}

.library-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

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

.search-box-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 50px;
  border: 1px solid var(--surface-border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.3s;
}

.search-box-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.category-filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-bottom: 5px;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-chip:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.filter-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  min-height: 200px;
}

.library-card {
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.library-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.library-card-img-placeholder {
  height: 80px;
  width: 80px;
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.library-card-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.library-card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0;
  color: var(--text);
  line-height: 1.4;
}

.library-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: auto;
}

.library-card-pdf {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
  font-size: 0.7rem;
  font-weight: 700;
  transition: all 0.2s;
}

.library-card-pdf:hover {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .library-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .library-controls {
    width: 100%;
  }
  
  .search-box-wrapper {
    width: 100%;
  }
  
  .category-filters {
    gap: 0.4rem;
    justify-content: flex-start;
  }
  
  .filter-chip {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
}

/* Glossy Cards Hover */
.cockpit-card, .card, .dash-card {
  position: relative;
  overflow: hidden;
}

.cockpit-card::before, .card::before, .dash-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.06), transparent 40%);
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 10;
}

.dark-theme .cockpit-card::before, .dark-theme .card::before, .dark-theme .dash-card::before {
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.03), transparent 40%);
}

.cockpit-card:hover::before, .card:hover::before, .dash-card:hover::before {
  opacity: 1;
}

/* Ingredient Sparklines — hidden */
.ing-sparkline {
  display: none !important;
}

.ing-row:hover .ing-sparkline {
  opacity: 0;
}

.ing-sparkline .spark-path {
  stroke: var(--text-muted);
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s;
}

.ing-row:hover .ing-sparkline .spark-path {
  stroke: var(--accent);
}

/* --- Margin Circular Chart --- */
.margin-ring-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.margin-circle-wrap {
  position: relative;
  width: 55px;
  height: 55px;
}

.circular-chart {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 250px;
}

.circle-bg {
  fill: none;
  stroke: var(--surface-border);
  stroke-width: 3.5;
}

.circle {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 1s cubic-bezier(0.165, 0.84, 0.44, 1), stroke 0.5s;
}

.margin-circle-wrap .circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
  padding: 0;
}

/* Assistant Saisonnalité */
.seasonality-badge {
  display: none;
}
.seasonality-badge:not(:empty) {
  display: flex;
  position: absolute;
  right: 10px;
  bottom: -22px;
  align-items: center;
  gap: 4px;
  background: var(--surface, #fff);
  padding: 3px 6px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  z-index: 10;
  border: 1px solid rgba(239, 68, 68, 0.2);
  animation: fadeUpItem 0.3s ease-out;
}
.season-warn {
  font-size: 0.7rem;
  color: var(--danger, #ef4444);
  font-weight: 700;
}
.seasonality-badge button {
  background: #fef2f2;
}
.seasonality-badge button:hover {
  background: var(--danger, #ef4444);
  color: #fff !important;
}
