@font-face {
  font-display: swap;
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  src: url("/fonts/Manrope-VariableFont_wght.ttf") format("truetype");
}

:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --panel: #ffffff;
  --text: #14201b;
  --muted: #69736d;
  --line: #e6eae3;
  --accent: #1c6b4f;
  --accent-fonce: #175a41;
  --accent-2: #2a6e87;
  --soft: #eaf1ec;
  --danger: #b23f38;
  --warning: #946410;
  --terracotta: #b6603e;
  --terracotta-soft: #f5e3d6;
  --shadow: 0 1px 2px rgba(20, 40, 30, 0.05), 0 10px 26px rgba(20, 40, 30, 0.05);
  --radius: 14px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --bottombar-height: 68px;
  --bottombar-clearance: 24px;
}

/* Breakpoints: mobile < 680px | tablette 680-900px | desktop > 900px. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.sidebar-lock {
  overflow: hidden;
}

#appShell {
  min-height: 100dvh;
}

.app-main {
  min-width: 0;
  width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.1;
}

h2,
h3 {
  font-size: 18px;
  margin: 0;
}

p,
span,
label,
small {
  color: var(--muted);
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px clamp(14px, 4vw, 42px);
  position: relative;
  z-index: 10;
}

.top-actions,
.panel-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mp-topbar {
  align-items: center;
  background: #f4f6f2;
  border-bottom: 1px solid #e2e7de;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 13px clamp(16px, 3vw, 30px);
}

.mp-topbar-title h1 {
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}

.mp-topbar-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-topbar-title-row {
  align-items: center;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.mp-topbar-brand {
  align-items: center;
  color: var(--text);
  display: none;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 0;
}

.mp-topbar-brand img {
  border-radius: 11px;
  height: 32px;
  width: 32px;
}

.mp-topbar-brand strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.mp-topbar-title p {
  color: var(--muted);
  font-size: 12.5px;
  margin: 2px 0 0;
}

.mp-page-badge {
  background: #ffffff;
  border: 1px solid #dce2da;
  border-radius: 999px;
  color: var(--muted);
  display: none;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  min-height: 28px;
  padding: 5px 10px;
  white-space: nowrap;
}

.mp-topbar-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.desktop-sidebar-toggle {
  display: none;
}

.mobile-tab-bar {
  display: none;
}

.mp-demo {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dce2da;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 800;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.mp-demo.hidden {
  display: none;
}

.mp-demo.is-active {
  background: #eaf4ee;
  border-color: #bfe0cc;
  color: var(--accent);
}

.mp-demo.danger {
  background: #f5dfdb;
  border-color: #e0b0a9;
  color: var(--danger);
}

.mp-dot {
  background: #a6aea8;
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

.mp-demo.is-active .mp-dot {
  background: var(--accent);
}

.mp-demo.danger .mp-dot {
  background: #a6aea8;
}

.mp-user-chip {
  align-items: center;
  background: #eaf1ec;
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 800;
  height: 38px;
  padding: 0 13px;
  white-space: nowrap;
}

.mp-icon-btn {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dce2da;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  width: 38px;
}

.mp-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mp-icon-btn.is-active {
  background: #eaf4ee;
  border-color: #bfe0cc;
  color: var(--accent);
}

.mp-icon-btn.is-logout:hover {
  background: #f8e4e2;
  border-color: #e0b0a9;
  color: #bf4a43;
}

.mobile-account-btn,
.mobile-account-backdrop,
.mobile-account-menu {
  display: none;
}

.mobile-account-state {
  align-items: center;
  background: #eef3f1;
  border: 1px solid #dce2da;
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  margin-top: 4px;
  padding: 4px 8px;
  white-space: nowrap;
}

body.loading {
  cursor: progress;
}

.auth-view {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 16px;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  margin: 0 auto;
  max-width: 420px;
  padding: 20px;
  width: 100%;
}

.auth-card h1 {
  margin-top: 6px;
}

#authMessage {
  color: var(--danger);
  font-weight: 750;
  min-height: 20px;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

main {
  display: grid;
  gap: 18px;
  padding: 16px clamp(12px, 4vw, 42px) 86px;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  min-height: 44px;
  padding: 9px 13px;
}

button:hover {
  filter: brightness(0.94);
}

button.secondary {
  background: #e8f0ed;
  color: var(--accent);
}

button.danger {
  background: var(--danger);
}

.hero {
  align-items: end;
  background: linear-gradient(135deg, #ffffff 0%, #e7f1e9 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px;
}

.hero h2 {
  color: var(--text);
  font-size: 38px;
  line-height: 1;
  margin-top: 6px;
}

.cockpit-hero {
  align-items: center;
  box-shadow: none;
}

.cockpit-hero h2 {
  font-size: 28px;
  margin-bottom: 6px;
}

.hero-main-number {
  color: var(--text);
  font-size: 38px;
  font-weight: 850;
  line-height: 1;
  margin-top: 6px;
}

.hero-hint {
  margin-top: 6px;
}

.hero-actions,
.actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-actions {
  align-items: end;
}

.dashboard-filter {
  align-items: start;
  display: grid;
  gap: 4px;
  min-width: 170px;
}

.dashboard-filter span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-filter input {
  min-height: 44px;
}

.hero-actions #openQuickProduction {
  min-height: 44px;
}

.metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cockpit-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cockpit-section-head {
  align-items: end;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.cockpit-section-head h2 {
  margin-top: 3px;
}

.kpi-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.kpi-filters button {
  background: #eff6f1;
  border: 1px solid #cbe0d3;
  color: var(--accent);
  filter: none;
  font-size: 12px;
  min-height: 32px;
  padding: 6px 9px;
}

.kpi-filters button:hover,
.kpi-filters button:focus-visible,
.kpi-filters button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  filter: none;
}

.kpi-filters button:active {
  background: var(--accent-fonce);
  border-color: var(--accent-fonce);
  color: #ffffff;
}

.kpi-filters button:focus-visible {
  outline: 2px solid rgba(28, 107, 79, 0.18);
  outline-offset: 2px;
}

.kpi-filters button.active:hover,
.kpi-filters button.active:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  display: grid;
  gap: 3px;
  min-height: 68px;
  padding: 10px 12px 9px;
}

.metrics article.hidden {
  display: none;
}

.metrics strong {
  color: var(--text);
  font-size: 23px;
  line-height: 1;
}

.metrics small {
  display: none;
}

.cockpit-metrics .metrics article > span {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

.cockpit-metrics .metrics article small {
  display: none !important;
}

.pilotage-zone {
  background: #f8fbf8;
  border: 1px solid #cbdad1;
  border-radius: 10px;
  display: grid;
  gap: 10px;
  padding: 10px;
}

.pilotage-directive {
  background: #f1faf3;
  border: 1px solid var(--line);
  border-left: 6px solid #55a467;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  padding: 12px;
}

.directive-heading,
.directive-context,
.directive-action {
  display: grid;
  gap: 10px;
}

.directive-heading {
  grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.7fr);
}

.directive-context {
  grid-template-columns: minmax(150px, .8fr) minmax(260px, 1.7fr) minmax(130px, .6fr);
}

.directive-action {
  align-items: end;
  border-top: 1px solid rgba(54, 94, 68, .16);
  grid-template-columns: minmax(260px, 1fr) auto;
  padding-top: 10px;
}

.pilotage-directive article {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pilotage-directive span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.pilotage-directive strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.directive-status strong,
.directive-priority strong {
  font-size: 18px;
}

.directive-normal {
  border-left-color: #55a467;
}

.directive-warning {
  background: #fffaf0;
  border-left-color: #d28a20;
}

.directive-danger {
  background: #fff5f3;
  border-left-color: #c6514b;
}

.directive-details {
  border-top: 1px solid rgba(54, 94, 68, .16);
  padding-top: 8px;
}

.directive-details summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.directive-details[open] summary {
  margin-bottom: 9px;
}

.cockpit-grid {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
}

.secondary-cockpit {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.65fr);
}

.trend-panel,
.watch-panel {
  min-height: 100%;
}

.trend-panel,
.watch-panel,
.quick-actions-panel,
.quick-production-panel {
  padding: 18px;
}

.panel-chip {
  align-self: start;
  background: var(--soft);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
  white-space: nowrap;
}

.panel {
  padding: 12px;
}

.compact-head {
  margin-bottom: 6px;
}

.compact-filter {
  display: grid;
  gap: 3px;
  min-width: 128px;
}

.compact-filter span {
  font-size: 12px;
  font-weight: 800;
}

.compact-filter select {
  min-height: 36px;
  padding: 6px 8px;
}

.production-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 8px;
}

.production-summary article {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 2px;
  padding: 11px 12px;
}

.production-summary article:nth-child(1) {
  border-left-color: var(--accent);
}

.production-summary article:nth-child(2) {
  border-left-color: var(--accent-2);
}

.production-summary article:nth-child(3) {
  border-left-color: var(--terracotta);
}

.production-summary article:nth-child(4) {
  border-left-color: #c7a33b;
}

.production-summary span {
  font-size: 12px;
  font-weight: 700;
}

.production-summary strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
}

.cockpit-filters {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(130px, 180px));
  margin-bottom: 8px;
}

.cockpit-filters label,
.quick-production-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cockpit-filters span,
.quick-production-grid span {
  font-size: 12px;
  font-weight: 800;
}

.cockpit-filters select {
  min-height: 38px;
  padding: 7px 9px;
}

.alerts {
  display: grid;
  gap: 8px;
}

.watch-list {
  display: grid;
  gap: 6px;
}

.watch-list {
  margin-bottom: 0;
}

.watch-list article {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-left: 4px solid #c7a33b;
  border-radius: 11px;
  display: grid;
  gap: 3px;
  padding: 11px 13px;
}

.watch-list strong {
  color: var(--text);
}

.watch-list span {
  font-size: 12px;
  line-height: 1.25;
}

.watch-ok {
  background: #edf8f0;
  border-color: #b9dfc2;
}

.watch-watch {
  background: #fff8e8;
  border-color: #f1d69b;
  border-left-color: #c7a33b;
}

.watch-danger {
  background: #fff1f0;
  border-color: #f2b8b5;
  border-left-color: #c0453f;
}

.quick-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-actions button {
  background: #eff6f1;
  border: 1px solid #cbe0d3;
  color: var(--accent);
  min-height: 44px;
  padding: 12px 14px;
  text-align: left;
}

.quick-actions button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.quick-actions button:focus-visible {
  background: var(--accent);
  border-color: #8fc0a3;
  color: #ffffff;
  outline: 2px solid rgba(28, 107, 79, 0.18);
  outline-offset: 1px;
}

.quick-production-panel {
  border-left: 6px solid var(--accent);
  scroll-margin-top: 86px;
}

.quick-production-rows {
  display: grid;
  gap: 10px;
}

.quick-production-row {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 11px;
}

.quick-production-row.completed {
  background: #f1faf3;
  border-color: #b9dfc2;
}

.quick-production-head,
.quick-production-footer {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.quick-production-head div {
  display: grid;
  gap: 3px;
}

.quick-production-head strong {
  color: var(--text);
}

.quick-production-state {
  background: #e8f0ed;
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}

.quick-production-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-production-grid input {
  min-height: 40px;
  min-width: 0;
  padding: 7px 9px;
}

.quick-production-footer {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.quick-production-footer p {
  color: var(--accent);
  font-weight: 800;
}

.mobile-account-mode-row {
  display: none;
}

.mp-switch {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  padding: 0;
}

.mp-switch-track {
  background: #d9e1db;
  border-radius: 999px;
  display: inline-flex;
  height: 24px;
  padding: 2px;
  transition: background 0.16s ease;
  width: 44px;
}

.mp-switch-thumb {
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(20, 40, 30, 0.16);
  display: block;
  height: 20px;
  transform: translateX(0);
  transition: transform 0.16s ease;
  width: 20px;
}

.mp-switch.is-active .mp-switch-track {
  background: var(--accent);
}

.mp-switch.is-active .mp-switch-thumb {
  transform: translateX(20px);
}

.workspace {
  align-items: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.form-panel:not(.open) {
  display: none;
}

.form-panel.open {
  display: grid;
}

.workspace > section.panel:not(.form-panel),
.workspace > .form-panel {
  width: 100%;
}

.form-panel,
form {
  display: grid;
  gap: 12px;
}

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

.form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.form-section summary {
  list-style: none;
  cursor: pointer;
}

.form-section summary::-webkit-details-marker {
  display: none;
}

.form-section-head,
.form-section > summary {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.form-section > summary {
  padding: 0;
}

.form-section h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.form-section-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-section-advanced {
  align-content: start;
}

.form-section-advanced[open] {
  gap: 14px;
}

.form-section-advanced .form-grid {
  padding-top: 4px;
}

.field[data-field="notes"],
.field[data-field="label"] {
  grid-column: 1 / -1;
}

.panel-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.password-control {
  display: grid;
  position: relative;
}

.password-control input {
  padding-right: 40px;
}

.reveal-password {
  align-items: center;
  border-radius: 999px;
  color: var(--muted);
  display: grid;
  height: 30px;
  justify-content: center;
  min-height: 30px;
  padding: 0;
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
}

.password-toggle-icon {
  fill: none;
  height: 16px;
  pointer-events: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 16px;
}

.reveal-password,
.reveal-password[aria-pressed="true"],
.reveal-password[aria-pressed="false"],
.reveal-password .password-toggle-icon,
.reveal-password[aria-pressed="true"] .password-toggle-icon,
.reveal-password[aria-pressed="false"] .password-toggle-icon {
  color: #777;
  stroke: #777;
}

.form-title {
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  padding-bottom: 10px;
}

.form-close-btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.form-close-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.check-field {
  align-items: center;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.check-field input {
  min-height: 22px;
  width: 22px;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-height: 44px;
  padding: 9px 11px;
  width: 100%;
}

input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  height: 44px;
  line-height: 1.2;
  min-height: 44px;
  padding: 9px 11px;
}

input[type="date"]::-webkit-date-and-time-value {
  line-height: 1.2;
  margin: 0;
  text-align: left;
}

input.readonly {
  background: #f4f7f5;
  color: var(--muted);
}

textarea {
  min-height: 74px;
  resize: vertical;
}

.list {
  display: grid;
  gap: 10px;
}

.module-tools {
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.module-tools--shell {
  background: transparent;
  border: 0;
  padding: 0;
}

.lots-tools {
  gap: 14px;
  padding: 18px;
}

.lots {
  background: #fff;
  border: 1px solid #e6eae3;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(20, 40, 30, 0.04);
  display: grid;
  gap: 16px;
  padding: 20px;
}

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

.lots__head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.lots__head p {
  color: var(--muted);
  font-size: 12.5px;
  margin: 3px 0 0;
}

.lots__actions {
  display: flex;
  gap: 10px;
}

.lots__filters {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.lots__filters label {
  display: grid;
  gap: 5px;
}

.lots__filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lots__filters select,
.lots__filters input {
  min-height: 40px;
  padding: 8px 10px;
}

.lots__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lots__summary strong {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  padding: 6px 9px;
}

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

.production-shell-strip,
.health-shell-strip,
.finance-shell-strip {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.production-shell-summary,
.health-shell-summary {
  align-items: center;
}

.module-tools .lots__head > div:first-child {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.module-tools .lots__head > div:first-child h2,
.module-tools .lots__head > div:first-child p {
  margin: 0;
}

.module-tools .lots__head > div:first-child p {
  white-space: nowrap;
}

.finance-shell-kpis {
  margin-top: 4px;
}

.finance-shell-split {
  margin-top: 2px;
}

.finance-shell-chart {
  margin-top: 2px;
}

.production-card {
  border-left: 4px solid #1c6b4f;
}

.health-card {
  border-left: 4px solid #2a6e87;
}

.finance-card {
  border-left: 4px solid #b6603e;
}

.export-inline {
  position: relative;
}

.export-inline.is-open .export__menu {
  display: flex;
}

.export__menu {
  background: #fff;
  border: 1px solid #e2e7de;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20, 40, 30, 0.14);
  display: none;
  flex-direction: column;
  gap: 2px;
  left: 0;
  min-width: 210px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 10;
}

.export__menu button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #2c3a33;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 11px;
  text-align: left;
}

.export__menu button:hover {
  background: #eff6f1;
  color: #1c6b4f;
}

.btn-ghost .caret {
  opacity: 0.6;
}

.btn-ghost,
.btn-primary,
.btn-soft,
.btn-danger {
  align-items: center;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  gap: 8px;
  height: 40px;
  justify-content: center;
  padding: 0 16px;
  white-space: nowrap;
}

.btn-ghost {
  background: #ffffff;
  border: 1px solid #dce2da;
  color: #36443d;
}

.btn-ghost:hover {
  border-color: #1c6b4f;
  color: #1c6b4f;
}

.btn-primary {
  background: #1c6b4f;
  border: 0;
  color: #fff;
}

.btn-primary:hover {
  background: #185b43;
}

.btn-soft {
  background: #fff;
  border: 1px solid #dce2da;
  color: #36443d;
}

.btn-soft:hover {
  border-color: #1c6b4f;
  color: #1c6b4f;
}

.btn-danger {
  background: #fcf1f0;
  border: 1px solid #f0dad7;
  color: #bf4a43;
}

.btn-danger:hover {
  background: #f8e4e2;
}

.lots-filter-bar {
  grid-template-columns: minmax(180px, 260px);
}

.lot {
  background: #fff;
  border: 1px solid #e6eae3;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(20, 40, 30, 0.04);
}

.lot:hover {
  border-color: #cbd6cd;
}

.lot__top {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.lot__top h3 {
  color: #14201b;
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.lot__top p {
  color: #69736d;
  font-size: 12.5px;
  margin: 3px 0 0;
}

.badge--ok {
  background: #e4f2ea;
  color: #1c7a4d;
}

.badge--info {
  background: #e2eef4;
  color: #2a6e87;
}

.badge--muted {
  background: #ecefea;
  color: #5c6660;
}

.badge--danger {
  background: #fbe6e4;
  color: var(--danger);
}

.badge--warn {
  background: #faf1d7;
  color: #7a6011;
}

.badge--terra {
  background: #f5e3d6;
  color: #94481f;
}

.badge--ok,
.badge--info,
.badge--muted,
.badge--danger,
.badge--warn,
.badge--terra {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  white-space: nowrap;
}

.lot__meta {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cell {
  background: #f5f7f3;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
}

.cell span {
  color: #8b948e;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cell strong {
  color: #1c2b24;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.cell--amount strong {
  font-size: 13.5px;
}

.amount-in {
  color: #1c7a4d;
}

.amount-out {
  color: #b6603e;
}

.lot__actions {
  align-items: center;
  border-top: 1px solid #eef1ec;
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding-top: 13px;
}

.filter-bar label {
  display: grid;
  gap: 5px;
}

.filter-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-bar select,
.filter-bar input {
  min-height: 40px;
  padding: 8px 10px;
}

.finance-module .lots__grid,
.production-module .lots__grid,
.health-module .lots__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

[data-module-grid] > .module-grid-empty {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .lots__grid,
  .lots__filters,
  .production-shell-strip,
  .health-shell-strip,
  .finance-shell-strip {
    grid-template-columns: 1fr;
  }

  .lots__head {
    flex-direction: column;
    gap: 10px;
  }

  .lots__actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .lots__actions .btn-primary,
  .lots__actions .btn-ghost,
  .lots__actions .export-inline {
    width: 100%;
  }
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-strip strong,
.summary-strip span {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  padding: 6px 9px;
}

.summary-strip strong {
  background: var(--soft);
  color: var(--accent);
}

.row {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 11px;
}

.row-finance {
  border-left: 4px solid var(--accent-2);
}

.row-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.row-actions button {
  min-height: 34px;
  padding: 7px 9px;
}

.compact-actions {
  justify-content: flex-end;
}

.compact-actions button {
  font-size: 14px;
}

.row-actions button.danger {
  background: #f6eeee;
  color: var(--danger);
}

.row-actions button.secondary {
  background: #eef3f1;
}

.row-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.badge {
  background: var(--soft);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
}

.badge.badge--ok,
.badge.badge--info,
.badge.badge--muted,
.badge.badge--danger,
.badge.badge--warn,
.badge.badge--terra {
  color: inherit;
}

.badge.badge--ok {
  background: #e4f2ea;
  color: #1c7a4d;
}

.badge.badge--info {
  background: #e2eef4;
  color: #2a6e87;
}

.badge.badge--muted {
  background: #ecefea;
  color: #5c6660;
}

.badge.badge--danger {
  background: #fbe6e4;
  color: var(--danger);
}

.badge.badge--warn {
  background: #faf1d7;
  color: #7a6011;
}

.badge.badge--terra {
  background: #f5e3d6;
  color: #94481f;
}

.badge.ok {
  background: #e5f5ec;
  color: #1f7a4f;
}

.badge.muted {
  background: #eef0f1;
  color: #67727a;
}

.weekly-summary {
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.mini-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-grid span {
  background: #f6f8f6;
  border-radius: 8px;
  padding: 10px;
}

.mini-grid strong {
  color: var(--text);
}

.detail-panel {
  display: grid;
  gap: 16px;
}

.detail-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline article {
  border-left: 3px solid var(--accent);
  display: grid;
  gap: 4px;
  padding: 8px 0 8px 12px;
}

.timeline strong {
  color: var(--text);
}

.trend {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 190px;
}

.trend.dense {
  grid-template-columns: repeat(30, minmax(28px, 1fr));
  overflow-x: auto;
  padding-bottom: 8px;
}

.trend.dense strong {
  font-size: 10px;
}

.trend div {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-rows: 1fr auto auto;
  height: 170px;
  justify-items: center;
}

.trend span {
  align-self: end;
  background: var(--accent-2);
  border-radius: 8px 8px 2px 2px;
  display: block;
  min-height: 6px;
  width: 100%;
}

.trend strong {
  color: var(--text);
  font-size: 13px;
}

.empty {
  background: #f7f9f7;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
}

.empty strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.action-empty {
  display: grid;
  gap: 10px;
}

.action-empty button {
  justify-self: start;
}

.hidden {
  display: none !important;
}

#statusMessage {
  color: var(--accent);
  font-weight: 800;
}

@media (max-width: 900px) {
  main {
    gap: 12px;
    padding-left: clamp(10px, 3vw, 24px);
    padding-right: clamp(10px, 3vw, 24px);
    padding-top: 12px;
  }

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

  .cockpit-section-head {
    align-items: start;
    display: grid;
  }

  .kpi-filters {
    justify-content: flex-start;
  }

  .metrics article:nth-child(3) {
    order: 1;
  }

  .metrics article:nth-child(4) {
    order: 2;
  }

  .metrics article:nth-child(9) {
    order: 4;
  }

  .metrics article:nth-child(8) {
    order: 3;
  }

  .metrics article:nth-child(1) {
    order: 5;
  }

  .metrics article:nth-child(2) {
    order: 6;
  }

  .metrics article:nth-child(5) {
    order: 7;
  }

  .metrics article:nth-child(6) {
    order: 8;
  }

  .metrics article:nth-child(7) {
    order: 9;
  }

  .cockpit-metrics article {
    order: initial;
  }

  .cockpit-grid,
  .secondary-cockpit {
    grid-template-columns: 1fr;
  }

  .production-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .workspace .panel:not(.form-panel) {
    order: 1;
  }

  .form-panel {
    order: 2;
  }

  .form-panel:not(.open) {
    display: none;
  }

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

  body[data-module="production"] .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-module="production"] .field[data-field="flock_id"],
  body[data-module="production"] .field[data-field="notes"] {
    grid-column: 1 / -1;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-production-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-primary {
    grid-column: span 2;
  }

  .form-panel.open {
    border-color: rgba(45, 106, 79, 0.35);
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: center;
    background: #ffffff;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    padding: 10px 12px;
    position: static;
  }

  .top-actions {
    display: grid;
    gap: 7px;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .top-actions button {
    min-height: 38px;
    padding: 7px 9px;
  }

  .hero {
    align-items: stretch;
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  .hero h2 {
    font-size: 32px;
  }

  .cockpit-hero h2 {
    font-size: 24px;
  }

  .hero-main-number {
    font-size: 34px;
  }

  .pilotage-zone {
    gap: 10px;
    margin-inline: -2px;
    padding: 10px;
  }

  .directive-heading,
  .directive-context,
  .directive-action {
    grid-template-columns: 1fr;
  }

  .directive-action button {
    width: 100%;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .dashboard-filter {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .hero-actions button,
  .sticky-actions button {
    width: 100%;
  }

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

  .metrics article {
    min-height: 76px;
    padding: 10px;
  }

  .metrics strong {
    font-size: 22px;
  }

  .panel-chip {
    justify-self: start;
    white-space: normal;
  }

  .compact-filter {
    min-width: 0;
  }

  .panel {
    padding: 12px;
  }

  .panel-head {
    display: grid;
    gap: 8px;
  }

  .panel-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

.panel-actions > * {
  width: 100%;
}

#moduleWorkspace > .panel.module-shell-hidden > .panel-head {
  display: none;
}

#listSubtitle {
  display: none;
}

  #listTitle {
    font-size: 18px;
  }

  .row-head {
    display: grid;
    gap: 8px;
  }

  .row {
    gap: 8px;
    padding: 10px;
  }

  .row-title {
    font-size: 16px;
  }

  .meta {
    gap: 5px;
    margin-top: 6px;
  }

  .badge {
    border-radius: 8px;
    font-size: 12px;
    padding: 4px 7px;
  }

  .compact-actions {
    justify-content: flex-start;
  }

  .row-actions button {
    flex: 0 1 auto;
    font-size: 13px;
    min-height: 34px;
    min-width: 82px;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar label {
    min-width: 0;
  }

  .filter-bar select,
  .filter-bar input {
    min-height: 38px;
  }

  .module-tools {
    gap: 8px;
    padding: 10px;
  }

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

  .export-inline {
    width: 100%;
  }

  .export-inline .export__menu {
    left: 0;
    min-width: 0;
    right: 0;
    width: 100%;
  }

  .summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-inline: 0;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .summary-strip strong,
  .summary-strip span {
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.25;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: normal;
  }

  .summary-strip strong {
    grid-column: 1 / -1;
  }

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

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

  input,
  select,
  textarea {
    min-height: 42px;
  }

  input[type="date"] {
    height: 42px;
    min-height: 42px;
  }

  textarea {
    min-height: 64px;
  }
}

@media (max-width: 680px) {
  .auth-view {
    align-items: start;
    padding: 12px;
  }

  .auth-card {
    gap: 11px;
    padding: 16px;
  }

  .auth-card h1 {
    font-size: 22px;
  }

  h1 {
    font-size: 22px;
  }

  .hero-actions,
  .filter-bar,
  .summary-strip,
  .pilotage-directive,
  body[data-module="production"] .form-grid {
    grid-template-columns: 1fr;
  }

  .cockpit-filters,
  .quick-production-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-production-head,
  .quick-production-footer {
    align-items: stretch;
    display: grid;
  }

  .quick-production-footer button {
    width: 100%;
  }

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

  .metrics article small {
    font-size: 12px;
  }

  .cockpit-metrics,
  .production-summary,
  .quick-actions,
  .fin-kpis,
  .fin-split,
  body[data-module="health"] .lots__grid,
  .mini-grid,
  .detail-grid,
  .weekly-summary {
    grid-template-columns: 1fr;
  }

  .fin {
    gap: 12px;
  }

  .fin-kpis {
    grid-template-columns: 1fr;
  }

  .fin-split {
    grid-template-columns: 1fr;
  }

  .fin-card {
    padding: 14px;
  }

  .fin-card__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .fin-chips {
    flex-wrap: wrap;
    width: 100%;
  }

  .fin-chip {
    flex: 1 1 0;
  }

  .fin-chart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: auto;
    min-height: 150px;
  }

  .fin-col {
    min-height: 150px;
  }

  .fin-stats {
    grid-template-columns: 1fr;
  }

  .fin-stat strong {
    font-size: 16px;
  }

  .fin-bar__top {
    align-items: flex-start;
    flex-direction: column;
  }

  .trend {
    gap: 5px;
    min-height: 150px;
  }

  .trend div {
    height: 136px;
  }
}


/* Passe UX terrain v27 */
html {
  scroll-behavior: smooth;
}

