:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #64748b;
  --line: #dfe8e6;
  --soft: #f4f7f6;
  --teal: #0f766e;
  --teal-dark: #064e3b;
  --teal-soft: #e8f6f3;
  --amber-soft: #fff8e7;
  --red: #b42318;
  --shadow: 0 12px 34px rgba(28, 55, 50, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--soft); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 80% 10%, rgba(45, 212, 191, .24), transparent 28%), linear-gradient(145deg, #f7fbfa, #e9f3f1); }
.login-card { width: min(100%, 470px); border: 1px solid rgba(15, 118, 110, .16); border-radius: 28px; background: rgba(255, 255, 255, .92); padding: 34px; box-shadow: 0 30px 80px rgba(6, 78, 59, .15); backdrop-filter: blur(18px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup span { display: block; color: var(--teal); font-size: 10px; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; }
.brand-lockup strong { display: block; margin-top: 2px; font-size: 18px; }
.brand-mark { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, var(--teal), #115e59); font-size: 25px; transform: rotate(-20deg); box-shadow: 0 9px 24px rgba(15, 118, 110, .25); }
.login-copy { margin: 48px 0 28px; }
.login-copy h1 { margin: 8px 0 12px; font-size: clamp(28px, 6vw, 38px); line-height: 1.08; letter-spacing: -.04em; }
.login-copy > p:last-child { color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; }
label > span:first-child { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
input, select { width: 100%; height: 44px; border: 1px solid #d3dfdc; border-radius: 11px; background: white; padding: 0 12px; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: #2dd4bf; box-shadow: 0 0 0 3px rgba(45, 212, 191, .15); }
small { color: #94a3b8; font-size: 10px; }
.with-unit { position: relative; display: block; }
.with-unit input { padding-right: 55px; }
.with-unit b { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 11px; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 0 14px; color: var(--ink); background: transparent; font-weight: 750; font-size: 13px; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--teal); border-color: var(--teal); }
.button.primary:hover { background: #0b655e; }
.button.secondary { border-color: #d5dfdd; background: white; }
.button.secondary:hover { border-color: #7dd3c7; color: var(--teal); }
.button.ghost:hover { background: #eef5f3; }
.button.small { min-height: 34px; padding-inline: 10px; font-size: 12px; }
.button.wide { width: 100%; height: 47px; }
.button.danger { color: var(--red); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.form-error { min-height: 18px; margin: 0; color: var(--red); font-size: 12px; }
.app-header { position: sticky; top: 0; z-index: 30; display: flex; height: 70px; align-items: center; justify-content: space-between; border-bottom: 1px solid #dce5e3; background: rgba(255, 255, 255, .92); padding: 0 24px; backdrop-filter: blur(18px); }
.brand-lockup.compact .brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 22px; }
.user-menu { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.page-shell { width: min(1560px, 100%); margin: 0 auto; padding: 26px 24px 60px; }
.project-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.breadcrumb { margin: 0; color: #94a3b8; font-size: 12px; font-weight: 750; }
.breadcrumb span { margin: 0 6px; }
.breadcrumb strong { color: #475569; }
.project-bar h1 { margin: 4px 0 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.actions select { width: 230px; height: 38px; }
.notice { margin: -5px 0 18px; border: 1px solid #b7e2d8; border-radius: 12px; background: #ecfdf8; padding: 11px 14px; color: #075e54; font-size: 13px; }
.notice.error { border-color: #f3c7c2; background: #fff1f0; color: var(--red); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.content-stack, .result-stack { display: grid; gap: 18px; }
.result-stack { position: sticky; top: 90px; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: white; padding: 22px; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.section-heading h2 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.015em; }
.eyebrow { margin: 0; color: var(--teal); font-size: 10px; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.pill { display: inline-flex; min-height: 28px; align-items: center; border: 1px solid #c6e9e1; border-radius: 999px; background: var(--teal-soft); padding: 0 10px; color: #0b655e; font-size: 11px; font-weight: 800; white-space: nowrap; }
.form-grid { display: grid; gap: 15px; margin-top: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.basin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.basin-tab { display: inline-flex; height: 36px; align-items: center; gap: 7px; border: 1px solid #d8e2e0; border-radius: 999px; background: white; padding: 0 13px; color: var(--muted); font-size: 12px; font-weight: 800; }
.basin-tab span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.basin-tab.active { border-color: var(--teal); background: var(--teal); color: white; box-shadow: 0 7px 18px rgba(15, 118, 110, .18); }
.basin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-radius: 15px; background: #f7f9f9; padding: 12px; }
.basin-toolbar input { max-width: 380px; font-size: 15px; font-weight: 800; }
.inline-actions { display: flex; gap: 4px; }
.surface-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 24px 0 10px; }
.surface-header h3 { margin: 0; font-size: 15px; }
.surface-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #edf1f0; padding: 9px 7px; text-align: left; font-size: 12px; }
th { color: var(--muted); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
td input { height: 37px; min-width: 110px; }
.surface-name { min-width: 210px; }
.outlet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; border: 1px solid #cdebe4; border-radius: 16px; background: #f0faf8; padding: 16px; }
.series-note { margin: 16px 0 0; border-left: 3px solid #2dd4bf; padding: 8px 12px; color: #46605b; background: #f4fbf9; font-size: 12px; line-height: 1.45; }
.chart { height: 235px; width: 100%; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: #e4ecea; stroke-dasharray: 4 4; }
.chart .axis-label { fill: #718096; font-size: 10px; }
.chart .area { fill: url(#area-fill); }
.chart .line { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.volume-card { overflow: hidden; border-radius: 22px; color: white; background: radial-gradient(circle at 92% 5%, rgba(94, 234, 212, .3), transparent 32%), linear-gradient(145deg, var(--teal), var(--teal-dark)); padding: 24px; box-shadow: 0 22px 50px rgba(6, 78, 59, .22); }
.volume-card > p { margin: 0; color: #b8fff2; font-size: 10px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.volume-card > div { display: flex; align-items: baseline; gap: 8px; margin: 11px 0 24px; }
.volume-card > div strong { font-size: 51px; letter-spacing: -.055em; }
.volume-card > div span { color: #b8fff2; font-size: 19px; font-weight: 800; }
.volume-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; border-top: 1px solid rgba(255,255,255,.18); padding-top: 18px; }
.volume-card dt { color: #a7f3e7; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.volume-card dd { margin: 4px 0 0; font-weight: 850; }
.summary-card h2 { margin: 4px 0 12px; font-size: 17px; }
.summary-card dl { margin: 0; }
.metric { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #eef2f1; padding: 11px 0; font-size: 12px; }
.metric dt { color: var(--muted); }
.metric dd { margin: 0; font-weight: 850; }
.totals-card { display: flex; align-items: center; justify-content: space-between; }
.totals-card strong { display: block; margin-top: 4px; font-size: 26px; }
.validation { border: 1px solid #bfe5d4; border-radius: 16px; background: #edfbf5; padding: 15px; color: #155d43; font-size: 12px; }
.validation.warning { border-color: #f0d8a0; background: var(--amber-soft); color: #7a5412; }
.validation strong { display: block; margin-bottom: 5px; }
.validation ul { margin: 7px 0 0; padding-left: 18px; }
.swmm-card { display: grid; gap: 12px; }
.swmm-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.swmm-heading strong { display: block; margin-top: 4px; font-size: 16px; }
.swmm-status { border-radius: 999px; background: #e7f0ff; padding: 6px 9px; color: #2459a9; font-size: 10px; font-weight: 850; white-space: nowrap; }
.swmm-card > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.swmm-result { border-radius: 12px; background: #f0faf8; padding: 12px; color: #155d43; font-size: 12px; line-height: 1.55; }
.swmm-result.error { background: #fff1f0; color: var(--red); }
.swmm-result strong { display: block; font-size: 15px; }
.method-note { border-radius: 15px; background: #e9eff3; padding: 15px; color: #425466; font-size: 11px; line-height: 1.48; }
.method-note p { margin: 5px 0 0; }
.print-report { display: none; }
@media (max-width: 1180px) { .layout { grid-template-columns: 1fr; } .result-stack { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); } .method-note, .validation, .swmm-card { grid-column: 1 / -1; } }
@media (max-width: 900px) { .project-bar { align-items: flex-start; flex-direction: column; } .actions { justify-content: flex-start; } .form-grid.four, .outlet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .app-header { height: 62px; padding: 0 14px; } .brand-lockup.compact .brand-mark { width: 36px; height: 36px; } .user-menu #user-name { display: none; } .page-shell { padding: 18px 12px 45px; } .panel { padding: 16px; border-radius: 16px; } .actions { width: 100%; } .actions select { width: 100%; } .actions .button { flex: 1 1 auto; } .form-grid.two, .form-grid.four, .outlet-grid, .result-stack { grid-template-columns: 1fr; } .basin-heading, .basin-toolbar, .surface-header { align-items: stretch; flex-direction: column; } .inline-actions { flex-wrap: wrap; } .login-card { padding: 24px; border-radius: 22px; } }
@media print {
  @page { size: A4; margin: 15mm; }
  body { background: white; color: #172033; }
  #login-screen, #workspace { display: none !important; }
  .print-report { display: block; font-family: Arial, sans-serif; }
  .print-report h1 { margin-bottom: 4px; color: #0f766e; font-size: 23px; }
  .print-report h2 { margin-top: 25px; color: #172033; font-size: 16px; }
  .print-report p { font-size: 11px; line-height: 1.5; }
  .print-report table { margin-top: 12px; }
  .print-report th, .print-report td { border: 1px solid #b8c4c2; padding: 7px; font-size: 9px; }
  .print-report th { background: #e9f5f2; }
  .print-report .warning-print { margin-top: 24px; border: 1px solid #d8c28b; padding: 10px; }
}
