/* Self-hosted Inter font (elimine la dependance a Google Fonts CDN) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1D7F, U+1DC0-1DFF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Reset & base */
* { box-sizing: border-box; }

/* Spacing helpers */
.space {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card.space {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --bg: radial-gradient(circle at 50% 8%, rgba(140,20,20,0.45) 0%, transparent 50%),
         linear-gradient(180deg, #3d0c0c 0%, #2e0808 30%, #200606 60%, #150404 100%);
  --bg-solid: #1a0505;
  --card: rgba(55, 16, 18, 0.92);
  --border: rgba(255, 200, 210, 0.14);
  --text: #fff5f5;
  --muted: #ffb7c7;
  --primary: #ff3d48;
  --primary-2: #ff9366;
  --btn-grad-1: #ff555d;
  --btn-grad-2: #ff8e63;
  --topbar-bg: rgba(45, 10, 10, 0.97);
  --topbar-border: rgba(255,180,200,0.16);
  --surface-text: var(--text);
  --field-bg: rgba(255, 255, 255, 0.10);
  --field-bg-focus: rgba(255, 255, 255, 0.16);
  --field-border: rgba(255, 255, 255, 0.20);
  --field-text: var(--text);
  --field-placeholder: rgba(255, 245, 245, 0.55);
  --select-option-bg: #2e0a0a;
  --select-option-text: #f8fafc;
  --ghost-bg: rgba(255,255,255,0.10);
  --ghost-text: var(--text);
  --ghost-border: rgba(255,255,255,0.20);
  --action-ghost-text: #ffffff;
  --pill-bg: rgba(255,255,255,0.10);
  --pill-bg-hover: rgba(255,255,255,0.18);
  --pill-text: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
}

:root[data-env="dev"] {
  --bg: radial-gradient(circle at 20% 10%, rgba(34, 211, 238, 0.12) 0%, transparent 42%),
        radial-gradient(circle at 82% 8%, rgba(59, 130, 246, 0.1) 0%, transparent 48%),
        linear-gradient(180deg, #040e1a 0%, #06152a 46%, #020a14 100%);
  --bg-solid: #020a14;
  --card: rgba(8, 22, 42, 0.88);
  --border: rgba(125, 211, 252, 0.12);
  --text: #e8f4f8;
  --muted: rgba(165, 243, 252, 0.75);
  --primary: #22d3ee;
  --primary-2: #60a5fa;
  --btn-grad-1: #06b6d4;
  --btn-grad-2: #3b82f6;
  --topbar-bg: rgba(4, 12, 26, 0.95);
  --topbar-border: rgba(125, 211, 252, 0.1);
  --ghost-bg: rgba(255,255,255,0.06);
  --ghost-border: rgba(125, 211, 252, 0.15);
}

:root[data-env="dev"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  border: 2px solid rgba(34, 211, 238, 0.35);
  box-shadow: inset 0 0 0 1px rgba(186, 230, 253, 0.1);
  pointer-events: none;
  z-index: 9997;
}

body {
  margin: 0;
  background: var(--bg);
  background-color: var(--bg-solid, #4a1020);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

input,
select,
textarea,
button {
  font: inherit;
}

/* Layout */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + var(--safe-top)) calc(32px + var(--safe-right)) 18px calc(32px + var(--safe-left));
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--topbar-border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
@media (min-width: 1280px) {
  .topbar {
    padding: calc(16px + var(--safe-top)) calc(40px + var(--safe-right)) 16px calc(40px + var(--safe-left));
  }
  .logo span { font-size: 20px; }
  .logo-img { height: 40px; }
  .nav { gap: 28px; }
  .nav-link {
    font-size: 13px;
    letter-spacing: 0.13em;
  }
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
}
.logo-grid {
  width: 54px;
  height: 36px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 2px;
}
.logo-square {
  border-radius: 4px;
  width: 100%;
  height: 100%;
}
.logo-square.c1 { background: #b91c1c; }
.logo-square.c2 { background: #f97316; }
.logo-square.c3 { background: #fecdd3; }

.logo span { font-size: 18px; }
.logo-img { height: 40px; width: auto; object-fit: contain; display:block; }
.dev-env-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(103, 232, 249, 0.48);
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.86), rgba(8, 145, 178, 0.72));
  color: #ecfeff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1;
  text-indent: 0.18em;
}

.dev-site-ribbon {
  position: fixed;
  top: calc(14px + var(--safe-top));
  right: calc(16px + var(--safe-right));
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.5);
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.96), rgba(30, 64, 175, 0.9));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  color: #ecfeff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}

@media (max-width: 720px) {
  :root[data-env="dev"] body::before {
    border-width: 3px;
  }
  .dev-env-badge {
    padding: 4px 8px;
    font-size: 10px;
  }
  .dev-site-ribbon {
    top: auto;
    right: calc(12px + var(--safe-right));
    bottom: calc(12px + var(--safe-bottom));
    padding: 8px 12px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-link {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  line-height: 1.1;
  padding: 6px 2px 8px;
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.nav-link:hover { color: #fff; border-color: var(--primary); }
.nav-link.active, .nav-link[style*="underline"] { color: #fff; border-color: var(--primary); }
.nav-link.mute { color: var(--muted); }
.admin-link { color: var(--primary); opacity: 0.85; }
#commission-link,
#export-link,
#admin-link {
  color: var(--primary);
  opacity: 0.85;
}
#commission-link:hover,
#export-link:hover,
#admin-link:hover {
  color: var(--primary);
  opacity: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  gap: 4px;
  flex-direction: column;
}
.nav-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

.profile-trigger {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  flex: 0 0 38px;
  line-height: 0;
}
.profile-trigger img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  flex: 0 0 100%;
}
.profile-trigger span {
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

.profile-shell {
  padding: 24px;
  overflow: hidden;
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.profile-hero--owner {
  padding: 22px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,0.34), rgba(255,255,255,0.1));
  border: 1px solid rgba(125, 211, 252, 0.25);
}

.profile-hero__main {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.profile-hero__copy {
  min-width: 0;
}

.profile-hero__lead {
  margin: 10px 0 0;
  max-width: 720px;
}

.profile-hero__side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.profile-avatar-frame {
  width: 104px;
  height: 104px;
  border-radius: 30px;
  padding: 4px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.9), rgba(15, 118, 110, 0.85));
  box-shadow: 0 18px 34px rgba(8, 47, 73, 0.22);
  flex: 0 0 104px;
  position: relative;
  overflow: hidden;
}

.profile-avatar-frame__img,
.profile-avatar-frame__fallback {
  width: 100%;
  height: 100%;
  border-radius: 26px;
}

.profile-avatar-frame__img {
  object-fit: cover;
  object-position: center;
  display: block;
  background: rgba(255,255,255,0.88);
}

.profile-avatar-frame__fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e0f2fe, #ccfbf1);
  color: #0f172a;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.04em;
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
}

.profile-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.profile-identity-list {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.profile-identity-list div {
  display: grid;
  gap: 4px;
}

.profile-identity-list span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 900;
}

.profile-owner-grid,
.profile-owner-stats,
.profile-detail-grid {
  margin-top: 18px;
}

.profile-action-card {
  min-height: 160px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.profile-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 16px 36px rgba(8, 47, 73, 0.14);
}

.profile-stat-card {
  min-height: 154px;
  display: grid;
  align-content: start;
}

.profile-stat-card--primary {
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 40%),
    linear-gradient(180deg, color-mix(in srgb, var(--card) 94%, white 6%), color-mix(in srgb, var(--card) 82%, #082f49 18%));
}

.profile-stat-card--warn {
  border-color: rgba(185, 28, 28, 0.35);
  box-shadow: 0 12px 30px rgba(127, 29, 29, 0.12);
}

.profile-stat-card__value {
  margin: 12px 0 10px;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.profile-card-block {
  display: grid;
  gap: 14px;
  min-height: 100%;
}

.profile-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-shell {
  max-width: 1780px;
  margin: 0 auto;
  padding: 32px calc(24px + var(--safe-right)) calc(60px + var(--safe-bottom)) calc(24px + var(--safe-left));
}
.app-shell--login {
  max-width: none;
  margin: 0;
  padding: 0;
}

:root[data-env="dev"] .watermark {
  opacity: 0.18;
  visibility: visible;
  color: rgba(186, 230, 253, 0.42);
}

/* Cards */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 96%, white 4%), color-mix(in srgb, var(--card) 85%, black 15%));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08);
  color: var(--surface-text);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.1);
}
button.card {
  color: var(--text);
  text-align: inherit;
}
button.card .title,
button.card .subtitle,
button.card .muted,
button.card p,
button.card h1,
button.card h2,
button.card h3,
button.card h4,
button.card h5,
button.card h6 {
  color: inherit;
}
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.subtitle {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 700;
  opacity: 0.85;
}

/* Login */
.login-wrapper {
  min-height: calc(100dvh - 90px - var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(32px + var(--safe-top)) calc(32px + var(--safe-right)) calc(32px + var(--safe-bottom)) calc(32px + var(--safe-left));
  background: transparent;
}
.login-card {
  max-width: 420px;
  width: 100%;
  padding: 44px 38px 36px;
  border-radius: 46px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, #fff7f7 0%, #ffe7e7 100%);
  text-align: center;
  color: #22030a;
}
.login-card .title {
  color: #1b0106;
  font-size: 28px;
  letter-spacing: 0.06em;
}
.login-card .subtitle {
  color: rgba(34, 3, 10, 0.6);
  font-weight: 700;
  letter-spacing: 0.18em;
}
.login-card #forgot-pass,
body:not(.light-mode) .login-card #forgot-pass {
  color: #0f172a !important;
  font-weight: 800;
}
.login-card .input,
body:not(.light-mode) .login-card .input {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.34) !important;
  color: #1f2937 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92) !important;
}
.login-card .input:focus,
body:not(.light-mode) .login-card .input:focus {
  border-color: rgba(230, 57, 70, 0.45) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.12) !important;
}
.login-card .input::placeholder,
body:not(.light-mode) .login-card .input::placeholder {
  color: rgba(100, 116, 139, 0.58) !important;
}
.input.password-visible {
  text-transform: none !important;
}
.login-card .btn.primary {
  box-shadow: 0 16px 28px rgba(230, 57, 70, 0.22);
}
.login-card .btn.ghost,
body:not(.light-mode) .login-card .btn.ghost {
  background: linear-gradient(180deg, rgba(255, 245, 245, 0.98), rgba(255, 234, 234, 0.98)) !important;
  border-color: rgba(244, 114, 114, 0.16) !important;
  color: #3f0a12 !important;
}
.login-card .btn.ghost:hover {
  background: linear-gradient(180deg, rgba(255, 250, 250, 1), rgba(255, 240, 240, 1)) !important;
  border-color: rgba(230, 57, 70, 0.24) !important;
}
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1f2937;
  box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 9999s ease-out 0s;
}
.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 2px solid var(--field-border);
  background: var(--field-bg);
  font-weight: 700;
  font-size: 14px;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: var(--field-text);
}
.input:focus {
  border-color: var(--primary);
  background: var(--field-bg-focus);
  box-shadow: 0 0 0 3px rgba(255, 98, 106, 0.25);
}
.input::placeholder {
  color: var(--field-placeholder);
}

.mailing-color-input {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px;
  min-height: 58px;
  cursor: pointer;
  overflow: hidden;
}

.mailing-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.mailing-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 12px;
}

.mailing-color-input::-moz-color-swatch {
  border: none;
  border-radius: 12px;
}

#new-user-schedule-letter,
#dlg-user-schedule-letter {
  text-transform: none !important;
  letter-spacing: normal !important;
}

#new-user-schedule-letter::placeholder,
#dlg-user-schedule-letter::placeholder {
  text-transform: none !important;
  letter-spacing: normal !important;
}

