:root {
  color-scheme: light;
  --ink: #1e2024;
  --ink-soft: #62666d;
  --ink-faint: #8a8e94;
  --paper: #f4f2ed;
  --surface: #fffefa;
  --surface-soft: #f8f6f1;
  --line: #e3ded4;
  --line-dark: #d3ccc0;
  --charcoal: #17191d;
  --charcoal-2: #22252a;
  --charcoal-3: #2d3036;
  --bronze: #a87843;
  --bronze-light: #d4b486;
  --bronze-pale: #f2e9dc;
  --green: #2f785c;
  --green-pale: #e7f1ec;
  --red: #a64b46;
  --red-pale: #f6e9e6;
  --amber: #a66a24;
  --amber-pale: #f6eee0;
  --shadow: 0 12px 36px rgba(28, 25, 20, 0.06);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  font-style: normal;
  text-rendering: optimizeLegibility;
}

/* Keep semantic emphasis without the browser's default italic typography. */
em, i, cite, dfn, address {
  font-style: normal;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

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

button,
a {
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

button {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong,
.number-cell {
  font-variant-numeric: tabular-nums;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 2.3vw, 38px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3vw, 48px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.25;
}

.muted {
  color: var(--ink-soft);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--bronze);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow--light {
  color: var(--bronze-light);
}

.button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

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

.button--primary {
  color: #fff;
  background: var(--bronze);
  box-shadow: 0 7px 18px rgba(168, 120, 67, 0.2);
}

.button--primary:hover {
  background: #916436;
}

.button--secondary {
  color: var(--bronze);
  border-color: #d9c6ad;
  background: #fffaf3;
}

.button--ghost {
  color: var(--ink-soft);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.button--ghost:hover {
  color: var(--ink);
  border-color: var(--line-dark);
  background: white;
}

.button--small {
  min-height: 36px;
  padding: 0 13px;
  font-size: 12px;
}

.button--wide {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.icon-button--dark {
  color: #9fa2a6;
  border-color: #373a40;
}

.icon-button--dark:hover {
  color: white;
  border-color: #555a61;
}

/* Login */
.login-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(460px, 1.08fr) minmax(430px, 0.92fr);
}

.login-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: clamp(34px, 5vw, 74px);
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 80% 20%, rgba(212, 180, 134, 0.18), transparent 28%),
    linear-gradient(145deg, #25282d 0%, #111317 78%);
}

.login-panel::before,
.login-panel::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(212, 180, 134, 0.12);
  border-radius: 50%;
}

.login-panel::before {
  right: -190px;
  bottom: -265px;
  width: 640px;
  height: 640px;
}

.login-panel::after {
  right: -40px;
  bottom: -145px;
  width: 390px;
  height: 390px;
}

.login-panel__brand,
.sidebar__brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(212, 180, 134, 0.75);
  border-radius: 50%;
  color: var(--bronze-light);
  font-family: Georgia, serif;
  font-size: 22px;
  font-style: normal;
}

.brand-mark--large {
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.brand-name,
.brand-caption {
  display: block;
}

.brand-name {
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0.26em;
}

.brand-caption {
  margin-top: 3px;
  color: #91959b;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: auto 0;
  padding: 70px 0;
}

.login-copy h1 {
  margin-bottom: 24px;
  font-size: clamp(45px, 5.2vw, 76px);
  line-height: 1.02;
}

.login-copy > p:last-child {
  max-width: 590px;
  margin-bottom: 0;
  color: #afb2b6;
  font-size: 17px;
  line-height: 1.65;
}

.login-panel__metrics {
  position: relative;
  z-index: 1;
  display: flex;
  gap: clamp(24px, 5vw, 72px);
}

.login-panel__metrics div {
  display: grid;
  gap: 4px;
}

.login-panel__metrics strong {
  color: var(--bronze-light);
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 500;
}

.login-panel__metrics span {
  color: #85898f;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-form-wrap {
  display: grid;
  min-height: 100vh;
  padding: 44px;
  place-items: center;
  background: #f6f4ef;
}

.login-form {
  width: min(400px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-form h2 {
  font-size: 38px;
}

.login-form > .muted {
  margin-bottom: 29px;
  font-size: 14px;
  line-height: 1.5;
}

.field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.field > span,
.check-field span {
  color: #45484e;
  font-size: 12px;
  font-weight: 720;
}

.field input,
.field select,
.field__control,
.edit-table input,
.edit-table select {
  border: 1px solid var(--line);
  background: #fff;
}

.field input,
.field select {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field select:focus,
.field__control:focus-within,
.edit-table input:focus,
.edit-table select:focus {
  border-color: #bb9365;
  box-shadow: 0 0 0 3px rgba(168, 120, 67, 0.09);
}

.field--login {
  margin-bottom: 18px;
}

.field--login input {
  height: 48px;
}

.demo-access {
  display: flex;
  margin-top: 22px;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 11px;
}

.demo-access code {
  color: var(--ink-soft);
}

.form-error {
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid #ebc7c1;
  border-radius: 9px;
  color: var(--red);
  background: var(--red-pale);
  font-size: 13px;
}

/* App shell */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 244px;
  padding: 28px 18px 20px;
  flex-direction: column;
  color: white;
  background: var(--charcoal);
}

.sidebar__brand {
  margin-bottom: 45px;
  padding-left: 10px;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav__item {
  display: flex;
  min-height: 45px;
  padding: 0 13px;
  align-items: center;
  gap: 12px;
  border-radius: 9px;
  color: #8f9399;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.nav__item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
}

.nav__item:hover {
  color: #e6e7e9;
  background: #22252a;
}

.nav__item--active {
  color: #f4e6d3;
  background: linear-gradient(90deg, rgba(168, 120, 67, 0.25), rgba(168, 120, 67, 0.08));
}

.nav__item--active::before {
  position: absolute;
  left: 0;
  width: 2px;
  height: 25px;
  border-radius: 0 2px 2px 0;
  background: var(--bronze-light);
  content: "";
}

.sidebar__project {
  display: grid;
  margin-top: auto;
  margin-bottom: 21px;
  padding: 18px 14px;
  gap: 5px;
  border: 1px solid #2c2f34;
  border-radius: 11px;
  background: #1c1e22;
}

.sidebar__project-label {
  margin-bottom: 4px;
  color: #70747a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar__project strong {
  font-size: 13px;
}

.sidebar__project > span:last-child,
.sidebar__user span {
  color: #74787e;
  font-size: 10px;
  line-height: 1.4;
}

.sidebar__footer {
  display: grid;
  padding: 16px 4px 0;
  align-items: center;
  grid-template-columns: 34px 1fr 34px;
  gap: 10px;
  border-top: 1px solid #2a2d31;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #f5e8d7;
  background: #3b332b;
  font-size: 11px;
  font-weight: 800;
}

.sidebar__user {
  display: grid;
  min-width: 0;
}

.sidebar__user strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
}

.workspace {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  display: flex;
  min-height: 94px;
  padding: 22px clamp(24px, 3.1vw, 50px);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 242, 237, 0.94);
}

.topbar h1 {
  font-family: inherit;
  font-size: 25px;
  font-weight: 760;
}

.topbar .eyebrow {
  margin-bottom: 5px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.save-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-faint);
  font-size: 11px;
}

.save-indicator i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 120, 92, 0.09);
}