.skip-link {
  background: var(--accent);
  border-radius: 0 0 8px 0;
  color: #ffffff;
  font-weight: 800;
  left: 0;
  padding: 10px 14px;
  position: fixed;
  top: 0;
  transform: translateY(-120%);
  transition: transform 160ms ease;
  z-index: 30;
}

.skip-link:focus {
  transform: translateY(0);
}

body:not(.is-authenticated) .skip-link {
  display: none;
}

@media (max-width: 680px) {
  .cockpit-section-head {
    gap: 8px;
  }

  .cockpit-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .cockpit-metrics .metrics article {
    min-height: 0;
    padding: 10px 11px;
  }

  .cockpit-metrics article {
    min-width: 0;
    overflow: visible;
  }

  .cockpit-metrics article > span,
  .cockpit-metrics span,
  .cockpit-metrics strong {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: normal;
  }

  .cockpit-grid,
  .secondary-cockpit {
    grid-template-columns: 1fr;
  }

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

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .trend {
    min-height: 140px;
  }

  .finance-shell-strip {
    grid-template-columns: 1fr;
  }

  .finance-shell-kpis,
  .finance-shell-split {
    grid-template-columns: 1fr;
  }

  .finance-shell-chart {
    margin-top: 0;
  }

  .fin-chart {
    height: auto;
    min-height: 150px;
  }

  .fin-col {
    min-height: 150px;
  }

  .fin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fin-card {
    padding: 14px;
  }

  .fin-card__head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .cockpit-metrics .metrics article {
    min-height: 0;
  }

  .production-summary,
  .quick-actions,
  .finance-shell-kpis,
  .finance-shell-split,
  .fin-stats {
    grid-template-columns: 1fr;
  }

  .finance-module .lots__grid,
  .production-module .lots__grid,
  .health-module .lots__grid {
    grid-template-columns: 1fr;
  }

  .finance-grid .lot__meta,
  .production-grid .lot__meta,
  .health-grid .lot__meta {
    grid-template-columns: 1fr;
  }

  .finance-grid .lot__actions,
  .production-grid .lot__actions,
  .health-grid .lot__actions {
    flex-direction: column;
  }

  .fin-chart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fin-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .fin-chip {
    min-width: 0;
    padding: 6px 4px;
    font-size: 11px;
    white-space: nowrap;
  }

  .fin-col {
    min-height: 140px;
  }

  .finance-grid,
  .production-grid,
  .health-grid,
  .lots__grid {
    grid-template-columns: 1fr;
  }

  .trend-panel,
  .watch-panel,
  .quick-actions-panel,
  .finance-shell-kpis,
  .finance-shell-split,
  .finance-shell-chart {
    padding: 12px;
  }

  .fin-kpi__value {
    font-size: 20px;
  }

  .fin-stat strong {
    font-size: 15px;
  }

  .fin-bar__top {
    align-items: flex-start;
    flex-direction: column;
  }

  .fin-analysis__head {
    flex-direction: column;
  }

  .finance-shell-chart {
    padding: 12px;
  }
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(29, 79, 115, 0.38);
  outline-offset: 3px;
}

