:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --line: #dfe5ee;
    --text: #1f2937;
    --muted: #667085;
    --primary: #1769aa;
    --primary-dark: #0f4c81;
    --accent: #19a974;
    --danger: #d64545;
    --warning: #c27803;
    --shadow: 0 12px 30px rgba(26, 39, 64, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: #e9eff6;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 72px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.brand-line,
.install-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    font-weight: 800;
}

.brand-line h1,
.install-brand h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
}

.brand-line p,
.install-brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 10px;
    color: var(--muted);
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 6px;
    white-space: nowrap;
}

.user-chip svg {
    width: 17px;
    height: 17px;
}

.app-shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 20px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 28px 36px;
}

.sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
    display: grid;
    gap: 6px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}

.nav-item svg,
.button svg,
.icon-button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.nav-item:hover {
    background: var(--surface-soft);
    color: var(--primary-dark);
}

.nav-item.active {
    color: #fff;
    background: var(--primary);
}

.workspace {
    min-width: 0;
    max-width: none;
}

.module {
    display: none;
}

.module.active {
    display: block;
}

.module-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.module-heading h2 {
    margin: 2px 0 0;
    font-size: 26px;
    line-height: 1.2;
}

.eyebrow {
    margin: 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.panel {
    padding: 18px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel-title {
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 700;
}

.panel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 280px;
    min-height: 38px;
    padding: 0 10px;
    color: var(--muted);
    background: #fff;
    border: 1px solid #cad3df;
    border-radius: 6px;
}

.search-box svg {
    width: 17px;
    height: 17px;
}

.search-box input {
    width: 100%;
    min-height: 34px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
}

.filter-select {
    min-height: 38px;
    min-width: 160px;
    padding: 8px 10px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cad3df;
    border-radius: 6px;
}

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

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(320px, 0.75fr);
    gap: 16px;
}

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

.metric-card {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.metric-card:nth-child(2) {
    border-left-color: var(--accent);
}

.metric-card:nth-child(3) {
    border-left-color: var(--warning);
}

.metric-card:nth-child(4) {
    border-left-color: #7c3aed;
}

.metric-card p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
}

.metric-card strong {
    display: block;
    font-size: 24px;
    line-height: 1.2;
}

.metric-card small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
}

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

.data-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    font-size: 14px;
}

#budgetItemsTable {
    min-width: 1180px;
}

.data-table th,
.data-table td {
    padding: 10px;
    border: 1px solid var(--line);
    vertical-align: middle;
    text-align: left;
}

.data-table th {
    color: #fff;
    background: var(--primary-dark);
    font-weight: 700;
    white-space: nowrap;
}

.empty-row {
    padding: 24px !important;
    color: var(--muted);
    text-align: center !important;
    background: #f7f9fc;
}

.data-table tfoot td,
.data-table .category-row td {
    background: #edf6ff;
    font-weight: 700;
}

.data-table input,
.data-table select,
.form-grid input,
.form-grid select,
.compact-input input {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cad3df;
    border-radius: 6px;
}

.data-table .quick-field,
.data-table .quick-select,
.data-table .quick-number {
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
}

.data-table .quick-number {
    width: 92px;
}

.data-table .unit-field {
    width: 74px;
}

.item-code {
    display: inline-block;
    max-width: 150px;
    padding: 4px 7px;
    overflow: hidden;
    color: #35506b;
    background: #edf2f7;
    border-radius: 5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.switch-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    white-space: nowrap;
}

.switch-line input {
    width: auto;
    min-height: auto;
}

.action-cell {
    white-space: nowrap;
}

.self-tag,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 12px;
}

.self-tag {
    color: var(--primary-dark);
    background: #edf6ff;
}

.status-pill {
    margin-left: 0;
}

.status-pill.on {
    color: #0f6b45;
    background: #eaf8f1;
}

