:root {
  --orange: #f47a20;
  --orange-dark: #ce5910;
  --orange-soft: #fff1e7;
  --ink: #171717;
  --ink-2: #242424;
  --muted: #6c6c6c;
  --line: #e7e7e7;
  --surface: #ffffff;
  --canvas: #f4f4f2;
  --danger: #b42318;
  --success: #177245;
  --radius: 16px;
  --shadow: 0 14px 40px rgba(20, 20, 20, .06);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 246px;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  color: #fff;
  background: var(--ink);
}
.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  width: max-content;
  color: inherit;
  text-decoration: none;
  letter-spacing: -.06em;
  line-height: 1;
}
.brand__word { display: inline-flex; align-items: center; font-size: 27px; font-weight: 850; }
.brand__suffix { color: var(--orange); font-size: 17px; font-weight: 850; letter-spacing: -.02em; }
.brand__e { display: inline-grid; width: 21px; height: 21px; margin: 0 1px; align-content: space-between; }
.brand__e i { display: block; height: 4px; border-radius: 2px; background: var(--orange); }
.brand__e i:nth-child(2) { width: 78%; }
.brand--small .brand__word { font-size: 21px; }
.brand--small .brand__suffix { font-size: 14px; }
.brand--small .brand__e { width: 17px; height: 17px; }
.brand--small .brand__e i { height: 3px; }

