/* 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 30% 10%, rgba(255,87,87,0.08) 0%, transparent 38%),
         radial-gradient(circle at 70% 0%, rgba(255,160,122,0.12) 0%, transparent 42%),
         linear-gradient(180deg, #120306 0%, #1c050a 40%, #070003 100%);
  --card: rgba(22, 6, 10, 0.92);
  --border: rgba(255, 255, 255, 0.1);
  --text: #fff5f5;
  --muted: #ffb7c7;
  --primary: #ff3d48;
  --primary-2: #ff9366;
  --btn-grad-1: #ff555d;
  --btn-grad-2: #ff8e63;
  --topbar-bg: rgba(23, 4, 6, 0.9);
  --topbar-border: rgba(255,255,255,0.15);
  font-family: 'Inter', 'Space Grotesk', system-ui, sans-serif;
}

:root[data-env="dev"] {
  --bg: radial-gradient(circle at 25% 5%, rgba(255,107,107,0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 5%, rgba(255,174,140,0.14) 0%, transparent 48%),
        linear-gradient(180deg, #070004 0%, #140008 45%, #000 100%);
  --card: rgba(11, 2, 5, 0.92);
  --border: rgba(255, 255, 255, 0.1);
  --text: #ffeef0;
  --muted: #ffbdcd;
  --primary: #ff555d;
  --primary-2: #ff8e63;
  --btn-grad-1: #ff555d;
  --btn-grad-2: #ff8e63;
  --topbar-bg: rgba(10, 0, 2, 0.92);
  --topbar-border: rgba(255,255,255,0.15);
}

body {
  margin: 0;
  background: var(--bg);
  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 15px 40px rgba(0,0,0,0.25);
}
@media (min-width: 1280px) {
  .topbar {
    padding: calc(22px + var(--safe-top)) calc(40px + var(--safe-right)) 22px calc(40px + var(--safe-left));
  }
  .logo span { font-size: 22px; }
  .logo-img { height: 46px; }
  .nav { gap: 26px; }
  .nav-link {
    font-size: 15px;
    letter-spacing: 0.12em;
  }
}
.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; }

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-link {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(255,255,255,0.75);
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-link:hover { color: #fff; border-color: var(--primary); }
.nav-link.mute { color: var(--muted); }
.admin-link { color: #dc2626; }

.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;
}

.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));
}

/* Cards */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 94%, white 6%), color-mix(in srgb, var(--card) 80%, black 20%));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
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: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 800;
}