.status-pill.off {
    color: #8a1f1f;
    background: #fff1f1;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.data-table input:focus,
.data-table select:focus,
.form-grid input:focus,
.form-grid select:focus,
.compact-input input:focus {
    outline: 2px solid rgba(23, 105, 170, 0.18);
    border-color: var(--primary);
}

.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.summary-line {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-end;
    margin-top: 14px;
    color: var(--muted);
}

.summary-line strong {
    color: var(--danger);
    font-size: 18px;
}

.button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.button.primary {
    color: #fff;
    background: var(--primary);
}

.button.primary:hover {
    background: var(--primary-dark);
}

.button.ghost {
    color: var(--primary-dark);
    background: #edf6ff;
    border-color: #c8def2;
}

.button.text {
    color: var(--muted);
    background: transparent;
}

.icon-button {
    width: 38px;
    padding: 0;
    color: var(--primary-dark);
    background: #edf6ff;
    border-color: #c8def2;
}

.danger-button {
    color: var(--danger);
    background: #fff1f1;
    border: 1px solid #ffd3d3;
}

.compact-input {
    display: grid;
    gap: 5px;
    min-width: 180px;
    color: var(--muted);
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

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

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

.form-grid label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.form-grid h2 {
    grid-column: 1 / -1;
    margin: 14px 0 0;
    font-size: 18px;
}

.span-2 {
    grid-column: 1 / -1;
}

.checkbox-line {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px !important;
}

.checkbox-line input {
    width: auto !important;
    min-height: auto !important;
}

.chart-box {
    position: relative;
    min-height: 360px;
}

.project-select {
    min-height: 38px;
    min-width: 260px;
    padding: 8px 10px;
    color: var(--text);
    background: #fff;
    border: 1px solid #c8def2;
    border-radius: 6px;
}

.header-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) minmax(120px, auto);
    gap: 12px;
    width: min(860px, 100%);
}

.creator-badge {
    display: grid;
    gap: 5px;
    align-content: end;
    min-height: 58px;
    padding: 8px 10px;
    color: var(--muted);
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
}

.creator-badge strong {
    color: var(--text);
    font-size: 14px;
}

.cost-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cost-summary-card {
    min-width: 0;
    padding: 14px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.cost-summary-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.cost-summary-card strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 18px;
    line-height: 1.25;
}

.cost-summary-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.danger-soft {
    color: #a33131 !important;
    background: #fff1f1 !important;
    border-color: #ffd3d3 !important;
}