.nav { display: grid; gap: 5px; margin-top: 48px; }
.nav__link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 12px;
  color: #bdbdbd;
  border-radius: 9px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.nav__link:hover { color: #fff; background: #2d2d2d; }
.nav__link.is-active { color: #fff; background: #313131; box-shadow: inset 3px 0 var(--orange); }
.nav__icon { width: 19px; color: var(--orange); font-size: 18px; text-align: center; }
.nav__label { margin: 28px 12px 7px; color: #777; font-size: 11px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.sidebar__user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 15px 0; border-top: 1px solid #343434; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; color: #111; background: var(--orange); font-size: 13px; font-weight: 800; }
.sidebar__identity { display: grid; min-width: 0; flex: 1; }
.sidebar__identity strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__identity span { color: #8f8f8f; font-size: 11px; }
.icon-button { color: #a7a7a7; text-decoration: none; }

.mobile-header { display: none; }
.content { min-height: 100vh; margin-left: 246px; }
.content__inner { width: min(1320px, 100%); margin: 0 auto; padding: 42px 42px 70px; }
.content--standalone { margin-left: 0; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin: 3px 0 4px; font-size: clamp(28px, 3vw, 39px); line-height: 1.08; letter-spacing: -.045em; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.eyebrow { margin: 0; color: var(--orange-dark); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.formula-chip { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 650; }
.formula-chip span { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }

.calculator-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.calculator-main { display: grid; gap: 18px; }
.panel { overflow: hidden; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel__heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 24px; }
.panel__heading--padded { padding: 26px 26px 0; }
.panel__heading h2 { margin: 0 0 3px; font-size: 18px; letter-spacing: -.02em; }
.panel__heading p { margin: 0; color: var(--muted); font-size: 13px; }
.step { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; color: var(--orange-dark); background: var(--orange-soft); font-size: 11px; font-weight: 850; }
.panel--table { padding: 0; }
.panel--narrow { max-width: 590px; }
.panel--dark { color: #fff; border-color: #2d2d2d; background: var(--ink); }
.panel--dark .eyebrow { color: var(--orange); }
.panel--dark h2 { margin: 5px 0 22px; }

.form-grid { display: grid; gap: 17px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid__wide { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; align-content: start; min-width: 0; }
.field > span, .field-group__title { color: #444; font-size: 13px; font-weight: 700; }
.field small { color: var(--muted); font-size: 11px; }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid #d5d5d5;
  border-radius: 9px;
  outline: none;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244, 122, 32, .13); }
.field--accent input { border-color: #f0b183; background: #fffaf6; }
.field input[readonly] { color: #555; cursor: not-allowed; background: #f3f3f1; }
.input-prefix, .input-suffix { display: flex; align-items: center; min-height: 44px; overflow: hidden; border: 1px solid #d5d5d5; border-radius: 9px; background: #fff; }
.input-prefix:focus-within, .input-suffix:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244, 122, 32, .13); }
.input-prefix b, .input-suffix b { padding: 0 11px; color: #777; font-size: 12px; }
.input-prefix input, .input-suffix input { min-width: 0; border: 0; border-radius: 0; box-shadow: none !important; }
.input-prefix input { padding-left: 0; }
.input-suffix input { padding-right: 0; }
.field-group { padding: 19px; border-radius: 12px; background: #f8f8f7; }
.field-group + .field-group { margin-top: 13px; }
.field-group + .form-grid { margin-top: 18px; }
.field-group__title { margin-bottom: 13px; }
.field-group__description { margin: -6px 0 17px; color: var(--muted); font-size: 12px; }
.pricing-settings { margin-top: 22px; }
.stack { display: grid; gap: 17px; }

.result-card { position: sticky; top: 26px; overflow: hidden; padding: 26px; border-radius: var(--radius); color: #fff; background: var(--ink); box-shadow: 0 22px 48px rgba(0,0,0,.16); }
.result-card::before { position: absolute; content: ''; inset: 0 0 auto; height: 4px; background: var(--orange); }
.result-card h2 { margin: 5px 0 20px; font-size: 25px; letter-spacing: -.035em; }
.pricing-mode { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -7px 0 19px; padding: 10px 12px; border: 1px solid #3b3b3b; border-radius: 9px; background: #222; }
.pricing-mode span { color: var(--orange); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.pricing-mode strong { color: #d1d1d1; font-size: 11px; text-align: right; }
.cost-list { display: grid; gap: 11px; }
.cost-list > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; color: #adadad; font-size: 13px; }
.cost-list strong { color: #fff; font-size: 14px; }
.cost-list__total { margin-top: 2px; padding-top: 13px; border-top: 1px solid #3c3c3c; }
.price-block { display: grid; gap: 2px; margin-top: 23px; padding: 15px; border: 1px solid #393939; border-radius: 11px; background: #222; }
.price-block span, .total-block span { color: #aaa; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.price-block strong { font-size: 21px; }
.total-block { display: grid; margin: 12px 0 0; padding: 18px 15px; border-radius: 11px; background: var(--orange); }
.total-block span { color: rgba(255,255,255,.77); }
.total-block strong { margin: 2px 0 1px; font-size: 30px; line-height: 1.1; letter-spacing: -.04em; }
.total-block small { color: rgba(255,255,255,.8); }
.profit-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 0 2px; color: #aaa; font-size: 12px; }
.profit-row strong { color: #fff; }
.result-actions { display: grid; gap: 9px; margin-top: 25px; }
.privacy-note { margin: 16px 0 0; color: #888; font-size: 11px; text-align: center; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 750; transition: transform .12s, background .12s, border-color .12s; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: #fff; background: var(--orange); }
.button--primary:hover { background: var(--orange-dark); }
.button--secondary { color: var(--ink); border-color: #d5d5d5; background: #fff; }
.button--ghost { color: #aaa; border-color: #373737; background: transparent; }
.button--ghost:hover { color: #fff; border-color: #555; }
.button--large { min-height: 48px; }
.button--small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.button--full { width: 100%; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.notice { margin-bottom: 20px; padding: 12px 15px; border: 1px solid #b9e2cd; border-radius: 10px; color: var(--success); background: #eefaf3; font-size: 13px; font-weight: 650; }
.notice--error { color: var(--danger); border-color: #f1c2bd; background: #fff2f0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; color: #777; border-bottom: 1px solid var(--line); background: #fafafa; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
td { padding: 15px 18px; border-bottom: 1px solid #ededed; color: #4c4c4c; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); }
td small { display: block; margin-top: 2px; color: #8a8a8a; }
.align-right { text-align: right; }
.table-link { color: var(--orange-dark); font-weight: 800; text-decoration: none; }
.empty-state { display: grid; place-items: center; min-height: 330px; padding: 40px; text-align: center; }
.empty-state strong { font-size: 18px; }
.empty-state p { margin: 6px 0 18px; color: var(--muted); }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #777; background: #eee; font-size: 11px; font-weight: 750; }
.status--active { color: var(--success); background: #e9f7ef; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 20px; align-items: start; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.detail-list > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:nth-child(even) { padding-left: 20px; }
.detail-list dt { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.detail-list dd { margin: 4px 0 0; font-weight: 700; }
.detail-list__total dd { color: var(--orange-dark); font-size: 20px; }
.cost-list--dark { gap: 14px; }
.settings-layout { display: grid; gap: 18px; max-width: 940px; }
.users-layout { display: grid; grid-template-columns: minmax(280px, .6fr) minmax(0, 1.4fr); gap: 20px; align-items: start; }
.error-card { margin: 9vh auto; text-align: center; }
.error-code { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%; color: #fff; background: var(--orange); font-size: 28px; font-weight: 900; }
.error-card h1 { margin: 0; }
.error-card p { color: var(--muted); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; color: #fff; background: #101010; }
.login-page::before { position: fixed; content: ''; inset: 0; pointer-events: none; background: radial-gradient(circle at 72% 18%, rgba(244,122,32,.13), transparent 31%), linear-gradient(120deg, transparent 0 48%, rgba(255,255,255,.025) 48% 49%, transparent 49%); }
.login-card { position: relative; width: min(430px, 100%); padding: 39px; border: 1px solid #313131; border-radius: 21px; background: #191919; box-shadow: 0 30px 80px rgba(0,0,0,.42); }
.brand--login { margin-bottom: 44px; }
.brand--login .brand__word { font-size: 31px; }
.brand--login .brand__suffix { font-size: 19px; }
.brand--login .brand__e { width: 24px; height: 23px; }
.login-card__intro h1 { margin: 5px 0 7px; font-size: 31px; letter-spacing: -.04em; }
.login-card__intro > p:not(.eyebrow) { margin: 0 0 25px; color: #9c9c9c; }
.login-card .field > span { color: #d7d7d7; }
.login-card .field input { color: #fff; border-color: #393939; background: #222; }
.login-card .field input:focus { border-color: var(--orange); }
.login-card__footer { margin: 25px 0 0; color: #6f6f6f; font-size: 11px; text-align: center; }

@media (max-width: 1080px) {
  .calculator-grid { grid-template-columns: 1fr; }
  .result-card { position: static; }
  .result-actions { grid-template-columns: 1fr 1fr; }
  .users-layout, .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .mobile-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 62px; padding: 0 18px; color: #fff; background: var(--ink); }
  .mobile-menu { padding: 7px 10px; color: #ddd; border: 1px solid #3d3d3d; border-radius: 7px; background: #242424; font-size: 12px; }
  .sidebar { visibility: hidden; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .2s, visibility .2s; box-shadow: 18px 0 50px rgba(0,0,0,.25); }
  .sidebar.is-open { visibility: visible; transform: translateX(0); }
  .content { margin-left: 0; }
  .content__inner { padding: 25px 16px 50px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .formula-chip { width: max-content; margin-top: 0; }
  .panel { padding: 20px 17px; border-radius: 13px; }
  .form-grid--2, .form-grid--3 { grid-template-columns: 1fr; }
  .field-group { padding: 15px; }
  .result-actions { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list > div:nth-child(even) { padding-left: 0; }
  .login-card { padding: 30px 23px; }
}

@media print {
  .sidebar, .mobile-header, .button { display: none !important; }
  .content { margin: 0; }
  .content__inner { padding: 0; }
  .panel { box-shadow: none; }
}