.select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--field-border);
  background: var(--field-bg);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--field-text);
  font-size: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.15s ease;
  color: #1a0f12;
}
.btn.primary {
  background: linear-gradient(135deg, var(--btn-grad-1), var(--btn-grad-2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.btn.primary:hover { background: linear-gradient(135deg, color-mix(in srgb, var(--btn-grad-1) 85%, white 15%), color-mix(in srgb, var(--btn-grad-2) 85%, white 15%)); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.btn.primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.btn.secondary {
  background: linear-gradient(135deg, #0f766e, #38bdf8);
  color: #fff;
  box-shadow: 0 4px 16px rgba(14, 116, 144, 0.18);
}
.btn.secondary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 22px rgba(14, 116, 144, 0.25); }
.btn.secondary:active { transform: translateY(0); }
.btn.ghost {
  background: var(--ghost-bg);
  color: var(--ghost-text);
  border: 1px solid var(--ghost-border);
  backdrop-filter: blur(4px);
}
.btn.ghost:hover { background: var(--pill-bg-hover); }
.btn.small { padding: 8px 12px; border-radius: 10px; font-size: 12px; }

/* Accent ghost buttons inside tables/actions */
.table .btn.ghost,
.row-actions .btn.ghost {
  background: linear-gradient(135deg, color-mix(in srgb, var(--btn-grad-1) 78%, #fff 22%), color-mix(in srgb, var(--btn-grad-2) 78%, #fff 22%));
  color: var(--action-ghost-text);
  font-weight: 900;
  letter-spacing: 0.04em;
  border: 1px solid color-mix(in srgb, var(--btn-grad-2) 70%, #0b172a 12%);
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}
.table .btn.ghost:hover,
.row-actions .btn.ghost:hover { filter: brightness(1.05); }
.table .btn.ghost:active,
.row-actions .btn.ghost:active { transform: translateY(0); box-shadow: 0 2px 10px rgba(0,0,0,0.16); }

/* Toolbar actions (search / refresh) */
#refresh-btn,
#search + #refresh-btn,
.toolbar .btn.ghost {
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: var(--action-ghost-text);
  font-weight: 900;
  letter-spacing: 0.04em;
  border: 1px solid color-mix(in srgb, #0ea5e9 70%, #0b172a 20%);
  box-shadow: 0 10px 22px rgba(14,165,233,0.28);
}
#refresh-btn:hover,
.toolbar .btn.ghost:hover { filter: brightness(1.08); }
#refresh-btn:active,
.toolbar .btn.ghost:active { transform: translateY(0); box-shadow: 0 3px 12px rgba(0,0,0,0.18); }

.dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #0ea5e9;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  margin-top: 8px;
}

/* Dashboard */
.kpi {
  text-align: center;
}
.kpi .big { font-size: 46px; font-weight: 900; margin: 4px 0; }
.kpi .label { text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; color: var(--muted); font-weight: 800; }

/* Dashboard welcome bar */
.dash-welcome {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.dash-welcome__info { flex: 1; min-width: 0; }
.dash-welcome__stats { display: flex; gap: 12px; align-items: center; }
.dash-welcome__stat { text-align: right; }
.dash-welcome__amount { font-size: 18px; font-weight: 800; }
.dash-welcome__amount--danger { color: #ef4444; }
.dash-welcome__amount--warn { color: #d97706; }

/* Dashboard KPI row */
.dashboard-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 300px;
  gap: 14px;
  margin-bottom: 14px;
}
.dashboard-kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Dashboard incentive panel */
.dash-incentive-panel {
  padding: 16px;
}
.dash-incentive-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.dash-incentive-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-top: 1px solid var(--border);
}
.dash-incentive-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.dash-incentive-row__score { font-weight: 700; }

/* RGPD section */
.rgpd-section {
  margin-top: 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent 75%);
  background: color-mix(in srgb, var(--primary) 4%, transparent 96%);
}

/* Clippy assistant */
.clippy-container {
  position: fixed;
  bottom: 24px !important;
  right: 40px !important;
  left: auto !important;
  top: auto !important;
  z-index: 99997;
  transition: bottom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0;
  user-select: none;
}
.clippy-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.clippy-bubble {
  background: linear-gradient(135deg, #fff5f5, #fff0eb);
  border: 2px solid #ff3d48;
  border-radius: 14px;
  padding: 10px 32px 10px 14px;
  max-width: 260px;
  font-size: 13px;
  color: #333;
  box-shadow: 0 4px 16px rgba(255,61,72,0.15);
  position: relative;
  margin-bottom: 8px;
  line-height: 1.4;
}
.clippy-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #fff5f5;
}
.clippy-close {
  position: absolute;
  top: 4px; right: 8px;
  background: none; border: none;
  font-size: 18px; color: #999;
  cursor: pointer; padding: 0; line-height: 1;
}
.clippy-close:hover { color: #333; }

/* === LOPY ROBOT === */
.clippy-body {
  width: 72px;
  height: 88px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s;
  animation: lopy-idle-float 3s ease-in-out infinite;
}
@keyframes lopy-idle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
/* Antenne - fine tige metallique */
.clippy-clip {
  position: absolute;
  left: 50%; top: -18px;
  transform: translateX(-50%);
  width: 3px; height: 16px;
  background: linear-gradient(180deg, #888, #555);
  border: none;
  border-radius: 2px;
  z-index: 2;
}
.clippy-clip::before {
  content: "";
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  background: radial-gradient(circle at 35% 35%, #ff7a82, #ff3d48, #b91c1c);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255,61,72,0.6), inset 0 1px 2px rgba(255,255,255,0.3);
  animation: lopy-antenna-pulse 2s ease-in-out infinite;
}
.clippy-clip::after { display: none; }
@keyframes lopy-antenna-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255,61,72,0.4), inset 0 1px 2px rgba(255,255,255,0.3); }
  50% { box-shadow: 0 0 12px rgba(255,61,72,0.9), 0 0 20px rgba(255,61,72,0.3), inset 0 1px 2px rgba(255,255,255,0.3); }
}
/* Tete robot - arrondie et brillante */
.clippy-face {
  position: relative;
  z-index: 1;
  width: 56px; height: 46px;
  background: linear-gradient(180deg, #ff5a63 0%, #ff3d48 40%, #cc2233 100%);
  border: 2px solid #a01020;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 2px;
  box-shadow: 0 3px 10px rgba(255,61,72,0.35), inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -2px 4px rgba(0,0,0,0.1);
}
/* Visiere / ecran - plus large avec lueur */
.clippy-face::before {
  content: "";
  position: absolute;
  top: 7px; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 24px;
  background: linear-gradient(180deg, #1a0a0a, #0d0505);
  border-radius: 8px;
  border: 1px solid #500;
  z-index: 0;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.5), 0 0 4px rgba(255,61,72,0.15);
}
.clippy-eyes {
  display: flex;
  gap: 14px;
  position: relative;
  z-index: 1;
  margin-top: -1px;
}
.clippy-eye {
  width: 14px; height: 14px;
  background: #4ade80;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 6px rgba(74,222,128,0.6), 0 0 14px rgba(74,222,128,0.2);
  transition: background 0.3s, box-shadow 0.3s;
}
.clippy-pupil {
  width: 6px; height: 6px;
  background: #052e16;
  border-radius: 50%;
  transition: transform 0.1s;
}
/* Bouche LED - plus large et arrondie */
.clippy-mouth {
  width: 18px; height: 5px;
  background: #4ade80;
  border-radius: 3px;
  position: relative;
  z-index: 1;
  margin-top: 1px;
  box-shadow: 0 0 5px rgba(74,222,128,0.5), 0 0 10px rgba(74,222,128,0.15);
  transition: background 0.3s, width 0.3s, height 0.3s, border-radius 0.3s;
}
/* Joues rosees subtiles */
.clippy-mouth::after {
  content: "";
  position: absolute;
  top: -6px; left: -14px;
  width: 7px; height: 4px;
  background: rgba(255,150,100,0.25);
  border-radius: 50%;
  box-shadow: 33px 0 0 0 rgba(255,150,100,0.25);
}
/* Corps robot - plus solide */
.clippy-body::after {
  content: "";
  width: 42px; height: 24px;
  background: linear-gradient(180deg, #ff9366 0%, #ff3d48 100%);
  border: 2px solid #a01020;
  border-radius: 4px 4px 12px 12px;
  margin-top: 2px;
  z-index: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), inset 0 6px 0 -4px rgba(255,255,255,0.08);
}
/* Bras - plus longs avec accent */
.clippy-face::after {
  content: "";
  position: absolute;
  bottom: -22px; left: -7px;
  width: 4px; height: 18px;
  background: linear-gradient(180deg, #cc2233 60%, #ff6666);
  border-radius: 3px;
  box-shadow: 60px 0 0 0 #cc2233;
  z-index: 0;
}
.clippy-label {
  font-size: 10px;
  font-weight: 700;
  color: #ff3d48;
  margin-top: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(255,61,72,0.3);
}

/* === LOPY ETATS REACTIFS === */
/* Etat content (vente, champ rempli) */
.clippy-body.lopy-happy .clippy-eye {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251,191,36,0.7), 0 0 16px rgba(251,191,36,0.2);
}
.clippy-body.lopy-happy .clippy-pupil { background: #78350f; }
.clippy-body.lopy-happy .clippy-mouth {
  width: 14px; height: 7px;
  border-radius: 0 0 10px 10px;
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251,191,36,0.5);
}
.clippy-body.lopy-happy { animation: lopy-bounce 0.5s ease; }
@keyframes lopy-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px) scale(1.05); }
  50% { transform: translateY(-4px); }
  70% { transform: translateY(-2px); }
}
/* Etat erreur */
.clippy-body.lopy-error .clippy-eye {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239,68,68,0.8), 0 0 20px rgba(239,68,68,0.3);
}
.clippy-body.lopy-error .clippy-pupil { background: #fff; width: 3px; height: 8px; border-radius: 1px; }
.clippy-body.lopy-error .clippy-mouth {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239,68,68,0.5);
}
.clippy-body.lopy-error { animation: lopy-shake 0.4s ease; }
@keyframes lopy-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-5px) rotate(-2deg); }
  35% { transform: translateX(5px) rotate(2deg); }
  55% { transform: translateX(-3px) rotate(-1deg); }
  75% { transform: translateX(2px); }
}
/* Etat reflexion (idle/typing) */
.clippy-body.lopy-think .clippy-eye { animation: lopy-blink 1.5s infinite; }
@keyframes lopy-blink {
  0%, 40%, 100% { transform: scaleY(1); }
  45%, 55% { transform: scaleY(0.1); }
}
.clippy-body.lopy-think .clippy-mouth {
  animation: lopy-pulse 1.2s ease-in-out infinite;
}
@keyframes lopy-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Tableau resume operateur */
.operator-summary-card { max-width: 520px; }
.operator-summary-table { font-size: 13px; }
.operator-summary-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.operator-summary-table td { padding: 6px 10px; }
.operator-summary-table tfoot td { font-weight: 700; }

/* Chibi easter egg */
.chibi-sprite {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.chibi-char {
  font-size: 48px;
  animation: chibi-bounce 0.6s ease-in-out infinite;
}
.chibi-name {
  font-size: 10px;
  font-weight: 800;
  color: #f8fafc;
  text-align: center;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  margin-top: 2px;
}
.chibi-bubble {
  background: rgba(15, 23, 42, 0.9);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  margin-bottom: 4px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px) scale(0.8);
  transition: opacity 0.3s, transform 0.3s;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.chibi-bubble::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(15, 23, 42, 0.9);
  margin: 0 auto;
}
@keyframes chibi-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
body.light-mode .chibi-bubble {
  background: rgba(255, 255, 255, 0.95);
  color: #d97706;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
body.light-mode .chibi-bubble::after {
  border-top-color: rgba(255, 255, 255, 0.95);
}
body.light-mode .chibi-name { color: #334155; text-shadow: none; }

/* Email verification indicators */
.email-valid { border-color: #22c55e !important; }
.email-warning { border-color: #f59e0b !important; }
.email-invalid { border-color: #ef4444 !important; }
.email-hint {
  font-size: 11px;
  margin-top: 4px;
  min-height: 16px;
  transition: color 0.15s;
}
.email-hint--ok { color: #22c55e; }
.email-hint--warn { color: #f59e0b; }
.email-hint--error { color: #ef4444; }
body.light-mode .email-hint--ok { color: #16a34a; }
body.light-mode .email-hint--warn { color: #d97706; }
body.light-mode .email-hint--error { color: #dc2626; }

/* Cookie consent banner */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.97);
  color: #f1f5f9;
  padding: 16px 24px;
  z-index: 99999;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  font-size: 14px;
}
.cookie-consent__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-consent__text { flex: 1; min-width: 280px; }
.cookie-consent__text strong { color: #f1f5f9; }
.cookie-consent__text p { margin: 4px 0 0; opacity: 0.85; font-size: 13px; }
.cookie-consent__text a { color: #60a5fa; text-decoration: underline; }
.cookie-consent__actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-consent__btn {
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.cookie-consent__btn--refuse {
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #f1f5f9;
}
.cookie-consent__btn--accept {
  border: none;
  background: #3b82f6;
  color: #fff;
  font-weight: 700;
}

.target-vendor-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.target-vendor-page > section {
  margin-top: 0 !important;
}

.target-vendor-hero,
.target-vendor-section {
  padding: 16px 18px;
}

.target-vendor-filters {
  gap: 10px !important;
}

.target-vendor-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.target-vendor-kpi {
  padding: 14px 16px;
  min-height: 0;
}

.target-vendor-kpi .big {
  font-size: 30px;
  line-height: 1.05;
  margin: 2px 0 0;
}

.target-vendor-kpi .label {
  font-size: 10px;
  letter-spacing: 0.14em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}
.badge-off {
  background: rgba(255, 99, 132, 0.15);
  color: #fff;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0; padding: 0;
  list-style: none;
}
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 85%, white 15%);
  color: var(--surface-text);
}
.list-item strong { font-size: 15px; }
.list-item small { color: var(--muted); font-weight: 700; }

/* Encodage */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: color-mix(in srgb, var(--card) 92%, white 8%);
  border-radius: 16px;
  overflow: hidden;
  color: var(--surface-text);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  background: color-mix(in srgb, var(--card) 82%, white 18%);
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}
.table td {
  padding: 12px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent 50%);
  color: var(--surface-text);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: rgba(255,255,255,0.04); }
.table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--card) 88%, white 12%); }
.table tbody tr:nth-child(even):hover { background: rgba(255,255,255,0.06); }
.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Schedule enhancements */
.schedule-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.stat-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 18px 20px;
  color: #fff;
  min-height: 110px;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.stat-label {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin: 0 0 6px;
}
.stat-value {
  margin: 0;
  font-size: 31px;
  font-weight: 800;
  display: flex;
  gap: 6px;
  align-items: baseline;
  color: #fff;
  flex-wrap: wrap;
  min-width: 0;
}
.stat-value span { font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; }
.stat-value.small { font-size: 20px; line-height: 1.3; }
.quota-editor { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.quota-editor .input { flex: 1 1 140px; min-width: 0; }
.quota-editor .btn { flex: 0 0 auto; }
.leave-summary-card { margin-top: 12px; max-width: 520px; }

@media (max-width: 1100px) {
  .schedule-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 700px) {
  .schedule-stats { grid-template-columns: 1fr; }
}

.leave-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.leave-actions .btn.secondary {
  background: linear-gradient(135deg, #1e3a8a, #22d3ee);
  color: #fff;
  border: none;
  box-shadow: 0 12px 28px rgba(34,211,238,0.32);
}
.leave-actions .btn.ghost {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}

.view-toggle {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.view-toggle span { font-size: 12px; }
.view-toggle .btn {
  font-size: 11px;
  letter-spacing: 0.18em;
}
.view-toggle .btn.primary {
  background: linear-gradient(135deg, #ff4f64, #ff915d);
  border: none;
  color: #fff;
  box-shadow: 0 12px 25px rgba(255,79,100,0.4);
}
.view-toggle .btn.ghost {
  background: rgba(255,255,255,0.15);
  color: rgba(20,20,25,0.85);
  border: 1px solid rgba(255,255,255,0.5);
}
.view-toggle .btn.ghost:hover {
  color: #000;
  border-color: rgba(255,255,255,0.75);
}

.leave-scope-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.leave-scope-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #e2e8f0;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .18s ease;
}
.leave-scope-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}
.leave-scope-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-color: rgba(14,165,233,0.55);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}
.leave-scope-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(15,23,42,0.3);
  color: #fff;
}
.leave-scope-btn.active .leave-scope-count {
  background: rgba(255,255,255,0.24);
}

.planning-hero {
  background: linear-gradient(135deg, #061036, #150b24);
  color: #fff;
  box-shadow: 0 30px 60px rgba(1, 5, 34, 0.45);
}
.planning-hero .subtitle,
.planning-hero .muted {
  color: rgba(255,255,255,0.85) !important;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.week-cell {
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 22px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
}
.week-cell.day-off {
  border-color: rgba(255,111,139,0.45);
  box-shadow: 0 12px 35px rgba(255, 111, 139, 0.18);
}
.week-cell__header h4 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.05em;
}
.week-cell__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.week-entry {
  background: rgba(6, 12, 32, 0.5);
  border-radius: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.18);
}
.week-entry__title {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
}
.week-entry__meta {
  margin: 2px 0 0;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
}
.week-note {
  min-height: 52px;
  font-size: 12px;
  text-transform: none;
  background: rgba(255,255,255,0.92);
  color: #0f172a;
}

.list-panel {
  margin-top: 16px;
  background: rgba(8,8,18,0.8);
}
.week-table textarea {
  min-width: 200px;
  min-height: 48px;
}

/* SAV blocks: champs et boutons plus grands */
.sav-hero {
  margin-bottom: 18px;
}
.sav-hero .muted {
  max-width: 760px;
  margin-top: 6px;
}
.sav-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.sav-overview-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 18px 38px rgba(0,0,0,0.18);
}
.sav-overview-card__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.65);
  margin-bottom: 8px;
}
.sav-overview-card__value {
  display: block;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}
.sav-overview-card--status {
  grid-column: span 1;
}
.sav-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sav-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  font-weight: 700;
}
.sav-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.sav-section-head .title {
  font-size: 20px;
  margin-top: 2px;
}
.sav-ticket-form,
.sav-supplier-form {
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 16px;
}
.sav-add-ticket-btn {
  min-width: 220px;
}
.sav-toolbar {
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
}
.sav-table-shell {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.06);
}
.sav-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(58, 38, 46, 0.95);
}
.sav-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.01);
}
.sav-table tbody tr:hover td {
  background: rgba(255,255,255,0.035);
}
.sav-supplier-list {
  margin-top: 12px;
}
.sav-supplier-item {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
}
.sav-block .input,
.sav-block .select,
.sav-block .btn {
  min-height: 46px;
  font-size: 14px;
}
.sav-block .btn.small { min-height: 38px; padding: 8px 12px; }
.sav-block .space { gap: 6px; }
.sav-block .grid { row-gap: 10px; }
.sav-block table th,
.sav-block table td { font-size: 13px; }
.sav-block table { table-layout: auto; min-width: 1400px; }
.sav-block table td input,
.sav-block table td select {
  width: 100%;
  min-width: 0;
}
.sav-mobile-steps,
.sav-mobile-step-actions {
  display: none;
}

