:root {
  --navy: #0b1f3a;
  --navy-2: #12345d;
  --blue: #1c5fa1;
  --blue-bright: #2d78c6;
  --indigo: #4f46e5;
  --teal: #0f9d8a;
  --amber: #d9911f;
  --red: #d95d4f;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #17243a;
  --muted: #68778c;
  --muted-2: #8a97a8;
  --border: #e4eaf2;
  --border-strong: #d6dfeb;
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, 0.04), 0 8px 24px rgba(11, 31, 58, 0.04);
  --shadow-md: 0 18px 45px rgba(11, 31, 58, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-width: 264px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(45, 120, 198, 0.28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

::selection {
  color: #fff;
  background: var(--blue);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e3;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 25px 20px 20px;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.project-label {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 5px 4px 24px;
  padding: 13px 14px;
  background: #f1f6fc;
  border: 1px solid #e2ecf7;
  border-radius: 13px;
}

.project-dot {
  width: 9px;
  height: 9px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(15, 157, 138, 0.10);
}

.project-label div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.project-label strong {
  color: var(--navy);
  font-size: 12px;
  letter-spacing: 0.11em;
}

.project-label div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-caption {
  margin: 18px 12px 7px;
  color: #97a3b2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-caption:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  color: #596a80;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 11px;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.nav-item span:nth-child(2) {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.nav-item:hover {
  color: var(--blue);
  background: #f4f7fb;
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--blue);
  background: #eaf2fb;
  box-shadow: inset 3px 0 0 var(--blue);
}

.nav-badge,
.nav-alert,
.count-badge {
  display: inline-flex;
  min-width: 24px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  color: #698097;
  font-size: 10px;
  font-weight: 700;
  background: #f0f4f8;
  border-radius: 7px;
}

.nav-alert {
  color: var(--red);
  background: #fff0ed;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: auto;
  padding-top: 30px;
}

.scope-card {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 13px;
}

.scope-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: var(--blue);
  background: #eaf2fb;
  border-radius: 8px;
}

.scope-icon svg {
  width: 16px;
  height: 16px;
}

.scope-card strong,
.scope-card span {
  display: block;
}

.scope-card strong {
  color: var(--navy);
  font-size: 11px;
}

.scope-card div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.sidebar-signature {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 5px;
  color: var(--muted-2);
  font-size: 10px;
}

.sidebar-signature strong {
  color: var(--navy);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(7, 22, 42, 0.38);
  backdrop-filter: blur(2px);
}

.main-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(228, 234, 242, 0.86);
  backdrop-filter: blur(16px);
}

.topbar-left,
.topbar-right,
.breadcrumb,
.analysis-date {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 12px;
}

.breadcrumb {
  gap: 8px;
  color: var(--muted-2);
  font-size: 12px;
}

.breadcrumb svg {
  width: 13px;
  height: 13px;
}

.breadcrumb strong {
  color: var(--text);
  font-weight: 600;
}

.topbar-right {
  gap: 18px;
}

.backend-login {
  min-height: 38px;
  padding: 8px 12px;
}

