:root {
  color-scheme: light;
  --ink: #17352d;
  --muted: #698078;
  --paper: #f5f7f2;
  --surface: #ffffff;
  --line: #dfe7e1;
  --green-900: #0d4435;
  --green-800: #145c47;
  --green-700: #1d7659;
  --green-100: #e2f1e9;
  --sun: #ffc900;
  --sun-soft: #fff5c7;
  --blue: #1c8fb8;
  --danger: #b23b3b;
  --shadow: 0 18px 50px rgba(24, 55, 46, 0.11);
  --radius-lg: 24px;
  --radius-md: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }

.auth-page { min-height: 100vh; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); }
.auth-story { position: relative; min-height: 100vh; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: white; background: var(--green-900); }
.auth-story::before { content: ""; position: absolute; inset: auto -140px -210px auto; width: 520px; height: 520px; border: 86px solid rgba(255, 201, 0, .17); border-radius: 50%; }
.auth-story::after { content: ""; position: absolute; top: 20%; right: -110px; width: 270px; height: 270px; border: 1px solid rgba(255,255,255,.18); transform: rotate(16deg); }
.auth-brand, .auth-story-copy, .auth-facts { position: relative; z-index: 1; }
.auth-brand { width: min(340px, 72%); padding: 14px 18px; background: white; border-radius: 18px; }
.auth-brand img { display: block; width: 100%; height: 84px; object-fit: contain; }
.auth-story-copy { max-width: 660px; padding: 80px 0; }
.auth-story-copy h1 { max-width: 620px; margin: 10px 0 20px; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -.045em; }
.auth-story-copy > p:last-child { max-width: 560px; margin: 0; color: #c9ddd6; font-size: 18px; line-height: 1.7; }
.auth-facts { display: flex; gap: 12px; flex-wrap: wrap; }
.auth-facts span { padding: 10px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.07); font-size: 13px; }