@media (max-width: 1200px) {
  .sav-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sav-overview {
    grid-template-columns: 1fr;
  }
  .sav-section-head {
    flex-direction: column;
  }
  .sav-ticket-form,
  .sav-supplier-form,
  .sav-toolbar {
    padding: 12px;
  }
  .sav-add-ticket-btn {
    min-width: 100%;
  }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  z-index: 50;
  overflow-y: auto;
}
.modal {
  width: min(1040px, 100%);
  margin: auto 0;
  max-height: none;
  overflow-y: visible;
  flex-shrink: 0;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-radius: 32px;
  padding: 28px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.2);
  color: #1b0d13;
}
.modal .section-header { margin-bottom: 16px; }
.modal .title,
.modal .subtitle,
.modal label {
  color: #1b0d13;
}
.modal .muted { color: rgba(27,13,19,0.6); }
body:not(.light-mode) .modal {
  background: linear-gradient(180deg, rgba(9, 15, 28, 0.98), rgba(31, 10, 18, 0.96));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  color: #f8fafc;
}
body:not(.light-mode) .modal .title,
body:not(.light-mode) .modal .subtitle,
body:not(.light-mode) .modal label,
body:not(.light-mode) .modal strong,
body:not(.light-mode) .modal small,
body:not(.light-mode) .modal .section-header,
body:not(.light-mode) .modal [style*="color:#222"],
body:not(.light-mode) .modal [style*="color: #222"],
body:not(.light-mode) .modal [style*="color:#333"],
body:not(.light-mode) .modal [style*="color: #333"] {
  color: #f8fafc !important;
}
body:not(.light-mode) .modal .muted,
body:not(.light-mode) .modal p.muted,
body:not(.light-mode) .modal .muted.small {
  color: rgba(226, 232, 240, 0.72) !important;
}
body:not(.light-mode) .dialog {
  background: linear-gradient(180deg, rgba(9, 15, 28, 0.98), rgba(31, 10, 18, 0.96));
  border-color: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}
body:not(.light-mode) .dialog .title,
body:not(.light-mode) .dialog .subtitle,
body:not(.light-mode) .dialog label,
body:not(.light-mode) .dialog strong,
body:not(.light-mode) .dialog h3,
body:not(.light-mode) .dialog [style*="color:#222"],
body:not(.light-mode) .dialog [style*="color: #222"],
body:not(.light-mode) .dialog [style*="color:#333"],
body:not(.light-mode) .dialog [style*="color: #333"],
body:not(.light-mode) .dialog [style*="color:#2b1a1d"],
body:not(.light-mode) .dialog [style*="color: #2b1a1d"] {
  color: #f8fafc !important;
}
body:not(.light-mode) .dialog .muted,
body:not(.light-mode) .dialog p,
body:not(.light-mode) .dialog small,
body:not(.light-mode) .dialog [style*="color:#6b5a5e"],
body:not(.light-mode) .dialog [style*="color: #6b5a5e"] {
  color: rgba(226, 232, 240, 0.72) !important;
}
body:not(.light-mode) .dialog .input,
body:not(.light-mode) .dialog .select,
body:not(.light-mode) .dialog input,
body:not(.light-mode) .dialog textarea {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
}
body:not(.light-mode) .dialog .input::placeholder,
body:not(.light-mode) .dialog textarea::placeholder {
  color: rgba(248, 250, 252, 0.4);
}
body:not(.light-mode) .dialog .select option {
  background: #111827;
  color: #f8fafc;
}
body:not(.light-mode) .dialog input:-webkit-autofill,
body:not(.light-mode) .dialog input:-webkit-autofill:hover,
body:not(.light-mode) .dialog input:-webkit-autofill:focus,
body:not(.light-mode) .dialog textarea:-webkit-autofill,
body:not(.light-mode) .dialog textarea:-webkit-autofill:hover,
body:not(.light-mode) .dialog textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
  box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.96) inset;
  transition: background-color 9999s ease-out 0s;
}
.modal-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.modal-columns {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  max-height: 320px;
  overflow: auto;
  padding-right: 6px;
}

.pill-btn {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--pill-bg);
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease, transform 0.1s ease;
  color: var(--pill-text);
}
.pill-btn span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  line-height: 1.25;
}
.pill-btn small {
  flex: 0 0 auto;
  margin-left: 12px;
  text-align: right;
  align-self: center;
}
.pill-btn:hover { border-color: var(--primary); background: var(--pill-bg-hover); transform: translateY(-1px); }
.pill-btn small { color: var(--muted); font-weight: 700; }
.brand-title { text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; color: var(--muted); margin-bottom: 8px; font-weight: 800; }
.scroll-y { max-height: 520px; overflow-y: auto; padding-right: 6px; }

.basket {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.basket-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #f1f5f9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.basket-item-main {
  min-width: 0;
  flex: 1 1 auto;
}
.basket-item-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.product-pick-btn {
  align-items: flex-start;
}
.product-pick-btn > span {
  min-width: 0;
  flex: 1 1 auto;
}
.product-pick-btn strong {
  display: inline-block;
  margin-bottom: 4px;
}
.product-pick-btn small {
  white-space: normal;
  line-height: 1.35;
}

.select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
  outline: none;
}
.select option {
  color: var(--select-option-text);
  background: var(--select-option-bg);
}
:root[data-env="dev"] .select option {
  color: var(--select-option-text);
  background: var(--select-option-bg);
}
.select:focus { border-color: var(--primary); }

.modal .section-header .btn {
  min-width: 120px;
}

/* Incentive modal custom look */
.incentive-modal {
  padding: 4px;
  border-radius: 40px;
  background: linear-gradient(135deg, #1fb5ff 0%, #3ce3c5 40%, #46fcb1 65%, #f7779a 100%);
  box-shadow: 0 40px 90px rgba(5, 8, 35, 0.55);
  border: none;
}
.incentive-modal .modal-content {
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.95), rgba(236, 244, 250, 0.96));
  border-radius: 34px;
  padding: 32px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 15px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.incentive-modal .modal-header h3 {
  color: #0b1221;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.incentive-modal label {
  color: #0b1221;
  font-weight: 700;
}
.incentive-modal .modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
}
.incentive-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.incentive-modal .close-modal {
  background: #0b1221;
  color: #fff;
  border: none;
  border-radius: 12px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(5, 8, 35, 0.35);
}
.incentive-modal .modal-body form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 22px;
  align-items: flex-start;
}
.incentive-modal .incentive-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 10px;
}
.incentive-modal .field-block label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.incentive-modal .field-block select,
.incentive-modal .field-block input {
  width: 100%;
}
.incentive-modal .incentive-panels {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.incentive-modal .panel {
  min-width: 0;
  background: rgba(255,255,255,0.9);
  border-radius: 26px;
  border: 1px solid rgba(15,23,42,0.08);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.incentive-modal .products-panel {
  grid-column: auto;
}
.incentive-modal .panel-title {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15,23,42,0.8);
  font-weight: 900;
}
.incentive-modal .extra-row {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  align-items: center;
  gap: 12px 20px;
  background: rgba(14,165,233,0.08);
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(14,165,233,0.2);
}
.incentive-modal .extra-input {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: none;
  min-width: 0;
}
.incentive-modal .extra-input span {
  font-size: 15px;
  line-height: 1.18;
}
.incentive-modal .extra-input .input {
  width: 120px;
}
.incentive-modal .modal-body form label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.incentive-modal .modal-body form input,
.incentive-modal .modal-body form select {
  width: 100%;
  border-radius: 16px;
  border: 2px solid rgba(148, 163, 184, 0.3);
  padding: 14px 16px;
  background: rgba(248, 250, 252, 0.98);
  font-weight: 800;
  color: #0b1221;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.incentive-modal .modal-body form input:focus,
.incentive-modal .modal-body form select:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.2);
  background: #fff;
}
.incentive-modal .modal-footer .btn {
  min-width: 140px;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.incentive-modal .modal-footer .btn.secondary {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.16);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.incentive-modal .modal-footer .btn.secondary:hover {
  background: #f8fafc;
  border-color: rgba(14, 165, 233, 0.45);
}
.incentive-modal #shops-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.incentive-modal #shops-wrapper label {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 14px !important;
  width: 100%;
  min-height: 0;
  border-radius: 20px !important;
  border: 1px solid rgba(15,23,42,0.08) !important;
  background: rgba(248,250,252,0.95) !important;
  padding: 14px 16px !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.incentive-modal #shops-wrapper label span {
  display: block;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
  font-size: 15px;
}
.incentive-modal #shops-wrapper input[type="checkbox"] {
  accent-color: #0ea5ff;
}
.incentive-modal #products-wrapper {
  background: rgba(248,250,252,0.9) !important;
  border-radius: 22px !important;
  border: 1px solid rgba(148,163,184,0.3) !important;
  padding: 12px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.incentive-modal #products-wrapper.chip-grid {
  display: block;
  gap: 12px;
}
.incentive-modal #products-wrapper .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 0;
  padding: 6px 12px;
  border-radius: 10px;
  justify-content: initial;
  flex-wrap: nowrap;
  margin: 3px;
  cursor: pointer;
}
.incentive-modal #products-wrapper .chip span {
  display: inline;
  min-width: 0;
  white-space: nowrap;
  overflow-wrap: normal;
  line-height: 1.3;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.incentive-modal #products-wrapper .input {
  background: #fff;
  border: 1px solid rgba(148,163,184,0.3);
  border-radius: 14px;
  font-weight: 700;
}
.incentive-modal #products-wrapper input[type="checkbox"] {
  accent-color: #f97316;
}
.incentive-modal .muted {
  color: rgba(15, 23, 42, 0.6);
}
body:not(.light-mode) .incentive-modal {
  background: linear-gradient(135deg, rgba(180,30,50,0.9) 0%, rgba(120,15,30,0.85) 40%, rgba(80,10,20,0.9) 70%, rgba(50,8,16,0.95) 100%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
}
body:not(.light-mode) .incentive-modal .modal-content {
  background: linear-gradient(180deg, rgba(50,12,18,0.98), rgba(35,8,14,0.97));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 20px 50px rgba(0, 0, 0, 0.3);
}
body:not(.light-mode) .incentive-modal .modal-header h3,
body:not(.light-mode) .incentive-modal label,
body:not(.light-mode) .incentive-modal .panel-title,
body:not(.light-mode) .incentive-modal .extra-input,
body:not(.light-mode) .incentive-modal .extra-input span {
  color: #f8fafc;
}
body:not(.light-mode) .incentive-modal .muted,
body:not(.light-mode) .incentive-modal .muted.small,
body:not(.light-mode) .incentive-modal .panel .muted {
  color: rgba(226, 232, 240, 0.72) !important;
}
body:not(.light-mode) .incentive-modal .field-block input,
body:not(.light-mode) .incentive-modal .field-block select,
body:not(.light-mode) .incentive-modal .modal-body form input,
body:not(.light-mode) .incentive-modal .modal-body form select {
  background: rgba(30, 8, 12, 0.94);
  border-color: rgba(255, 200, 210, 0.2);
  color: #f8fafc;
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
}
body:not(.light-mode) .incentive-modal .modal-body form input::placeholder {
  color: rgba(248, 250, 252, 0.42);
}
body:not(.light-mode) .incentive-modal .modal-body form input:focus,
body:not(.light-mode) .incentive-modal .modal-body form select:focus {
  border-color: rgba(255, 80, 100, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 80, 100, 0.15);
  background: rgba(30, 8, 12, 0.98);
}
body:not(.light-mode) .incentive-modal .panel {
  background: rgba(40, 10, 16, 0.7);
  border-color: rgba(255, 200, 210, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
body:not(.light-mode) .incentive-modal .extra-row {
  background: rgba(180, 30, 50, 0.15);
  border-color: rgba(255, 80, 100, 0.2);
}
body:not(.light-mode) .incentive-modal #shops-wrapper label,
body:not(.light-mode) .incentive-modal .chip {
  background: rgba(30, 8, 12, 0.8) !important;
  border-color: rgba(255, 200, 210, 0.15) !important;
  color: #f8fafc !important;
}
body:not(.light-mode) .incentive-modal .chip.selected {
  background: rgba(180, 30, 50, 0.25) !important;
  border-color: rgba(255, 80, 100, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(255, 80, 100, 0.2) inset;
}
body:not(.light-mode) .incentive-modal #products-wrapper {
  background: rgba(20, 5, 8, 0.6) !important;
  border-color: rgba(255, 200, 210, 0.15) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
body:not(.light-mode) .incentive-modal .close-modal {
  background: rgba(30, 8, 12, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
body:not(.light-mode) .incentive-modal .modal-footer .btn.secondary {
  background: rgba(30, 8, 12, 0.94);
  border-color: rgba(255, 200, 210, 0.18);
  color: #f8fafc;
}

.incentive-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.incentive-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(120deg, rgba(24,144,255,0.18), rgba(56,189,248,0.25));
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 20px 60px rgba(15,23,42,0.15);
}

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

.incentive-card {
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.98), rgba(240,245,255,0.92));
  border-radius: 26px;
  padding: 22px;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 25px 60px rgba(15,23,42,0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.incentive-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill-brand {
  background: rgba(14,165,233,0.12);
  color: #0ea5ff;
}

.pill-progress {
  background: rgba(236,72,153,0.15);
  color: #ec4899;
}

.incentive-card__reward {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.reward-amount {
  font-size: 32px;
  font-weight: 800;
  color: #0b1221;
}

.reward-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(15,23,42,0.6);
  font-size: 12px;
}

.incentive-card__progress .progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
  overflow: hidden;
}

.incentive-card__progress .progress.neon .progress-bar {
  background: linear-gradient(90deg, #0ea5ff, #22d3ee, #f472b6);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15,23,42,0.55);
}

.incentive-card__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  background: rgba(248,250,252,0.9);
  border-radius: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(15,23,42,0.05);
}

.metric span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15,23,42,0.5);
}

.metric strong {
  display: block;
  font-size: 20px;
  margin-top: 6px;
  color: #0f172a;
}

.incentive-card__actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.incentive-card__actions .btn {
  flex: 1;
  min-width: 120px;
  border-radius: 14px;
  font-weight: 700;
}

.muted.small {
  font-size: 12px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.1);
  background: rgba(255,255,255,0.8);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.04em;
  max-width: 100%;
}

.chip input {
  accent-color: #0ea5ff;
}

.chip.selected {
  border-color: rgba(14,165,233,0.8);
  background: rgba(14,165,233,0.15);
  color: #0f172a;
}

/* Incentive action buttons */
.btn-incentive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  color: #e2f3ff;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.btn-incentive svg { stroke: currentColor; }
.btn-incentive:hover {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,0.8);
  background: linear-gradient(135deg, rgba(14,165,233,0.15), rgba(255,255,255,0.06));
}
.btn-incentive:active {
  transform: translateY(0);
}
.btn-incentive.btn-edit {
  color: #38bdf8;
  border-color: rgba(14,165,233,0.45);
}
.btn-incentive.btn-delete {
  color: #f87171;
  border-color: rgba(248,113,113,0.45);
}
.btn-incentive.btn-edit:hover {
  background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(14,165,233,0.08));
}
.btn-incentive.btn-delete:hover {
  background: linear-gradient(135deg, rgba(248,113,113,0.22), rgba(248,113,113,0.1));
}