#statusMessage {
  color: #ffffff;
}

.toast-message {
  background: #214f3f;
  border-radius: 8px;
  bottom: 18px;
  box-shadow: var(--shadow);
  max-width: min(420px, calc(100vw - 24px));
  opacity: 0;
  padding: 11px 14px;
  pointer-events: none;
  position: fixed;
  right: 18px;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 40;
}

.toast-message.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 680px) {
  .toast-message {
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
  }

}

@media (max-width: 680px) {
  .mp-topbar {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 9px 12px;
    position: relative;
    z-index: 30;
  }

  .mp-topbar-title {
    align-items: flex-start;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    order: 0;
    min-width: 0;
  }

  .mp-topbar-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-end;
    margin-left: auto;
    order: 1;
  }

  .mp-demo {
    display: none;
  }

  .mp-icon-btn {
    min-width: 0;
  }

  main {
    padding-bottom: 18px;
  }

  .toast-message {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .filter-bar,
  .cockpit-filters,
  .quick-production-grid,
  .form-grid,
  .metrics,
  .cockpit-metrics,
  .production-summary,
  .quick-actions,
  .mini-grid,
  .detail-grid,
  .fin-kpis,
  .fin-split,
  .fin-stats {
    grid-template-columns: 1fr;
  }

  .quick-primary {
    grid-column: auto;
  }

  .app-main > main {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Refonte progressive v1 : écran de connexion uniquement. */
:root {
  --bg: var(--mp-fond);
  --panel: var(--mp-surface);
  --text: var(--mp-texte);
  --muted: var(--mp-texte-3);
  --line: var(--mp-bordure);
  --accent: var(--mp-vert);
  --accent-2: var(--mp-terracotta);
  --soft: var(--mp-vert-clair);
  --danger: var(--mp-danger-fg);
  --warning: var(--mp-warn-fg);
}

.auth-view {
  background: var(--mp-fond);
  display: grid;
  gap: 0;
  grid-template-columns: 458px minmax(0, 1fr);
  min-height: 100vh;
  padding: 0;
}

.auth-brand-panel {
  align-content: stretch;
  background: linear-gradient(180deg, #163a2b 0%, #1c6b4f 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
  overflow: hidden;
  padding: 36px 30px 28px;
  position: relative;
}

.auth-brand-panel::before {
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.14), transparent 160px),
    radial-gradient(circle at 86% 60%, rgba(255, 255, 255, 0.08), transparent 240px);
  content: "";
  inset: 0;
  position: absolute;
}

.auth-brand-mark,
.auth-brand-copy,
.auth-brand-note {
  position: relative;
  z-index: 1;
}

.auth-brand-mark {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  max-width: 250px;
}

.auth-brand-mark img {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  height: 40px;
  padding: 7px;
  width: 40px;
}

.auth-brand-mark strong {
  color: #ffffff;
  display: block;
  font-size: 16px;
  line-height: 1.05;
}

.auth-brand-mark small {
  color: #9fc2b1;
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 1px;
}

.auth-brand-copy {
  margin-bottom: 0;
  margin-top: clamp(200px, 24vh, 240px);
  max-width: 370px;
}

.auth-brand-copy h1,
.auth-brand-copy p,
.auth-brand-note,
.auth-brand-points li {
  color: #ffffff;
}

.auth-brand-copy h1 {
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.05;
  max-width: 390px;
}

.auth-brand-copy p:not(.eyebrow) {
  color: #c4d8cc;
  font-size: 16px;
  line-height: 1.45;
  margin-top: 18px;
  max-width: 352px;
}

.auth-brand-points {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.auth-brand-points li {
  align-items: center;
  display: flex;
  font-size: 14px;
  gap: 10px;
  line-height: 1.35;
}

.auth-brand-points li::before {
  background: #69c28d;
  border-radius: 999px;
  content: "";
  flex: 0 0 7px;
  height: 7px;
  margin-top: 1px;
}

.auth-brand-note {
  display: none;
}

.auth-form-panel {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 28px 22px 24px;
}

.auth-form-panel .auth-card {
  max-width: 380px;
}

.auth-form-head {
  display: grid;
  gap: 5px;
  margin-bottom: 4px;
}

.auth-mobile-brand {
  display: none;
}

.auth-mobile-note {
  display: none;
}

.auth-form-hint {
  color: var(--mp-texte-3);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 2px;
}

.auth-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 17px;
  margin: 0;
  padding: 0;
  width: 100%;
}

.auth-card h1 {
  color: var(--mp-texte);
  font-size: 23px;
}

.auth-card .field {
  gap: 8px;
}

.auth-card .field > span:first-child {
  color: var(--mp-texte-2);
  font-size: var(--mp-fs-sm);
  font-weight: 800;
}

.auth-card input {
  border-color: var(--mp-bordure-2);
  border-radius: var(--mp-radius);
  min-height: 44px;
}

.auth-card input:focus-visible {
  border-color: var(--mp-vert);
  outline: 2px solid rgba(28, 107, 79, 0.28);
  outline-offset: 2px;
}

.auth-card button[type="submit"] {
  background: var(--mp-vert);
  border-radius: 12px;
  font-weight: 800;
  height: 48px;
}

.auth-card button[type="submit"]:hover {
  background: var(--mp-vert-fonce);
  filter: none;
}

.auth-card .reveal-password {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #777;
  height: 30px;
  right: 12px;
  transition: color 160ms ease, transform 160ms ease;
  width: 30px;
}

.auth-card .reveal-password:hover,
.auth-card .reveal-password:focus-visible,
.auth-card .reveal-password.is-visible {
  background: transparent;
  border-color: transparent;
  color: #777;
  filter: none;
}

.auth-card .reveal-password:hover .password-toggle-icon,
.auth-card .reveal-password:focus-visible .password-toggle-icon,
.auth-card .reveal-password.is-visible .password-toggle-icon {
  color: #777;
  stroke: #777;
}

.auth-card .reveal-password:active {
  background: transparent;
  border-color: transparent;
  color: #777;
}

.auth-card .reveal-password.is-visible {
  box-shadow: none;
}

.auth-card .reveal-password.is-visible:hover {
  background: transparent;
  border-color: transparent;
  color: #777;
}

.auth-card button.secondary.reveal-password,
.auth-card button.secondary.reveal-password:hover,
.auth-card button.secondary.reveal-password:focus-visible,
.auth-card button.secondary.reveal-password:active,
.auth-card button.secondary.reveal-password.is-visible,
.auth-card button.secondary.reveal-password.is-visible:hover {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #777;
  filter: none;
}

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

  .auth-brand-panel {
    display: none;
  }

  .auth-brand-copy {
    margin-bottom: 0;
    margin-top: 0;
  }

  .auth-form-panel {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 24px 16px 32px;
  }

  .auth-mobile-brand {
    align-items: center;
    display: inline-flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
    width: 100%;
  }

  .auth-mobile-brand img {
    background: var(--mp-vert);
    border-radius: 10px;
    height: 34px;
    padding: 6px;
    width: 34px;
  }

  .auth-mobile-brand strong {
    color: var(--text);
    font-size: 17px;
    font-weight: 850;
    line-height: 1.05;
  }

  .auth-mobile-note {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    margin-top: auto;
    padding-top: 18px;
    text-align: center;
  }

  .auth-form-panel .auth-card {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .auth-brand-panel {
    min-height: 240px;
    padding: 18px 14px 16px;
  }

  .auth-brand-copy h1 {
    font-size: 28px;
  }

  .auth-brand-copy p:not(.eyebrow) {
    font-size: 14px;
  }

  .auth-form-panel {
    padding: 16px 12px 28px;
  }

  .auth-card {
    gap: 16px;
  }
}

/* ============================================================
   REFONTE v2 — Application authentifiée (cockpit + modules)
   Visuel maquette : vert sapin, terracotta pour les sorties,
   cartes arrondies 14px, hero en bandeau sapin.
   Pur habillage : aucune classe/ID/structure du JS n'est touchée.
   ============================================================ */

/* Surfaces : arrondis plus généreux + bordure douce */
.metrics article,
.panel,
.module-tools,
.weekly-summary,
.row,
.empty,
.quick-production-row {
  border-radius: var(--radius);
}

input,
select,
textarea,
button {
  border-radius: var(--radius-sm);
}

/* Topbar : fond plein, plus net */
.topbar {
  background: var(--panel);
  padding-block: 14px;
}
.topbar .eyebrow {
  letter-spacing: 0.04em;
}
.topbar h1 {
  font-size: 20px;
}

/* Boutons : sapin + hover assombri (pas de filtre global) */
button {
  font-weight: 800;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
button:hover {
  filter: none;
  background: var(--accent-fonce);
}
button.secondary:not(.danger) {
  background: var(--soft);
  color: var(--accent);
}
button.secondary:not(.danger):hover {
  background: #dceae1;
  color: var(--accent-fonce);
}
button.danger:hover {
  background: #9d352f;
}

/* HERO COCKPIT : bandeau sapin signature */
.cockpit-hero {
  background: linear-gradient(135deg, var(--mp-vert-nuit-2) 0%, var(--mp-vert) 100%);
  border: 0;
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.cockpit-hero .eyebrow {
  color: #9fd0b6;
}
.cockpit-hero h2,
.cockpit-hero .hero-main-number {
  color: #ffffff;
}
.cockpit-hero #todayRate {
  color: rgba(255, 255, 255, 0.82);
}
.cockpit-hero .dashboard-filter span {
  color: #cfe6d8;
}
.cockpit-hero .dashboard-filter input {
  background: #ffffff;
  border-color: transparent;
}
.cockpit-hero #openQuickProduction {
  background: #ffffff;
  color: var(--accent);
}
.cockpit-hero #openQuickProduction:hover {
  background: #eaf4ee;
  color: var(--accent-fonce);
}