/* 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: radial-gradient(circle at 18% 15%, rgba(255, 62, 75, 0.28), transparent 32%),
              radial-gradient(circle at 78% 12%, rgba(255, 137, 102, 0.26), transparent 34%),
              linear-gradient(180deg, #120306 0%, #20070d 100%);
}
.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 {
  color: #0f172a;
  font-weight: 800;
}
.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 2px solid rgba(255, 98, 106, 0.3);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 13px;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: #150b13;
}
.input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 98, 106, 0.25);
}
.input::placeholder {
  color: rgba(32,16,24,0.5);
}

.select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid rgba(255, 98, 106, 0.25);
  background: rgba(255,255,255,0.92);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #150b13;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  color: #1a0f12;
}
.btn.primary {
  background: linear-gradient(135deg, var(--btn-grad-1), var(--btn-grad-2));
  color: #fff;
}
.btn.primary:hover { background: linear-gradient(135deg, color-mix(in srgb, var(--btn-grad-1) 88%, white 12%), color-mix(in srgb, var(--btn-grad-2) 88%, white 12%)); transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }
.btn.ghost {
  background: rgba(255,255,255,0.92);
  color: #1a0f12;
  border: 1px solid rgba(94, 32, 39, 0.25);
}
.btn.small { padding: 10px 12px; border-radius: 12px; 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: #0b1221;
  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: #0b1221;
  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: 42px; font-weight: 900; margin: 4px 0; }
.kpi .label { text-transform: uppercase; letter-spacing: 0.18em; font-size: 11px; color: var(--muted); font-weight: 800; }

.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: 11px;
}
.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%);
}
.list-item strong { font-size: 14px; }
.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: 18px;
  overflow: hidden;
}
.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: color-mix(in srgb, var(--card) 88%, white 12%);
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--card) 85%, white 15%); }

/* 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.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 16px;
  color: #fff;
  min-height: 110px;
  min-width: 0;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin: 0 0 6px;
}
.stat-value {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  gap: 6px;
  align-items: baseline;
  color: #fff;
  flex-wrap: wrap;
  min-width: 0;
}
.stat-value span { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; }
.stat-value.small { font-size: 18px; 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);
}

.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); }
.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: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease, transform 0.1s ease;
}
.pill-btn:hover { border-color: var(--primary); background: #fff; 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);
}

.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: #111827;
  background: #ffffff;
}
:root[data-env="dev"] .select option {
  color: #0b1221;
  background: #e2e8f0;
}
.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: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.incentive-modal .panel {
  background: rgba(255,255,255,0.8);
  border-radius: 22px;
  border: 1px solid rgba(15,23,42,0.06);
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.incentive-modal .products-panel {
  grid-column: 1 / -1;
}
.incentive-modal .panel-title {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15,23,42,0.8);
  font-weight: 800;
}
.incentive-modal .extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(14,165,233,0.08);
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(14,165,233,0.2);
}
.incentive-modal .extra-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.incentive-modal .extra-input span {
  font-size: 14px;
}
.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: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
}
.incentive-modal #shops-wrapper label {
  border-radius: 999px !important;
  border: 1px solid rgba(15,23,42,0.08) !important;
  background: rgba(248,250,252,0.8) !important;
  padding: 8px 16px !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.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 .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);
}

.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;
}

.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));
}

/* 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 .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 #basket-summary { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.05); }
.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; }
.encodage-modal .basket-item {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #2b1a1d;
}
.encodage-modal .pill-btn {
  background: #f7f8fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #2b1a1d;
}
.encodage-modal .pill-btn small { color: #d63c3c; }
.encodage-modal .brand-title { color: #d63c3c; }

/* Progress bar */
.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  width: 0;
  transition: width 0.3s ease;
}

/* 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;
}
.dialog h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.dialog p { margin: 0; color: var(--muted); 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;
}
.schedule-violation-line {
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
}
.schedule-violation-label {
  font-weight: 800;
  color: #0f172a;
}
.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: 16px; }
  .nav-link { font-size: 13px; letter-spacing: 0.12em; }
  .table th, .table td { padding: 10px 8px; font-size: 12px; }
  .badge { font-size: 11px; padding: 5px 8px; }
  .card { padding: 16px; border-radius: 20px; }
  .title { font-size: 22px; }
  .subtitle { font-size: 12px; }
  .kpi .big { font-size: 36px; }
}

@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: mobile */
@media (max-width: 640px) {
  .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: none;
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
    max-height: calc(100dvh - 110px - var(--safe-top));
    overflow-y: auto;
  }
  .topbar.is-nav-open .nav {
    display: flex;
  }
  .nav-link {
    font-size: 12px;
    letter-spacing: 0.08em;
    padding: 10px 0;
    width: 100%;
  }
  .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: 16px; }
  .subtitle { font-size: 10px; }
  .table th, .table td { padding: 6px 4px; font-size: 10px; }
  .badge { font-size: 9px; padding: 3px 6px; }
  .btn.small { padding: 7px 8px; font-size: 10px; }
  .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; }
  .kpi .big { font-size: 28px; }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .incentive-grid { grid-template-columns: 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;
  }
}

.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; }
.scroll-x table { min-width: 600px; }

/* 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; }

/* 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;
}
.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: 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 { max-width: 900px; }
.week-template-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.week-template-table th, .week-template-table td { border: 1px solid rgba(255,255,255,0.08); padding: 6px; text-align: center; }
.week-template-table th { background: rgba(255,255,255,0.06); 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 { text-align: left; font-weight: 700; }
.tpl-controls, .tpl-apply { margin: 12px 0; }
.tpl-apply .chip { margin-bottom: 6px; }

/* 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 .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; }
body.light-mode .pday-sat { background: #ffedd5; }
body.light-mode .pday-ferie { background: #ede9fe; }
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;
}

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: #64748b !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: #55657d !important; }
body.light-mode .muted { color: #64748b !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: #64748b !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 .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; }

.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-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

  .bonus-toolbar {
    width: 100%;
  }

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