.incentive-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.incentive-tabbar {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.incentive-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
}

.incentive-archive-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.incentive-archive-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.incentive-archive-card {
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
}

.incentive-archive-card summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(14,165,233,0.1), rgba(56,189,248,0.04));
}

.incentive-archive-card summary::-webkit-details-marker {
  display: none;
}

.incentive-archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.incentive-archive-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.incentive-archive-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 22px 22px;
}

.incentive-archive-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.incentive-archive-vendors {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.incentive-vendor-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(248,250,252,0.92);
  border: 1px solid rgba(15,23,42,0.06);
  min-width: 150px;
}

.incentive-vendor-pill span {
  font-size: 12px;
  color: rgba(15,23,42,0.65);
}

.incentive-archive-actions {
  display: flex;
  justify-content: flex-end;
}

.incentive-archive-table td div + div {
  margin-top: 4px;
}

/* Encodage modal (clair gris/blanc) */
.encodage-modal {
  background: linear-gradient(145deg, #f8f9fb 0%, #f3f4f7 50%, #edefef 100%);
  border-radius: 32px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.18);
  padding: 22px;
}
.encodage-modal .section-header {
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.encodage-modal .title,
.encodage-modal .subtitle {
  color: #2b1a1d;
}
.encodage-modal .subtitle { opacity: 0.7; }
.encodage-modal .section-header .btn.small {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.encodage-modal .btn.primary.small { box-shadow: 0 8px 24px rgba(214, 60, 60, 0.2); }
.encodage-modal .btn.ghost.small {
  background: rgba(0, 0, 0, 0.03);
  color: #2b1a1d;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.encodage-modal .modal-grid {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.encodage-modal .space { color: #3a2a2e; }
.encodage-modal .input,
.encodage-modal .select {
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #2b1a1d;
}
.encodage-modal .select option {
  color: #1f1f1f;
  background: #ffffff;
}
.encodage-modal .input:focus,
.encodage-modal .select:focus {
  border-color: #d63c3c;
  box-shadow: 0 0 0 3px rgba(214, 60, 60, 0.18);
  background: #ffffff;
}
.encodage-modal #basket-panel,
.encodage-modal #products-panel {
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  padding: 12px;
}
.encodage-modal-shell {
  width: min(1680px, 98vw);
}
.encodage-modal .encodage-layout {
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1fr) minmax(480px, 1.6fr);
  gap: 20px;
}
.encodage-modal #sale-details-panel {
  min-width: 0;
}

/* Panier panel */
.encodage-modal #basket-panel {
  border-right: none;
  padding-right: 0;
}
.encodage-modal #basket-panel > .subtitle {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.encodage-modal #basket,
.encodage-modal #products-list {
  max-height: none;
}
.encodage-modal #basket:empty::before {
  content: "Selectionne des produits pour les ajouter au panier";
  display: block;
  text-align: center;
  padding: 28px 16px;
  font-size: 13px;
  opacity: 0.5;
  font-style: italic;
}
.encodage-modal #basket-summary { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.05); }
.encodage-modal .encodage-summary-list {
  max-height: 360px;
}

/* Labels - meilleur contraste */
.encodage-modal .subtitle,
.encodage-modal label.subtitle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* Inputs - spacing ameliore */
.encodage-modal #sale-details-panel > div {
  margin-bottom: 4px;
}

/* List items */
.modal.encodage-modal .list-item,
.encodage-modal #basket-summary .list-item,
.encodage-modal .list-item {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #2b1a1d !important;
}
.modal.encodage-modal .list-item strong,
.encodage-modal .list-item strong { color: #2b1a1d !important; }
.modal.encodage-modal .list-item small,
.encodage-modal .list-item small { color: #6b5a5e !important; }
.modal.encodage-modal .list-item div,
.encodage-modal .list-item div { color: #2b1a1d !important; }

/* Basket items - design ameliore */
.encodage-modal .basket-item {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #2b1a1d;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 16px;
  padding: 12px 14px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.encodage-modal .basket-item:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.encodage-modal .basket-item .badge {
  font-size: 12px;
  font-weight: 800;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.encodage-modal .basket-item [data-remove] {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}
.encodage-modal .basket-item [data-remove]:hover {
  background: #fef2f2;
  color: #b91c1c;
}

/* Produits panel */
.encodage-modal #products-panel {
  border-left: none;
  padding-left: 0;
}

/* Pill buttons - design ameliore */
.encodage-modal .pill-btn {
  background: #f7f8fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #2b1a1d;
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.encodage-modal .pill-btn:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.encodage-modal .pill-btn input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex-shrink: 0;
  accent-color: #2563eb;
}
.encodage-modal .pill-btn small {
  color: #dc2626;
  font-weight: 800;
  font-size: 13px;
  background: rgba(220, 38, 38, 0.08);
  padding: 3px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

/* Product wrap (pill + remove button) */
.pill-product-wrap {
  display: flex;
  align-items: stretch;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.1s;
}
.pill-product-wrap:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}
.pill-product-wrap .pill-btn {
  border-radius: 14px;
  flex: 1;
  min-width: 0;
}
.pill-product-wrap.is-selected .pill-btn {
  border-radius: 14px 0 0 14px;
}

/* Pill inner layout */
.pill-btn__left {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.pill-btn__left input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  margin-top: 2px;
  pointer-events: none;
  accent-color: #2563eb;
  flex-shrink: 0;
}
.pill-btn__price {
  font-weight: 800 !important;
  font-size: 13px !important;
  padding: 4px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

/* Pill selected state */
.pill-product-wrap.is-selected {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(59, 130, 246, 0.15);
}
.encodage-modal .pill-btn.is-selected {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: #3b82f6 !important;
}

/* Brand category titles */
.encodage-modal .brand-title {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 8px 0 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 8px;
}

/* Pill remove button (X cross) */
.pill-btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex-shrink: 0;
  border: none;
  border-left: 1px solid rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.12);
  color: #f87171;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  border-radius: 0 14px 14px 0;
  transition: background 0.15s, color 0.15s;
}
.pill-btn-remove:hover {
  background: rgba(220, 38, 38, 0.25);
  color: #fecaca;
}

/* Product search input */
.encodage-product-search {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(15, 23, 42, 0.7) !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc;
  font-size: 13px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.encodage-product-search::placeholder { color: rgba(248, 250, 252, 0.4); }
.encodage-product-search:focus {
  outline: none;
  border-color: #3b82f6;
}
.encodage-product-search-wrap {
  position: relative;
}
.encodage-product-search-wrap::before {
  content: "\1F50D";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
  opacity: 0.5;
}

/* Floating product counter */
.encodage-floating-counter {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0 0 16px 16px;
  margin: 10px -12px -12px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  z-index: 5;
}
.encodage-floating-counter[hidden] { display: none; }
.encodage-floating-counter__total {
  font-size: 16px;
  font-weight: 800;
  color: #4ade80;
}

/* Light mode overrides */
body.light-mode .encodage-product-search {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #1e293b;
}
body.light-mode .encodage-product-search::placeholder { color: #94a3b8; }
body.light-mode .encodage-floating-counter {
  background: rgba(255, 255, 255, 0.95);
  border-top-color: #e2e8f0;
  color: #1e293b;
}
body.light-mode .encodage-floating-counter__total { color: #16a34a; }
body.light-mode .encodage-modal .pill-btn.is-selected {
  background: rgba(37, 99, 235, 0.06);
  border-color: #3b82f6;
}

@media (max-width: 1280px) {
  .encodage-modal-shell {
    width: min(1280px, 98vw);
  }
  .encodage-modal .encodage-layout {
    grid-template-columns: 1fr;
  }
}

body:not(.light-mode) .encodage-modal .modal-grid {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(20, 12, 24, 0.96));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
body:not(.light-mode) .encodage-modal .space,
body:not(.light-mode) .encodage-modal .title,
body:not(.light-mode) .encodage-modal .subtitle,
body:not(.light-mode) .encodage-modal label,
body:not(.light-mode) .encodage-modal .muted {
  color: #f8fafc !important;
}
body:not(.light-mode) .encodage-modal .muted {
  color: rgba(248, 250, 252, 0.72) !important;
}
body:not(.light-mode) .encodage-modal .input,
body:not(.light-mode) .encodage-modal .select {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
}
body:not(.light-mode) .encodage-modal input,
body:not(.light-mode) .encodage-modal textarea {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
}
body:not(.light-mode) .encodage-modal .input::placeholder {
  color: rgba(248, 250, 252, 0.4);
}
body:not(.light-mode) .encodage-modal input:-webkit-autofill,
body:not(.light-mode) .encodage-modal input:-webkit-autofill:hover,
body:not(.light-mode) .encodage-modal input:-webkit-autofill:focus,
body:not(.light-mode) .encodage-modal textarea:-webkit-autofill,
body:not(.light-mode) .encodage-modal textarea:-webkit-autofill:hover,
body:not(.light-mode) .encodage-modal textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
  box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.96) inset;
  transition: background-color 9999s ease-out 0s;
}
body:not(.light-mode) .encodage-modal .select option {
  background: #111827;
  color: #f8fafc;
}
body:not(.light-mode) .encodage-modal .input:focus,
body:not(.light-mode) .encodage-modal .select:focus {
  background: rgba(17, 24, 39, 1);
}
body:not(.light-mode) .encodage-modal #basket-panel,
body:not(.light-mode) .encodage-modal #products-panel,
body:not(.light-mode) .encodage-modal #basket-summary {
  background: rgba(15, 23, 42, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.08);
}
body:not(.light-mode) .modal.encodage-modal .list-item,
body:not(.light-mode) .encodage-modal #basket-summary .list-item,
body:not(.light-mode) .encodage-modal .list-item,
body:not(.light-mode) .encodage-modal .basket-item {
  background: rgba(17, 24, 39, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}
body:not(.light-mode) .modal.encodage-modal .list-item strong,
body:not(.light-mode) .encodage-modal .list-item strong,
body:not(.light-mode) .modal.encodage-modal .list-item div,
body:not(.light-mode) .encodage-modal .list-item div {
  color: #f8fafc !important;
}
body:not(.light-mode) .modal.encodage-modal .list-item small,
body:not(.light-mode) .encodage-modal .list-item small {
  color: rgba(248, 250, 252, 0.68) !important;
}
body:not(.light-mode) .encodage-modal .pill-btn {
  background: rgba(148, 210, 255, 0.08);
  border-color: rgba(100, 160, 220, 0.25);
  color: #f8fafc;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  min-height: 0;
}
body:not(.light-mode) .encodage-modal .pill-btn:hover {
  background: rgba(148, 210, 255, 0.16);
  border-color: rgba(100, 180, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
body:not(.light-mode) .encodage-modal .pill-btn input[type="checkbox"] {
  accent-color: #3b82f6;
}
body:not(.light-mode) .encodage-modal .pill-btn small {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.15);
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}
body:not(.light-mode) .encodage-modal .brand-title {
  color: rgba(255, 183, 201, 0.8);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
body:not(.light-mode) .encodage-modal .pill-btn.is-selected {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: rgba(96, 165, 250, 0.6) !important;
}
body:not(.light-mode) .pill-product-wrap.is-selected {
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.4), 0 2px 10px rgba(59, 130, 246, 0.2);
}
body:not(.light-mode) .pill-btn__price {
  color: #fca5a5 !important;
  background: rgba(220, 38, 38, 0.15);
}
body:not(.light-mode) .encodage-modal #basket:empty::before {
  color: rgba(248, 250, 252, 0.4);
}
body:not(.light-mode) .encodage-modal .basket-item .badge {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.25);
}
body:not(.light-mode) .encodage-modal .basket-item [data-remove] {
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.2);
}
body:not(.light-mode) .encodage-modal .basket-item [data-remove]:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #fecaca;
}
body:not(.light-mode) .encodage-modal .basket-item:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
body:not(.light-mode) .encodage-modal .btn.ghost.small {
  background: rgba(248, 250, 252, 0.08);
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

/* Progress bar */
.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 6px;
}
body:not(.light-mode) .progress {
  background: rgba(255, 255, 255, 0.1);
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--btn-grad-1, #0ea5e9), var(--btn-grad-2, #10b981));
  width: 0;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.3);
}