/* Zone pilotage : conteneur plus discret */
.pilotage-zone {
  background: transparent;
  border: 0;
  gap: 14px;
  padding: 0;
}

/* KPI cards */
.cockpit-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.metrics article {
  box-shadow: var(--shadow);
  border-left: 4px solid var(--line);
  align-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 10px 12px 9px;
}

.metrics article:nth-child(1) {
  border-left-color: var(--accent);
}

.metrics article:nth-child(2) {
  border-left-color: #3d8d69;
}

.metrics article:nth-child(3) {
  border-left-color: var(--accent-2);
}

.metrics article:nth-child(4) {
  border-left-color: #c7a33b;
}

.metrics article:nth-child(5) {
  border-left-color: var(--terracotta);
}

.metrics article:nth-child(6) {
  border-left-color: #c0453f;
}

.metrics article:nth-child(7) {
  border-left-color: #4d7f5f;
}

.metrics article:nth-child(8) {
  border-left-color: #6b7d92;
}

.metrics article:nth-child(9) {
  border-left-color: #2a6e87;
}

.metrics article:nth-child(10) {
  border-left-color: #7b5ea6;
}

.metrics strong {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 680px) {
  #dashboardView .cockpit-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }

  #dashboardView .cockpit-metrics article {
    min-width: 0;
    padding: 10px;
  }

  #dashboardView .cockpit-metrics article > span {
    display: -webkit-box;
    line-height: 1.2;
    min-height: 2.4em;
    overflow: hidden;
    overflow-wrap: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    word-break: normal;
  }

  #dashboardView .cockpit-metrics strong {
    font-size: 22px;
    overflow-wrap: normal;
    white-space: normal;
    word-break: normal;
  }
}