.page-content {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 34px clamp(24px, 3.1vw, 50px) 60px;
}

/* Shared cards */
.card,
.metric-card,
.scenario-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card {
  min-width: 0;
  padding: 24px;
}

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

.card__hint {
  color: var(--ink-faint);
  font-size: 11px;
  white-space: nowrap;
}

.counter {
  display: grid;
  min-width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  color: var(--bronze);
  background: var(--bronze-pale);
  font-size: 12px;
  font-weight: 800;
}

/* Dashboard */
.dashboard-hero {
  position: relative;
  display: flex;
  min-height: 230px;
  margin-bottom: 20px;
  padding: 38px 42px;
  overflow: hidden;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  border-radius: 18px;
  color: white;
  background:
    radial-gradient(circle at 90% 30%, rgba(196, 151, 96, 0.28), transparent 22%),
    linear-gradient(112deg, #1d2024 0%, #2b2d31 62%, #1c1e21 100%);
  box-shadow: 0 18px 44px rgba(26, 27, 30, 0.12);
}

.dashboard-hero::after {
  position: absolute;
  top: -170px;
  right: -110px;
  width: 470px;
  height: 470px;
  border: 1px solid rgba(212, 180, 134, 0.14);
  border-radius: 50%;
  content: "";
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero h2 {
  margin-bottom: 10px;
  font-size: clamp(34px, 3.5vw, 53px);
}

.dashboard-hero p {
  margin-bottom: 0;
  color: #9fa2a6;
  font-size: 13px;
}

.dashboard-hero__meta {
  display: flex;
  margin-bottom: 17px;
  align-items: center;
  gap: 9px;
  color: #8f9398;
  font-size: 11px;
}

.dashboard-hero__meta strong {
  color: #d9c1a2;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.scenario-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bd8b54;
  box-shadow: 0 0 0 5px rgba(189, 139, 84, 0.12);
}

.dashboard-hero__side {
  display: grid;
  min-width: 245px;
  padding: 18px 20px;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(8px);
}

.dashboard-hero__side span {
  color: #84888e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.dashboard-hero__side strong {
  font-size: 13px;
}

.dashboard-hero__side a {
  color: var(--bronze-light);
  font-size: 11px;
  text-decoration: none;
}

.metric-grid,
.staff-summary {
  display: grid;
  margin-bottom: 20px;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card {
  position: relative;
  display: grid;
  min-height: 128px;
  padding: 20px;
  overflow: hidden;
  align-content: space-between;
}

.metric-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: #d4cec2;
  content: "";
}

.metric-card--positive::before {
  background: var(--green);
}

.metric-card--negative::before {
  background: var(--red);
}

.metric-card > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.metric-card > strong {
  align-self: center;
  font-family: Georgia, serif;
  font-size: clamp(25px, 2vw, 32px);
  font-weight: 500;
  line-height: 1;
}

.metric-card small {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.35;
}

.metric-card--positive small {
  color: var(--green);
}

.metric-card--negative small {
  color: var(--red);
}

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

.dashboard-grid--chart {
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 0.72fr);
}

.chart-wrap {
  overflow: hidden;
}

.bar-chart {
  display: block;
  width: 100%;
  min-width: 560px;
  overflow: visible;
}

.chart-grid {
  stroke: #e9e4dc;
  stroke-width: 1;
}

.chart-axis,
.chart-label,
.chart-unit {
  fill: #8b8d91;
  font-family: inherit;
  font-size: 10px;
}

.chart-unit {
  fill: #a0a2a6;
  font-size: 9px;
}

.bar-revenue {
  fill: #34383e;
}

.bar-ebitda {
  fill: var(--bronze);
}

.chart-legend {
  display: flex;
  gap: 18px;
  color: var(--ink-soft);
  font-size: 10px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chart-legend span::before {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  content: "";
}

.legend-revenue::before {
  background: #34383e;
}

.legend-ebitda::before {
  background: var(--bronze);
}

.return-toggle {
  display: grid;
  margin-bottom: 25px;
  padding: 3px;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.return-toggle button {
  height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-faint);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.return-toggle button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 9px rgba(31, 29, 25, 0.08);
}

.returns-list {
  display: grid;
  gap: 0;
}

.returns-list > div {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #eee9e1;
}

.returns-list span {
  color: var(--ink-soft);
  font-size: 11px;
}

.returns-list strong {
  text-align: right;
  font-size: 13px;
}

.returns-card__note {
  margin-top: 20px;
  padding: 12px 13px;
  border-radius: 8px;
  color: #7a6c59;
  background: var(--bronze-pale);
  font-size: 9px;
  line-height: 1.45;
}

.annual-card,
.sensitivity-card {
  margin-bottom: 20px;
}

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

table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.financial-table {
  width: 100%;
  min-width: 800px;
}

.financial-table th,
.financial-table td {
  min-width: 130px;
  padding: 12px 14px;
  border-bottom: 1px solid #eee9e1;
  text-align: right;
  font-size: 11px;
}

.financial-table th:first-child,
.financial-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 230px;
  text-align: left;
  background: var(--surface);
}

.financial-table thead th {
  color: var(--ink-faint);
  background: var(--surface-soft);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.financial-table thead th:first-child {
  background: var(--surface-soft);
}

.financial-table tbody td:first-child {
  color: var(--ink-soft);
}

.financial-table .row--strong td {
  color: var(--ink);
  font-weight: 760;
}

.financial-table .row--highlight td {
  color: #75532d;
  background: #fbf6ee;
  font-weight: 760;
}

.financial-table .row--highlight td:first-child {
  background: #fbf6ee;
}

.warning-list,
.scenario-compare {
  display: grid;
  gap: 9px;
}

.warning {
  display: grid;
  min-height: 57px;
  padding: 10px 12px;
  align-items: center;
  grid-template-columns: 9px 1fr;
  gap: 12px;
  border: 1px solid #eee9e1;
  border-radius: 10px;
  background: #fdfcf9;
}

.warning > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.warning > div {
  display: grid;
  gap: 4px;
}

.warning strong {
  font-size: 11px;
}

.warning span {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.4;
}

.warning--danger > i {
  background: var(--red);
}

.warning--ok > i {
  background: var(--green);
}

.scenario-compare__row {
  display: grid;
  min-height: 61px;
  padding: 10px 12px;
  align-items: center;
  grid-template-columns: minmax(130px, 1.3fr) 1fr 0.7fr;
  gap: 12px;
  border: 1px solid #eee9e1;
  border-radius: 10px;
}

.scenario-compare__row--active {
  border-color: #d7bea0;
  background: #fbf6ef;
}

.scenario-compare__row > div {
  display: grid;
  gap: 3px;
}

.scenario-compare__row > div:not(:first-child) {
  text-align: right;
}

.scenario-compare__row strong {
  font-size: 11px;
}

.scenario-compare__row span {
  color: var(--ink-faint);
  font-size: 9px;
}

.sensitivity-wrap {
  overflow-x: auto;
}

.sensitivity-axis {
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 9px;
  text-transform: uppercase;
}

.sensitivity-table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 5px;
}

.sensitivity-table th,
.sensitivity-table td {
  height: 49px;
  padding: 7px 10px;
  border-radius: 6px;
  text-align: center;
  font-size: 10px;
}

.sensitivity-table th {
  color: var(--ink-faint);
  font-weight: 650;
}

.sensitivity-table td {
  color: color-mix(in srgb, #443326 calc(55% + var(--strength) * 30%), #fff);
  background: color-mix(in srgb, #c99d67 calc(8% + var(--strength) * 48%), #f7f4ee);
  font-weight: 750;
}

.sensitivity-table td.is-base {
  outline: 2px solid var(--bronze);
  outline-offset: 1px;
}

/* Parameters */
.page-lead {
  display: flex;
  margin-bottom: 24px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-lead h2 {
  margin-bottom: 9px;
  font-size: 36px;
}

.page-lead p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.scenario-picker {
  display: grid;
  margin-bottom: 20px;
  padding: 13px;
  align-items: stretch;
  grid-template-columns: minmax(210px, 1.1fr) repeat(3, minmax(170px, 1fr));
  gap: 8px;
}

.scenario-picker__copy {
  display: grid;
  padding: 8px 13px;
  align-content: center;
  gap: 5px;
}

.scenario-picker__copy span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scenario-picker__copy strong {
  font-size: 12px;
}

.scenario-option {
  display: grid;
  min-height: 57px;
  padding: 10px 12px;
  align-items: center;
  grid-template-columns: 8px 1fr;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface-soft);
  cursor: pointer;
  text-align: left;
}

.scenario-option:hover {
  border-color: var(--line-dark);
}

.scenario-option i {
  width: 8px;
  height: 8px;
  border: 2px solid #c3beb5;
  border-radius: 50%;
}

.scenario-option span {
  display: grid;
  gap: 3px;
}

.scenario-option strong {
  font-size: 11px;
}

.scenario-option small {
  color: var(--ink-faint);
  font-size: 9px;
}

.scenario-option--active {
  border-color: #d7bea0;
  background: #fbf5ec;
}

.scenario-option--active i {
  border-color: var(--bronze);
  background: var(--bronze);
  box-shadow: 0 0 0 3px white inset;
}

.tabs {
  display: flex;
  margin-bottom: 20px;
  overflow-x: auto;
  gap: 3px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  min-height: 45px;
  padding: 0 17px;
  border: 0;
  color: var(--ink-faint);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.tab::after {
  position: absolute;
  right: 17px;
  bottom: -1px;
  left: 17px;
  height: 2px;
  background: transparent;
  content: "";
}

.tab--active {
  color: var(--ink);
}

.tab--active::after {
  background: var(--bronze);
}

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

.settings-card:first-child:last-child,
.settings-card:nth-child(3):last-child {
  grid-column: 1 / -1;
}

.settings-card__head {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee9e1;
}

.settings-card__head h3 {
  margin-bottom: 6px;
}

.settings-card__head p {
  margin-bottom: 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

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

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

.form-grid__wide {
  grid-column: 1 / -1;
}

.field__control {
  display: flex;
  height: 43px;
  align-items: center;
  border-radius: 9px;
  overflow: hidden;
}

.field__control input {
  min-width: 0;
  height: 41px;
  border: 0;
  box-shadow: none;
}

.field__control input:focus {
  box-shadow: none;
}

.field__control em {
  padding-right: 12px;
  color: var(--ink-faint);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.check-field {
  display: flex;
  min-height: 43px;
  padding: 0 13px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.check-field input,
.table-check {
  accent-color: var(--bronze);
}

.editable-card {
  padding: 24px 0 0;
  overflow: hidden;
}

.editable-card > .card__head {
  padding: 0 24px;
}

.edit-table {
  width: 100%;
  min-width: 980px;
}

.edit-table th,
.edit-table td {
  padding: 9px 8px;
  border-top: 1px solid #ece7df;
  text-align: left;
  font-size: 10px;
}

.edit-table th:first-child,
.edit-table td:first-child {
  padding-left: 24px;
}

.edit-table th:last-child,
.edit-table td:last-child {
  padding-right: 24px;
}

.edit-table th {
  height: 37px;
  color: var(--ink-faint);
  background: var(--surface-soft);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.edit-table input:not([type="checkbox"]),
.edit-table select {
  width: 100%;
  min-width: 90px;
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  outline: none;
  font-size: 10px;
}

.edit-table input:disabled {
  color: var(--ink-faint);
  background: #f3f0ea;
}

.edit-table td small {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 8px;
}

.edit-table .number-cell {
  min-width: 120px;
  text-align: right;
  white-space: nowrap;
}

.number-cell--strong {
  color: #75532d;
  font-weight: 800;
}

.row-action {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.row-action--danger {
  color: #bc8c87;
  font-size: 18px;
}

.row-action--danger:hover {
  color: var(--red);
  background: var(--red-pale);
}

.edit-table tfoot td {
  color: var(--ink-soft);
  background: #faf8f4;
  font-weight: 700;
}

.edit-table tfoot td:nth-child(2) {
  text-align: right;
}

.edit-table .total-row td {
  color: var(--ink);
  background: #f2ede5;
  font-weight: 850;
}

.edit-table--opex {
  min-width: 780px;
}

/* Staff */
.staff-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.staff-table {
  min-width: 1570px;
}

.staff-table td:nth-child(1),
.staff-table th:nth-child(1) {
  min-width: 120px;
}

.staff-table td:nth-child(2),
.staff-table th:nth-child(2) {
  min-width: 245px;
}

.staff-table td:nth-child(3),
.staff-table th:nth-child(3) {
  width: 75px;
}

.staff-table .role-input {
  min-width: 225px;
}

.staff-table tr.row--muted td {
  color: #a2a4a8;
  background: #faf9f6;
}

/* Dialog and feedback */
.modal {
  width: min(650px, calc(100vw - 30px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(20, 20, 20, 0.26);
}

.modal::backdrop {
  background: rgba(18, 20, 23, 0.65);
  backdrop-filter: blur(4px);
}

.modal__head {
  display: flex;
  padding: 24px 26px 20px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.modal__head h2 {
  margin: 0;
  font-size: 30px;
}

.modal__body {
  padding: 24px 26px;
}

.modal__actions {
  display: flex;
  padding: 18px 26px 24px;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 28px;
  bottom: 28px;
  padding: 13px 17px;
  border: 1px solid #3b3f45;
  border-radius: 9px;
  color: white;
  background: #24272b;
  box-shadow: 0 14px 35px rgba(20, 20, 20, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 11px;
}

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

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .dashboard-grid--chart {
    grid-template-columns: 1fr;
  }

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

  .scenario-picker__copy {
    grid-column: 1 / -1;
  }
}

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

  .login-panel {
    min-height: 480px;
  }

  .login-form-wrap {
    min-height: auto;
    padding: 54px 24px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    width: 100%;
    height: auto;
    padding: 12px 18px;
    flex-direction: row;
    align-items: center;
  }

  .sidebar__brand {
    margin: 0 18px 0 0;
    padding: 0;
  }

  .sidebar__brand .brand-caption,
  .sidebar__project,
  .sidebar__user,
  .user-avatar {
    display: none;
  }

  .nav {
    display: flex;
    flex: 1;
    gap: 2px;
  }

  .nav__item {
    min-height: 40px;
  }

  .nav__item--active::before {
    display: none;
  }

  .sidebar__footer {
    display: block;
    padding: 0;
    border: 0;
  }

  .workspace {
    grid-column: auto;
  }

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

  .settings-card:nth-child(3):last-child {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .login-panel {
    min-height: 430px;
    padding: 28px;
  }

  .login-copy {
    padding: 55px 0 38px;
  }

  .login-copy h1 {
    font-size: 42px;
  }

  .login-panel__metrics {
    gap: 24px;
  }

  .login-panel__metrics div:last-child {
    display: none;
  }

  .login-form {
    padding: 30px 24px;
  }

  .sidebar__brand .brand-name,
  .nav__item span {
    display: none;
  }

  .sidebar__brand {
    margin-right: 5px;
  }

  .nav {
    justify-content: center;
  }

  .nav__item {
    justify-content: center;
  }

  .topbar {
    min-height: 78px;
    padding: 16px 18px;
  }

  .topbar .eyebrow,
  .save-indicator,
  .topbar .button {
    display: none;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .page-content {
    padding: 22px 15px 40px;
  }

  .dashboard-hero {
    min-height: 300px;
    padding: 27px 24px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
  }

  .dashboard-hero h2 {
    font-size: 34px;
  }

  .dashboard-hero__side {
    min-width: 0;
  }

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

  .metric-card {
    min-height: 116px;
    padding: 16px;
  }

  .metric-card > strong {
    font-size: 24px;
  }

  .card {
    padding: 18px;
  }

  .chart-legend {
    display: none;
  }

  .page-lead {
    align-items: stretch;
    flex-direction: column;
  }

  .page-lead h2 {
    font-size: 31px;
  }

  .scenario-picker {
    grid-template-columns: 1fr;
  }

  .scenario-picker__copy {
    grid-column: auto;
  }

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

  .form-grid__wide {
    grid-column: auto;
  }

  .scenario-compare__row {
    grid-template-columns: 1.3fr 1fr 0.7fr;
  }

  .modal__body {
    max-height: 60vh;
    overflow-y: auto;
  }
}

@media (max-width: 430px) {
  .metric-grid,
  .staff-summary {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 108px;
  }

  .scenario-compare__row {
    grid-template-columns: 1fr 1fr;
  }

  .scenario-compare__row > div:first-child {
    grid-column: 1 / -1;
  }
}