.progress.progress-neutral .progress-bar {
  background: linear-gradient(90deg, #f97316, #fb7185);
  opacity: 0.7;
}

/* Dialog mini-modal */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
.dialog {
  width: min(420px, 90%);
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(15,23,42,0.2);
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #1e293b;
  /* Force light field colors — dialog is always white */
  --field-bg: #ffffff;
  --field-bg-focus: #ffffff;
  --field-border: #e2e8f0;
  --field-text: #1e293b;
  --field-placeholder: #94a3b8;
  --ghost-bg: #ffffff;
  --ghost-text: #334155;
  --ghost-border: #e2e8f0;
  --muted: #64748b;
  --text: #1e293b;
}
.dialog h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; color: #0f172a; }
.dialog p { margin: 0; color: #64748b; font-weight: 700; font-size: 13px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }
.schedule-violations-dialog {
  width: min(760px, 94%);
  max-height: 80vh;
}
.schedule-violations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}
.schedule-violation-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%);
}
.schedule-violation-item strong {
  display: block;
  margin-bottom: 6px;
  color: #7f1d1d;
}
body:not(.light-mode) .schedule-violation-item strong {
  color: #ffd6de !important;
}
.schedule-violation-line {
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
}
.schedule-violation-label {
  font-weight: 800;
  color: #0f172a;
}
body:not(.light-mode) .schedule-violation-item {
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.06));
}
body:not(.light-mode) .schedule-violation-line {
  color: rgba(226, 232, 240, 0.88);
}
body:not(.light-mode) .schedule-violation-label {
  color: #ffffff;
}
body:not(.light-mode) .schedule-violation-move {
  border-top-color: rgba(255, 255, 255, 0.08);
}
.schedule-violation-move {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.schedule-violation-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.schedule-violation-controls .select {
  min-width: 220px;
  flex: 1 1 220px;
}

/* Helpers */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.flex { display: flex; gap: 12px; align-items: center; }
.space { margin-top: 18px; }

/* Responsive: tablets */
@media (max-width: 1200px) {
  .app-shell { padding: 20px 18px 40px; }
}

@media (max-width: 1024px) {
  .app-shell { padding: 24px calc(18px + var(--safe-right)) calc(48px + var(--safe-bottom)) calc(18px + var(--safe-left)); }
  .topbar { padding: calc(18px + var(--safe-top)) calc(24px + var(--safe-right)) 18px calc(24px + var(--safe-left)); }
  .logo span { font-size: 20px; }
  .logo-img { height: 42px; }
  .nav { gap: 20px; }
  .nav-link { font-size: 18px; letter-spacing: 0.1em; }
  .table th, .table td { padding: 10px 8px; font-size: 13px; }
  .badge { font-size: 12px; padding: 5px 8px; }
  .card { padding: 16px; border-radius: 20px; }
  .profile-shell { padding: 18px; }
  .profile-hero { grid-template-columns: 1fr; }
  .profile-hero--owner { padding: 18px; }
  .profile-avatar-frame { width: 88px; height: 88px; flex-basis: 88px; }
  .profile-stat-card__value { font-size: 34px; }
  .title { font-size: 22px; }
  .subtitle { font-size: 12px; }
  .kpi .big { font-size: 38px; }
  .dashboard-kpi-row { grid-template-columns: 1fr 1fr; }
  .dash-incentive-panel { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
  .nav-link { font-size: 11px; letter-spacing: 0.06em; gap: 16px; }
  .nav { gap: 12px; }
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
  }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .planif-main > div:first-child {
    align-items: flex-start !important;
  }
  .planif-sidebar {
    padding: 14px;
  }
}

/* Responsive: tablette + mobile — menu hamburger */
@media (max-width: 1024px) {
  .topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: calc(10px + var(--safe-top)) calc(12px + var(--safe-right)) 10px calc(12px + var(--safe-left));
  }
  .nav-menu-toggle {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
  }
  .nav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 45;
    width: min(82vw, 320px);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: calc(78px + var(--safe-top)) 14px calc(18px + var(--safe-bottom)) calc(14px + var(--safe-left));
    background: color-mix(in srgb, var(--topbar-bg) 92%, black 8%);
    border-right: 1px solid var(--topbar-border);
    box-shadow: 16px 0 36px rgba(0, 0, 0, 0.34);
    overflow-y: auto;
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .topbar.is-nav-open .nav {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .topbar.is-nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(7, 10, 20, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .nav-link {
    font-size: 12px;
    letter-spacing: 0.08em;
    padding: 12px 10px;
    width: 100%;
    border-bottom-width: 0;
    border-left: 3px solid transparent;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
  }
  .nav-link:hover {
    border-color: transparent;
    border-left-color: var(--primary);
    background: rgba(255,255,255,0.08);
  }
  .logo-grid { width: 36px; height: 36px; }
  .logo span { font-size: 14px; }
  .logo-img { height: 32px; }
  .topbar-actions { width: auto; gap: 8px; justify-content: flex-end; margin-left: auto; }
  .profile-trigger { width: 34px; height: 34px; }
  .app-shell { padding: 12px calc(8px + var(--safe-right)) calc(30px + var(--safe-bottom)) calc(8px + var(--safe-left)); }
  .card { padding: 12px 10px; border-radius: 14px; }
  .title { font-size: 17px; }
  .subtitle { font-size: 11px; }
  .table th, .table td { padding: 7px 5px; font-size: 11px; }
  .badge { font-size: 10px; padding: 4px 6px; }
  .btn.small { padding: 7px 8px; font-size: 11px; }
  .profile-hero__main { align-items: flex-start; }
  .profile-identity-list { padding: 14px; border-radius: 18px; }
  .profile-chip-row,
  .profile-inline-actions { gap: 8px; }
  .input,
  .select,
  input,
  select,
  textarea {
    padding: 12px 12px;
    font-size: 16px;
    border-radius: 12px;
  }
  button,
  .btn {
    min-height: 44px;
  }
  .modal { padding: 16px; border-radius: 20px; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-columns { grid-template-columns: 1fr; max-height: 250px; }
  body:not(.light-mode) .encodage-modal .pill-btn {
    padding: 7px 9px;
    gap: 6px;
  }
  body:not(.light-mode) .encodage-modal .pill-btn span {
    line-height: 1.15;
  }
  body:not(.light-mode) .encodage-modal .pill-btn small {
    margin-left: 6px;
    font-size: 11px;
  }
  .kpi .big { font-size: 28px; }
  .dash-welcome { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dash-welcome__stats { width: 100%; justify-content: space-between; }
  .dash-welcome__stat { text-align: left; }
  .dash-welcome__amount { font-size: 16px; }
  .dashboard-kpi-row { grid-template-columns: 1fr; }
  .dash-incentive-panel { grid-column: auto; }
  .dash-incentive-row__name { max-width: none; }
  .cookie-consent__inner { flex-direction: column; align-items: stretch; }
  .cookie-consent__text { min-width: 0; }
  .cookie-consent__actions { justify-content: stretch; }
  .cookie-consent__btn { flex: 1; text-align: center; }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .incentive-grid { grid-template-columns: 1fr; }
  .incentive-toolbar,
  .incentive-archive-head,
  .incentive-archive-actions { justify-content: flex-start; }
  .incentive-archive-summary { grid-template-columns: 1fr 1fr; }
  .week-grid { grid-template-columns: 1fr 1fr; }
  .list-item { padding: 10px 10px; border-radius: 12px; flex-wrap: wrap; gap: 6px; }
  .planif-main { padding: 10px !important; }
  .planif-main > div:first-child,
  .planif-main > div:first-child > div:last-child,
  #sched-palette { width: 100%; }
  .planif-main > div:first-child > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px !important;
  }
  .planif-main .btn.small {
    min-height: 38px;
    flex: 1 1 140px;
  }
  #planning-grid-wrapper {
    max-height: 58vh;
    border-radius: 12px;
  }
  .shop-overview-scroll {
    max-height: 46vh;
    border-radius: 12px;
  }
  .vendor-legend-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }
  .mobile-horaire-weeks {
    display: grid;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 14px;
  }
  .planif-main--seller .planning-scroll,
  .planif-main--seller .sched-hover-indicator {
    display: none;
  }
  .sav-mobile-steps,
  .sav-mobile-step-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
  .sav-mobile-step-actions {
    justify-content: space-between;
    margin-top: 8px;
  }
  .sav-ticket-form {
    display: grid;
    grid-template-columns: 1fr !important;
  }
  .sav-ticket-form .sav-step-block {
    display: none;
  }
  .sav-ticket-form .sav-step-block.is-active {
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }
  .logo {
    min-width: 0;
  }
  .logo span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }
  .nav-menu-toggle {
    justify-self: end;
  }
  .nav {
    width: min(88vw, 300px);
    padding-right: 12px;
  }
}

.scroll-x,
.planning-scroll,
.shop-overview-scroll,
.sav-table-shell {
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
  .nav-link {
    font-size: 8px;
    letter-spacing: 0.06em;
  }
  .planif-main .btn.small {
    flex-basis: 100%;
  }
}

/* Scrollable tables */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: auto; scrollbar-color: color-mix(in srgb, var(--primary) 70%, white 30%) rgba(255,255,255,0.08); padding-bottom: 8px; }
.scroll-x table { min-width: 600px; }
.scroll-x::-webkit-scrollbar,
.scroll-y::-webkit-scrollbar,
.sav-table-shell::-webkit-scrollbar,
.commission-summary-scroll::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}
.scroll-x::-webkit-scrollbar-track,
.scroll-y::-webkit-scrollbar-track,
.sav-table-shell::-webkit-scrollbar-track,
.commission-summary-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}
.scroll-x::-webkit-scrollbar-thumb,
.scroll-y::-webkit-scrollbar-thumb,
.sav-table-shell::-webkit-scrollbar-thumb,
.commission-summary-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 82%, white 18%), color-mix(in srgb, var(--primary-2) 82%, white 18%));
  border-radius: 999px;
  border: 2px solid rgba(15,23,42,0.28);
}

/* Compact commission table */
.table-compact th, .table-compact td { padding: 6px 5px; font-size: 11px; white-space: nowrap; }
.table-compact .badge { font-size: 10px; padding: 3px 6px; }
.commission-summary-scroll { overflow-x: auto; overflow-y: visible; border: 1px solid rgba(255,255,255,0.08); border-radius: 18px; background: rgba(15,23,42,0.18); }
.commission-summary-table { min-width: 1400px; }
.commission-summary-table th,
.commission-summary-table td { white-space: nowrap; }
.commission-summary-table th:nth-child(1),
.commission-summary-table td:nth-child(1) { min-width: 170px; width: 170px; }
.commission-summary-table th:nth-child(2),
.commission-summary-table td:nth-child(2) { min-width: 90px; width: 90px; }
.commission-summary-table th:nth-child(3),
.commission-summary-table td:nth-child(3) { min-width: 100px; width: 100px; }
.commission-summary-table th:nth-child(1),
.commission-summary-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--card);
}
.commission-summary-table th:nth-child(2),
.commission-summary-table td:nth-child(2) {
  position: sticky;
  left: 170px;
  z-index: 3;
  background: var(--card);
}
.commission-summary-table th:nth-child(3),
.commission-summary-table td:nth-child(3) {
  position: sticky;
  left: 260px;
  z-index: 3;
  background: var(--card);
}
.commission-summary-table thead th:nth-child(1),
.commission-summary-table thead th:nth-child(2),
.commission-summary-table thead th:nth-child(3) {
  z-index: 4;
}


body.light-mode .commission-summary-scroll {
  border-color: #dbe4ee !important;
  background: #ffffff !important;
}
body.light-mode .commission-summary-table th:nth-child(1),
body.light-mode .commission-summary-table td:nth-child(1),
body.light-mode .commission-summary-table th:nth-child(2),
body.light-mode .commission-summary-table td:nth-child(2),
body.light-mode .commission-summary-table th:nth-child(3),
body.light-mode .commission-summary-table td:nth-child(3) {
  background: #ffffff !important;
  color: #1e293b !important;
}
body.light-mode .commission-summary-table tbody tr:nth-child(even) td:nth-child(-n+3) {
  background: #f8fafc !important;
}
body.light-mode .commission-summary-table tbody tr:hover td:nth-child(-n+3) {
  background: #f1f5f9 !important;
}
body.light-mode .commission-summary-table td:nth-child(1) strong,
body.light-mode .commission-summary-table td:nth-child(2) .badge,
body.light-mode .commission-summary-table td:nth-child(3) .badge {
  color: #1e293b !important;
}

/* Planning table (Excel-like) */
.planification-layout {
  display: grid;
  grid-template-columns: minmax(0, 3.3fr) minmax(280px, 0.55fr);
  gap: 22px;
  align-items: flex-start;
}
.planification-layout--pascal {
  grid-template-columns: minmax(0, 4.3fr) minmax(360px, 0.9fr);
  gap: 26px;
}
.planif-main { min-width: 0; }
.planif-main--pascal {
  padding: 16px !important;
}
.pascal-rdv-accordion {
  padding: 0 !important;
  overflow: hidden;
}
.pascal-rdv-accordion__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}
.pascal-rdv-accordion__summary::-webkit-details-marker {
  display: none;
}
.pascal-rdv-accordion__summary::after {
  content: '\25BE';
  margin-left: auto;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.2s ease;
}
.pascal-rdv-accordion:not([open]) .pascal-rdv-accordion__summary::after {
  transform: rotate(-90deg);
}
.pascal-rdv-accordion__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px;
}
.pascal-rdv-accordion__body {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0 16px 14px;
}
.pascal-suggestions-panel {
  padding: 14px 16px !important;
}
.pascal-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pascal-suggestions-section {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
}
.pascal-suggestions-section h5 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
}
.mobile-horaire-weeks {
  display: none;
}
.mobile-week-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(12, 9, 22, 0.55);
  padding: 14px;
  display: grid;
  gap: 12px;
}
.mobile-week-card__head h4 {
  margin: 4px 0 0;
  font-size: 16px;
}
.mobile-week-card__rows {
  display: grid;
  gap: 10px;
}
.mobile-week-row {
  display: grid;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mobile-week-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.mobile-week-row.is-weekend .mobile-week-row__date {
  color: #fda4af;
}
.mobile-week-row__date {
  font-weight: 800;
  font-size: 13px;
}
.mobile-week-row__main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.mobile-week-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-weight: 800;
  font-size: 12px;
}
.mobile-week-meta {
  color: rgba(255,255,255,0.72);
  font-size: 12px;
}
.planif-sidebar {
  position: sticky;
  top: 82px;
  align-self: flex-start;
  background: rgba(15,15,25,0.9);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 20px 45px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.05);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  width: min(100%, 320px);
}
.planif-sidebar--pascal {
  width: min(100%, 390px);
  padding: 20px;
}
.planif-sidebar h4 { margin: 0 0 12px; font-size: 16px; letter-spacing: 0.05em; text-transform: uppercase; }
.planif-sidebar h5 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.7); }
.planif-sidebar .sidebar-section { margin-bottom: 18px; }
.planif-sidebar--pascal .sidebar-section {
  margin-bottom: 20px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
}
.vendor-stat-list { display: flex; flex-direction: column; gap: 10px; }
.vendor-stat-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); border-radius: 14px; padding: 10px 12px; }
.planif-sidebar--pascal .vendor-stat-card {
  padding: 12px 14px;
}
.vendor-stat-card__header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; font-size: 13px; flex-wrap: wrap; }
.vendor-stat-card__header strong { min-width: 0; overflow-wrap: anywhere; }
.vendor-stat-card__header span { text-align: right; margin-left: auto; }
.vendor-stat-card__grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; font-size: 11px; color: rgba(255,255,255,0.7); }
.vendor-stat-card__grid span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pending-list { display: flex; flex-direction: column; gap: 10px; }
.pending-item { border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 12px; background: rgba(255,255,255,0.02); align-items: flex-start; flex-wrap: wrap; }
.planif-sidebar--pascal .pending-item {
  padding: 12px 14px;
  border-radius: 16px;
}
.pending-item__content { min-width: 0; flex: 1 1 170px; }
.pending-item strong { display: block; margin-bottom: 4px; }
.pending-item .muted.small { overflow-wrap: anywhere; }
.pending-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex: 0 1 180px; }
.pending-actions .btn { min-width: 84px; }

@media (max-width: 340px) {
  .vendor-stat-card__grid { grid-template-columns: 1fr; }
  .pending-actions { flex-direction: column; align-items: stretch; }
  .pending-actions .btn { width: 100%; }
}

@media (max-width: 980px) {
  .pascal-suggestions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1400px) {
  .planification-layout { grid-template-columns: 1fr; }
  .planif-sidebar { position: static; max-height: none; }
  .planning-scroll { overflow-x: auto; }
}

@media (max-width: 640px) {
  .planning-table {
    min-width: 440px;
  }
  .pday-cell {
    width: 142px;
    min-width: 142px;
  }
  .pday-label strong {
    font-size: 11px;
  }
  .pvendor-head,
  .pvendor-col {
    min-width: 86px;
  }
  .pcell {
    font-size: 10px;
    padding: 5px 6px;
  }
  .pcell-extra {
    font-size: 9px;
  }
  .shop-overview-table {
    min-width: 860px;
    font-size: 11px;
  }
  .shop-overview-table th,
  .shop-overview-table td {
    padding: 5px 4px;
  }
  .shop-cell {
    min-width: 52px;
  }
}