/* Tendance : barres sapin (au lieu du bleu/terracotta) */
.trend span {
  background: #7fb79b;
}
.trend div:last-child span {
  background: var(--accent);
}

.row-finance {
  border-left-color: var(--terracotta);
}

/* Badges : pastille neutre par défaut */
.badge {
  font-weight: 800;
}

/* Lignes : ombre légère + survol */
.row {
  box-shadow: var(--shadow);
}
.row-actions button.danger {
  background: #fcf1f0;
  border: 1px solid #f0dad7;
}
.row-actions button.danger:hover {
  background: #f8e4e2;
}

/* ============================================================
   REFONTE v3 — Coque maquette : sidebar desktop / tiroir mobile
   ============================================================ */
.production-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Actions rapides : panneau pleine largeur, grille confortable */
.quick-actions-panel .quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* --- Desktop : sidebar fixe + colonne contenu --- */
@media (min-width: 901px) {
  #appShell:not(.hidden) {
    align-items: stretch;
    display: flex;
  }
  #appShell.sidebar-collapsed .mp-sidebar {
    flex: 0 0 0;
    margin-right: 0;
    min-width: 0;
    opacity: 0;
    overflow: hidden;
    padding-left: 0;
    padding-right: 0;
    pointer-events: none;
    transform: translateX(-24px);
    width: 0;
  }
  #appShell.sidebar-collapsed .app-main {
    flex: 1 1 auto;
    min-width: 0;
  }
  .mp-sidebar {
    align-self: flex-start;
    background: var(--mp-vert-nuit);
    display: flex;
    flex: 0 0 var(--mp-sidebar-w);
    flex-direction: column;
    gap: 14px;
    height: 100vh;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    transition: flex-basis 0.25s ease, opacity 0.22s ease, padding 0.25s ease, transform 0.25s ease, width 0.25s ease;
    width: var(--mp-sidebar-w);
  }
  .app-main {
    flex: 1;
    min-width: 0;
  }
  .app-main > main {
    margin: 0 auto;
    max-width: 1600px;
  }
  .topbar {
    top: 0;
  }
  .desktop-sidebar-toggle {
    display: inline-flex;
  }
  .mp-topbar-brand {
    display: none !important;
  }
  .mp-topbar-title h1,
  .mp-topbar-title p {
    display: none;
  }
}