.report-paper {
    position: relative;
    width: 960px;
    max-width: 100%;
    min-height: 1120px;
    margin: 0 auto 24px;
    padding: 42px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.report-paper h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.report-paper h2 {
    margin: 28px 0 12px;
    font-size: 19px;
}

.report-paper p {
    color: var(--muted);
}

.report-watermark {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-position: center;
    background-repeat: repeat;
    background-size: 260px auto;
    opacity: 0.10;
    transform: rotate(-18deg) scale(1.15);
}

.report-content {
    position: relative;
    z-index: 1;
}

.report-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.report-kpi {
    min-width: 0;
    padding: 12px 10px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.report-kpi span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.report-kpi strong {
    display: block;
    margin-top: 5px;
    font-size: 16px;
    line-height: 1.25;
    word-break: keep-all;
    white-space: normal;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.report-table th,
.report-table td {
    padding: 8px;
    border: 1px solid #d7dee8;
    text-align: left;
}

.report-table th {
    background: #edf6ff;
}

.report-cover {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 24px;
    align-items: stretch;
    min-height: 260px;
    margin: -42px -42px 30px;
    padding: 44px 42px;
    color: #fff;
    background: linear-gradient(135deg, #0f4c81 0%, #1769aa 52%, #19a974 100%);
}

.cover-kicker {
    margin: 0 0 18px !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.report-cover h1 {
    max-width: 720px;
    margin: 0 0 16px;
    color: #fff;
    font-size: 36px;
    line-height: 1.12;
}

.report-cover p {
    color: rgba(255, 255, 255, 0.82);
}

.rating-card {
    display: grid;
    align-content: center;
    gap: 10px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.rating-card span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
}

.rating-card strong {
    color: #fff;
    font-size: 30px;
}

.rating-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
}

.rating-card.weak {
    background: rgba(214, 69, 69, 0.24);
}

.rating-card.watch {
    background: rgba(194, 120, 3, 0.24);
}

.rating-card.medium {
    background: rgba(23, 105, 170, 0.28);
}

.rating-card.strong {
    background: rgba(25, 169, 116, 0.26);
}

.report-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 2px solid #e4ebf4;
}

.report-hero h1 {
    font-size: 32px;
}

.report-meta-list {
    display: grid;
    gap: 8px;
    padding: 16px;
    background: #f5f8fc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.report-meta-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.report-meta-list strong {
    color: var(--text);
}

.report-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.report-chart-card {
    min-width: 0;
    padding: 14px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.report-chart-card h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.report-chart-card:nth-child(3) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    column-gap: 18px;
    align-items: center;
}

.report-chart-card:nth-child(3) h3 {
    grid-column: 1 / -1;
}

.report-chart-card:nth-child(3) .mini-chart {
    min-height: 150px;
}

.report-chart-card:nth-child(3) .legend-list {
    margin-top: 0;
}

.report-wide-chart {
    min-height: 260px;
    padding: 16px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.mini-chart {
    display: grid;
    place-items: center;
    min-height: 170px;
    overflow: hidden;
}

.static-donut {
    width: 150px;
    height: 150px;
    max-width: 100%;
}

.donut-main {
    fill: var(--text);
    font-size: 17px;
    font-weight: 800;
}

.donut-sub {
    fill: var(--muted);
    font-size: 9px;
}

.static-line {
    width: 100%;
    height: 240px;
    overflow: visible;
}

.static-line text {
    fill: var(--muted);
    font-size: 11px;
}

.zero-line {
    stroke: #cbd5e1;
    stroke-width: 1.5;
    stroke-dasharray: 5 5;
}

.cashflow-line {
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cashflow-dot {
    fill: var(--primary);
}

.axis-label {
    font-size: 10px !important;
}

.static-empty {
    display: grid;
    place-items: center;
    width: 150px;
    height: 150px;
    color: var(--muted);
    background: #edf2f7;
    border-radius: 50%;
}

.legend-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
    font-size: 12px;
    break-inside: avoid;
}

.legend-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.analysis-note {
    padding: 14px 16px;
    color: #234;
    background: #edf6ff;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
}

.risk-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

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

.report-chart-card,
.report-wide-chart,
.risk-card,
.validation-card,
.suggestion-list li,
.report-table,
.analysis-note {
    break-inside: avoid;
    page-break-inside: avoid;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 8mm;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        background: #fff;
    }

    .topbar,
    .sidebar,
    .module-heading,
    .toast {
        display: none !important;
    }

    .app-shell {
        display: block;
        padding: 0;
    }

    .module {
        display: none !important;
    }

    #module-report {
        display: block !important;
    }

    .report-paper {
        width: 960px;
        max-width: none;
        margin: 0 auto;
        padding: 42px;
        overflow: visible;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .report-cover {
        margin: -42px -42px 30px;
        padding: 44px 42px;
        min-height: 260px;
    }

    .report-watermark {
        position: fixed;
    }
}

.risk-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9fc;
}

.risk-card strong {
    display: block;
    margin-bottom: 8px;
}

.risk-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.risk-card.high {
    border-color: #ffd3d3;
    background: #fff1f1;
}

.risk-card.mid {
    border-color: #f5ddad;
    background: #fff8e8;
}

.risk-card.low {
    border-color: #bbe8d2;
    background: #eaf8f1;
}

.validation-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9fc;
}

.validation-card strong {
    display: block;
    margin-bottom: 8px;
}

.validation-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.validation-card.ok {
    border-color: #bbe8d2;
    background: #eaf8f1;
}

.validation-card.mid {
    border-color: #f5ddad;
    background: #fff8e8;
}

.validation-card.high {
    border-color: #ffd3d3;
    background: #fff1f1;
}

.suggestion-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.suggestion-list li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.suggestion-list span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #fff;
    background: var(--primary);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
}