@media (max-width: 420px) {
  .planning-table {
    min-width: 390px;
  }
  .pday-cell {
    width: 130px;
    min-width: 130px;
  }
  .pvendor-head,
  .pvendor-col {
    min-width: 72px;
  }
  .shop-overview-table {
    min-width: 760px;
  }
}

.planning-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  min-width: 520px;
}
.planning-table th, .planning-table td { border: 1px solid rgba(255,255,255,0.08); }
.planning-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(30,30,50,0.98);
  color: rgba(255,255,255,0.9);
  font-weight: 700;
}
.pvendor-head { z-index: 4; background: rgba(30,30,50,0.98) !important; padding: 4px 8px !important; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; min-width: 70px; }
.pvendor { position: sticky; left: 0; z-index: 2; background: rgba(30,30,50,0.95); padding: 2px 8px; font-weight: 700; font-size: 11px; white-space: nowrap; color: #fff; }
.planning-scroll {
  max-height: 520px;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sched-hover-indicator { font-size: 12px; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.pvendor-col { min-width: 62px; }
.pday-head { position: sticky; top: 0; left: 0; z-index: 5; background: rgba(30,30,50,0.98); padding: 6px 10px; text-transform: uppercase; letter-spacing: 0.05em; font-size: 10px; }
.planning-table tbody tr:nth-child(even) .pvendor { background: rgba(40,40,60,0.95); }
.planning-table tbody tr:hover .pvendor { background: rgba(60,60,80,0.98); }
.pday-cell { position: sticky; left: 0; background: rgba(20,20,35,0.95); color: #fff; width: 190px; }
.pday-label { display: flex; flex-direction: column; gap: 2px; }
.pday-label strong { font-size: 13px; line-height: 1.2; }
.pday-label span { font-size: 10px; letter-spacing: 0.05em; }
.pday-sun { background: rgba(231,76,60,0.15); }
.pday-sat { background: rgba(230,126,34,0.12); }
.pday-ferie { background: rgba(155,89,182,0.2); }
.pcell {
  width: auto; min-height: 28px; text-align: center; vertical-align: middle;
  font-weight: 800; font-size: 11px; padding: 6px 8px; line-height: 1.2;
  color: #1a1a2e; cursor: pointer; user-select: none;
  transition: background 0.1s; white-space: normal;
}
.pcell-extra {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
}
.pcell:hover { outline: 2px solid #e63946; outline-offset: -2px; }
.pcell-col-highlight { outline: 2px solid rgba(230,57,70,0.8); outline-offset: -2px; }
.pday-row-highlight { box-shadow: inset 0 0 0 2px rgba(230,57,70,0.4); }

.shop-overview-scroll {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: auto;
}
.planif-main--pascal .shop-overview-scroll {
  max-height: 68vh;
}
.shop-overview-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 12px; }
.shop-overview-table th, .shop-overview-table td { border: 1px solid rgba(255,255,255,0.05); text-align: center; padding: 6px; }
.planif-main--pascal .shop-overview-table {
  min-width: 1180px;
  font-size: 13px;
}
.planif-main--pascal .shop-overview-table th,
.planif-main--pascal .shop-overview-table td {
  padding: 8px 7px;
}
.shop-overview-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(30,30,50,0.98);
}
.shop-overview-table th:first-child {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 5;
}
.shop-cell { min-width: 60px; }
.planif-main--pascal .shop-cell { min-width: 72px; }
.planif-main--pascal .shop-initial {
  min-width: 28px;
  min-height: 28px;
  font-size: 14px;
}
.shop-cell--editable { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.shop-cell--dragover { box-shadow: inset 0 0 0 3px rgba(230,57,70,0.9); transform: scale(1.01); }
.vendor-drag-chip:active { cursor: grabbing; }
.shop-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #0a0a12;
  margin: 1px;
}
.shop-initial--exception {
  width: auto;
  min-width: 24px;
  padding: 0 8px;
  font-size: 11px;
}
.vendor-legend { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px; }
.vendor-legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.vendor-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-initial { width: 28px; height: 28px; border-radius: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: #0a0a12; }

body.light-mode .shop-overview-table th,
body.light-mode .shop-overview-table td { border-color: #e2e8f0; }
body.light-mode .shop-initial,
body.light-mode .legend-initial { color: #0f172a; }

/* Week template modal */
.week-template-modal {
  width: min(1380px, calc(100vw - 32px));
  max-width: 1380px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.week-template-modal .section-header,
.week-template-help,
.week-template-vendors,
.week-template-actions,
.week-template-footer {
  flex-shrink: 0;
}
.week-template-help { margin: 0 0 12px; }
.week-template-grid-wrap {
  overflow: auto;
  max-height: min(46vh, 520px);
  margin: 10px 0 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(15,23,42,0.22);
}
.week-template-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
}
.week-template-table th,
.week-template-table td {
  border-right: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 6px;
  text-align: center;
  min-width: 72px;
}
.week-template-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(15,23,42,0.96);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.week-template-table .tpl-input {
  width: 100%;
  text-align: center;
  font-weight: 700;
  padding: 4px;
  border-radius: 6px;
}
.week-template-table th:first-child,
.week-template-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 110px;
  text-align: left;
  font-weight: 700;
  background: rgba(15,23,42,0.96);
}
.week-template-table thead th:first-child { z-index: 4; }
.week-template-actions {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.28fr);
  gap: 14px;
  align-items: start;
}
.tpl-controls,
.tpl-apply {
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15,23,42,0.24);
  border: 1px solid rgba(255,255,255,0.08);
}
.week-template-inline-actions {
  align-items: center;
}
.week-template-inline-actions .select {
  min-width: 260px;
  flex: 1 1 260px;
}
.week-template-chips {
  max-height: 180px;
  overflow: auto;
  padding-right: 4px;
}
.tpl-apply .chip { margin-bottom: 6px; }
.week-template-footer { margin-top: 16px; }
@media (max-width: 980px) {
  .week-template-modal {
    width: min(100vw - 20px, 100%);
    max-height: calc(100vh - 20px);
  }
  .week-template-grid-wrap { max-height: 38vh; }
  .week-template-actions { grid-template-columns: 1fr; }
}

/* Jours fériés */
.week-cell.day-ferie { border-color: rgba(155,89,182,0.4) !important; background: rgba(155,89,182,0.06) !important; }
.week-cell.day-ferie .week-cell__header h4 { color: #9b59b6 !important; }
body.light-mode .planning-table th, body.light-mode .planning-table td { border-color: #e2e8f0; }
body.light-mode .planning-table thead th { background: #f1f5f9; color: #334155; }
body.light-mode .pvendor-head { background: #fff !important; color: #334155; }
body.light-mode .pvendor { background: #fff; color: #1e293b; }
body.light-mode .planning-table tbody tr:nth-child(even) .pvendor { background: #f8fafc; }
body.light-mode .planning-table tbody tr:hover .pvendor { background: #f1f5f9; }
body.light-mode .planif-main { background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%) !important; }
body.light-mode .planif-sidebar {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7) !important;
}
body.light-mode .planif-sidebar--pascal .sidebar-section {
  background: rgba(255,255,255,0.82) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}
body.light-mode .planif-sidebar h4,
body.light-mode .planif-sidebar h5,
body.light-mode .sidebar-section,
body.light-mode .vendor-stat-card strong,
body.light-mode .vendor-stat-card span,
body.light-mode .pending-item strong {
  color: #1e293b !important;
}
body.light-mode .planif-sidebar h5,
body.light-mode .vendor-stat-card__grid,
body.light-mode .pending-item .muted.small,
body.light-mode .sched-hover-indicator,
body.light-mode .muted {
  color: #64748b !important;
}
body.light-mode .vendor-stat-card,
body.light-mode .pending-item {
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 8px 20px rgba(148, 163, 184, 0.12) !important;
}
body.light-mode .pascal-rdv-accordion__summary::after,
body.light-mode .pascal-rdv-accordion__meta .muted.small,
body.light-mode .pascal-suggestions-section h5 {
  color: #64748b !important;
}
body.light-mode .pascal-rdv-accordion__body {
  border-top-color: #e2e8f0 !important;
}
body.light-mode .pascal-suggestions-section {
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
body.light-mode .planning-scroll,
body.light-mode .shop-overview-scroll {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
}
body.light-mode .pday-cell {
  background: #f8fafc;
  color: #0f172a;
}
body.light-mode .pday-sun { background: #fee2e2; color: #991b1b; }
body.light-mode .pday-sat { background: #ffedd5; color: #9a3412; }
body.light-mode .pday-ferie { background: #ede9fe; color: #5b21b6; }
body.light-mode .shop-overview-table th {
  background: #f1f5f9;
  color: #334155;
}
body.light-mode .shop-overview-table td {
  background: rgba(255,255,255,0.82);
  color: #334155;
}
body.light-mode .shop-cell .muted.small {
  color: #94a3b8 !important;
}
body.light-mode .sched-paint-btn {
  box-shadow: none !important;
}

/* ===== LIGHT MODE ===== */
body.light-mode {
  background: linear-gradient(180deg, #f5f7fa 0%, #ebeef3 100%) !important;
  color: #2d3748 !important;
  transition: background 0.3s ease, color 0.3s ease;
  --text: #2d3748;
  --muted: #526277;
  --surface-text: #1e293b;
  --field-bg: #ffffff;
  --field-bg-focus: #ffffff;
  --field-border: #e2e8f0;
  --field-text: #1e293b;
  --field-placeholder: #94a3b8;
  --select-option-bg: #ffffff;
  --select-option-text: #1e293b;
  --ghost-bg: #ffffff;
  --ghost-text: #334155;
  --ghost-border: #e2e8f0;
  --action-ghost-text: #ffffff;
  --pill-bg: #f8fafc;
  --pill-bg-hover: #ffffff;
  --pill-text: #1e293b;
}

body.light-mode .topbar {
  background: rgba(255,255,255,0.97) !important;
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  box-shadow: 0 1px 12px rgba(0,0,0,0.05) !important;
}
body.light-mode .nav-link { color: #475569 !important; }
body.light-mode .nav-link:hover { color: #1e293b !important; border-color: #e63946 !important; }
body.light-mode .admin-link { color: #e63946 !important; }
body.light-mode .logo span { color: #1e293b !important; }

body.light-mode .card {
  background: #fff !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04) !important;
}

body.light-mode .list-item {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
body.light-mode .list-item strong,
body.light-mode .list-item div { color: #1e293b !important; }
body.light-mode .list-item small { color: #94a3b8 !important; }

body.light-mode .table { background: #fff !important; }
body.light-mode .table th {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
}
body.light-mode .table td {
  color: #334155 !important;
  border-color: #f1f5f9 !important;
}
body.light-mode .table tbody tr:nth-child(even) { background: #f8fafc !important; }
body.light-mode .table tbody tr:hover { background: #f1f5f9 !important; }

body.light-mode .badge { background: #f1f5f9 !important; color: #475569 !important; }
body.light-mode .badge-off { background: #fef2f2 !important; color: #dc2626 !important; }

body.light-mode .btn.ghost {
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
body.light-mode .btn.ghost:hover { background: #f8fafc !important; }
body.light-mode .btn.primary { color: #fff !important; }

body.light-mode .table .btn.ghost {
  background: linear-gradient(135deg, #e63946, #f4845f) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(230,57,70,0.2) !important;
}

body.light-mode .profile-trigger { border-color: #cbd5e1 !important; }
body.light-mode .profile-trigger span { color: #334155 !important; }

body.light-mode .kpi .big { color: #1e293b !important; }
body.light-mode .kpi .label { color: #475569 !important; }

body.light-mode .subtitle { color: #475569 !important; }
body.light-mode .muted { color: #526277 !important; }
body.light-mode .title { color: #1e293b !important; }
body.light-mode strong { color: #1e293b; }
body.light-mode td { color: #334155; }
body.light-mode p { color: #475569; }
body.light-mode .card .title,
body.light-mode .card h1,
body.light-mode .card h2,
body.light-mode .card h3,
body.light-mode .card h4,
body.light-mode .card h5,
body.light-mode .card h6 { color: #0f172a !important; }
body.light-mode .card .subtitle,
body.light-mode .card .label { color: #475569 !important; }
body.light-mode .card .muted,
body.light-mode .card p.muted,
body.light-mode .card .small.muted { color: #55657d !important; }

body.light-mode .tag { color: #334155 !important; background: #f1f5f9 !important; }

/* Schedule light */
body.light-mode .planning-hero {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff) !important;
  color: #1e293b !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important;
}
body.light-mode .planning-hero .subtitle,
body.light-mode .planning-hero .muted { color: #64748b !important; }
body.light-mode .week-cell {
  background: #fff !important;
  border-color: #e2e8f0 !important;
}
body.light-mode .week-cell.day-off {
  border-color: #fca5a5 !important;
  background: #fef2f2 !important;
}
body.light-mode .week-cell__header h4 { color: #1e293b !important; }
body.light-mode .week-entry {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}
body.light-mode .week-entry__title { color: #1e293b !important; }
body.light-mode .week-entry__meta { color: #94a3b8 !important; }

body.light-mode .stat-card {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
body.light-mode .stat-label { color: #94a3b8 !important; }
body.light-mode .stat-value { color: #1e293b !important; }

body.light-mode .leave-actions .btn.ghost { background: #fff !important; color: #334155 !important; border-color: #e2e8f0 !important; }
body.light-mode .view-toggle { color: #64748b !important; }
body.light-mode .view-toggle .btn.ghost { background: #fff !important; color: #334155 !important; border-color: #e2e8f0 !important; }
body.light-mode .view-toggle .btn.primary { box-shadow: 0 4px 12px rgba(230,57,70,0.25) !important; }
body.light-mode .leave-scope-tabs { background: #eef2ff !important; border-color: #c7d2fe !important; box-shadow: inset 0 1px 0 rgba(255,255,255,0.9) !important; }
body.light-mode .leave-scope-btn { color: #334155 !important; }
body.light-mode .leave-scope-btn:hover { background: #e2e8f0 !important; border-color: #cbd5e1 !important; }
body.light-mode .leave-scope-btn.active { background: linear-gradient(135deg, #0ea5e9, #2563eb) !important; color: #fff !important; border-color: rgba(14,165,233,0.5) !important; box-shadow: 0 6px 16px rgba(37,99,235,0.25) !important; }
body.light-mode .leave-scope-count { background: rgba(15,23,42,0.1) !important; color: #334155 !important; }
body.light-mode .leave-scope-btn.active .leave-scope-count { background: rgba(255,255,255,0.24) !important; color: #fff !important; }

body.light-mode .btn-incentive {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important;
}

body.light-mode .select {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}
body.light-mode .select:focus { border-color: #e63946 !important; box-shadow: 0 0 0 3px rgba(230,57,70,0.1) !important; }
body.light-mode .input {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}
body.light-mode .input:focus { border-color: #e63946 !important; box-shadow: 0 0 0 3px rgba(230,57,70,0.1) !important; }
body.light-mode .input::placeholder { color: #94a3b8 !important; }

/* SAV light */
body.light-mode .sav-block .input,
body.light-mode .sav-block .select { background: #f8fafc !important; }
body.light-mode .sav-overview-card,
body.light-mode .sav-ticket-form,
body.light-mode .sav-supplier-form,
body.light-mode .sav-toolbar,
body.light-mode .sav-table-shell,
body.light-mode .sav-supplier-item {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border-color: rgba(148,163,184,0.22) !important;
  box-shadow: 0 16px 30px rgba(148,163,184,0.12) !important;
}
body.light-mode .sav-overview-card__label,
body.light-mode .sav-status-pill {
  color: #64748b !important;
}
body.light-mode .sav-status-pill {
  background: #eef2f7 !important;
  border-color: #dbe3ec !important;
}
body.light-mode .sav-table thead th {
  background: #f1f5f9 !important;
}
body.light-mode .sav-table tbody tr:hover td {
  background: #f8fafc !important;
}

/* Login light */
body.light-mode .login-wrapper {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8edf5 30%, #fdf2f4 60%, #f5f7fa 100%) !important;
}
body.light-mode .login-card {
  background: #fff !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08) !important;
}
body.light-mode .login-card .title { color: #1e293b !important; }
body.light-mode .login-card .subtitle { color: #94a3b8 !important; }
body.light-mode .login-card #forgot-pass { color: #475569 !important; }

/* Watermark light */
body.light-mode .watermark { color: rgba(0,0,0,0.04) !important; }

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.05); }
body.light-mode .theme-toggle { border-color: #e2e8f0 !important; background: #f8fafc !important; }
body.light-mode .theme-toggle:hover { border-color: #cbd5e1 !important; background: #f1f5f9 !important; }

.notification-center-wrap {
  position: relative;
}
.notification-bell {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.notification-bell:hover {
  border-color: rgba(125, 211, 252, 0.45);
  background: rgba(255,255,255,0.1);
}
.notification-bell.has-unread {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}
.notification-bell__icon {
  font-size: 18px;
  line-height: 1;
}
.notification-bell__count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fb7185, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.3);
}
.notification-center {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 28px));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(9, 15, 28, 0.98), rgba(31, 10, 18, 0.97));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  z-index: 50;
}
.notification-center__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.notification-center__list {
  display: grid;
  gap: 10px;
}
.notification-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: inherit;
  cursor: pointer;
}
.notification-item:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(125, 211, 252, 0.2);
}
.notification-item--success { border-left: 4px solid #22c55e; }
.notification-item--warning { border-left: 4px solid #f59e0b; }
.notification-item--danger { border-left: 4px solid #ef4444; }
.notification-item--info { border-left: 4px solid #38bdf8; }
.notification-item--empty {
  cursor: default;
  border-left: 4px solid rgba(148, 163, 184, 0.45);
}
.notification-item--empty:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.notification-item__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.notification-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.notification-item__body {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.notification-dismiss {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notification-dismiss:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.24);
}
.notification-item__meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}
body.light-mode .notification-bell {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: #334155 !important;
}
body.light-mode .notification-bell:hover {
  border-color: #cbd5e1 !important;
  background: #f1f5f9 !important;
}
body.light-mode .notification-center {
  border-color: rgba(148, 163, 184, 0.22) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16) !important;
}
body.light-mode .notification-item {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}
body.light-mode .notification-item:hover {
  background: #f8fafc !important;
  border-color: rgba(125, 211, 252, 0.28) !important;
}
body.light-mode .notification-dismiss {
  border-color: rgba(148, 163, 184, 0.26) !important;
  background: #ffffff !important;
  color: #334155 !important;
}
body.light-mode .notification-dismiss:hover {
  background: #f8fafc !important;
  border-color: rgba(125, 211, 252, 0.3) !important;
}
@media (max-width: 640px) {
  .notification-center {
    position: fixed;
    top: calc(72px + var(--safe-top));
    right: calc(12px + var(--safe-right));
    left: calc(12px + var(--safe-left));
    width: auto;
    max-height: min(68vh, 560px);
  }
}

.mail-dev-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.mail-dev-toggle[hidden] {
  display: none !important;
}
.mail-dev-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  margin: 0;
  z-index: 2;
}
.mail-dev-toggle > span {
  pointer-events: none;
}
.mail-dev-toggle:focus-within {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}
.mail-dev-toggle.is-loading {
  opacity: 0.7;
}
.mail-dev-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.16);
  transition: background 0.2s ease, border-color 0.2s ease;
  flex: 0 0 42px;
}
.mail-dev-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}
.mail-dev-label {
  white-space: nowrap;
}
.mail-dev-state {
  min-width: 30px;
  text-align: right;
  color: #ffb7c7;
}
.mail-dev-toggle.is-active {
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(251, 113, 133, 0.1);
}
.mail-dev-toggle.is-active .mail-dev-switch {
  background: linear-gradient(135deg, #fb7185, #ff8e63);
  border-color: rgba(255,255,255,0.2);
}
.mail-dev-toggle.is-active .mail-dev-switch-knob {
  transform: translateX(18px);
}
.mail-dev-toggle.is-active .mail-dev-state {
  color: #ffe4e8;
}
.mail-dev-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.16), rgba(255, 142, 99, 0.14));
  color: #ffe4e8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  max-width: min(360px, 38vw);
}
.mail-dev-banner[hidden] {
  display: none !important;
}
body.light-mode .mail-dev-toggle {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
}
body.light-mode .mail-dev-switch {
  background: #cbd5e1;
  border-color: #cbd5e1;
}
body.light-mode .mail-dev-switch-knob {
  background: #ffffff;
}
body.light-mode .mail-dev-state {
  color: #475569;
}
body.light-mode .mail-dev-toggle.is-active {
  border-color: #fda4af !important;
  background: #fff1f2 !important;
}
body.light-mode .mail-dev-toggle.is-active .mail-dev-state {
  color: #be123c;
}
body.light-mode .mail-dev-banner {
  border-color: #fda4af;
  background: #fff1f2;
  color: #be123c;
}
body.light-mode .mail-dev-toggle:focus-within {
  outline-color: rgba(15, 23, 42, 0.3);
}

.bonus-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.bonus-panel {
  overflow: hidden;
}

.bonus-toolbar {
  align-items: center;
  gap: 10px;
}

.bonus-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.bonus-submit-btn {
  grid-column: span 2;
  min-height: 58px;
  padding: 0 24px;
  white-space: nowrap;
  justify-self: stretch;
}

.bonus-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.bonus-tabs .tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 250, 252, 0.88);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.bonus-tabs .tab-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.bonus-tabs .tab-button.active {
  background: linear-gradient(135deg, var(--btn-grad-1), var(--btn-grad-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 30px rgba(214, 60, 60, 0.28);
}

body.light-mode .bonus-tabs .tab-button {
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #334155;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

body.light-mode .bonus-tabs .tab-button:hover {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.18);
}

body.light-mode .bonus-tabs .tab-button.active {
  background: linear-gradient(135deg, var(--btn-grad-1), var(--btn-grad-2));
  border-color: rgba(239, 68, 68, 0.28);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16), 0 14px 30px rgba(214, 60, 60, 0.18);
  transform: translateY(-1px);
}

body.light-mode .incentive-tabbar .btn.primary {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16), 0 14px 28px rgba(214, 60, 60, 0.16) !important;
}

body.light-mode .incentive-tabbar .btn.ghost {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06) !important;
}

@media (max-width: 1100px) {
  .incentive-modal .incentive-panels,
  .incentive-modal .extra-row {
    grid-template-columns: 1fr;
  }

  .incentive-modal #products-wrapper.chip-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .incentive-modal #shops-wrapper,
  .incentive-modal #products-wrapper.chip-grid {
    grid-template-columns: 1fr;
  }
}

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

  .bonus-submit-btn {
    grid-column: auto;
    min-height: 52px;
    width: 100%;
  }

  .bonus-toolbar {
    width: 100%;
  }

  .bonus-toolbar .select {
    width: 100%;
  }

  .bonus-tabs .tab-button {
    min-height: 40px;
    padding: 0 14px;
    font-size: 12px;
  }
}

/* Dark mode polish */
body:not(.light-mode) .topbar {
  background:
    linear-gradient(180deg, rgba(8, 14, 26, 0.94), rgba(22, 6, 10, 0.9)),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 40%);
  border-bottom-color: rgba(125, 211, 252, 0.14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

body:not(.light-mode) .nav-link {
  color: rgba(255, 230, 236, 0.72);
}

body:not(.light-mode) .nav-link:hover {
  color: #ffffff;
}

body:not(.light-mode) .btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

body:not(.light-mode) .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

body:not(.light-mode) .input,
body:not(.light-mode) .select {
  background: rgba(14, 20, 32, 0.82);
  border-color: rgba(255, 147, 102, 0.18);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body:not(.light-mode) .input::placeholder {
  color: rgba(226, 232, 240, 0.46);
}

body:not(.light-mode) .input:focus,
body:not(.light-mode) .select:focus {
  background: rgba(17, 24, 39, 0.96);
  border-color: rgba(255, 120, 88, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 120, 88, 0.18);
}

body:not(.light-mode) .mailing-color-input {
  background: rgba(17, 24, 39, 0.96);
}
body:not(.light-mode) .login-card .input {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.34) !important;
  color: #1f2937 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92) !important;
}
body:not(.light-mode) .login-card .input:focus {
  background: #ffffff !important;
  border-color: rgba(230, 57, 70, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.12) !important;
}
body:not(.light-mode) .login-card .input::placeholder {
  color: rgba(100, 116, 139, 0.58) !important;
}

body:not(.light-mode) .select option {
  color: #f8fafc;
  background: #111827;
}

body:not(.light-mode) .dialog {
  background: linear-gradient(180deg, rgba(9, 15, 28, 0.98), rgba(31, 10, 18, 0.96));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  color: #f8fafc;
}

body:not(.light-mode) .dialog h3 {
  color: #ffffff;
}

body:not(.light-mode) .dialog p {
  color: rgba(226, 232, 240, 0.72);
}

body:not(.light-mode) .dialog label,
body:not(.light-mode) .dialog label span,
body:not(.light-mode) .dialog strong,
body:not(.light-mode) .dialog small,
body:not(.light-mode) .dialog .subtitle,
body:not(.light-mode) .dialog [style*="color:#222"],
body:not(.light-mode) .dialog [style*="color: #222"],
body:not(.light-mode) .dialog [style*="color:#333"],
body:not(.light-mode) .dialog [style*="color: #333"] {
  color: #ffffff !important;
}

body:not(.light-mode) .dialog input[type="checkbox"] + span,
body:not(.light-mode) .dialog input[type="checkbox"] + small {
  color: #ffffff !important;
}

body:not(.light-mode) .incentive-hero {
  background:
    linear-gradient(125deg, rgba(17, 24, 39, 0.86), rgba(19, 49, 84, 0.72) 55%, rgba(22, 7, 15, 0.84)),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.22), transparent 35%);
  border-color: rgba(125, 211, 252, 0.18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

body:not(.light-mode) .incentive-card,
body:not(.light-mode) .incentive-archive-card {
  background:
    linear-gradient(180deg, rgba(13, 20, 33, 0.94), rgba(37, 17, 28, 0.9)),
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 40%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

body:not(.light-mode) .incentive-archive-card summary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(244, 114, 182, 0.1));
}

body:not(.light-mode) .pill-brand {
  background: rgba(14, 165, 233, 0.18);
  color: #7dd3fc;
}

body:not(.light-mode) .pill-progress {
  background: rgba(244, 114, 182, 0.16);
  color: #f9a8d4;
}

body:not(.light-mode) .reward-amount,
body:not(.light-mode) .metric strong {
  color: #f8fafc;
}

body:not(.light-mode) .reward-label,
body:not(.light-mode) .progress-meta,
body:not(.light-mode) .metric span,
body:not(.light-mode) .incentive-vendor-pill span {
  color: rgba(226, 232, 240, 0.68);
}

body:not(.light-mode) .incentive-card__progress .progress {
  background: rgba(148, 163, 184, 0.16);
}

body:not(.light-mode) .metric,
body:not(.light-mode) .incentive-vendor-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Encodage page — tailles identiques dark/light */
.encodage-page-header {
  align-items: flex-start;
  gap: 16px;
}

.encodage-page-header .title {
  font-size: 30px;
}

.encodage-page-header .muted {
  font-size: 16px;
  line-height: 1.35;
}

.encodage-page-tabs {
  gap: 14px !important;
}

.encodage-page-tabs .btn.small {
  min-height: 58px;
  padding: 0 22px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.encodage-page-filters {
  gap: 14px !important;
}

.encodage-page-filters .select,
.encodage-page-filters .input {
  min-height: 42px;
  min-width: 220px !important;
  padding-inline: 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
}

/* ── Mobile horaire light ── */
body.light-mode .mobile-week-card {
  background: #fff !important;
  border-color: #e2e8f0 !important;
}
body.light-mode .mobile-week-row {
  border-color: #e2e8f0 !important;
}
body.light-mode .mobile-week-row__date {
  color: #1e293b !important;
}
body.light-mode .mobile-week-row.is-weekend .mobile-week-row__date {
  color: #dc2626 !important;
}
body.light-mode .mobile-week-meta {
  color: #64748b !important;
}
body.light-mode .mobile-week-chip {
  background: #f1f5f9 !important;
  color: #334155 !important;
}
body.light-mode .mobile-week-card__head h4 {
  color: #1e293b !important;
}

/* ── List panel light ── */
body.light-mode .list-panel {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
}

/* ── Week entry light (horaire détaillé) ── */
body.light-mode .week-entry__meta {
  color: #64748b !important;
}

/* ── Leave card light ── */
body.light-mode .leave-actions .btn.secondary {
  color: #fff !important;
}

/* ── SAV overview value light ── */
body.light-mode .sav-overview-card__value {
  color: #1e293b !important;
}

/* ── Planning table sticky cells light ── */
body.light-mode .pday-head {
  background: #f1f5f9 !important;
  color: #334155 !important;
}
body.light-mode .pday-cell {
  background: #fff !important;
  color: #1e293b !important;
}
body.light-mode .pday-label strong { color: #0f172a !important; }
body.light-mode .pday-label span { color: #64748b !important; }

/* ── Dialog text light ── */
body.light-mode .dialog h3 { color: #0f172a !important; }
body.light-mode .dialog p { color: #475569 !important; }

/* ── Notification item text light ── */
body.light-mode .notification-item__title { color: #1e293b !important; }
body.light-mode .notification-item__body { color: #334155 !important; }
body.light-mode .notification-item__meta { color: #64748b !important; }

/* ── DevTool option effect rows ── */
.devtool-option-effect-row {
  background: rgba(255,255,255,0.03);
  transition: background 0.15s ease;
}
.devtool-option-effect-row:hover {
  background: rgba(255,255,255,0.06);
}
body.light-mode .devtool-option-effect-row {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
body.light-mode .devtool-option-effect-row:hover {
  background: #f1f5f9 !important;
}

@media (max-width: 768px) {
  body.light-mode .encodage-page-tabs .btn.small {
    min-height: 50px;
    padding: 0 18px;
    font-size: 14px;
  }

  body.light-mode .encodage-page-filters .select,
  body.light-mode .encodage-page-filters .input {
    min-width: 100% !important;
  }
}

/* ── Visual polish (dev) ── */

/* Announcement banner refinements */
.site-announcement {
  border-radius: 12px !important;
  padding: 12px 18px !important;
  font-size: 13px;
  line-height: 1.5;
  backdrop-filter: blur(8px);
}

/* Smoother page transitions */
.page-content, [id="app"] > * {
  animation: fadeInPage 0.25s ease-out;
}
@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Badge refinements */
.badge {
  font-variant-numeric: tabular-nums;
}

/* Scrollbar styling for dark theme */
:root[data-env="dev"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
:root[data-env="dev"] ::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}
:root[data-env="dev"] ::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 252, 0.2);
  border-radius: 4px;
}
:root[data-env="dev"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(125, 211, 252, 0.35);
}

/* Select/dropdown refinements */
.select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.select:focus, .input:focus, textarea:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent 75%);
}

/* Dashboard KPI grid */
.dashboard-kpi-row {
  align-items: stretch;
}
.dashboard-kpi-row .card {
  display: flex;
  flex-direction: column;
}
@media (max-width: 900px) {
  .dashboard-kpi-row {
    grid-template-columns: 1fr 1fr !important;
  }
  .dashboard-kpi-row > .card:last-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 600px) {
  .dashboard-kpi-row {
    grid-template-columns: 1fr !important;
  }
}

/* Progress meta (Realise / Progression) */
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* RGPD section - softer in dark mode */
body:not(.light-mode) .card [style*="color:#dc2626"],
body:not(.light-mode) .card [style*="color: #dc2626"] {
  color: var(--primary) !important;
}
body:not(.light-mode) .badge[style*="background:#dc2626"],
body:not(.light-mode) .badge[style*="background: #dc2626"] {
  background: var(--primary) !important;
}

/* Pagination component (F.K4) */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border, rgba(148,163,184,0.15));
  margin-top: 0.5rem;
}
.pagination-btn {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border, rgba(148,163,184,0.25));
  border-radius: 6px;
  background: transparent;
  color: var(--text, inherit);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.pagination-btn:hover:not([disabled]) {
  background: var(--bg-hover, rgba(148,163,184,0.1));
  border-color: var(--primary, #0ea5e9);
}
.pagination-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-info {
  font-size: 13px;
  color: var(--muted, #94a3b8);
  min-width: 120px;
  text-align: center;
}

/* ============================================================
   DASHBOARD ENHANCEMENTS - Leaderboard, Sparklines, Stats, Animations
   ============================================================ */

/* --- Leaderboard --- */
.dashboard-leaderboard .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.leaderboard-period-toggle {
  display: flex;
  gap: 4px;
}
.leaderboard-period-toggle .btn.active {
  background: var(--primary);
  color: #fff;
}
.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.leaderboard-card {
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--radius, 8px);
  background: var(--surface2, rgba(148,163,184,0.06));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.leaderboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.leaderboard-card.is-current {
  border: 2px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent 92%);
}
.leaderboard-medal {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}
.leaderboard-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-commission {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}
.leaderboard-count {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* --- Sparklines --- */
.sparkline-container {
  margin: 10px 0 0;
}
.sparkline-svg {
  display: block;
  border-radius: 4px;
}
.sparkline-svg:hover .sparkline-dot {
  opacity: 1;
  transition: opacity 0.15s ease;
}
.sparkline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
  padding: 0 1px;
}
.sparkline-comparison {
  display: flex;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  flex-wrap: wrap;
  gap: 4px;
}
.sparkline-delta {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.sparkline-delta.positive {
  color: #15803d;
  background: rgba(21, 128, 61, 0.1);
}
.sparkline-delta.negative {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* --- Stats Personnelles --- */
.dashboard-stats .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-item {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius, 8px);
  background: var(--surface2, rgba(148,163,184,0.06));
}
.stat-icon {
  font-size: 20px;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-detail {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 4px;
}

/* Weekly chart bars */
.stats-weekly-chart {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex: 1;
  min-height: 60px;
}
.stats-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.stats-bar-track {
  width: 100%;
  max-width: 28px;
  height: 48px;
  background: var(--surface2, rgba(148,163,184,0.06));
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.stats-bar-fill {
  width: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stats-bar-label {
  font-size: 10px;
  color: var(--muted);
}
.stats-bar-value {
  font-size: 9px;
  font-weight: 700;
  color: var(--text);
}

/* --- Incentive Stats Charts --- */
.incentive-stats-section {
  margin-top: 16px;
}
.incentive-stats-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}
.incentive-stats-chart-block {
  background: var(--surface2, rgba(148,163,184,0.06));
  border-radius: var(--radius, 8px);
  padding: 14px;
}
.incentive-stats-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.incentive-stats-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.incentive-stats-bar-label {
  width: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.incentive-stats-bar-track {
  flex: 1;
  height: 20px;
  background: var(--surface2, rgba(148,163,184,0.1));
  border-radius: 4px;
  overflow: hidden;
}
.incentive-stats-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 2px;
}
.incentive-stats-bar-value {
  width: 40px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .incentive-stats-charts {
    grid-template-columns: 1fr;
  }
  .incentive-stats-bar-label {
    width: 70px;
    font-size: 11px;
  }
}

/* --- Incentive Archive Month Dividers --- */
.incentive-archive-month-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 10px;
  padding: 0 4px;
}
.incentive-archive-month-divider span {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  white-space: nowrap;
}
.incentive-archive-month-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, rgba(148,163,184,0.18));
}

/* --- Incentive Stats Filters --- */
.incentive-stats-filters {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: flex-end;
}
.incentive-stats-filters > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.incentive-stats-filters .select {
  min-width: 160px;
}

/* --- Incentive Pie Charts --- */
.incentive-pie-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.incentive-pie-svg {
  flex-shrink: 0;
}
.incentive-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.incentive-pie-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.incentive-pie-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
@media (max-width: 500px) {
  .incentive-pie-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Micro-animations --- */

/* Card stagger entrance */
@keyframes cardStaggerIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-stagger {
  animation: cardStaggerIn 0.4s ease-out both;
}

/* Progress bar smooth fill */
.progress-bar-animated {
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Badge bounce in */
@keyframes badgeBounceIn {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.badge-bounce-in {
  animation: badgeBounceIn 0.4s ease-out both;
}

/* Save button pulse green */
@keyframes pulseGreen {
  0%   { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(21, 128, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}
.btn-pulse-green {
  animation: pulseGreen 1.5s ease-in-out infinite;
  border-color: #15803d !important;
  color: #15803d !important;
}

/* Count-up text */
.dashboard-count-up {
  font-variant-numeric: tabular-nums;
}

/* --- Responsive --- */
@media (max-width: 760px) {
  .leaderboard-podium {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .leaderboard-card {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 10px 12px;
  }
  .leaderboard-medal {
    font-size: 22px;
    margin-bottom: 0;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sparkline-comparison {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .leaderboard-period-toggle {
    flex-wrap: wrap;
  }
}

/* --- Light mode overrides for dashboard enhancements --- */
body.light-mode .dashboard-leaderboard {
  background: #fff !important;
  border: 1px solid #e2e8f0;
}
body.light-mode .leaderboard-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
body.light-mode .leaderboard-card:hover {
  background: #f1f5f9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
body.light-mode .leaderboard-card.is-current {
  background: #fef2f2;
  border-color: #e63946;
}
body.light-mode .leaderboard-name {
  color: #1e293b !important;
}
body.light-mode .leaderboard-commission {
  color: #e63946 !important;
}
body.light-mode .leaderboard-count {
  color: #64748b !important;
}
body.light-mode .leaderboard-period-toggle .btn.ghost {
  background: #f8fafc !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
}
body.light-mode .leaderboard-period-toggle .btn.active {
  background: #e63946 !important;
  color: #fff !important;
  border-color: #e63946 !important;
}
body.light-mode .dashboard-stats {
  background: #fff !important;
  border: 1px solid #e2e8f0;
}
body.light-mode .stat-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
body.light-mode .stat-value {
  color: #1e293b !important;
}
body.light-mode .stat-detail {
  color: #64748b !important;
}
body.light-mode .stat-label {
  color: #94a3b8 !important;
}
body.light-mode .stats-bar-track {
  background: #f1f5f9;
}
body.light-mode .stats-bar-fill {
  background: #e63946;
}
body.light-mode .stats-bar-label {
  color: #64748b !important;
}
body.light-mode .stats-bar-value {
  color: #1e293b !important;
}
body.light-mode .incentive-stats-bar-track {
  background: #f1f5f9;
}
body.light-mode .incentive-stats-bar-fill {
  background: #e63946;
}
body.light-mode .incentive-stats-bar-label {
  color: #64748b !important;
}
body.light-mode .incentive-stats-bar-value {
  color: #1e293b !important;
}
body.light-mode .incentive-stats-chart-block {
  background: #f8fafc;
}
body.light-mode .incentive-pie-svg circle:last-of-type,
body.light-mode .incentive-pie-svg path + circle {
  fill: #f8fafc;
}
body.light-mode .sparkline-labels {
  color: #94a3b8 !important;
}
body.light-mode .sparkline-delta.positive {
  color: #15803d;
  background: rgba(21, 128, 61, 0.08);
}
body.light-mode .sparkline-delta.negative {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}
body.light-mode .sparkline-line {
  stroke: #e63946 !important;
}
body.light-mode .sparkline-dot {
  fill: #e63946 !important;
}
body.light-mode .sparkline-fill {
  fill: url(#spark-grad-main) !important;
}
body.light-mode .sparkline-svg stop {
  stop-color: #e63946 !important;
}

/* ============================================================
   COMMAND PALETTE (Ctrl+K)
   ============================================================ */
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
}
.cmd-palette {
  width: 100%;
  max-width: 480px;
  background: var(--card, rgba(55,16,18,0.92));
  border: 1px solid var(--border, rgba(255,200,210,0.14));
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: cardStaggerIn 0.2s ease-out;
}
.cmd-palette-input {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid var(--border, rgba(255,200,210,0.14));
  background: transparent;
  color: var(--text, #fff);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
}
.cmd-palette-input::placeholder { color: var(--muted); }
.cmd-palette-results {
  max-height: 320px;
  overflow-y: auto;
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.1s ease;
  color: var(--text, #fff);
  font-size: 14px;
}
.cmd-palette-item:hover,
.cmd-palette-item.is-selected {
  background: rgba(255,255,255,0.08);
}
.cmd-palette-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.cmd-palette-empty {
  padding: 16px 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.cmd-palette-hint {
  padding: 8px 18px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border, rgba(255,200,210,0.14));
  text-align: center;
}

/* Light mode */
body.light-mode .cmd-palette {
  background: #fff;
  border-color: #e2e8f0;
}
body.light-mode .cmd-palette-input {
  color: #1e293b;
  border-color: #e2e8f0;
}
body.light-mode .cmd-palette-item { color: #1e293b; }
body.light-mode .cmd-palette-item:hover,
body.light-mode .cmd-palette-item.is-selected { background: #f1f5f9; }
body.light-mode .cmd-palette-hint { color: #94a3b8; border-color: #e2e8f0; }

/* ============================================================
   PRODUCT FAVORITES
   ============================================================ */
.fav-star {
  position: absolute;
  top: 2px;
  right: 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  padding: 2px 4px;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 2;
}
.fav-star:hover { opacity: 1; transform: scale(1.2); }
.fav-star.is-fav { color: #f59e0b; opacity: 1; }

/* ============================================================
   DAILY GOALS WIDGET
   ============================================================ */
.daily-goal-widget {
  margin-bottom: 12px;
}
.daily-goal-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--card, rgba(55,16,18,0.92));
  border: 1px solid var(--border, rgba(255,200,210,0.14));
  border-radius: var(--radius, 8px);
  font-size: 13px;
  color: var(--text);
}
.daily-goal-options {
  display: flex;
  gap: 6px;
}
.daily-goal-progress {
  padding: 10px 16px;
  background: var(--card, rgba(55,16,18,0.92));
  border: 1px solid var(--border, rgba(255,200,210,0.14));
  border-radius: var(--radius, 8px);
}
.daily-goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}
.daily-goal-pct {
  font-weight: 800;
}

/* Light mode */
body.light-mode .daily-goal-prompt,
body.light-mode .daily-goal-progress {
  background: #fff;
  border-color: #e2e8f0;
  color: #1e293b;
}
body.light-mode .daily-goal-header { color: #1e293b; }

/* ============================================================
   PERIOD COMPARISON
   ============================================================ */
.dashboard-comparison .comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.comparison-item {
  padding: 12px;
  background: var(--surface2, rgba(148,163,184,0.06));
  border-radius: var(--radius, 8px);
}
.comparison-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.comparison-values {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.comparison-current {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.comparison-vs {
  font-size: 12px;
  color: var(--muted);
}
.comparison-delta {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
}
.comparison-delta.positive {
  color: #15803d;
  background: rgba(21,128,61,0.1);
}
.comparison-delta.negative {
  color: #ef4444;
  background: rgba(239,68,68,0.1);
}

/* Light mode */
body.light-mode .dashboard-comparison {
  background: #fff !important;
  border: 1px solid #e2e8f0;
}
body.light-mode .comparison-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
body.light-mode .comparison-current { color: #1e293b !important; }
body.light-mode .comparison-label { color: #64748b !important; }
body.light-mode .comparison-vs { color: #94a3b8 !important; }

/* ============================================================
   ONBOARDING TOUR
   ============================================================ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.6);
  display: none;
}
.onboarding-spotlight {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.6);
  border: 2px solid var(--primary, #ff3d48);
  z-index: 1;
  transition: all 0.3s ease;
}
.onboarding-tooltip {
  position: absolute;
  z-index: 2;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--card, rgba(55,16,18,0.96));
  border: 1px solid var(--border, rgba(255,200,210,0.2));
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  animation: cardStaggerIn 0.3s ease-out;
}
.onboarding-avatar {
  font-size: 32px;
  margin-bottom: 8px;
}
.onboarding-msg {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text, #fff);
  margin-bottom: 16px;
}
.onboarding-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.onboarding-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted, rgba(255,255,255,0.3));
  transition: background 0.2s ease;
}
.onboarding-dot.active {
  background: var(--primary, #ff3d48);
  width: 16px;
  border-radius: 3px;
}
.onboarding-help-btn {
  position: fixed;
  bottom: 56px;
  right: 16px;
  z-index: 9990;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border, rgba(255,200,210,0.2));
  background: var(--card, rgba(55,16,18,0.92));
  color: var(--muted, #fff);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}
.onboarding-help-btn:hover {
  transform: scale(1.1);
}

/* Light mode */
body.light-mode .onboarding-tooltip {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}
body.light-mode .onboarding-msg { color: #1e293b; }
body.light-mode .onboarding-help-btn {
  background: #fff;
  border-color: #e2e8f0;
  color: #475569;
}

/* ============================================================
   CLIENT HISTORY HINT
   ============================================================ */
.client-history-hint {
  margin-top: 4px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  animation: cardStaggerIn 0.3s ease-out;
}
body.light-mode .client-history-hint {
  background: #fef2f2;
}

/* ============================================================
   RESPONSIVE: new features
   ============================================================ */
@media (max-width: 760px) {
  .cmd-palette { max-width: calc(100vw - 24px); }
  .comparison-grid { grid-template-columns: 1fr !important; }
  .daily-goal-prompt { flex-direction: column; align-items: flex-start; gap: 8px; }
  .onboarding-tooltip { width: calc(100vw - 32px); }
}