.auth-panel { min-height: 100vh; padding: 40px; display: grid; place-items: center; align-content: center; gap: 28px; background: #fbfcf9; }
.login-card { width: min(440px, 100%); padding: clamp(30px, 5vw, 48px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.login-card h2 { margin: 8px 0 8px; font-size: 34px; letter-spacing: -.035em; }
.muted { color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0; color: var(--green-700); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.light { color: #f8d95f; }
.form-stack { display: grid; gap: 18px; margin-top: 32px; }
.field { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 48px; padding: 0 14px; color: var(--ink); border: 1px solid #cbd8d0; border-radius: 12px; outline: none; background: #fff; transition: border-color .18s, box-shadow .18s; }
.field textarea { width: 100%; resize: vertical; padding: 12px 14px; color: var(--ink); border: 1px solid #cbd8d0; border-radius: 12px; outline: none; background: #fff; font: inherit; }
.full-field { grid-column: 1 / -1; }
.field small { color: var(--muted); font-size: .74rem; font-weight: 500; }
.customer-id-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 16px; border-radius: 14px; background: #eef7f2; border: 1px dashed #9bc2af; }
.customer-id-preview span, .customer-id-preview small { color: var(--muted); }
.customer-id-preview strong { color: var(--green-700); letter-spacing: .02em; }
.field input:focus, .field select:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(29, 118, 89, .12); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 96px; }
.text-button { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); padding: 7px 8px; color: var(--green-700); border: 0; background: transparent; font-size: 12px; font-weight: 800; }
.button { min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; font-weight: 800; transition: transform .18s, background .18s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--green-800); }
.button.primary:hover { background: var(--green-900); }
.button.sun { color: #3e3400; background: var(--sun); }
.button.wide { width: 100%; }
.form-message { padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.form-message.error { color: #852d2d; background: #fff0ef; border: 1px solid #f2cac7; }
.credential-note { margin-top: 26px; padding: 15px; display: flex; gap: 12px; align-items: flex-start; border-radius: 14px; background: var(--green-100); }
.credential-note p { margin: 5px 0 0; color: #436359; font-size: 13px; }
.credential-note code { padding: 2px 5px; border-radius: 4px; color: var(--green-900); background: rgba(255,255,255,.7); }
.status-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--green-700); box-shadow: 0 0 0 5px rgba(29,118,89,.12); }
.auth-footer { margin: 0; color: var(--muted); font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; display: flex; flex-direction: column; color: white; background: var(--green-900); }
.sidebar-brand { display: block; padding: 8px 10px; border-radius: 14px; background: #fff; }
.sidebar-brand img { width: 100%; height: 74px; display: block; object-fit: contain; }
.side-nav { display: grid; gap: 7px; margin-top: 38px; }
.nav-item { min-height: 45px; padding: 0 15px; text-align: left; color: #c9ddd6; border: 0; border-radius: 11px; background: transparent; font-weight: 700; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.11); }
.nav-item.logout { margin-top: auto; color: #ffe97f; }
.workspace { min-width: 0; padding: 34px clamp(24px, 4vw, 56px) 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 30px; }
.topbar h1 { margin: 6px 0 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.035em; }
.user-chip { min-height: 44px; padding: 5px 13px 5px 5px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.user-chip span { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--green-700); font-weight: 800; }
.dashboard-hero { position: relative; overflow: hidden; padding: clamp(28px, 4vw, 48px); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(230px, .6fr); gap: 28px; align-items: center; color: white; border-radius: var(--radius-lg); background: var(--green-800); box-shadow: var(--shadow); }
.dashboard-hero::after { content: ""; position: absolute; width: 310px; height: 310px; right: -190px; top: -100px; border: 54px solid rgba(255,201,0,.24); border-radius: 50%; }
.dashboard-hero h2 { max-width: 720px; margin: 12px 0; font-size: clamp(30px, 4vw, 50px); line-height: 1.06; letter-spacing: -.045em; }
.dashboard-hero p:not(.eyebrow) { max-width: 620px; color: #d8ebe4; line-height: 1.65; }
.dashboard-hero .button { margin-top: 12px; }
.energy-mark { min-height: 190px; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid rgba(255,255,255,.2); border-radius: 18px; background: rgba(255,255,255,.07); }
.energy-mark span { color: var(--sun); font-weight: 900; letter-spacing: .16em; }
.energy-mark strong { margin: 6px 0; font-size: 32px; letter-spacing: -.03em; }
.energy-mark small { color: #bcd7cd; }
.metric-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { min-height: 150px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.metric-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { margin: 8px 0 4px; font-size: 34px; }
.metric-card small { margin-top: auto; color: var(--muted); }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: auto; padding: 32px; }
  .auth-story-copy { padding: 60px 0 40px; }
  .auth-story-copy h1 { font-size: clamp(36px, 8vw, 56px); }
  .auth-panel { min-height: auto; padding: 54px 24px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; gap: 18px; padding: 12px 18px; }
  .sidebar-brand { width: 150px; }
  .sidebar-brand img { height: 48px; }
  .side-nav { margin: 0 0 0 auto; display: flex; }
  .nav-item.logout { margin: 0; }
  .dashboard-hero { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .auth-brand { width: 230px; }
  .auth-story { padding: 24px; }
  .auth-story-copy { padding: 48px 0 32px; }
  .auth-facts { display: none; }
  .auth-panel { padding: 36px 16px; }
  .login-card { padding: 28px 22px; }
  .sidebar { overflow-x: auto; }
  .sidebar-brand { flex: 0 0 116px; }
  .side-nav .nav-item:nth-child(n+3) { display: none; }
  .workspace { padding: 24px 16px 48px; }
  .topbar { align-items: flex-start; }
  .user-chip strong { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
}

/* Application workspace */
[hidden] { display: none !important; }
.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; }
.sidebar .nav-item { display: flex; align-items: center; gap: 12px; }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-user { margin-top: auto; padding: 14px 10px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user .avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green-900); border-radius: 50%; background: var(--sun); font-weight: 900; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user small { margin-top: 2px; color: #9fc1b4; font-size: 10px; }
.nav-item.logout { margin-top: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.mobile-logout { display: none; border: 1px solid #cfe0d8; background: #fff; color: var(--green-800); border-radius: 10px; padding: 8px 10px; font-weight: 800; }
#user-form { max-width: 980px; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px 18px; align-items: end; }
#user-form .field input, #user-form .field select { min-height: 48px; padding: 10px 14px; font-size: 16px; }
#user-form > .button { min-height: 48px; padding: 10px 18px; font-size: 16px; }
.local-badge { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; color: #527067; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 700; }
.local-badge i { width: 8px; height: 8px; border-radius: 50%; background: #2ca66f; box-shadow: 0 0 0 4px rgba(44,166,111,.12); }
.app-section { animation: section-in .25s ease-out; }
@keyframes section-in { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.content-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 8px 30px rgba(24,55,46,.06); }
.recent-card, .page-card { margin-top: 20px; padding: clamp(22px, 3vw, 32px); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; margin-bottom: 24px; }
.section-heading h2 { margin: 7px 0 0; font-size: 24px; letter-spacing: -.025em; }
.section-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); line-height: 1.5; }
.section-heading.compact { margin-bottom: 22px; }
.section-heading.compact > div { position: relative; padding-left: 55px; }
.section-heading.compact h2 { margin: 0; }
.step-number { position: absolute; left: 0; top: 1px; width: 39px; height: 39px; display: grid; place-items: center; color: var(--green-800); border-radius: 12px; background: var(--green-100); font-size: 12px; font-weight: 900; }
.button.ghost { color: var(--green-800); border: 1px solid var(--line); background: #fff; }
.button.ghost:hover { border-color: #b8ccc0; background: #f7faf7; }
.button.outline { color: var(--green-800); border: 1px solid var(--green-700); background: transparent; }
.button.small { min-height: 38px; padding: 0 14px; font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.data-table th { padding: 12px 14px; text-align: left; color: #6a8178; border-bottom: 1px solid var(--line); background: #f8faf7; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.data-table th:first-child { border-radius: 10px 0 0 10px; }
.data-table th:last-child { border-radius: 0 10px 10px 0; }
.data-table td { padding: 16px 14px; color: #405b52; border-bottom: 1px solid #edf1ee; font-size: 13px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td strong, .data-table td small { display: block; }
.data-table td strong { color: var(--ink); font-size: 14px; }
.data-table td small { margin-top: 4px; color: var(--muted); }
.data-table tbody tr:hover { background: #fbfcfa; }
.pill { display: inline-flex; padding: 5px 9px; color: var(--green-800); border-radius: 999px; background: var(--green-100); font-size: 11px; font-weight: 800; white-space: nowrap; }
.table-empty-inline { padding: 28px; display: grid; place-items: center; gap: 5px; color: var(--muted); text-align: center; }
.table-empty-inline strong { color: var(--ink) !important; }
.skeleton-row { display: block; height: 34px; border-radius: 8px; background: #eef2ef; }
.metric-card { position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--green-700); }
.metric-card.accent-blue::before { background: var(--blue); }
.metric-card.accent-sun::before { background: var(--sun); }
.metric-card.accent-teal::before { background: #31a889; }

/* Design calculator */
.design-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.design-main { display: grid; gap: 20px; min-width: 0; }
.form-card { padding: clamp(22px, 3vw, 30px); }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field select, .field textarea { width: 100%; min-height: 48px; padding: 0 38px 0 14px; color: var(--ink); border: 1px solid #cbd8d0; border-radius: 12px; outline: none; background: #fff; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 57px; }
.input-suffix b { position: absolute; top: 50%; right: 13px; transform: translateY(-50%); color: #688078; font-size: 12px; pointer-events: none; }
.load-table-wrap { overflow-x: auto; }
.load-table { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0 8px; }
.load-table th { padding: 0 8px 5px; text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .055em; }
.load-table td { padding: 0 5px; }
.load-table td:first-child { padding-left: 0; }
.load-table td:last-child { padding-right: 0; }
.load-table input { width: 100%; min-width: 80px; height: 43px; padding: 0 10px; color: var(--ink); border: 1px solid #d5dfd8; border-radius: 10px; outline: none; background: #fbfcfa; }
.load-table input:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(29,118,89,.1); background: #fff; }
.load-table td:first-child input { min-width: 170px; }
.load-table output { min-width: 82px; display: block; color: var(--green-800); font-weight: 800; text-align: right; }
.remove-row { width: 35px; height: 35px; display: grid; place-items: center; color: #aa5151; border: 0; border-radius: 9px; background: #fff0ef; font-size: 21px; }
.remove-row:hover { background: #f8dedd; }
.add-load-mobile { display: none; }
.audit-summary { position: sticky; top: 24px; padding: 26px; }
.audit-summary h2 { margin: 8px 0 22px; font-size: 23px; }
.summary-number { display: flex; align-items: baseline; gap: 7px; }
.summary-number strong { font-size: clamp(36px, 4vw, 50px); letter-spacing: -.045em; }
.summary-number span { color: var(--muted); font-weight: 700; }
.summary-stats { margin: 22px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary-stats div { padding: 13px; border-radius: 12px; background: #f4f7f3; }
.summary-stats span, .summary-stats strong { display: block; }
.summary-stats span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.summary-stats strong { margin-top: 5px; font-size: 14px; }
.energy-scale { height: 7px; overflow: hidden; border-radius: 999px; background: #e8eeea; }
.energy-scale i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sun); transition: width .25s ease; }
.summary-hint { margin: 10px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.audit-summary .button + .button { margin-top: 10px; }
.result-area { display: grid; gap: 16px; scroll-margin-top: 20px; }
.result-banner { padding: 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; color: white; border-radius: var(--radius-lg); background: var(--green-800); }
.result-banner h2 { margin: 7px 0; font-size: 27px; }
.result-banner p:not(.eyebrow) { margin: 0; color: #cfe2da; }
.result-cost { min-width: 230px; padding-left: 26px; border-left: 1px solid rgba(255,255,255,.2); }
.result-cost span, .result-cost strong, .result-cost small { display: block; }
.result-cost span { color: #b9d6cb; font-size: 12px; }
.result-cost strong { margin: 5px 0; color: var(--sun); font-size: 25px; }
.result-cost small { color: #dcebe5; }
.warning-box { padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; color: #675717; border: 1px solid #ebd98d; border-radius: 12px; background: var(--sun-soft); font-size: 12px; line-height: 1.5; }
.warning-box + .warning-box { margin-top: 7px; }
.warning-box strong { flex: 0 0 auto; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.result-card { position: relative; min-width: 0; padding: 22px; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.result-card > .field, .result-card > dl { grid-column: 1 / -1; }
.result-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--green-800); border-radius: 14px; background: var(--green-100); font-size: 13px; font-weight: 900; }
.result-icon.panel-icon { color: #176c8a; background: #e1f3f8; }
.result-icon.scc-icon { color: #846b00; background: var(--sun-soft); }
.result-icon.inverter-icon { color: #87531c; background: #faecde; }
.result-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.result-card h3 { margin: 5px 0 0; font-size: 16px; line-height: 1.35; }
.compact-field { margin-top: 4px; }
.compact-field select { min-height: 42px; font-size: 12px; }
.result-card dl { margin: 0; display: grid; gap: 8px; }
.result-card dl > div { padding-top: 8px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #edf1ee; }
.result-card dt { color: var(--muted); font-size: 12px; }
.result-card dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 800; text-align: right; }
.result-note { padding: 16px 18px; border-left: 4px solid var(--blue); border-radius: 0 12px 12px 0; background: #eef7fa; }
.result-note strong { font-size: 13px; }
.result-note p { margin: 5px 0 0; color: #4d6871; font-size: 12px; line-height: 1.55; }

/* Projects and components */
.toolbar { margin: 0 0 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.search-field { width: min(420px, 100%); }
.search-field input { width: 100%; height: 42px; padding: 0 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; outline: none; background: #f8faf7; }
.search-field input:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(29,118,89,.1); background: #fff; }
.record-count { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.table-actions { text-align: right; white-space: nowrap; }
.row-action { padding: 7px 9px; color: var(--green-700); border: 0; border-radius: 8px; background: var(--green-100); font-size: 11px; font-weight: 800; }
.row-action + .row-action { margin-left: 5px; }
.row-action.danger { color: #a13d3d; background: #fff0ef; }
.empty-state { padding: 62px 24px; text-align: center; }
.empty-state strong { font-size: 20px; }
.empty-state p { margin: 8px 0 20px; color: var(--muted); }
.tabs { margin: 0 0 18px; padding: 5px; display: inline-flex; gap: 3px; border-radius: 13px; background: #eef2ee; }
.tab { min-height: 38px; padding: 0 13px; color: #62776f; border: 0; border-radius: 9px; background: transparent; font-size: 12px; font-weight: 800; }
.tab span { margin-left: 5px; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.7); font-size: 10px; }
.tab.active { color: var(--green-900); background: #fff; box-shadow: 0 3px 10px rgba(24,55,46,.09); }
.component-table { min-width: 820px; }

/* Dialogs and feedback */
.modal { width: min(860px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 0; color: var(--ink); border: 0; border-radius: 22px; background: transparent; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(8, 32, 25, .58); backdrop-filter: blur(3px); }
.modal-card { margin: 0; max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 22px; background: #fff; overflow: hidden; }
.modal-header { padding: 24px 26px 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 6px 0 0; font-size: 25px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 24px; }
.modal-body { padding: 24px 26px; overflow-y: auto; }
.modal-body .form-message { margin-top: 18px; }
.modal-actions { padding: 16px 26px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); background: #f9faf8; }
.project-actions { flex-wrap: wrap; }
.invoice-history { display: flex; flex-wrap: wrap; gap: 8px; }
.project-detail-card { width: 100%; }
.detail-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.detail-overview div { padding: 15px; border-radius: 13px; background: #f2f6f2; }
.detail-overview span, .detail-overview strong { display: block; }
.detail-overview span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.detail-overview strong { margin-top: 5px; font-size: 14px; }
.detail-section { margin-top: 24px; }
.detail-section h3 { margin: 0 0 12px; font-size: 16px; }
.detail-components { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-components div { padding: 14px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 12px; }
.detail-components span { color: var(--green-700); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.detail-components strong { font-size: 13px; }
.detail-components small { color: var(--muted); }
.guide-page { overflow: hidden; }
.guide-intro { margin: 4px 0 28px; padding: 24px 28px; border: 1px solid #d7e8df; border-radius: 18px; background: linear-gradient(135deg, #f2faf5, #fff); }
.guide-kicker { color: var(--green-700); font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.guide-intro h3 { margin: 8px 0 5px; color: var(--green-900); font-size: clamp(22px, 3vw, 31px); letter-spacing: -.03em; }
.guide-intro p { max-width: 680px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.guide-grid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; counter-reset: guide; }
.guide-grid::before { content: ''; position: absolute; top: 30px; bottom: 30px; left: 29px; width: 1px; background: #d7e8df; }
.guide-step { position: relative; z-index: 1; display: grid; grid-template-columns: 58px 1fr; gap: 16px; min-height: 190px; padding: 22px 22px 22px 14px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 8px 22px rgba(14, 64, 48, .045); }
.guide-step > span { display: grid; place-items: center; width: 42px; height: 42px; margin-top: 1px; color: #fff; border: 5px solid #f2faf5; border-radius: 50%; background: var(--green-700); font-size: 13px; font-weight: 900; }
.guide-step h3 { margin: 1px 0 8px; color: var(--green-900); font-size: 19px; letter-spacing: -.02em; }
.guide-step p, .guide-step li { color: var(--muted); font-size: 13px; line-height: 1.65; }
.guide-step p { margin: 0; }
.guide-step ol { margin: 7px 0 0; padding-left: 19px; }
.guide-step li { margin: 4px 0; }
.guide-step strong { color: var(--green-800); font-weight: 800; }
.accent-profit { border-color: #ead9a8; background: linear-gradient(145deg, #fffdf4, #fff); }
.accent-profit strong { color: #9a6810; }
.dashboard-guide-card { margin-top: 18px; padding: 24px 28px; }
.dashboard-guide-card .section-heading { margin-bottom: 16px; }
.dashboard-guide-card h2 { font-size: 24px; line-height: 1.15; }
.dashboard-guide-card .section-heading p { max-width: 680px; font-size: 14px; line-height: 1.55; }
.profit-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 20px; border: 1px solid #ead9a8; border-radius: 14px; background: #fffdf4; color: #765a20; font-size: 14px; font-weight: 700; }
.profit-flow b { color: #b38b2e; font-size: 20px; }
.profit-flow strong { color: #8a5d0b; font-size: 18px; }
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 20; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 380px; padding: 13px 16px; color: #fff; border-radius: 11px; background: var(--green-800); box-shadow: 0 12px 30px rgba(13,68,53,.25); font-size: 13px; font-weight: 700; animation: toast-in .2s ease-out; }
.toast.error { background: #9f3b3b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .design-layout { grid-template-columns: 1fr; }
  .audit-summary { position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; }
  .audit-summary > .eyebrow, .audit-summary > h2, .audit-summary > .energy-scale, .audit-summary > .summary-hint { display: none; }
  .audit-summary .summary-number { min-width: 240px; }
  .audit-summary .summary-stats { margin: 0; min-width: 260px; }
  .audit-summary .button { width: auto; margin: 0 !important; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 15; left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; height: 68px; padding: 7px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; border-radius: 18px; box-shadow: 0 15px 40px rgba(13,68,53,.3); }
  .sidebar-brand, .sidebar-user { display: none; }
  .side-nav { display: contents; }
  .side-nav .nav-item:nth-child(n+3) { display: flex; }
  .nav-item, .nav-item.logout { min-height: 54px; margin: 0; padding: 5px; display: flex; flex-direction: column; justify-content: center; gap: 3px; text-align: center; font-size: 9px; }
  .nav-item svg { width: 18px; height: 18px; }
  .workspace { padding-bottom: 110px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { margin-bottom: 22px; }
  .local-badge { display: none; }
  .mobile-logout { display: inline-flex; }
  .topbar h1 { font-size: 28px; }
  .dashboard-hero { padding: 26px 22px; }
  .energy-mark { min-height: 130px; }
  .section-heading { flex-direction: column; }
  .section-heading > .button { width: 100%; }
  .form-grid.two, .form-grid.three, .result-grid, .detail-components { grid-template-columns: 1fr; }
  .load-heading .button { display: none; }
  .add-load-mobile { width: 100%; min-height: 42px; margin-top: 12px; display: block; color: var(--green-800); border: 1px dashed #a9c6b7; border-radius: 11px; background: #f5faf6; font-weight: 800; }
  .audit-summary { display: block; }
  .audit-summary > .eyebrow, .audit-summary > h2, .audit-summary > .energy-scale, .audit-summary > .summary-hint { display: block; }
  .audit-summary .summary-stats { margin: 22px 0 18px; min-width: 0; }
  .audit-summary .button { width: 100%; margin-top: 10px !important; }
  .result-banner { grid-template-columns: 1fr; }
  .result-cost { padding: 16px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.2); }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { flex: 0 0 auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .record-count { align-self: flex-end; }
  .detail-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #user-form { max-width: none; grid-template-columns: 1fr; }
  .modal-body .form-grid.two { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-grid::before { display: none; }
  .guide-step { min-height: 0; padding-right: 16px; }
  .guide-intro { padding: 20px; }
  .dashboard-guide-card { padding: 20px; }
  .dashboard-guide-card h2 { font-size: 22px; }
  .profit-flow { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; font-size: 13px; }
  .profit-flow b { line-height: 1; }
  .profit-flow strong { font-size: 16px; }
}

@media (max-width: 480px) {
  .workspace { padding: 20px 14px 105px; }
  .topbar-actions { gap: 5px; }
  .user-chip { border: 0; background: transparent; }
  .dashboard-hero h2 { font-size: 32px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 130px; }
  .page-card, .recent-card, .form-card { padding: 20px 16px; }
  .section-heading.compact > div { padding-left: 48px; }
  .warning-box { display: grid; }
  .detail-overview { grid-template-columns: 1fr; }
  .toast-region { left: 14px; right: 14px; bottom: 92px; }
  .toast { max-width: none; }
}

@media print {
  body * { visibility: hidden; }
  #project-modal, #project-modal * { visibility: visible; }
  #project-modal { position: absolute; inset: 0; width: 100%; max-height: none; box-shadow: none; }
  #project-modal::backdrop, #project-modal .modal-actions, #project-modal .icon-button { display: none; }
  .project-detail-card, .modal-body { max-height: none; overflow: visible; }
}
