:root {
  color-scheme: light;
  --navy-950: #0b1728;
  --navy-900: #101f35;
  --navy-800: #172b46;
  --navy-700: #25405f;
  --orange-600: #e87822;
  --orange-500: #f28a31;
  --orange-100: #fff0e3;
  --ink: #172336;
  --muted: #718096;
  --line: #e5eaf0;
  --canvas: #f4f6f8;
  --surface: #fff;
  --green: #23835d;
  --green-bg: #e9f6ef;
  --red: #bd3d3d;
  --red-bg: #fff0ef;
  --amber: #9b6712;
  --amber-bg: #fff5df;
  --shadow: 0 14px 40px rgba(15, 31, 53, .08);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(242, 138, 49, .45); outline-offset: 2px; }
#app { min-height: 100vh; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 258px; background: var(--navy-900); color: #fff; display: flex; flex-direction: column; flex: 0 0 258px; padding: 22px 14px 18px; position: fixed; inset: 0 auto 0 0; z-index: 20; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 11px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-logo { width: 46px; height: 46px; object-fit: contain; background: white; border-radius: 10px; padding: 4px; }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; font-size: 20px; letter-spacing: .045em; line-height: 1; }
.brand-copy span { display: block; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: #a9b8c9; margin-top: 5px; }
.nav-label { margin: 22px 12px 9px; color: #8496aa; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-list { display: grid; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; width: 100%; color: #c2cedb; border: 0; border-radius: 8px; padding: 9px 12px; background: transparent; text-align: left; font-size: 13px; font-weight: 600; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(242,138,49,.16); color: #ffad67; box-shadow: inset 3px 0 var(--orange-500); }
.nav-icon { width: 19px; display: inline-flex; justify-content: center; color: currentColor; opacity: .95; }
.sidebar-bottom { margin-top: auto; padding: 17px 9px 0; }
.sidebar-note { color: #9fb0c3; font-size: 11px; line-height: 1.55; padding: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.035); }
.sidebar-note strong { color: #fff; display: block; font-size: 12px; margin-bottom: 4px; }
.workspace { min-width: 0; width: calc(100% - 258px); margin-left: 258px; }
.topbar { height: 72px; position: sticky; z-index: 10; top: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 3vw, 44px); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.breadcrumb { display: grid; gap: 1px; }
.breadcrumb span { text-transform: uppercase; color: var(--muted); font-size: 10px; letter-spacing: .11em; font-weight: 700; }
.breadcrumb strong { font-family: "Barlow Condensed", sans-serif; font-size: 22px; font-weight: 600; line-height: 1.05; }
.user-chip { display: flex; gap: 10px; align-items: center; padding-left: 16px; border-left: 1px solid var(--line); }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--navy-800); font-size: 12px; font-weight: 700; border-radius: 50%; flex: 0 0 auto; }
.user-copy { display: grid; line-height: 1.3; }
.user-copy strong { font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy span { color: var(--muted); font-size: 11px; }
.menu-toggle { display: none; border: 1px solid var(--line); border-radius: 8px; width: 40px; height: 40px; background: #fff; color: var(--navy-900); font-size: 18px; }
.main-content { max-width: 1600px; margin: 0 auto; padding: 30px clamp(18px, 3vw, 44px) 52px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.eyebrow { color: var(--orange-600); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 700; margin-bottom: 6px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: clamp(29px, 3vw, 38px); line-height: 1; margin-bottom: 8px; color: var(--navy-900); }
.page-heading p { max-width: 730px; color: var(--muted); font-size: 13px; margin: 0; line-height: 1.6; }
.heading-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 39px; padding: 9px 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 12px; font-weight: 700; transition: background .15s, transform .15s, border-color .15s; }
.btn:hover { border-color: #bec9d5; background: #f9fafb; }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-primary { color: #fff; background: var(--orange-600); border-color: var(--orange-600); }
.btn-primary:hover { background: #cf6418; border-color: #cf6418; }
.btn-dark { color: #fff; background: var(--navy-900); border-color: var(--navy-900); }
.btn-dark:hover { background: var(--navy-800); }
.btn-danger { color: var(--red); background: #fff; border-color: #f0d2d0; }
.btn-small { min-height: 30px; padding: 6px 9px; font-size: 11px; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--navy-900); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 2px 10px rgba(15,31,53,.025); }
.card-pad { padding: 19px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.card-head h2, .card-head h3 { font-size: 14px; margin: 0; font-weight: 700; color: var(--navy-900); }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.metric-card { padding: 16px 17px 15px; position: relative; overflow: hidden; }
.metric-card:after { content: ""; width: 3px; position: absolute; inset: 14px auto 14px 0; background: var(--orange-500); border-radius: 0 4px 4px 0; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-value { font-family: "Barlow Condensed", sans-serif; font-size: 30px; line-height: 1.05; color: var(--navy-900); font-weight: 600; margin-top: 8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-meta { color: var(--muted); font-size: 10px; margin-top: 7px; }
.dashboard-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 620px; text-align: left; }
th { color: #718096; background: #f8fafb; text-transform: uppercase; letter-spacing: .075em; font-size: 9px; font-weight: 700; padding: 11px 13px; white-space: nowrap; }
td { padding: 12px 13px; border-top: 1px solid #edf0f3; color: #324155; font-size: 11px; vertical-align: middle; }
td strong { color: var(--navy-900); font-size: 11px; font-weight: 700; }
.table-empty { padding: 30px 16px; color: var(--muted); text-align: center; font-size: 12px; }
.data-table { overflow: hidden; }
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.table-tools p { font-size: 11px; color: var(--muted); margin: 0; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 9px; font-size: 10px; line-height: 1.15; font-weight: 700; white-space: nowrap; background: #edf1f5; color: #526174; }
.status:before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.status-green { background: var(--green-bg); color: var(--green); }
.status-red { background: var(--red-bg); color: var(--red); }
.status-amber { background: var(--amber-bg); color: var(--amber); }
.status-blue { background: #eaf1fa; color: #3b6597; }
.status-gray { background: #edf1f5; color: #526174; }
.notice { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; background: #fff8eb; border: 1px solid #f1dfbd; border-radius: 8px; color: #77541a; margin-bottom: 15px; font-size: 12px; line-height: 1.55; }
.notice strong { color: #62420d; }
.notice-info { background: #eff5fb; border-color: #d7e4f1; color: #3b5878; }
.notice-error { background: var(--red-bg); border-color: #f1d0ce; color: #903434; }
.notice-success { background: var(--green-bg); border-color: #cce7d6; color: #276448; }
.state-panel { display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; min-height: 260px; padding: 34px; }
.state-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--orange-600); background: var(--orange-100); font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.state-panel h2 { font-family: "Barlow Condensed", sans-serif; font-size: 25px; margin-bottom: 7px; color: var(--navy-900); }
.state-panel p { max-width: 510px; color: var(--muted); font-size: 12px; line-height: 1.65; margin-bottom: 17px; }
.spinner { width: 24px; height: 24px; border: 3px solid #e5eaf0; border-top-color: var(--orange-600); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: #4f5e71; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; border: 1px solid #dce3ea; border-radius: 7px; background: #fff; color: var(--ink); padding: 9px 11px; font-size: 12px; }
.field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: #a6b0bc; }
.field small { font-size: 10px; color: var(--muted); line-height: 1.4; }
.checkbox-row { display: flex; align-items: center; gap: 8px; padding-top: 22px; font-size: 11px; color: #4f5e71; font-weight: 600; }
.checkbox-row input { accent-color: var(--orange-600); width: 15px; height: 15px; }
.form-section { grid-column: 1/-1; padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--line); }
.form-section h3 { margin: 8px 0 3px; color: var(--navy-900); font-size: 12px; }
.form-section p { margin: 0 0 7px; color: var(--muted); font-size: 10px; }
.calculator-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(270px,.65fr); gap: 16px; align-items: start; }
.calculator-form { padding: 20px; }
.calculator-form .form-section:first-child { border: 0; padding-top: 0; margin-top: 0; }
.calc-sidebar { display: grid; gap: 14px; position: sticky; top: 90px; }
.scenario-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.scenario-card { padding: 13px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; }
.scenario-card.recommended { background: #fff8f1; border-color: #f4c99f; }
.scenario-title { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.scenario-price { margin: 7px 0; color: var(--navy-900); font-family: "Barlow Condensed", sans-serif; font-size: 23px; white-space: nowrap; }
.scenario-detail { display: grid; gap: 4px; font-size: 10px; color: var(--muted); }
.result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 13px; }
.result-item { padding: 10px; border-radius: 7px; background: #f6f8fa; }
.result-item span { color: var(--muted); font-size: 9px; display: block; }
.result-item strong { display: block; color: var(--navy-900); font-size: 13px; margin-top: 4px; }
.price-adjust { padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.price-adjust .field { margin-top: 10px; }
.price-adjust input { font-size: 18px; font-weight: 700; height: 48px; }
.price-diff { margin-top: 8px; font-size: 10px; color: var(--muted); }
.ref-list { display: grid; gap: 7px; }
.ref-row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #eef1f4; padding: 7px 0; font-size: 10px; }
.ref-row:last-child { border-bottom: 0; }
.ref-row span { color: var(--muted); }
.ref-row strong { text-align: right; color: var(--navy-900); }
.json-preview { max-width: 290px; max-height: 90px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: #516176; font-family: ui-monospace, monospace; font-size: 10px; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 75% 20%, rgba(242,138,49,.2), transparent 36%), linear-gradient(135deg, #0b1728 0%, #132943 58%, #1c3856 100%); }
.auth-card { width: min(100%, 470px); padding: clamp(26px, 5vw, 44px); border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.26); }
.auth-logo { width: 84px; height: 84px; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; padding: 8px; margin-bottom: 25px; }
.auth-kicker { color: var(--orange-600); font-size: 10px; text-transform: uppercase; letter-spacing: .15em; font-weight: 700; }
.auth-card h1 { font-size: 34px; margin: 9px 0 10px; }
.auth-card p { color: var(--muted); font-size: 13px; line-height: 1.65; margin-bottom: 21px; }
.auth-card .btn { width: 100%; min-height: 46px; }
.auth-foot { color: #8a96a4 !important; font-size: 10px !important; text-align: center; margin: 14px 0 0 !important; }
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(8, 19, 33, .62); backdrop-filter: blur(3px); }
.modal { width: min(100%, 680px); max-height: min(90vh, 900px); overflow: auto; background: #fff; border-radius: 13px; box-shadow: 0 25px 90px rgba(0,0,0,.28); }
.modal.modal-wide { width: min(100%, 920px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: "Barlow Condensed", sans-serif; font-size: 25px; color: var(--navy-900); margin: 0; }
.modal-head p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.modal-close { flex: 0 0 auto; border: 0; background: transparent; font-size: 23px; color: var(--muted); padding: 0 3px; line-height: 1; }
.modal-body { padding: 19px 22px; }
.modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 13px 22px 20px; border-top: 1px solid var(--line); }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); pointer-events: none; }
.toast { border-radius: 9px; padding: 13px 15px; box-shadow: var(--shadow); background: var(--navy-900); color: #fff; font-size: 12px; line-height: 1.5; animation: toast-in .18s ease-out; }
.toast.error { background: #872d2d; }
.toast.success { background: #1c684b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.mobile-overlay { display: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
@media (max-width: 1150px) {
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .calculator-layout { grid-template-columns: 1fr; }
  .calc-sidebar { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calc-sidebar > .card:first-child { grid-column: 1/-1; }
}
@media (max-width: 760px) {
  .sidebar { width: 275px; flex-basis: 275px; transform: translateX(-101%); transition: transform .2s ease; box-shadow: 14px 0 35px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-left: 0; width: 100%; }
  .mobile-overlay.visible { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(5,15,28,.45); }
  .menu-toggle { display: inline-grid; place-items: center; }
  .topbar { height: 64px; padding: 0 15px; }
  .topbar-left { gap: 10px; }
  .breadcrumb span { font-size: 9px; }
  .breadcrumb strong { font-size: 19px; }
  .user-chip { padding-left: 10px; gap: 7px; }
  .user-copy { display: none; }
  .user-avatar { width: 34px; height: 34px; }
  .main-content { padding: 23px 15px 38px; }
  .page-heading { flex-direction: column; gap: 14px; }
  .heading-actions { justify-content: flex-start; }
  .metrics-grid { gap: 9px; }
  .metric-card { padding: 13px; }
  .metric-value { font-size: 25px; }
  .form-grid.cols-3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calc-sidebar { grid-template-columns: 1fr; }
  .calc-sidebar > .card:first-child { grid-column: auto; }
  .scenario-grid { grid-template-columns: 1fr; }
  .scenario-card { display: grid; grid-template-columns: 1fr 1.1fr; gap: 0 8px; align-items: center; }
  .scenario-price { text-align: right; grid-column: 2; grid-row: 1; margin: 0; }
  .scenario-detail { grid-column: 1/-1; display: flex; flex-wrap: wrap; justify-content: space-between; margin-top: 7px; }
  .modal-backdrop { padding: 8px; align-items: end; }
  .modal { max-height: 94vh; border-radius: 14px 14px 8px 8px; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-footer { padding: 12px 16px 16px; }
}
@media (max-width: 460px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-label { font-size: 10px; }
  .metric-value { font-size: 23px; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .field.full, .form-section { grid-column: auto; }
  .checkbox-row { padding-top: 4px; }
  .heading-actions .btn { flex: 1 1 auto; }
  .table-tools { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