.suggestion-list p {
    margin: 4px 0 0;
    color: var(--text);
}

.watermark-box {
    display: grid;
    gap: 12px;
}

.watermark-preview {
    min-height: 160px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px dashed #bac7d6;
    border-radius: 8px;
    overflow: hidden;
}

.watermark-preview img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.file-drop {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 50;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    max-width: 360px;
    padding: 12px 14px;
    color: #fff;
    background: #1f2937;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: 0.2s ease;
}

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

.modal {
    width: min(680px, calc(100% - 28px));
    padding: 0;
    border: 0;
    border-radius: 8px;
}

.modal::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.modal-card {
    padding: 22px;
}

.modal-card h3 {
    margin: 0 0 16px;
}

.modal-subtitle {
    margin: -8px 0 16px;
    color: var(--muted);
    font-size: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.alert {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.alert.danger {
    color: #8a1f1f;
    background: #fff1f1;
    border: 1px solid #ffd3d3;
}

.alert.success {
    color: #0f6b45;
    background: #eaf8f1;
    border: 1px solid #bbe8d2;
}

.install-page,
.login-page {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(rgba(238, 242, 247, 0.84), rgba(238, 242, 247, 0.92)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Crect width='160' height='160' fill='%23dfe5ee'/%3E%3Cpath d='M0 80h160M80 0v160' stroke='%23cbd5e1' stroke-width='1'/%3E%3C/svg%3E");
}

.install-shell,
.login-shell {
    width: min(760px, 100%);
}

.install-panel,
.login-card {
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-card {
    width: min(420px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.login-card label {
    display: grid;
    gap: 6px;
    color: var(--muted);
}

.login-card input {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #cad3df;
    border-radius: 6px;
}

.install-brand {
    margin-bottom: 20px;
}

@media screen and (max-width: 1100px) {
    .metric-grid,
    .report-kpis,
    .cost-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .analytics-grid,
    .report-chart-grid,
    .report-hero,
    .report-cover,
    .risk-grid,
    .validation-grid {
        grid-template-columns: 1fr;
    }

    .report-chart-card:nth-child(3) {
        grid-column: auto;
        display: block;
    }
}

@media screen and (max-width: 760px) {
    .topbar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        padding: 14px;
    }

    .top-actions {
        width: 100%;
        padding-bottom: 2px;
    }

    .project-select {
        min-width: 210px;
    }

    .button span {
        white-space: nowrap;
    }

    .app-shell {
        display: block;
        padding: 12px;
    }

    .sidebar {
        position: static;
        display: flex;
        overflow-x: auto;
        margin-bottom: 12px;
        box-shadow: none;
    }

    .nav-item {
        flex: 0 0 auto;
        width: auto;
    }

    .module-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-toolbar,
    .toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box,
    .filter-select {
        min-width: 0;
        width: 100%;
    }

    .header-fields {
        grid-template-columns: 1fr;
    }

    .module-heading h2 {
        font-size: 22px;
    }

    .panel {
        padding: 12px;
    }

    .metric-grid,
    .report-kpis,
    .cost-summary-grid,
    .form-grid.two,
    .form-grid.three {
        grid-template-columns: 1fr;
    }

    .compact-input {
        min-width: 0;
    }

    .chart-box {
        min-height: 280px;
    }

    .report-paper {
        min-height: auto;
        padding: 22px 14px;
        border-radius: 6px;
    }

    .report-cover {
        margin: -22px -14px 22px;
        padding: 28px 18px;
    }

    .report-cover h1 {
        font-size: 30px;
    }

    .data-table {
        min-width: 760px;
        font-size: 13px;
    }

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

    .brand-line h1 {
        font-size: 16px;
    }
}