.backend-login span {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.read-only #reference-add,
body.read-only #transport-add,
body.read-only #electricity-add,
body.read-only #factor-add,
body.read-only [data-add-extra],
body.read-only [data-add-transport],
body.read-only [data-add-electricity],
body.read-only [data-edit-site],
body.read-only [data-edit-truck-type],
body.read-only [data-edit-extra],
body.read-only [data-edit-entry],
body.read-only [data-edit-electricity],
body.read-only [data-edit-factor],
body.read-only [data-delete-site],
body.read-only [data-delete-truck-type],
body.read-only [data-delete-extra],
body.read-only [data-delete-entry],
body.read-only [data-delete-electricity] {
  opacity: 0.45;
  pointer-events: none;
}

body[data-role="saisisseur"] #reference-add,
body[data-role="saisisseur"] #factor-add,
body[data-role="saisisseur"] [data-add-extra],
body[data-role="saisisseur"] [data-edit-site],
body[data-role="saisisseur"] [data-edit-truck-type],
body[data-role="saisisseur"] [data-edit-extra],
body[data-role="saisisseur"] [data-edit-factor],
body[data-role="saisisseur"] [data-delete-site],
body[data-role="saisisseur"] [data-delete-truck-type],
body[data-role="saisisseur"] [data-delete-extra],
body[data-role="validateur"] #reference-add,
body[data-role="validateur"] #factor-add,
body[data-role="validateur"] [data-add-extra],
body[data-role="validateur"] [data-edit-site],
body[data-role="validateur"] [data-edit-truck-type],
body[data-role="validateur"] [data-edit-extra],
body[data-role="validateur"] [data-edit-factor],
body[data-role="validateur"] [data-delete-site],
body[data-role="validateur"] [data-delete-truck-type],
body[data-role="validateur"] [data-delete-extra] {
  display: none !important;
}

body.read-only [data-edit-vehicle-profile],
body.read-only [data-delete-vehicle-profile],
body.read-only [data-edit-physical-vehicle],
body.read-only [data-delete-physical-vehicle],
body.read-only [data-add-physical-vehicle-from-transport],
body[data-role="saisisseur"] [data-edit-vehicle-profile],
body[data-role="saisisseur"] [data-delete-vehicle-profile],
body[data-role="saisisseur"] [data-edit-physical-vehicle],
body[data-role="saisisseur"] [data-delete-physical-vehicle],
body[data-role="saisisseur"] [data-add-physical-vehicle-from-transport],
body[data-role="validateur"] [data-edit-vehicle-profile],
body[data-role="validateur"] [data-delete-vehicle-profile],
body[data-role="validateur"] [data-edit-physical-vehicle],
body[data-role="validateur"] [data-delete-physical-vehicle],
body[data-role="validateur"] [data-add-physical-vehicle-from-transport] {
  display: none !important;
}

.analysis-date {
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.analysis-date svg {
  width: 15px;
  height: 15px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.icon-button:hover {
  color: var(--navy);
  background: #f2f5f9;
  border-color: var(--border);
}

.menu-button {
  display: none;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button svg {
  width: 16px;
  height: 16px;
}

.button-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(28, 95, 161, 0.20);
}

.button-primary:hover {
  background: #17558f;
  box-shadow: 0 10px 24px rgba(28, 95, 161, 0.26);
}

.button-secondary {
  color: var(--navy);
  background: #fff;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
  background: #f8fafc;
}

.button-light {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.export-wrap {
  position: relative;
}

.export-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 50;
  width: 205px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  animation: fadeUp 140ms ease both;
}

.export-menu button {
  width: 100%;
  padding: 10px 11px;
  color: #44556c;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
}

.export-menu button:hover {
  color: var(--blue);
  background: #f0f5fb;
}

.content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 34px 20px;
}

.method-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 27px;
  padding: 12px 15px;
  color: #5b6d83;
  background: #edf4fb;
  border: 1px solid #dce9f6;
  border-radius: 12px;
  font-size: 11px;
}

.method-banner > svg {
  width: 17px;
  height: 17px;
  color: var(--blue);
}

.method-banner p {
  flex: 1;
  margin: 0;
}

.method-banner strong {
  color: var(--navy);
}

.method-banner button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--blue);
  background: none;
  border: 0;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.method-banner button svg {
  width: 14px;
  height: 14px;
}

