/* GPP Carry - GreenPoint UI system */

:root {
  --background: #f5f7fb;
  --foreground: #1a202c;
  --card: #ffffff;
  --card-foreground: #1a202c;
  --muted: #f0f2f7;
  --muted-foreground: #6b7280;
  --border: #e2e5ed;
  --input: #ffffff;
  --primary: #1478ff;
  --primary-foreground: #ffffff;
  --primary-muted: #eaf2ff;
  --primary-border: #c8ddff;
  --primary-alpha: rgba(20, 120, 255, 0.12);
  --primary-alpha-strong: rgba(20, 120, 255, 0.32);
  --success: #1b7f3a;
  --success-muted: #e8f5ed;
  --warning: #b97c00;
  --warning-muted: #fff7e3;
  --destructive: #dc2626;
  --destructive-muted: #fef2f2;
  --ring: rgba(20, 120, 255, 0.24);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 12px 28px rgba(16, 24, 40, 0.10);
  --radius: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  border: 0;
}

button,
input[type="range"],
input[type="checkbox"] {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

svg[data-icon],
.btn svg,
.acc-chevron-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

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

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

::-webkit-scrollbar-thumb {
  background: #cbd2df;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd2df transparent;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.separator {
  background: var(--border);
  flex-shrink: 0;
}

/* Header */
.app-header {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.header-inner {
  min-height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left,
.header-right,
.header-badges {
  display: flex;
  align-items: center;
}

.header-left {
  gap: 12px;
  min-width: 0;
}

.header-right {
  gap: 12px;
}

.header-badges {
  gap: 8px;
}

.brand-logo {
  width: auto;
  height: 26px;
  flex-shrink: 0;
  filter: brightness(0) saturate(100%);
  opacity: 0.9;
}

.header-divider {
  width: 1px;
  height: 24px;
}

.header-title-group {
  min-width: 0;
}

.header-title {
  color: var(--foreground);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
}

.header-subtitle {
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.gp-label {
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Primitives */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.badge-status {
  border-color: var(--primary-border);
  background: var(--primary-muted);
  color: var(--primary);
}

.badge-secondary,
.acc-badge {
  border-color: var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
}

.badge-destructive {
  border-color: #fecaca;
  background: var(--destructive-muted);
  color: var(--destructive);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--foreground);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: #0f6be8;
  border-color: #0f6be8;
}

.btn-secondary,
.btn-set-all {
  background: var(--muted);
  border-color: var(--border);
  color: var(--foreground);
}

.btn-secondary:hover,
.btn-set-all:hover {
  border-color: #c8d0df;
  background: #e9edf5;
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  border-color: #c8d0df;
  background: var(--muted);
  color: var(--foreground);
}

.btn-danger {
  border-color: #fecaca;
  background: var(--destructive-muted);
  color: var(--destructive);
}

.btn-danger:hover {
  background: var(--destructive);
  border-color: var(--destructive);
  color: #ffffff;
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.btn-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
}

.btn-with-icon svg[data-icon="inline-start"] {
  margin-left: -2px;
}

.input {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input);
  color: var(--foreground);
  padding: 0 10px;
  font-size: 0.84rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

.input::placeholder {
  color: #9aa3b2;
}

.input[aria-invalid="true"] {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.input-addon {
  color: var(--muted-foreground);
  font-size: 0.82rem;
  font-weight: 650;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

.field-label {
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.field-value {
  color: var(--muted-foreground);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  color: var(--foreground);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.card-content {
  padding: 16px;
}

/* Tabs */
.tabs-list {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
}

.tabs-trigger {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 0.84rem;
  font-weight: 650;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tabs-trigger:hover {
  color: var(--foreground);
}

.tabs-trigger.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

/* Shell */
.app-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 336px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #fbfcff;
}

.sidebar-section {
  flex-shrink: 0;
}

.sidebar-global {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.sidebar-section-label {
  margin-bottom: 12px;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-vehicles-section {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.sidebar-vehicles-label {
  margin: 0;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-vehicles {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.set-all-input {
  width: 72px;
  min-width: 72px;
  text-align: right;
}

.scenario-name-input {
  min-width: 0;
}

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

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

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

.scenario-name-input.shake {
  animation: shake 0.28s ease;
}

/* Accordion */
.acc-item {
  position: relative;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.acc-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--item-color, var(--primary));
  opacity: 0;
  transition: opacity 0.15s ease;
}

.acc-item.is-open::before,
.acc-item:hover::before {
  opacity: 1;
}

.acc-disabled {
  opacity: 0.58;
}

.acc-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px 11px 16px;
}

.acc-header-left,
.acc-header-right {
  display: flex;
  align-items: center;
}

.acc-header-left {
  flex: 1;
  min-width: 0;
  gap: 8px;
}

.acc-header-right {
  flex-shrink: 0;
  gap: 10px;
}

.acc-chevron-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.acc-chevron-icon {
  transition: transform 0.18s ease;
  transform: rotate(-90deg);
}

.acc-chevron-btn.open .acc-chevron-icon {
  transform: rotate(0deg);
}

.acc-dot,
.summary-dot,
.vtt-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 999px;
}

.acc-name {
  min-width: 0;
  overflow: hidden;
  color: var(--foreground);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-badge {
  min-height: 22px;
  border-radius: 999px;
  font-size: 0.68rem;
}

.acc-carry {
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

.acc-carry.muted {
  color: var(--muted-foreground);
  font-weight: 650;
}

.switch {
  display: inline-flex;
  align-items: center;
}

.switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 34px;
  height: 20px;
  border: 1px solid #c8d0df;
  border-radius: 999px;
  background: var(--muted);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.20);
  transition: transform 0.15s ease;
}

.switch-input:checked + .switch-track {
  border-color: var(--primary);
  background: var(--primary);
}

.switch-input:checked + .switch-track .switch-thumb {
  transform: translateX(14px);
}

.switch-input:focus-visible + .switch-track {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.acc-body.open {
  max-height: 590px;
}

.acc-controls {
  padding: 2px 16px 16px 47px;
}

.acc-control {
  gap: 8px;
}

.acc-control-value {
  min-height: 24px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.acc-control-value.sens-up {
  border-color: #bbf7d0;
  background: var(--success-muted);
  color: var(--success);
}

.acc-control-value.sens-down {
  border-color: #fecaca;
  background: var(--destructive-muted);
  color: var(--destructive);
}

.control-row,
.acc-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-range {
  width: 100%;
  min-width: 0;
  height: 6px;
  border-radius: 999px;
  background: #d9dfeb;
  appearance: none;
  outline: none;
}

.input-range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.22);
  appearance: none;
}

.input-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.22);
}

.input-range:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 6px;
}

.input-number {
  width: 74px;
  min-width: 74px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: right;
}

.input-number-sm {
  width: 70px;
  min-width: 70px;
}

.input-number::-webkit-inner-spin-button,
.input-number::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.input-number {
  appearance: textfield;
}

.input-suffix,
.acc-vesting-lbl,
.acc-slider-bounds {
  color: var(--muted-foreground);
  font-size: 0.74rem;
  font-weight: 650;
}

.acc-vesting-lbl {
  width: 34px;
  flex-shrink: 0;
}

.acc-slider-bounds {
  display: flex;
  justify-content: space-between;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
}

.acc-vesting-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Main */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--background);
}

.metric-strip,
.kpi-row {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.metric-item,
.kpi-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  padding: 14px 18px;
}

.kpi-sep {
  width: 1px;
  margin: 12px 0;
  background: var(--border);
}

.kpi-label {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.kpi-value {
  color: var(--foreground);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.main-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.chart-card {
  min-width: 0;
  overflow: hidden;
}

.chart-card-header {
  padding: 14px 16px 12px;
}

.chart-card-content {
  padding: 16px;
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.summary-card {
  overflow: hidden;
}

.table-scroll {
  padding: 0;
  overflow-x: auto;
}

.summary-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.summary-table thead {
  background: var(--muted);
}

.summary-table th,
.summary-table td {
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  color: var(--card-foreground);
  text-align: left;
  white-space: nowrap;
}

.summary-table thead th {
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.summary-table tbody tr:last-child th,
.summary-table tbody tr:last-child td {
  border-bottom: 0;
}

.summary-table tbody tr:hover th,
.summary-table tbody tr:hover td {
  background: #fbfcff;
}

.summary-table td:not(:first-child),
.summary-table .table-number,
.th-right {
  text-align: right;
}

.summary-vehicle {
  display: table-cell;
  font-weight: 700;
}

.summary-dot {
  display: inline-block;
  margin-right: 8px;
  vertical-align: 1px;
}

.summary-fund {
  color: var(--muted-foreground);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.summary-row.row-disabled {
  opacity: 0.58;
}

.summary-disabled {
  color: var(--muted-foreground);
  font-style: italic;
  text-align: left;
}

.positive {
  color: var(--success);
}

/* Scenarios */
.scenarios-layout {
  width: min(760px, 100%);
  padding: 20px;
}

.scenarios-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.section-title {
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.25;
}

.muted-copy {
  color: var(--muted-foreground);
  font-size: 0.86rem;
  line-height: 1.45;
}

#scenario-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scenario-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.scenario-name {
  color: var(--foreground);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.scenario-date {
  display: block;
  margin-top: 3px;
  color: var(--muted-foreground);
  font-size: 0.78rem;
}

.scenario-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.empty-state {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed #c8d0df;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted-foreground);
  text-align: center;
}

.empty-title {
  color: var(--foreground);
  font-size: 0.92rem;
  font-weight: 750;
}

.empty-description {
  max-width: 300px;
  color: var(--muted-foreground);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* Tooltip */
.tooltip-trigger {
  cursor: default;
  border-bottom: 1px dashed #b8c1d1;
}

.tooltip-trigger:hover {
  border-bottom-color: var(--primary);
}

#vehicle-tooltip {
  position: fixed;
  z-index: 90;
  display: none;
  width: 250px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

#vehicle-tooltip.vtt-visible {
  display: block;
  animation: vtt-in 0.12s ease;
}

@keyframes vtt-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

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

.vtt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.vtt-name {
  color: var(--foreground);
  font-size: 0.88rem;
  font-weight: 750;
}

.vtt-fund {
  margin-left: auto;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.vtt-section-label {
  margin: 10px 0 6px;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.vtt-section-label:first-of-type {
  margin-top: 0;
}

.vtt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
}

.vtt-label,
.vtt-val {
  font-size: 0.78rem;
  line-height: 1.3;
}

.vtt-label {
  color: var(--muted-foreground);
}

.vtt-val {
  color: var(--foreground);
  text-align: right;
}

.vtt-note {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  background: var(--warning-muted);
  color: var(--warning);
  font-size: 0.76rem;
  line-height: 1.4;
}

/* Toast */
#scenario-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 100;
  display: none;
  max-width: calc(100vw - 24px);
  padding: 10px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-md);
  color: var(--foreground);
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
}

#scenario-toast.toast-visible {
  display: block;
  animation: toast-in 0.18s ease;
}

#scenario-toast.toast-fade-out {
  animation: toast-out 0.24s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
}

@media (max-width: 1280px) {
  .sidebar {
    width: 318px;
  }

  .acc-controls {
    padding-left: 43px;
  }

  .kpi-value {
    font-size: 1.12rem;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-global {
    padding: 14px 16px;
  }

  .sidebar-vehicles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: auto;
  }

  .acc-item {
    border-right: 1px solid var(--border);
  }

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

@media (max-width: 900px) {
  .header-inner {
    min-height: 68px;
    flex-wrap: wrap;
    align-content: center;
    padding: 10px 14px;
  }

  .header-left {
    flex: 1 1 100%;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .header-badges {
    display: none;
  }

  .tabs-list {
    width: 100%;
  }

  .tabs-trigger {
    flex: 1;
  }

  .sidebar {
    max-height: 48vh;
  }

  .sidebar-vehicles {
    grid-template-columns: 1fr;
  }

  .metric-strip,
  .kpi-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .kpi-sep {
    display: none;
  }

  .metric-item,
  .kpi-item {
    min-height: 72px;
    padding: 12px 14px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .metric-item:nth-of-type(even),
  .kpi-item:nth-of-type(even) {
    border-right: 0;
  }

  .kpi-label {
    white-space: normal;
  }

  .main-body,
  .scenarios-layout {
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .brand-logo {
    max-width: 132px;
  }

  .header-divider,
  .header-subtitle,
  .badge-status {
    display: none;
  }

  .sidebar-global .input-group {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .set-all-input {
    flex: 1;
  }

  .btn-set-all,
  .btn-save {
    flex: 1;
  }

  .acc-header {
    align-items: flex-start;
  }

  .acc-header-right {
    padding-top: 2px;
  }

  .acc-badge {
    display: none;
  }

  .acc-controls {
    padding: 2px 12px 14px 16px;
  }

  .control-row,
  .acc-slider-row {
    flex-wrap: wrap;
  }

  .input-range {
    flex: 1 1 100%;
    order: 2;
  }

  .input-number-sm {
    width: 86px;
  }

  .chart-wrap {
    height: 230px;
  }

  .scenario-item {
    align-items: stretch;
    flex-direction: column;
  }

  .scenario-actions {
    width: 100%;
  }

  .scenario-actions .btn {
    flex: 1;
  }
}