.mp-sidebar {
  background: var(--mp-vert-nuit);
  color: #eaf1ec;
}

.mp-sidebar .app-brand {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
  padding: 4px 6px 6px;
}

.mp-sidebar .app-brand img {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  height: 40px;
  padding: 7px;
  width: 40px;
}

.mp-sidebar .app-brand strong {
  color: #ffffff;
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
}

.mp-sidebar .app-brand small {
  color: #7e9387;
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.mp-sidebar .tabs {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.mp-sidebar .mp-nav-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 11px;
  color: #a9bbae;
  display: flex;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
}

.mp-sidebar .mp-nav-item svg {
  flex: 0 0 auto;
}

.mp-sidebar .mp-nav-item span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.mp-sidebar .mp-nav-item strong {
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.05;
}

.mp-sidebar .mp-nav-item small {
  color: #7e9387;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.05;
}

.mp-sidebar .mp-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.mp-sidebar .mp-nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.mp-sidebar .mp-nav-item.active small {
  color: rgba(255, 255, 255, 0.7);
}

.mp-sidebar-foot {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.mp-avatar {
  align-items: center;
  background: #2e5645;
  border-radius: 50%;
  color: #cfe3d7;
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.mp-user {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mp-user strong {
  color: #eaf1ec;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
}

.mp-user small {
  color: #7e9387;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
}

@media (min-width: 901px) {
  .mp-page-badge {
    display: inline-flex;
  }

  #demoModeBtn,
  #currentUserChip,
  #changePasswordBtn,
  #logoutBtn {
    display: none;
  }

  .mobile-account-btn {
    align-items: center;
    background: #15281f;
    border: 0;
    border-radius: 50%;
    color: #cfe3d7;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    padding: 0;
    width: 40px;
  }

  .mobile-account-backdrop {
    display: none !important;
  }

  .mobile-account-menu {
    background: #ffffff;
    border: 1px solid #e6eae3;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(20, 40, 30, 0.1);
    display: block;
    max-width: calc(100vw - 32px);
    min-width: 270px;
    opacity: 0;
    overflow: hidden;
    position: fixed;
    right: clamp(16px, 3vw, 30px);
    top: 70px;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    width: min(316px, calc(100vw - 32px));
    z-index: 74;
  }

  .mobile-account-menu.is-open {
    opacity: 1;
    transform: translateY(0);
  }

  .desktop-account-mode-row {
    align-items: center;
    border-bottom: 1px solid #e6eae3;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 12px 14px;
  }

  .desktop-account-mode-row > span {
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
  }

  .mobile-account-state {
    display: none;
  }

  .mobile-account-head {
    align-items: center;
    border-bottom: 1px solid #e6eae3;
    display: flex;
    gap: 10px;
    padding: 12px 14px;
  }

  .mobile-account-head span:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-account-avatar {
    align-items: center;
    background: #15281f;
    border-radius: 50%;
    color: #cfe3d7;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
  }

  .mobile-account-head strong {
    color: var(--text);
    display: block;
    font-size: 14px;
    line-height: 1.15;
  }

  .mobile-account-head small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 1px;
  }

  .desktop-account-mode-row {
    display: none;
  }

  .mobile-account-item {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text);
    display: flex;
    font-size: 14px;
    font-weight: 750;
    gap: 12px;
    justify-content: flex-start;
    min-height: 46px;
    padding: 13px 14px;
    text-align: left;
    width: 100%;
  }

  .mobile-account-item:hover,
  .mobile-account-item:focus-visible {
    background: #f4f6f2;
    color: var(--text);
    filter: none;
  }

  .mobile-account-item.danger {
    background: #fcf1f0;
    border: 1px solid #f0dad7;
    color: #bf4a43;
  }

  .mobile-account-item.danger:hover,
  .mobile-account-item.danger:focus-visible {
    background: #f8e4e2;
    border-color: #e0b0a9;
    color: #bf4a43;
  }
}

@media (max-width: 900px) {
  #appShell:not(.hidden) {
    display: block;
  }

  .mp-sidebar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .app-main {
    min-width: 0;
    width: 100%;
  }

  .mp-topbar {
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
  }

  .mp-topbar-title {
    min-width: 0;
  }

  .mp-topbar-title h1,
  .mp-topbar-title p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mp-topbar-title h1 {
    font-size: 18px;
    line-height: 1.1;
  }

  .mp-topbar-title p {
    font-size: 11.5px;
    margin-top: 1px;
  }

  .mp-topbar-actions {
    flex: 0 0 auto;
    gap: 0;
  }

  .desktop-sidebar-toggle,
  .mp-topbar-brand,
  .desktop-account-mode-row {
    display: none !important;
  }

  #demoModeBtn,
  #currentUserChip,
  #changePasswordBtn,
  #logoutBtn {
    display: none;
  }

  .mobile-account-btn {
    align-items: center;
    background: #15281f;
    border: 0;
    border-radius: 50%;
    color: #cfe3d7;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    padding: 0;
    width: 40px;
  }

  .mobile-account-backdrop {
    background: transparent;
    bottom: 0;
    display: block;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 72;
  }

  .mobile-account-menu {
    background: #ffffff;
    border: 1px solid #e6eae3;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(20, 40, 30, 0.1);
    display: block;
    max-width: calc(100vw - 24px);
    min-width: 254px;
    opacity: 0;
    overflow: hidden;
    position: fixed;
    right: 12px;
    top: 62px;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    width: min(304px, calc(100vw - 24px));
    z-index: 74;
  }

  .mobile-account-menu.is-open {
    opacity: 1;
    transform: translateY(0);
  }

  .mobile-account-mode-row {
    display: none;
  }

  .mobile-account-head {
    align-items: center;
    border-bottom: 1px solid #e6eae3;
    display: flex;
    gap: 10px;
    padding: 12px 14px;
  }

  .mobile-account-avatar {
    align-items: center;
    background: #15281f;
    border-radius: 50%;
    color: #cfe3d7;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
  }

  .mobile-account-head strong {
    color: var(--text);
    display: block;
    font-size: 14px;
    line-height: 1.15;
  }

  .mobile-account-head small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 1px;
  }

  .mobile-account-item {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text);
    display: flex;
    font-size: 14px;
    font-weight: 750;
    gap: 12px;
    justify-content: flex-start;
    min-height: 46px;
    padding: 13px 14px;
    text-align: left;
    width: 100%;
  }

  .mobile-account-item:hover,
  .mobile-account-item:focus-visible {
    background: #f4f6f2;
    color: var(--text);
    filter: none;
  }

  .mobile-account-item.danger {
    background: #fcf1f0;
    border: 1px solid #f0dad7;
    color: #bf4a43;
  }

  .mobile-account-item.danger:hover,
  .mobile-account-item.danger:focus-visible {
    background: #f8e4e2;
    border-color: #e0b0a9;
    color: #bf4a43;
  }

  .mobile-tab-bar {
    align-items: stretch;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #dce2da;
    bottom: 0;
    box-shadow: 0 -10px 24px rgba(20, 40, 30, 0.12);
    display: flex;
    gap: 0;
    min-height: calc(var(--bottombar-height) + env(safe-area-inset-bottom));
    left: 0;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 55;
  }

  .mobile-tab-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    min-height: 50px;
    min-width: 0;
    padding: 5px 2px;
    text-align: center;
  }

  .mobile-tab-item:hover {
    filter: none;
  }

  .mobile-tab-item svg {
    flex: 0 0 auto;
  }

  .mobile-tab-item span {
    color: inherit;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tab-item.is-active {
    background: var(--mp-vert-clair-2);
    color: var(--accent);
  }

  #mobileMoreBtn[aria-expanded="true"] {
    background: #f7f8f6;
    color: var(--accent);
  }

  .mobile-sheet-backdrop {
    background: rgba(10, 18, 14, 0.42);
    bottom: 0;
    left: 0;
    opacity: 0;
    position: fixed;
    right: 0;
    top: 0;
    transition: opacity 0.22s ease;
    z-index: 58;
  }

  .mobile-sheet-backdrop.is-open {
    opacity: 1;
  }

  .mobile-more-sheet {
    background: var(--panel);
    border-radius: 20px 20px 0 0;
    bottom: calc(var(--bottombar-height) + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(10, 18, 14, 0.18);
    left: 0;
    max-height: min(54dvh, 360px);
    overflow-y: auto;
    padding: 8px 16px 18px;
    position: fixed;
    right: 0;
    transform: translateY(112%);
    transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 66;
  }

  .mobile-more-sheet.is-open {
    transform: translateY(0);
  }

  .mobile-sheet-grabber {
    background: #d5ddd3;
    border: 0;
    border-radius: 999px;
    display: block;
    height: 4px;
    margin: 6px auto 14px;
    min-height: 0;
    padding: 0;
    width: 38px;
  }

  .mobile-sheet-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .mobile-sheet-head h2 {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
  }

  .mobile-sheet-close {
    align-items: center;
    background: var(--soft);
    border: 0;
    border-radius: 50%;
    color: var(--accent);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    min-height: 32px;
    padding: 0;
    width: 32px;
  }

  .mobile-sheet-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-sheet-item {
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    display: flex;
    gap: 8px;
    min-height: 58px;
    min-width: 0;
    padding: 11px 9px;
    text-align: left;
  }

  .mobile-sheet-item:hover {
    filter: none;
  }

  .mobile-sheet-item.is-active {
    background: var(--mp-vert-clair-2);
    border-color: var(--accent);
    color: var(--accent);
  }

  .mobile-sheet-item svg {
    color: var(--accent);
    flex: 0 0 auto;
  }

  .mobile-sheet-item span {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .mobile-sheet-item strong {
    color: var(--text);
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: normal;
    white-space: normal;
    word-break: normal;
  }

  .mobile-sheet-item small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
  }

  .mobile-sheet-item.is-active strong,
  .mobile-sheet-item.is-active small {
    color: var(--accent);
  }

  main {
    padding-bottom: calc(var(--bottombar-height) + var(--bottombar-clearance) + env(safe-area-inset-bottom));
  }

  @supports selector(:has(*)) {
    #appShell:has(input:focus, textarea:focus, select:focus) .mobile-tab-bar {
      transform: translateY(calc(100% + env(safe-area-inset-bottom)));
    }
  }
}