.view-panel {
  animation: fadeUp 260ms ease both;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow,
.card-kicker {
  display: block;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 5px 0 5px;
  color: var(--navy);
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.period-pill,
.subtle-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: #53657c;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.period-pill.small {
  min-height: 27px;
  font-size: 9px;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 30px;
  min-height: 268px;
  margin-bottom: 22px;
  padding: 34px 38px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(120deg, #0b1f3a 0%, #123f70 62%, #1c5fa1 100%);
  border-radius: 22px;
  box-shadow: 0 20px 45px rgba(11, 31, 58, 0.16);
}

.hero-card::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.11;
  background-image: linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent, #000);
}

.hero-copy,
.hero-metrics {
  position: relative;
  z-index: 2;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b9d8f5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-kicker span {
  width: 7px;
  height: 7px;
  background: #5ee0c2;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(94, 224, 194, 0.12);
}

.hero-copy h2 {
  margin: 15px 0 10px;
  font-size: clamp(28px, 3vw, 43px);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-copy p {
  max-width: 520px;
  margin: 0 0 21px;
  color: #c2d5e8;
  font-size: 12px;
  line-height: 1.7;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 1px;
  align-self: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.hero-metrics > div {
  min-height: 132px;
  padding: 22px;
  background: rgba(6, 25, 49, 0.23);
}

.hero-metrics span,
.hero-metrics p {
  display: block;
  margin: 0;
}

.hero-metrics span {
  color: #b8cee4;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-metrics strong {
  display: block;
  margin: 9px 0 4px;
  font-size: 35px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.hero-metrics small {
  font-size: 13px;
  font-weight: 600;
}

.hero-metrics p {
  color: #a9c2d9;
  font-size: 9px;
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.orbit-one {
  right: -90px;
  bottom: -190px;
  width: 430px;
  height: 430px;
}

.orbit-two {
  right: -10px;
  bottom: -115px;
  width: 270px;
  height: 270px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.kpi-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-card {
  position: relative;
  min-height: 154px;
  padding: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: #d5e1ef;
  box-shadow: 0 16px 35px rgba(11, 31, 58, 0.08);
}

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

.kpi-label {
  color: #65758a;
  font-size: 11px;
  font-weight: 650;
}

.kpi-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
}

.kpi-icon.blue { color: var(--blue); background: #eaf2fb; }
.kpi-icon.teal { color: var(--teal); background: #e8f7f4; }
.kpi-icon.indigo { color: var(--indigo); background: #efedff; }
.kpi-icon.red { color: var(--red); background: #fff0ed; }
.kpi-icon.amber { color: var(--amber); background: #fff6e7; }

.kpi-value {
  margin-top: 14px;
  color: var(--navy);
  font-size: clamp(25px, 2.1vw, 32px);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1;
}

.kpi-value small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 750;
  border-radius: 6px;
}

.trend svg {
  width: 11px;
  height: 11px;
}

.trend.good { color: #0a7f70; background: #e8f7f4; }
.trend.bad { color: #b7473b; background: #fff0ed; }
.trend.neutral { color: #67768a; background: #f0f3f7; }

.comparison-card {
  margin-bottom: 20px;
}

.comparison-selects {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.comparison-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.comparison-metric {
  padding: 15px 16px;
  background: #f8fafc;
  border: 1px solid #edf1f6;
  border-radius: 12px;
}

.comparison-metric span,
.comparison-metric strong,
.comparison-metric small {
  display: block;
}

.comparison-metric span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.comparison-metric strong {
  margin-top: 6px;
  color: var(--navy);
  font-size: 21px;
  letter-spacing: -0.03em;
}

.comparison-metric small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

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

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

.card {
  min-width: 0;
  padding: 21px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}

.card-header h2 {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.card-kicker {
  font-size: 8px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 0;
  color: var(--blue);
  background: none;
  border: 0;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.text-button svg {
  width: 13px;
  height: 13px;
  transition: transform 150ms ease;
}

.text-button:hover svg {
  transform: translateX(2px);
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  background: #f1f4f8;
  border: 1px solid #e8edf3;
  border-radius: 10px;
}

.segmented button {
  min-height: 29px;
  padding: 6px 10px;
  color: #718096;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 650;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.segmented button:hover {
  color: var(--blue);
}

.segmented button.active {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 2px 7px rgba(11, 31, 58, 0.08);
}

.segmented.small button {
  padding: 5px 8px;
  font-size: 9px;
}

.chart-container {
  width: 100%;
  min-height: 270px;
}

.chart-container svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: -5px 0 8px;
  color: var(--muted);
  font-size: 9px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.legend-line {
  width: 15px;
  height: 3px;
  border-radius: 99px;
}

.priority-card .segmented {
  margin-bottom: 18px;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 10px;
}

.bar-row-head strong {
  color: #34465e;
  font-weight: 650;
}

.bar-row-head span {
  color: var(--muted);
  font-size: 9px;
}

.bar-track {
  height: 7px;
  overflow: hidden;
  background: #eef2f7;
  border-radius: 99px;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  transform-origin: left;
  animation: growBar 700ms cubic-bezier(.2,.7,.2,1) both;
}

.watchlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watch-item {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  color: inherit;
  text-align: left;
  background: #fafbfd;
  border: 1px solid #edf1f6;
  border-radius: 11px;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.watch-item:hover {
  background: #fff;
  border-color: #dce5ef;
  transform: translateX(2px);
}

.severity-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 4px;
  border-radius: 50%;
}

.severity-dot.critique { background: var(--red); box-shadow: 0 0 0 4px rgba(217, 93, 79, .10); }
.severity-dot.élevée { background: #e58b2b; box-shadow: 0 0 0 4px rgba(229, 139, 43, .10); }
.severity-dot.moyenne { background: #d4a62d; box-shadow: 0 0 0 4px rgba(212, 166, 45, .10); }
.severity-dot.faible { background: #6c8bad; box-shadow: 0 0 0 4px rgba(108, 139, 173, .10); }

.watch-item div {
  min-width: 0;
  flex: 1;
}

.watch-item strong,
.watch-item span {
  display: block;
}

.watch-item strong {
  color: #34465e;
  font-size: 10px;
  line-height: 1.4;
}

.watch-item div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.watch-item > svg {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  color: #9ba8b8;
}

.mini-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-action {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  background: #fafbfd;
  border: 1px solid #edf1f6;
  border-radius: 11px;
}

.priority-tag {
  display: inline-flex;
  min-width: 30px;
  height: 26px;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  background: #eaf2fb;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
}

.priority-tag.p0 { color: #b7473b; background: #fff0ed; }
.priority-tag.p1 { color: #9a6513; background: #fff6e7; }
.priority-tag.p2 { color: #0a7f70; background: #e8f7f4; }

.mini-action div {
  min-width: 0;
}

.mini-action strong,
.mini-action span {
  display: block;
}

.mini-action strong {
  overflow: hidden;
  color: #34465e;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-action div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.insight-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 27px;
  color: #fff;
  background: linear-gradient(145deg, #0f8f7e, #0b746b);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 15px 35px rgba(15, 143, 126, 0.17);
}

.insight-card.insight-warning {
  color: var(--navy);
  background: linear-gradient(145deg, #fff8e9, #fff2d8);
  border-color: #f2e2c1;
  box-shadow: var(--shadow-sm);
}

.insight-card.insight-danger {
  background: linear-gradient(145deg, #b9473d, #91352f);
  box-shadow: 0 15px 35px rgba(185, 71, 61, 0.17);
}

.insight-icon {
  display: grid;
  width: 39px;
  height: 39px;
  margin-bottom: 17px;
  place-items: center;
  color: inherit;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
}

.insight-warning .insight-icon {
  color: #a56b13;
  background: rgba(217, 145, 31, 0.12);
  border-color: rgba(217, 145, 31, 0.18);
}

.insight-card .card-kicker {
  color: inherit;
  opacity: 0.74;
}

.insight-card h2 {
  margin: 8px 0 9px;
  font-size: 29px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.insight-card p {
  margin: 0 0 17px;
  color: inherit;
  font-size: 11px;
  line-height: 1.65;
  opacity: 0.88;
}

.insight-card .text-button {
  margin-top: auto;
  color: inherit;
}

.table-card {
  margin-bottom: 20px;
}

.table-header {
  align-items: center;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-field {
  display: flex;
  min-width: 220px;
  height: 37px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: #8b98a9;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.search-field svg {
  width: 15px;
  height: 15px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 11px;
}

.search-field input::placeholder {
  color: #9aa6b5;
}

select {
  height: 37px;
  padding: 0 30px 0 11px;
  color: #52637a;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font-size: 10px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th {
  padding: 11px 12px;
  color: #7e8b9c;
  text-align: left;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 12px;
  color: #4a5b71;
  border-bottom: 1px solid #edf1f6;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 130ms ease;
}

.data-table tbody tr:hover {
  background: #fafcff;
}

.data-table td strong {
  color: var(--navy);
  font-weight: 700;
}

.table-site {
  display: flex;
  align-items: center;
  gap: 9px;
}

.site-mark {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--blue);
  background: #edf4fb;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
}

.site-mark svg {
  width: 14px;
  height: 14px;
}

.cell-bar {
  display: flex;
  min-width: 110px;
  align-items: center;
  gap: 8px;
}

.cell-bar-track {
  width: 62px;
  height: 5px;
  overflow: hidden;
  background: #edf1f6;
  border-radius: 99px;
}

.cell-bar-fill {
  height: 100%;
  background: var(--blue-bright);
  border-radius: inherit;
}

.table-empty {
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.anomaly-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.anomaly-card {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  color: inherit;
  text-align: left;
  background: #fafbfd;
  border: 1px solid #e9eef5;
  border-radius: 12px;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.anomaly-card:hover {
  transform: translateY(-2px);
  border-color: #d8e3ef;
  box-shadow: 0 10px 24px rgba(11, 31, 58, 0.06);
}

.anomaly-card > div {
  min-width: 0;
  flex: 1;
}

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

.anomaly-card h3 {
  margin: 0;
  color: #33465e;
  font-size: 11px;
  line-height: 1.45;
}

.severity-pill {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 3px 7px;
  font-size: 8px;
  font-weight: 750;
  border-radius: 6px;
  white-space: nowrap;
}

.severity-pill.critique { color: #b7473b; background: #fff0ed; }
.severity-pill.élevée { color: #a5681b; background: #fff4e4; }
.severity-pill.moyenne { color: #927018; background: #fff8df; }
.severity-pill.faible { color: #5c7691; background: #edf3f8; }

.anomaly-card p {
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.anomaly-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #8996a6;
  font-size: 8px;
}

.anomaly-meta strong {
  color: #5d6f84;
  font-weight: 650;
}

.anomaly-meta svg {
  width: 11px;
  height: 11px;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  background: #fafbfd;
  border: 1px solid #edf1f6;
  border-radius: 10px;
}

.source-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: var(--blue);
  background: #eaf2fb;
  border-radius: 8px;
}

.source-icon svg {
  width: 15px;
  height: 15px;
}

.source-item div {
  min-width: 0;
  flex: 1;
}

.source-item strong,
.source-item span {
  display: block;
}

.source-item strong {
  overflow: hidden;
  color: #41536a;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-item div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.file-type {
  padding: 3px 6px;
  color: #7b8999;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 7px;
  font-weight: 750;
}

.methodology-card {
  position: relative;
  padding: 26px 28px;
  overflow: hidden;
  background: linear-gradient(120deg, #0b1f3a, #123f70);
  border-radius: var(--radius);
  color: #fff;
  box-shadow: 0 15px 35px rgba(11, 31, 58, 0.14);
}

.methodology-card > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9fc6eb;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.methodology-card h2 {
  max-width: 760px;
  margin: 12px 0 8px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.methodology-card p {
  max-width: 850px;
  margin: 0;
  color: #bed1e3;
  font-size: 10px;
  line-height: 1.7;
}

.action-progress-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: center;
  margin-bottom: 21px;
  padding: 26px 29px;
  color: #fff;
  background: linear-gradient(120deg, #0b1f3a, #154777);
  border-radius: var(--radius);
  box-shadow: 0 15px 35px rgba(11, 31, 58, 0.14);
}

.action-progress-copy h2 {
  margin: 6px 0 5px;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.action-progress-copy p {
  margin: 0;
  color: #b8cee4;
  font-size: 10px;
}

.progress-ring-wrap {
  display: flex;
  align-items: center;
  gap: 17px;
}

.progress-ring {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
}

.progress-ring svg {
  position: absolute;
  inset: 0;
  width: 76px;
  height: 76px;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 6;
}

.progress-ring .ring-bg {
  stroke: rgba(255, 255, 255, 0.13);
}

.progress-ring .ring-value {
  stroke: #5ee0c2;
  stroke-linecap: round;
  transition: stroke-dashoffset 400ms ease;
}

.progress-ring strong {
  font-size: 19px;
}

.progress-copy strong,
.progress-copy span {
  display: block;
}

.progress-copy strong {
  font-size: 12px;
}

.progress-copy span {
  margin-top: 3px;
  color: #a9c2d9;
  font-size: 9px;
}

.action-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 14px;
}

.action-filter-bar > span {
  color: var(--muted);
  font-size: 10px;
}

.action-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.action-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 30px rgba(11, 31, 58, 0.07);
}

.action-card.done {
  opacity: 0.72;
  background: #f8fbfa;
  border-color: #dcece7;
}

.action-check {
  position: relative;
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  place-items: center;
  margin-top: 1px;
}

.action-check input {
  position: absolute;
  inset: 0;
  width: 23px;
  height: 23px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.check-visual {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  pointer-events: none;
  color: #fff;
  background: #fff;
  border: 1.5px solid #cbd6e4;
  border-radius: 7px;
  transition: background 150ms ease, border-color 150ms ease;
}

.check-visual svg {
  width: 14px;
  height: 14px;
  opacity: 0;
}

.action-check input:checked + .check-visual {
  background: var(--teal);
  border-color: var(--teal);
}

.action-check input:checked + .check-visual svg {
  opacity: 1;
}

.action-check input:focus-visible + .check-visual {
  outline: 3px solid rgba(45, 120, 198, 0.25);
  outline-offset: 2px;
}

.action-card > div:last-child {
  min-width: 0;
  flex: 1;
}

.action-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.action-card h3 {
  margin: 0;
  color: #33465e;
  font-size: 12px;
  line-height: 1.4;
}

.action-card.done h3 {
  text-decoration: line-through;
  text-decoration-color: #9bb5ad;
}

.action-card p {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: #8996a6;
  font-size: 8px;
}

.action-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.action-meta svg {
  width: 12px;
  height: 12px;
}

.reference-tabs {
  display: flex;
  gap: 4px;
  margin: -4px 0 15px;
  padding-bottom: 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.reference-tabs button {
  white-space: nowrap;
}

.reference-tabs button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 650;
}

.reference-tabs button.active {
  color: var(--blue);
  background: #eaf2fb;
}

.local-data-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 19px 21px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.local-data-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: var(--blue);
  background: #eaf2fb;
  border-radius: 11px;
}

.local-data-banner > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.local-data-banner strong {
  color: var(--navy);
  font-size: 12px;
}

.local-data-banner p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.row-action-button {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  padding: 0;
  color: #718096;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.row-action-button svg {
  width: 14px;
  height: 14px;
}

.row-action-button:hover {
  color: var(--blue);
  background: #f1f6fc;
  border-color: #d7e5f3;
}

.row-action-button.danger:hover {
  color: var(--red);
  background: #fff2f0;
  border-color: #f4d6d2;
}

.scope-badge {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  margin-left: 7px;
  padding: 2px 6px;
  color: var(--blue);
  background: #eaf2fb;
  border-radius: 5px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.factor-info {
  padding: 10px 12px;
  color: #52657a;
  background: #f1f6fc;
  border: 1px solid #dce9f6;
  border-radius: 9px;
  font-size: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

#reference-form .form-field:has([name="status"]),
#reference-form .form-field:has([name="active"]) {
  display: none;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  color: #53657b;
  font-size: 10px;
  font-weight: 700;
}

.form-hint {
  color: var(--muted-2);
  font-size: 8px;
}

.linked-reference-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: -4px 0 18px;
  padding: 10px 12px;
  color: #5b6d83;
  background: #edf4fb;
  border: 1px solid #dce9f6;
  border-radius: 10px;
  font-size: 9px;
}

.linked-reference-note svg {
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.vehicle-select-row {
  display: flex;
  gap: 8px;
}

.vehicle-select-row select {
  flex: 1;
  min-width: 0;
}

.linked-reference-note button {
  padding: 3px 7px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #d7e5f3;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 11px;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font-size: 11px;
}

.form-field textarea {
  min-height: 82px;
  resize: vertical;
}

.form-check {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  color: #53657b;
  font-size: 11px;
}

.form-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 23px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.delete-warning {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 15px;
  place-items: center;
  color: var(--red);
  background: #fff0ed;
  border-radius: 13px;
}

.transport-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.transport-tools .search-field {
  min-width: 160px;
}

.transport-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.transport-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  color: #6e4c18;
  background: #fff8e9;
  border: 1px solid #f2e2c1;
  border-radius: 11px;
  font-size: 10px;
}

.transport-alert.blocking {
  color: #9d4036;
  background: #fff2f0;
  border-color: #f3d8d4;
}

.transport-alert svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.transport-alert strong {
  display: block;
  margin-bottom: 2px;
}

.entry-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 17px;
  padding: 13px;
  background: #f1f6fc;
  border: 1px solid #dce9f6;
  border-radius: 12px;
}

.entry-preview > div {
  min-width: 0;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e3ecf6;
  border-radius: 9px;
}

.entry-preview span,
.entry-preview strong {
  display: block;
}

.entry-preview span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  text-transform: uppercase;
}

.entry-preview strong {
  margin-top: 4px;
  color: var(--navy);
  font-size: 15px;
  letter-spacing: -0.02em;
}

.main-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 22px 2px 4px;
  color: #929eac;
  font-size: 9px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 22, 42, 0.48);
  backdrop-filter: blur(5px);
  animation: fadeIn 160ms ease both;
}

.modal {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 44px);
  padding: 30px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  animation: modalIn 220ms cubic-bezier(.2,.8,.2,1) both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal h2 {
  margin: 10px 35px 12px 0;
  color: var(--navy);
  font-size: 23px;
  letter-spacing: -0.03em;
}

.modal p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.modal-impact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 3px 0 18px;
  padding: 9px 11px;
  color: #a13e34;
  background: #fff0ed;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 750;
}

.modal-section {
  margin-top: 19px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.modal-section h3 {
  margin: 0 0 7px;
  color: var(--navy);
  font-size: 12px;
}

.modal-section p {
  margin: 0;
}

.modal-source {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 19px;
  color: #8592a3;
  font-size: 9px;
}

.modal-source svg {
  width: 14px;
  height: 14px;
}

.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 150;
  display: flex;
  max-width: 360px;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  color: #fff;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(11, 31, 58, 0.24);
  font-size: 11px;
  animation: toastIn 220ms ease both;
}

.toast svg {
  width: 17px;
  height: 17px;
  color: #5ee0c2;
}

#print-report {
  display: none;
}

@media print {
  body {
    background: #fff !important;
  }

  .sidebar,
  .main-shell,
  .modal-backdrop,
  .toast,
  .sidebar-overlay {
    display: none !important;
  }

  #print-report,
  #print-report[hidden] {
    display: block !important;
  }

  #print-report {
    position: absolute;
    inset: 0;
    width: 100%;
    color: #17243a;
    background: #fff;
  }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes growBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 1240px) {
  :root { --sidebar-width: 238px; }
  .sidebar { padding-inline: 15px; }
  .content { padding-inline: 25px; }
  .topbar { padding-inline: 25px; }
  .hero-card { padding: 30px; }
  .hero-metrics > div { padding: 18px; }
  .kpi-card { padding: 17px; }
  .kpi-value { font-size: 27px; }
  .kpi-grid-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
  .two-columns { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1020px) {
  :root { --sidebar-width: 220px; }
  .nav-item { padding-inline: 10px; }
  .nav-badge { display: none; }
  .content { padding: 24px 20px 18px; }
  .topbar { padding-inline: 20px; }
  .analysis-date { display: none; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-metrics { max-width: 480px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-header { align-items: flex-start; flex-direction: column; }
  .table-tools { width: 100%; }
  .search-field { flex: 1; min-width: 0; }
  .anomaly-list { grid-template-columns: 1fr; }
  .action-list { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar {
    width: 264px;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(.2,.8,.2,1);
    box-shadow: 20px 0 50px rgba(11, 31, 58, 0.12);
  }
  .sidebar.open { transform: translateX(0); }
  .main-shell { margin-left: 0; }
  .menu-button { display: inline-grid; }
  .topbar { height: 64px; }
  .content { padding: 22px 18px 18px; }
  .method-banner { align-items: flex-start; }
  .method-banner button { display: none; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 28px; }
  .hero-card { min-height: 0; padding: 27px; }
  .hero-copy h2 { font-size: 35px; }
  .hero-metrics { grid-template-columns: 1fr 1fr; }
  .two-columns { grid-template-columns: 1fr; }
  .action-progress-card { grid-template-columns: 1fr; gap: 20px; }
  .progress-ring-wrap { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .topbar { padding-inline: 14px; }
  .breadcrumb span,
  .breadcrumb svg { display: none; }
  .breadcrumb strong { font-size: 11px; }
  .button-primary { min-height: 36px; padding: 8px 11px; }
  .backend-login span { display: none; }
  .topbar-right { gap: 8px; }
  .content { padding: 18px 13px 15px; }
  .method-banner { margin-bottom: 20px; padding: 11px 12px; font-size: 10px; }
  .page-heading { flex-direction: column; gap: 13px; margin-bottom: 19px; }
  .page-heading .button { align-self: flex-start; }
  .heading-actions { flex-wrap: wrap; }
  .page-heading h1 { font-size: 26px; }
  .page-heading p { font-size: 11px; }
  .hero-card { gap: 24px; padding: 24px 21px; border-radius: 18px; }
  .hero-copy h2 { font-size: 31px; }
  .hero-copy p { font-size: 11px; }
  .hero-metrics > div { min-height: 112px; padding: 16px; }
  .hero-metrics strong { font-size: 28px; }
  .kpi-grid { gap: 10px; }
  .kpi-grid-five { grid-template-columns: 1fr; }
  .comparison-results { grid-template-columns: 1fr; }
  .comparison-selects { width: 100%; }
  .comparison-selects select { flex: 1; }
  .kpi-card { min-height: 143px; padding: 15px; }
  .kpi-label { font-size: 10px; }
  .kpi-icon { width: 31px; height: 31px; }
  .kpi-value { font-size: 24px; }
  .kpi-foot { align-items: flex-start; flex-direction: column; gap: 5px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 13px; }
  .span-2 { grid-column: span 1; }
  .card { padding: 17px; border-radius: 15px; }
  .card-header { flex-direction: column; gap: 12px; }
  .card-header .segmented { align-self: flex-start; }
  .chart-container { min-height: 220px; }
  .mini-actions { grid-template-columns: 1fr; }
  .table-tools { align-items: stretch; flex-direction: column; }
  .search-field { min-height: 38px; }
  select { width: 100%; }
  .anomaly-card { padding: 14px; }
  .anomaly-title-row { flex-direction: column-reverse; gap: 7px; }
  .action-filter-bar { align-items: flex-start; flex-direction: column; }
  .action-card { padding: 15px; }
  .action-card-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .local-data-banner { align-items: flex-start; padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .vehicle-select-row { flex-direction: column; }
  .form-field.full { grid-column: auto; }
  .entry-preview { grid-template-columns: 1fr; }
  .transport-tools { width: 100%; justify-content: flex-start; }
  .transport-tools select { width: calc(50% - 5px); }
  .main-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .modal { padding: 25px 21px; border-radius: 16px; }
  .modal h2 { font-size: 21px; }
  .toast { right: 13px; bottom: 13px; left: 13px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