.mp-topbar {
  background: #f4f6f2;
  border-bottom: 1px solid #e2e7de;
  padding: 13px clamp(16px, 3vw, 30px);
}

.mp-topbar-title h1 {
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.mp-topbar-title p {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

button.mp-demo.secondary {
  background: #ffffff;
  border-color: #dce2da;
  color: var(--muted);
}

button.mp-demo.secondary:hover {
  background: #f7f8f6;
  border-color: #cfd6cf;
  color: var(--text);
}

button.mp-demo.secondary.is-active {
  background: #eaf4ee;
  border-color: #bfe0cc;
  color: var(--accent);
}

button.mp-demo.secondary.is-active:hover {
  background: #dceae1;
  border-color: #bfe0cc;
  color: var(--accent-fonce);
}

button.mp-demo.secondary.danger {
  background: #f5dfdb;
  border-color: #e0b0a9;
  color: #a03630;
}

button.mp-demo.secondary.danger:hover {
  background: #efcac5;
  border-color: #d79d95;
  color: #a03630;
}

button.mp-demo.secondary.danger .mp-dot {
  background: #a6aea8;
}

button.mp-icon-btn {
  background: #ffffff;
  border: 1px solid #dce2da;
  color: var(--muted);
  height: 38px;
  width: 38px;
}

button.mp-icon-btn:hover {
  background: #ffffff;
  border-color: var(--accent);
  color: var(--accent);
}

button.mp-icon-btn.is-logout:hover {
  background: #f8e4e2;
  border-color: #e0b0a9;
  color: #bf4a43;
}

.mp-user-chip {
  height: 38px;
}

button.secondary:not(.danger):not(.reveal-password):not(.mp-icon-btn):not(.mp-demo),
.btn-ghost,
.btn-soft,
.export__menu button {
  background: #eff6f1;
  border: 1px solid #cbe0d3;
  color: var(--accent);
  filter: none;
}

button.secondary:not(.danger):not(.reveal-password):not(.mp-icon-btn):not(.mp-demo):hover,
button.secondary:not(.danger):not(.reveal-password):not(.mp-icon-btn):not(.mp-demo):focus-visible,
.btn-ghost:hover,
.btn-ghost:focus-visible,
.btn-soft:hover,
.btn-soft:focus-visible,
.export__menu button:hover,
.export__menu button:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  filter: none;
}

button.secondary:not(.danger):not(.reveal-password):not(.mp-icon-btn):not(.mp-demo):active,
.btn-ghost:active,
.btn-soft:active,
.export__menu button:active {
  background: var(--accent-fonce);
  border-color: var(--accent-fonce);
  color: #ffffff;
}

button.secondary:not(.danger):not(.reveal-password):not(.mp-icon-btn):not(.mp-demo):focus-visible,
.btn-ghost:focus-visible,
.btn-soft:focus-visible,
.export__menu button:focus-visible {
  outline: 2px solid rgba(28, 107, 79, 0.18);
  outline-offset: 2px;
}

.fin {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: "Manrope", system-ui, sans-serif;
}

.fin-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fin-kpi {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #fff;
  border: 1px solid #e6eae3;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(20, 40, 30, 0.04);
}

.fin-kpi--rev { border-left: 4px solid #1c6b4f; }
.fin-kpi--dep { border-left: 4px solid #b6603e; }
.fin-kpi--bal { border-left: 4px solid #2a6e87; }

.fin-kpi__label {
  font-size: 12px;
  font-weight: 700;
  color: #69736d;
}

.fin-kpi__value {
  font-size: 22px;
  font-weight: 800;
  color: #14201b;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.fin-kpi__sub {
  font-size: 12px;
  color: #8b948e;
}

.fin-card {
  background: #fff;
  border: 1px solid #e6eae3;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(20, 40, 30, 0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fin-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fin-card__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #14201b;
}

.fin-pill {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.fin-pill--rev {
  background: #e4f2ea;
  color: #1c7a4d;
}

.fin-pill--dep {
  background: #f5e3d6;
  color: #94481f;
}

.fin-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.fin-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fin-bar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.fin-bar__top span:first-child {
  font-size: 13.5px;
  font-weight: 700;
  color: #1a2620;
}

.fin-bar__top span:last-child {
  font-size: 13px;
  font-weight: 800;
  color: #1c2b24;
  font-variant-numeric: tabular-nums;
}

.fin-track {
  height: 9px;
  border-radius: 999px;
  background: #edf1ec;
  overflow: hidden;
}

.fin-track--dep {
  background: #f3e9e4;
}

.fin-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.fin-fill--rev {
  background: #1c6b4f;
}

.fin-fill--dep {
  background: #b6603e;
}

.fin-analysis__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.fin-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1c6b4f;
}

.fin-analysis__head h2 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: #14201b;
}

.fin-chips {
  display: flex;
  gap: 6px;
}

.fin-chip {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
  background: #eaf1ec;
  color: #36443d;
}

.fin-chip.is-active {
  background: #1c6b4f;
  color: #fff;
}

.fin-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.fin-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #5c6660;
}

.fin-sw {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.fin-sw--rev {
  background: #1c6b4f;
}

.fin-sw--dep {
  background: #b6603e;
}

.fin-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  height: 168px;
}

.fin-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  height: 100%;
  justify-content: flex-end;
}

.fin-pair {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 100%;
  width: 100%;
  justify-content: center;
}

.fin-b {
  width: 42%;
  border-radius: 4px 4px 2px 2px;
  min-height: 4px;
}

.fin-b--rev {
  background: #1c6b4f;
}

.fin-b--dep {
  background: #b6603e;
}

.fin-col__m {
  font-size: 11px;
  font-weight: 600;
  color: #8b948e;
}

.fin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid #eef1ec;
  padding-top: 14px;
}

.fin-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fin-stat span {
  font-size: 11.5px;
  font-weight: 700;
  color: #69736d;
}

.fin-stat strong {
  font-size: 17px;
  font-weight: 800;
  color: #14201b;
  font-variant-numeric: tabular-nums;
}

.fin-note {
  margin: 0;
  font-size: 12px;
  color: #69736d;
}

.fin .filter-bar,
.fin .fin-card,
.fin .fin-split,
.fin .fin-kpis {
  width: 100%;
}

.fin .filter-bar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.fin .fin-card {
  min-width: 0;
}

.fin .fin-chart {
  min-height: 176px;
}

.fin .fin-stats {
  gap: 12px;
}

.fin .fin-kpi {
  min-width: 0;
}

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

  .fin-split {
    grid-template-columns: 1fr;
  }

  .fin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lots__head {
    flex-direction: column;
  }

  .lots__actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .lots__actions .btn-primary,
  .lots__actions .btn-ghost,
  .lots__actions .export-inline {
    width: 100%;
  }

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

@media (max-width: 680px) {
  .lot {
    padding: 14px;
  }

  .lot__actions {
    flex-direction: column;
  }

  .lot__actions .btn-soft,
  .lot__actions .btn-danger {
    width: 100%;
  }
}

@media (max-width: 900px) {
  #appShell .mp-topbar {
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 9px 12px;
  }

  #appShell .mp-topbar-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  #appShell .mp-topbar-title h1,
  #appShell .mp-topbar-title p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #appShell .mp-topbar-title h1 {
    font-size: 18px;
    line-height: 1.1;
  }

  #appShell .mp-topbar-title p {
    font-size: 11.5px;
    margin-top: 1px;
  }

  #appShell .mp-topbar-actions {
    flex: 0 0 auto;
    gap: 0;
    margin-left: auto;
  }
}
