:root {
    --bg: #f4efe8;
    --surface: #fffdf9;
    --surface-soft: rgba(255, 250, 244, 0.9);
    --surface-strong: #fff8f0;
    --ink: #172434;
    --muted: #657487;
    --line: rgba(21, 38, 57, 0.1);
    --brand: #1569d8;
    --brand-dark: #0f2439;
    --teal: #1e9a8f;
    --gold: #d18a1d;
    --slate: #33465d;
    --danger: #a14a57;
    --success: #2d7b54;
    --shadow-xl: 0 26px 70px rgba(18, 37, 54, 0.12);
    --shadow-lg: 0 18px 42px rgba(18, 37, 54, 0.1);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(21, 105, 216, 0.12), transparent 25%),
        radial-gradient(circle at bottom right, rgba(30, 154, 143, 0.12), transparent 24%),
        linear-gradient(180deg, #f8f4ee 0%, var(--bg) 100%);
}

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

h1,
h2,
h3 {
    margin: 0;
    font-family: "Georgia", "Palatino Linotype", serif;
    letter-spacing: -0.025em;
}

p {
    margin: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--brand);
}

.eyebrow-light {
    color: rgba(255, 255, 255, 0.7);
}

.muted,
.panel-note,
.cell-muted,
.timeline-author,
.timeline-meta span {
    color: var(--muted);
}

.primary-button,
.ghost-button,
.ghost-button-light,
.filter-chip {
    appearance: none;
    border: none;
    font: inherit;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
    border-radius: 999px;
    padding: 14px 22px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, #2d8aff 100%);
    box-shadow: 0 16px 32px rgba(21, 105, 216, 0.22);
}

.ghost-button,
.ghost-button-light {
    border-radius: 999px;
    padding: 14px 22px;
    font-weight: 700;
}

.ghost-button {
    background: rgba(15, 36, 57, 0.94);
    color: #fff;
}

.ghost-button-light {
    width: 100%;
    background: #f6ede1;
    color: var(--brand-dark);
}

.primary-button:hover,
.ghost-button:hover,
.ghost-button-light:hover,
.filter-chip:hover {
    transform: translateY(-1px);
}

.auth-shell,
.dashboard-shell,
.detail-shell {
    min-height: 100vh;
    padding: 18px;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 22px;
    width: min(100%, 1720px);
    margin: 0 auto;
}

.auth-story,
.auth-card,
.sidebar-card,
.hero-card,
.metric-card,
.panel-card {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.auth-story {
    min-height: 760px;
    padding: 42px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(21, 105, 216, 0.18), rgba(21, 105, 216, 0) 48%),
        linear-gradient(155deg, #10273d 0%, #153553 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-story h1 {
    margin-top: 18px;
    font-size: clamp(42px, 4vw, 72px);
    line-height: 0.95;
    max-width: 780px;
}

.auth-lead {
    margin-top: 22px;
    max-width: 760px;
    font-size: 20px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.82);
}

.auth-points {
    display: grid;
    gap: 14px;
    margin-top: 42px;
}

.auth-point {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-point-label,
.sidebar-label,
.metric-label,
.search-label,
.insight-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
}

.auth-card {
    padding: 34px;
    background: rgba(255, 252, 247, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card-head h2 {
    margin-top: 10px;
    font-size: 42px;
}

.login-form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.login-form label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(23, 36, 52, 0.12);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    font: inherit;
}

input:focus {
    outline: none;
    border-color: rgba(21, 105, 216, 0.32);
    box-shadow: 0 0 0 4px rgba(21, 105, 216, 0.1);
}

.error-box,
.empty-box,
.notes-box {
    padding: 16px 18px;
    border-radius: var(--radius-md);
}

.error-box {
    margin-top: 18px;
    color: #8a2332;
    background: rgba(161, 74, 87, 0.08);
    border: 1px solid rgba(161, 74, 87, 0.18);
}

.empty-box {
    background: rgba(30, 154, 143, 0.06);
    border: 1px dashed rgba(30, 154, 143, 0.24);
    color: var(--muted);
}

.notes-box {
    white-space: pre-wrap;
    background: rgba(21, 105, 216, 0.05);
    border: 1px solid rgba(21, 105, 216, 0.14);
}

.dashboard-grid {
    width: min(100%, 1840px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sidebar-card {
    background: linear-gradient(180deg, #11293f 0%, #0d2236 100%);
    color: #fff;
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: calc(100vh - 36px);
    position: sticky;
    top: 18px;
}

.sidebar-brand {
    margin-top: 14px;
    font-size: 38px;
    line-height: 0.98;
}

.sidebar-copy {
    margin-top: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.74);
}

.sidebar-block {
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #68d19b;
    box-shadow: 0 0 0 8px rgba(104, 209, 155, 0.16);
    flex: 0 0 auto;
}

.sidebar-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.82);
}

.sidebar-note {
    margin-top: auto;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-note p {
    margin-top: 10px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
}

.sidebar-logout {
    margin-top: 2px;
}

.content-column {
    display: grid;
    gap: 18px;
}

.hero-card {
    padding: 28px 30px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 24%),
        linear-gradient(135deg, #f8f2e9 0%, #f1ebe1 100%);
    border: 1px solid rgba(23, 36, 52, 0.08);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 360px);
    gap: 18px;
    align-items: stretch;
}

.hero-copy-wrap h2 {
    margin-top: 12px;
    font-size: clamp(36px, 3.6vw, 64px);
    line-height: 0.96;
    max-width: 980px;
}

.hero-copy {
    margin-top: 18px;
    max-width: 920px;
    color: #3c4e5f;
    line-height: 1.72;
    font-size: 18px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.hero-tag {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 36, 57, 0.06);
    border: 1px solid rgba(15, 36, 57, 0.08);
    font-size: 13px;
    font-weight: 700;
}

.hero-insights {
    display: grid;
    gap: 12px;
}

.insight-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(23, 36, 52, 0.08);
    box-shadow: var(--shadow-lg);
}

.insight-card strong {
    display: block;
    margin-top: 4px;
    font-size: 26px;
    line-height: 1.1;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.insight-card p {
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.6;
}

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

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 22px 24px;
    color: #fff;
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -24px;
    top: -24px;
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    font-size: 46px;
    line-height: 1;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.metric-card p {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.55;
}

.metric-card-blue {
    background: linear-gradient(135deg, #1871e4 0%, #2291ff 100%);
}

.metric-card-green {
    background: linear-gradient(135deg, #1a8d83 0%, #35b09d 100%);
}

.metric-card-gold {
    background: linear-gradient(135deg, #ca7f14 0%, #e59c1f 100%);
}

.metric-card-slate {
    background: linear-gradient(135deg, #2b3e54 0%, #475f79 100%);
}

.panel-card {
    background: var(--surface-soft);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 22px;
    backdrop-filter: blur(8px);
}

.panel-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
    gap: 20px;
    align-items: end;
    margin-bottom: 18px;
}

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

.panel-header h3 {
    margin-top: 10px;
    font-size: 30px;
    line-height: 1.02;
}

.toolbar-card {
    display: grid;
    grid-template-columns: minmax(250px, 1.1fr) minmax(300px, 1.5fr) 140px;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(23, 36, 52, 0.08);
}

.search-box,
.filter-box {
    display: grid;
    gap: 8px;
}

.search-label {
    color: var(--muted);
}

.toolbar-input {
    height: 54px;
    background: rgba(255, 255, 255, 0.88);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 36, 57, 0.04);
    border: 1px solid rgba(15, 36, 57, 0.08);
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 700;
}

.filter-chip.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, #2d8aff 100%);
    border-color: transparent;
}

.toolbar-summary {
    align-self: stretch;
    display: grid;
    gap: 4px;
    justify-items: end;
    padding: 12px 14px;
    border-radius: 20px;
    background: rgba(17, 40, 61, 0.92);
    color: #fff;
}

.toolbar-summary .search-label {
    color: rgba(255, 255, 255, 0.64);
}

.toolbar-summary strong {
    font-size: 28px;
    line-height: 1;
}

.toolbar-summary small {
    color: rgba(255, 255, 255, 0.74);
}

.projects-table-wrap {
    overflow: auto;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.projects-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
}

.projects-table thead {
    background: #f2e9d8;
}

.projects-table th,
.projects-table td {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(23, 36, 52, 0.08);
    text-align: left;
    vertical-align: top;
}

.projects-table tbody tr {
    transition: background 0.18s ease;
}

.projects-table tbody tr:hover {
    background: rgba(21, 105, 216, 0.04);
}

.projects-table tbody tr[hidden] {
    display: none;
}

.cell-id {
    font-weight: 700;
    color: var(--brand-dark);
}

.project-link {
    display: grid;
    gap: 6px;
}

.project-name {
    color: var(--brand);
    font-weight: 700;
    font-size: 17px;
}

.project-address {
    color: var(--muted);
    line-height: 1.55;
}

.cell-contract {
    display: grid;
    gap: 6px;
}

.cell-contract small {
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-active {
    color: #236846;
    background: rgba(45, 123, 84, 0.12);
    border-color: rgba(45, 123, 84, 0.18);
}

.status-paused {
    color: #8b5b12;
    background: rgba(209, 138, 29, 0.12);
    border-color: rgba(209, 138, 29, 0.18);
}

.status-done {
    color: #4b5c6e;
    background: rgba(75, 92, 110, 0.12);
    border-color: rgba(75, 92, 110, 0.18);
}

.status-draft {
    color: #2457a4;
    background: rgba(21, 105, 216, 0.12);
    border-color: rgba(21, 105, 216, 0.18);
}

.status-neutral {
    color: var(--brand-dark);
    background: rgba(15, 36, 57, 0.08);
    border-color: rgba(15, 36, 57, 0.08);
}

.table-empty {
    margin-top: 14px;
}

.detail-shell {
    width: min(100%, 1840px);
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
    padding: 28px 30px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 22%),
        linear-gradient(135deg, #10273d 0%, #1b3a58 100%);
    color: #fff;
    box-shadow: var(--shadow-xl);
}

.back-link {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.detail-hero h1 {
    margin-top: 14px;
    font-size: clamp(34px, 3vw, 56px);
    line-height: 0.96;
}

.detail-hero p {
    margin-top: 18px;
    max-width: 900px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.72;
}

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

.detail-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.detail-list div {
    display: grid;
    gap: 6px;
}

.detail-list dt {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
    line-height: 1.62;
}

.doc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mini-link {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(21, 105, 216, 0.08);
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(23, 36, 52, 0.08);
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.timeline-text {
    line-height: 1.65;
    margin-bottom: 10px;
}

@media (max-width: 1320px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-card {
        position: static;
        min-height: auto;
    }

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

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

    .toolbar-card {
        grid-template-columns: 1fr;
    }

    .toolbar-summary {
        justify-items: start;
    }
}

@media (max-width: 960px) {
    .auth-layout,
    .detail-grid,
    .panel-header,
    .detail-hero {
        grid-template-columns: 1fr;
    }

    .auth-story {
        min-height: auto;
    }

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

    .hero-copy-wrap h2,
    .detail-hero h1,
    .sidebar-brand {
        font-size: clamp(30px, 7vw, 44px);
    }

    .auth-shell,
    .dashboard-shell,
    .detail-shell {
        padding: 14px;
    }
}

/* Projects dashboard v2 */

.dashboard-shell-v2 {
    padding: 16px;
}

.workspace-frame {
    width: 100%;
    display: grid;
    gap: 18px;
}

.topbar-card {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) minmax(320px, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px 22px;
    border-radius: 28px;
    background: rgba(255, 251, 246, 0.8);
    border: 1px solid rgba(23, 36, 52, 0.08);
    box-shadow: 0 10px 30px rgba(18, 37, 54, 0.06);
    backdrop-filter: blur(10px);
}

.topbar-card-projects {
    grid-template-columns: minmax(260px, 1fr) auto auto;
}

.topbar-userbox-compact {
    justify-content: flex-end;
}

.topbar-brand {
    display: grid;
    gap: 6px;
}

.topbar-brand strong {
    font-size: 24px;
    line-height: 1.05;
    font-family: "Georgia", "Palatino Linotype", serif;
    color: var(--brand-dark);
}

.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.topbar-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(21, 105, 216, 0.06);
    border: 1px solid rgba(21, 105, 216, 0.1);
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 700;
}

.topbar-userbox {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.topbar-usertext {
    display: grid;
    gap: 2px;
    justify-items: end;
}

.topbar-usertext strong {
    font-size: 19px;
}

.overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
    gap: 18px;
    align-items: stretch;
}

.hero-card-v2 {
    padding: 34px 36px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 22%),
        linear-gradient(135deg, #11283d 0%, #1e4362 52%, #255a75 100%);
    color: #fff;
    border: none;
    position: relative;
    overflow: hidden;
}

.hero-card-v2::after {
    content: "";
    position: absolute;
    inset: auto -40px -70px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.hero-card-v2 .eyebrow {
    color: rgba(255, 255, 255, 0.75);
}

.hero-card-v2 h1 {
    margin-top: 12px;
    max-width: 900px;
    font-size: clamp(38px, 4vw, 76px);
    line-height: 0.95;
}

.hero-copy-wide {
    max-width: 900px;
    color: rgba(255, 255, 255, 0.84);
}

.hero-ribbon {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.hero-ribbon-item {
    position: relative;
    z-index: 1;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-ribbon-item .insight-label {
    color: rgba(255, 255, 255, 0.7);
}

.hero-ribbon-item strong {
    display: block;
    margin-top: 2px;
    font-size: 23px;
    line-height: 1.08;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.hero-ribbon-item p {
    margin-top: 10px;
    line-height: 1.58;
    color: rgba(255, 255, 255, 0.8);
}

.overview-stack {
    display: grid;
    gap: 18px;
}

.focus-card,
.signal-card,
.metric-panel {
    border-radius: 28px;
    background: rgba(255, 252, 247, 0.88);
    border: 1px solid rgba(23, 36, 52, 0.08);
    box-shadow: 0 12px 30px rgba(18, 37, 54, 0.06);
    backdrop-filter: blur(8px);
}

.focus-card {
    padding: 24px;
}

.focus-card h2 {
    margin-top: 10px;
    font-size: 32px;
    line-height: 1.04;
}

.focus-list {
    margin: 18px 0 0;
    padding-left: 20px;
    display: grid;
    gap: 12px;
    line-height: 1.6;
    color: #314253;
}

.signal-card {
    display: grid;
    gap: 12px;
    padding: 20px 22px;
}

.signal-row {
    display: grid;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(23, 36, 52, 0.08);
}

.signal-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.signal-label {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
}

.signal-row strong {
    font-size: 21px;
    line-height: 1.15;
    color: var(--brand-dark);
}

.stats-grid-v2 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-panel {
    position: relative;
    overflow: hidden;
    padding: 20px 22px 22px;
}

.metric-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 5px;
    background: currentColor;
    opacity: 0.9;
}

.metric-panel strong {
    display: block;
    margin-top: 10px;
    font-size: 48px;
    line-height: 1;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.metric-panel p {
    margin-top: 10px;
    color: #47596c;
    line-height: 1.55;
}

.metric-panel-blue {
    color: #176ddc;
}

.metric-panel-green {
    color: #1d8f78;
}

.metric-panel-gold {
    color: #cc8316;
}

.metric-panel-slate {
    color: #32485f;
}

.panel-card-wide {
    padding: 24px;
}

.panel-header-wide {
    grid-template-columns: minmax(0, 1fr) 170px;
    align-items: start;
    margin-bottom: 22px;
}

.panel-header-main {
    display: grid;
    gap: 10px;
}

.panel-header-main h2 {
    font-size: clamp(34px, 3vw, 56px);
    line-height: 0.96;
}

.panel-lead {
    max-width: 760px;
    color: #495b6d;
    line-height: 1.65;
}

.panel-header-side {
    align-self: stretch;
    display: grid;
    gap: 4px;
    justify-items: end;
    padding: 16px 18px;
    border-radius: 24px;
    background: rgba(17, 40, 61, 0.94);
    color: #fff;
}

.panel-header-side .search-label {
    color: rgba(255, 255, 255, 0.62);
}

.panel-header-side strong {
    font-size: 38px;
    line-height: 1;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.panel-header-side small {
    color: rgba(255, 255, 255, 0.74);
}

.toolbar-card-wide {
    grid-template-columns: minmax(320px, 1.2fr) minmax(360px, 1.8fr);
    padding: 18px;
    margin-bottom: 20px;
}

.panel-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.panel-inline-button {
    min-height: 52px;
    width: auto;
}

.form-panel {
    padding: 28px;
}

.form-actions-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.form-actions-inline .ghost-button-light,
.form-actions-inline .primary-button,
.panel-inline-actions .ghost-button-light,
.panel-inline-actions .primary-button {
    width: auto;
}

.projects-table-wrap-wide {
    border-radius: 28px;
}

.projects-table-wrap-wide .projects-table {
    min-width: 1180px;
}

.projects-table-wrap-wide .projects-table thead {
    background: #f7efe0;
}

.projects-table-wrap-wide .projects-table th {
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #536477;
}

.projects-table-wrap-wide .projects-table td {
    padding-top: 20px;
    padding-bottom: 20px;
}

.projects-table-wrap-wide .project-name {
    font-size: 22px;
    line-height: 1.15;
}

.projects-table-wrap-wide .project-address {
    font-size: 15px;
}

.projects-table-wrap-wide .cell-contract {
    min-width: 180px;
}

@media (max-width: 1460px) {
    .topbar-card,
    .overview-grid {
        grid-template-columns: 1fr;
    }

    .topbar-userbox {
        justify-content: space-between;
    }

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

    .panel-header-wide,
    .toolbar-card-wide {
        grid-template-columns: 1fr;
    }

    .panel-header-side {
        justify-items: start;
    }
}

@media (max-width: 960px) {
    .dashboard-shell-v2 {
        padding: 12px;
    }

    .topbar-card,
    .hero-ribbon,
    .stats-grid-v2 {
        grid-template-columns: 1fr;
    }

    .topbar-meta,
    .topbar-userbox {
        justify-content: flex-start;
    }

    .topbar-userbox {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-usertext {
        justify-items: start;
    }

    .hero-card-v2,
    .focus-card,
    .signal-card,
    .panel-card-wide {
        padding: 20px;
    }

    .hero-card-v2 h1,
    .panel-header-main h2 {
        font-size: clamp(30px, 9vw, 44px);
    }

    .projects-table-wrap-wide .project-name {
        font-size: 18px;
    }
}

/* Auth and project detail refinement */

.auth-shell-v2 {
    padding: 16px;
}

.auth-layout-v2 {
    width: min(100%, 1840px);
    grid-template-columns: minmax(0, 1.28fr) minmax(380px, 0.72fr);
    gap: 18px;
}

.auth-story-v2 {
    min-height: calc(100vh - 32px);
    padding: 44px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 22%),
        linear-gradient(145deg, #0e253a 0%, #153654 52%, #21516d 100%);
    position: relative;
    overflow: hidden;
}

.auth-story-v2::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.auth-story-head {
    position: relative;
    z-index: 1;
}

.auth-story-v2 h1 {
    margin-top: 18px;
    max-width: 980px;
    font-size: clamp(46px, 4.5vw, 82px);
    line-height: 0.94;
}

.auth-trust-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 40px;
}

.auth-trust-card {
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
}

.auth-trust-card strong {
    display: block;
    margin-top: 2px;
    font-size: 23px;
    line-height: 1.12;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.auth-trust-card p {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.58;
}

.auth-story-footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.auth-footer-chip {
    display: inline-flex;
    align-items: center;
    padding: 11px 15px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 700;
}

.auth-card-v2 {
    padding: 34px;
    background: rgba(255, 252, 247, 0.92);
    display: grid;
    align-content: center;
    gap: 20px;
}

.auth-card-head-v2 h2 {
    margin-top: 10px;
    font-size: 46px;
    line-height: 0.98;
}

.auth-side-note {
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(21, 105, 216, 0.06);
    border: 1px solid rgba(21, 105, 216, 0.12);
}

.auth-side-note strong {
    display: block;
    margin-top: 2px;
    font-size: 24px;
    line-height: 1.08;
    color: var(--brand-dark);
    font-family: "Georgia", "Palatino Linotype", serif;
}

.auth-side-note p {
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.58;
}

.detail-shell-v2 {
    padding: 16px;
}

.detail-topbar .topbar-meta {
    justify-content: center;
}

.topbar-chip-link:hover {
    background: rgba(21, 105, 216, 0.12);
}

.detail-hero-v2 {
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    padding: 34px 36px;
}

.detail-hero-side {
    display: grid;
    gap: 14px;
}

.detail-highlight {
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.detail-highlight .insight-label {
    color: rgba(255, 255, 255, 0.68);
}

.detail-highlight strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
    line-height: 1.18;
    color: #fff;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.detail-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.detail-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 18px;
}

.timeline-v2 {
    gap: 16px;
}

.timeline-item-v2 {
    padding: 20px 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 24px rgba(18, 37, 54, 0.04);
}

@media (max-width: 1460px) {
    .auth-layout-v2,
    .detail-hero-v2,
    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    .auth-trust-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 960px) {
    .auth-shell-v2,
    .detail-shell-v2 {
        padding: 12px;
    }

    .auth-story-v2,
    .auth-card-v2 {
        padding: 24px;
    }

    .auth-card-head-v2 h2 {
        font-size: 38px;
    }

    .detail-stats-grid,
    .detail-list-grid {
        grid-template-columns: 1fr;
    }

    .detail-hero-v2 {
        padding: 24px;
    }

    .detail-highlight strong {
        font-size: 20px;
    }
}

/* Estimate editor */

select,
textarea {
    width: 100%;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(23, 36, 52, 0.12);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    font: inherit;
}

select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(21, 105, 216, 0.32);
    box-shadow: 0 0 0 4px rgba(21, 105, 216, 0.1);
}

.estimate-shell {
    min-height: 100vh;
    padding: 16px;
}

.estimate-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    gap: 18px;
    padding: 34px 36px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 22%),
        linear-gradient(135deg, #11283d 0%, #214c67 54%, #2a6377 100%);
    color: #fff;
    box-shadow: var(--shadow-xl);
}

.estimate-hero h1 {
    margin-top: 12px;
    font-size: clamp(36px, 4vw, 66px);
    line-height: 0.94;
}

.estimate-hero p {
    margin-top: 18px;
    max-width: 900px;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.7;
}

.estimate-hero-side {
    display: grid;
    gap: 14px;
}

.estimate-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.estimate-inline-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
}

.estimate-dirty-badge {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 244, 214, 0.16);
    border: 1px solid rgba(255, 230, 162, 0.28);
    color: #fff0c7;
    font-size: 13px;
    font-weight: 700;
}

.estimate-aside-card {
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.estimate-aside-card .insight-label {
    color: rgba(255, 255, 255, 0.7);
}

.estimate-aside-card strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
    line-height: 1.18;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.estimate-aside-card p {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.58;
}

.notice-banner {
    padding: 16px 18px;
    border-radius: 22px;
    font-weight: 700;
}

.notice-banner-success {
    color: #1d6d4a;
    background: rgba(45, 123, 84, 0.12);
    border: 1px solid rgba(45, 123, 84, 0.18);
}

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

.estimate-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
    gap: 18px;
}

.estimate-layout-span {
    grid-column: 1 / -1;
}

.estimate-main-card,
.estimate-side-card,
.estimate-table-card {
    min-width: 0;
}

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

.estimate-form-grid label,
.estimate-dialog-row {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.estimate-form-span-2,
.estimate-dialog-span-2 {
    grid-column: span 2;
}

.estimate-form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(23, 36, 52, 0.08);
}

.estimate-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.estimate-check input {
    width: 18px;
    height: 18px;
    padding: 0;
}

.estimate-inline-note {
    color: var(--muted);
    line-height: 1.58;
}

.estimate-action-stack {
    display: grid;
    gap: 12px;
}

.estimate-action-stack button:disabled {
    opacity: 0.52;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.estimate-secondary-button {
    background: linear-gradient(135deg, #1d8f78 0%, #35b09d 100%);
    box-shadow: 0 16px 32px rgba(29, 143, 120, 0.2);
}

.estimate-selection-card {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(17, 40, 61, 0.94);
    color: #fff;
}

.estimate-selection-card strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
    line-height: 1.14;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.estimate-selection-card p {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.58;
}

.estimate-hint-box {
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(21, 105, 216, 0.06);
    border: 1px solid rgba(21, 105, 216, 0.12);
}

.estimate-hint-box strong {
    display: block;
    font-size: 20px;
    line-height: 1.1;
    color: var(--brand-dark);
    font-family: "Georgia", "Palatino Linotype", serif;
}

.estimate-hint-box p {
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.6;
}

.estimate-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.estimate-shortcuts span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 36, 57, 0.06);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 700;
}

.estimate-section-card {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(23, 36, 52, 0.08);
}

.estimate-section-card-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.estimate-section-card-head strong {
    font-size: 28px;
    line-height: 1;
    font-family: "Georgia", "Palatino Linotype", serif;
    color: var(--brand-dark);
}

.estimate-section-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.estimate-section-empty {
    color: var(--muted);
    line-height: 1.6;
}

.estimate-section-nav-item {
    appearance: none;
    width: 100%;
    display: grid;
    gap: 6px;
    text-align: left;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(23, 36, 52, 0.08);
    background: rgba(15, 36, 57, 0.04);
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.estimate-section-nav-item:hover {
    transform: translateY(-1px);
    background: rgba(21, 105, 216, 0.07);
    border-color: rgba(21, 105, 216, 0.12);
}

.estimate-section-nav-item.is-collapsed {
    opacity: 0.76;
}

.estimate-section-nav-item strong {
    font-size: 16px;
    line-height: 1.2;
    color: var(--brand-dark);
}

.estimate-section-nav-item span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.estimate-table-wrap {
    overflow: auto;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
}

.estimate-quick-add {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(21, 105, 216, 0.05) 0%, rgba(30, 154, 143, 0.05) 100%);
    border: 1px solid rgba(23, 36, 52, 0.08);
}

.estimate-quick-add-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    gap: 16px;
    align-items: start;
}

.estimate-quick-add-head h4 {
    margin-top: 10px;
    font-size: 28px;
    line-height: 1.02;
    font-family: "Georgia", "Palatino Linotype", serif;
    color: var(--brand-dark);
}

.estimate-quick-add-head p {
    color: var(--muted);
    line-height: 1.6;
}

.estimate-quick-add-grid {
    display: grid;
    grid-template-columns: 160px minmax(0, 1.3fr) repeat(4, minmax(110px, 0.45fr));
    gap: 14px;
    margin-top: 16px;
}

.estimate-quick-add-grid label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.estimate-quick-add-name {
    min-width: 0;
}

.estimate-quick-add-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.estimate-table-toolbar {
    display: grid;
    grid-template-columns: minmax(320px, 1.25fr) minmax(260px, 0.95fr);
    gap: 16px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(23, 36, 52, 0.08);
}

.estimate-search-box,
.estimate-filter-box {
    display: grid;
    gap: 8px;
}

.estimate-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.estimate-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.estimate-table thead {
    background: #f7efe0;
}

.estimate-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.estimate-table th,
.estimate-table td {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(23, 36, 52, 0.08);
    text-align: left;
    vertical-align: top;
}

.estimate-table tr {
    transition: background 0.18s ease;
}

.estimate-table tbody tr:hover {
    background: rgba(21, 105, 216, 0.04);
}

.estimate-row-selected {
    background: rgba(21, 105, 216, 0.14);
    box-shadow: inset 4px 0 0 #1569d8;
}

.estimate-row-section {
    background: rgba(17, 40, 61, 0.92);
    color: #fff;
}

.estimate-row-section td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.estimate-row-type {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
}

.estimate-section-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.estimate-section-title-wrap {
    display: grid;
    gap: 8px;
}

.estimate-section-title {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.2;
}

.estimate-section-meta {
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
    font-weight: 600;
}

.estimate-row-name {
    font-weight: 700;
}

.estimate-row-muted {
    color: var(--muted);
}

.estimate-empty {
    padding: 22px;
    color: var(--muted);
}

.estimate-dialog {
    width: min(760px, calc(100vw - 24px));
    border: none;
    padding: 0;
    background: transparent;
}

.estimate-dialog::backdrop {
    background: rgba(15, 36, 57, 0.45);
    backdrop-filter: blur(4px);
}

.estimate-dialog-card {
    padding: 24px;
    border-radius: 28px;
    background: rgba(255, 252, 247, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-xl);
}

.estimate-dialog-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.estimate-dialog-head h3 {
    margin-top: 10px;
    font-size: 34px;
    line-height: 0.98;
}

.estimate-close-button {
    width: auto;
}

.estimate-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.estimate-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

.estimate-bottom-bar {
    position: sticky;
    bottom: 12px;
    z-index: 8;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px 22px;
    border-radius: 28px;
    background: rgba(17, 40, 61, 0.94);
    color: #fff;
    box-shadow: 0 18px 42px rgba(18, 37, 54, 0.2);
}

.estimate-bottom-bar-copy strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
    line-height: 1.14;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.estimate-bottom-bar-copy p {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.58;
}

.estimate-bottom-bar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.dialog-hidden {
    display: none !important;
}

.detail-hero-actions {
    margin-top: 24px;
}

.detail-hero-note {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
}

.inline-link {
    color: var(--brand);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 1460px) {
    .estimate-hero,
    .estimate-layout {
        grid-template-columns: 1fr;
    }

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

    .estimate-table-toolbar {
        grid-template-columns: 1fr;
    }

    .estimate-quick-add-head,
    .estimate-quick-add-grid,
    .estimate-bottom-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .estimate-shell {
        padding: 12px;
    }

    .estimate-hero,
    .estimate-dialog-grid,
    .estimate-form-grid,
    .estimate-metric-grid {
        grid-template-columns: 1fr;
    }

    .estimate-hero,
    .estimate-main-card,
    .estimate-side-card,
    .estimate-table-card,
    .estimate-dialog-card {
        padding: 20px;
    }

    .estimate-form-span-2,
    .estimate-dialog-span-2 {
        grid-column: span 1;
    }

    .estimate-form-footer,
    .estimate-dialog-actions,
    .estimate-hero-actions,
    .estimate-quick-add-actions,
    .estimate-bottom-bar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .estimate-bottom-bar {
        position: static;
    }
}

/* Estimate editor v3 */

.estimate-shell-v3 {
    padding: 0;
    background:
        linear-gradient(180deg, #0b1017 0 84px, #eef2f6 84px 100%),
        #eef2f6;
}

.estimate-app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 0;
    background: #eef2f6;
}

.estimate-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px 18px;
    background:
        linear-gradient(180deg, #11161e 0%, #171d27 100%);
    color: #f2f5f8;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    gap: 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.estimate-rail-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.estimate-rail-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(135deg, #1982f8 0%, #3dc0ff 100%);
}

.estimate-rail-brand-copy {
    display: grid;
    gap: 4px;
}

.eyebrow-rail {
    color: rgba(255, 255, 255, 0.54);
}

.estimate-rail-brand-copy strong {
    font-size: 20px;
    line-height: 1.1;
    color: #fff;
    font-family: "Bahnschrift", "Aptos", "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
}

.estimate-rail-block {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.estimate-rail-label {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.54);
    font-weight: 700;
}

.estimate-rail-project {
    display: grid;
    gap: 8px;
}

.estimate-rail-project strong {
    font-size: 18px;
    line-height: 1.22;
    color: #fff;
}

.estimate-rail-project span {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.5;
    font-size: 14px;
}

.estimate-rail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.estimate-rail-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(25, 130, 248, 0.16);
    border: 1px solid rgba(61, 192, 255, 0.18);
    font-size: 12px;
    font-weight: 700;
    color: #d9ecff;
}

.estimate-rail-block-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.estimate-rail-block-head strong {
    font-size: 26px;
    color: #fff;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.estimate-rail-sections {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding-right: 4px;
}

.estimate-rail-sections .estimate-section-empty {
    color: rgba(255, 255, 255, 0.68);
}

.estimate-rail-sections .estimate-section-nav-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.estimate-rail-sections .estimate-section-nav-item:hover {
    background: rgba(25, 130, 248, 0.14);
    border-color: rgba(61, 192, 255, 0.18);
}

.estimate-rail-sections .estimate-section-nav-item strong {
    color: #ffffff;
}

.estimate-rail-sections .estimate-section-nav-item span {
    color: rgba(255, 255, 255, 0.7);
}

.estimate-rail-actions {
    display: grid;
    gap: 10px;
}

.estimate-rail-button,
.estimate-rail-link-button {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #f2f5f8;
    border-radius: 14px;
    min-height: 42px;
    padding: 0 14px;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.estimate-rail-button:hover,
.estimate-rail-link-button:hover,
.estimate-rail-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.estimate-rail-button-danger {
    color: #ffd7dd;
    border-color: rgba(255, 96, 122, 0.26);
    background: rgba(161, 74, 87, 0.12);
}

.estimate-rail-button-primary {
    background: linear-gradient(135deg, #1982f8 0%, #2667ff 100%);
    border-color: transparent;
}

.estimate-rail-selection strong {
    display: block;
    font-size: 18px;
    line-height: 1.25;
}

.estimate-rail-selection p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.55;
    font-size: 14px;
}

.estimate-selected-actions {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.estimate-rail-selection-note {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.55;
    font-size: 13px;
}

.estimate-rail-footer {
    align-self: end;
    display: grid;
    gap: 8px;
}

.estimate-rail-link,
.estimate-rail-link-button {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.estimate-workspace {
    min-width: 0;
    padding: 18px 22px 32px;
    display: grid;
    gap: 18px;
}

.estimate-header-strip {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 8px 0 2px;
}

.estimate-header-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px;
    border-radius: 16px;
    background: #171b22;
}

.estimate-header-tab {
    appearance: none;
    border: none;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.estimate-header-tab.is-active,
.estimate-header-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.estimate-header-user {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.estimate-header-user-label {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6f7b89;
    font-weight: 700;
}

.estimate-summary-board,
.estimate-document-bar,
.estimate-stage-board,
.estimate-final-board {
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(18, 33, 52, 0.08);
    box-shadow: 0 12px 28px rgba(18, 37, 54, 0.05);
}

.estimate-summary-board {
    padding: 28px 30px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 360px;
    gap: 22px;
}

.estimate-summary-main h1 {
    margin-top: 10px;
    font-size: clamp(34px, 3.2vw, 58px);
    line-height: 0.95;
    color: #172434;
}

.estimate-summary-main p {
    margin-top: 16px;
    max-width: 860px;
    color: #546376;
    line-height: 1.7;
    font-size: 17px;
}

.estimate-summary-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.estimate-summary-chip {
    padding: 16px;
    border-radius: 18px;
    background: #f4f7fb;
    border: 1px solid rgba(18, 33, 52, 0.06);
}

.estimate-summary-chip span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #748295;
    font-weight: 700;
}

.estimate-summary-chip strong {
    display: block;
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.5;
    color: #182434;
}

.estimate-summary-side {
    display: grid;
    gap: 14px;
}

.estimate-total-card {
    padding: 20px 22px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(135deg, #171d26 0%, #263241 100%);
}

.estimate-total-label {
    display: block;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
    font-weight: 700;
}

.estimate-total-card strong {
    display: block;
    margin-top: 8px;
    font-size: 42px;
    line-height: 1;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.estimate-total-card small {
    display: block;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.72);
}

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

.estimate-kpi-card {
    padding: 16px;
    border-radius: 18px;
    background: #f6f8fb;
    border: 1px solid rgba(18, 33, 52, 0.06);
}

.estimate-kpi-card span {
    display: block;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #738293;
    font-weight: 700;
}

.estimate-kpi-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    line-height: 1;
    color: #172434;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.estimate-workspace-form {
    display: grid;
    gap: 18px;
}

.estimate-document-bar {
    padding: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 300px;
    gap: 18px;
}

.estimate-document-title-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.estimate-document-title-row h2 {
    margin-top: 8px;
    font-size: 30px;
    line-height: 1;
}

.estimate-document-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.estimate-document-grid label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.estimate-toggle-box {
    align-content: start;
}

.estimate-check-inline {
    margin-top: 8px;
}

.estimate-document-actions {
    display: grid;
    gap: 10px;
    align-content: start;
}

.estimate-inline-note-block {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(21, 105, 216, 0.06);
    border: 1px solid rgba(21, 105, 216, 0.12);
    color: #556679;
    line-height: 1.55;
}

.estimate-stage-board {
    padding: 20px;
}

.estimate-stage-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.estimate-stage-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.estimate-stage-order {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #172434;
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.estimate-stage-title h3 {
    margin-top: 8px;
    font-size: 30px;
}

.estimate-stage-totals {
    display: flex;
    gap: 22px;
}

.estimate-stage-totals div {
    display: grid;
    gap: 6px;
    justify-items: end;
}

.estimate-stage-totals span {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #718091;
    font-weight: 700;
}

.estimate-stage-totals strong {
    font-size: 28px;
    line-height: 1;
    color: #162434;
}

.estimate-tool-row {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
    gap: 14px;
    align-items: end;
}

.estimate-tool-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.estimate-tool-tab {
    appearance: none;
    border: 1px solid rgba(18, 33, 52, 0.08);
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: #f5f7fa;
    color: #1c2a3a;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.estimate-tool-tab:hover {
    background: #edf3f8;
}

.estimate-tool-tab-primary {
    color: #fff;
    background: linear-gradient(135deg, #1982f8 0%, #2667ff 100%);
    border-color: transparent;
}

.estimate-tool-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 10px;
}

.estimate-inline-qty {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.estimate-quick-add-panel {
    margin-top: 16px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8fbff 0%, #f3f9fa 100%);
    border: 1px solid rgba(18, 33, 52, 0.08);
}

.estimate-quick-add-panel-copy {
    display: grid;
    gap: 8px;
}

.estimate-quick-add-panel-copy h4 {
    font-size: 28px;
    line-height: 1.02;
    color: #172434;
}

.estimate-quick-add-panel-copy p {
    color: #58677a;
    line-height: 1.6;
}

.estimate-quick-add-panel-fields {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 140px minmax(0, 1.3fr) 110px 120px 150px;
    gap: 12px;
}

.estimate-quick-add-panel-fields label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.estimate-quick-add-panel-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.estimate-table-toolbar-v3 {
    margin-top: 16px;
    margin-bottom: 14px;
    padding: 14px 16px;
}

.estimate-shortcuts-inline {
    justify-content: flex-end;
    align-items: center;
}

.estimate-table-wrap-v3 {
    border-radius: 18px;
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(18, 33, 52, 0.08);
}

.estimate-table-v3 {
    min-width: 1180px;
}

.estimate-table-v3 thead {
    background: #f4f7fb;
}

.estimate-table-v3 th {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #657487;
    font-weight: 800;
}

.estimate-table-v3 td,
.estimate-table-v3 th {
    padding: 14px 12px;
}

.estimate-table-v3 tbody tr:hover {
    background: #f7fbff;
}

.estimate-row-selected {
    background: #eaf4ff !important;
    box-shadow: inset 3px 0 0 #1982f8;
}

.estimate-row-section {
    background: #f1f5f9 !important;
    color: #172434;
}

.estimate-row-section td {
    border-bottom-color: rgba(18, 33, 52, 0.05);
}

.estimate-row-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #23936e;
}

.estimate-row-type-badge.is-section {
    background: #3a4a5f;
}

.estimate-row-reference {
    color: #708194;
    font-weight: 700;
}

.estimate-row-name-wrap {
    display: grid;
    gap: 4px;
}

.estimate-row-name {
    font-weight: 700;
    color: #162434;
}

.estimate-row-muted {
    color: #77879a;
}

.estimate-row-actions {
    display: flex;
    justify-content: flex-end;
    position: relative;
}

.estimate-row-menu {
    appearance: none;
    border: 1px solid rgba(18, 33, 52, 0.08);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #fff;
    color: #77879a;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(18, 33, 52, 0.08);
}

.estimate-row-menu:hover {
    background: #f3f7fb;
}

.estimate-row-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    min-width: 220px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 253, 249, 0.98);
    border: 1px solid rgba(18, 33, 52, 0.08);
    box-shadow: 0 18px 42px rgba(18, 33, 52, 0.16);
    display: grid;
    gap: 6px;
}

.estimate-row-menu-item {
    appearance: none;
    border: none;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    background: transparent;
    color: #172434;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.estimate-row-menu-item:hover {
    background: #edf4fb;
}

.estimate-row-menu-item.is-danger {
    color: #a14a57;
}

.estimate-row-menu-item.is-danger:hover {
    background: rgba(161, 74, 87, 0.1);
}

.estimate-section-toggle {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(18, 33, 52, 0.08);
    background: #fff;
    color: #172434;
}

.estimate-section-title-wrap {
    display: grid;
    gap: 5px;
}

.estimate-section-title {
    font-weight: 800;
    font-size: 17px;
    color: #172434;
}

.estimate-section-meta {
    color: #748395;
    font-size: 13px;
    font-weight: 600;
}

.estimate-final-board {
    padding: 22px;
    display: grid;
    grid-template-columns: minmax(320px, 0.7fr) minmax(0, 1fr);
    gap: 18px;
}

.estimate-final-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.estimate-final-head h3 {
    font-size: 28px;
}

.estimate-final-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(25, 130, 248, 0.1);
    color: #1e64c8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.estimate-final-grid {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.estimate-final-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #f6f8fb;
    border: 1px solid rgba(18, 33, 52, 0.06);
}

.estimate-final-row span {
    color: #617184;
    font-weight: 700;
}

.estimate-final-row strong {
    font-size: 26px;
    color: #172434;
    font-family: "Georgia", "Palatino Linotype", serif;
}

.estimate-comment-card {
    padding: 18px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(18, 33, 52, 0.06);
}

.estimate-comment-card h4 {
    margin-top: 8px;
    font-size: 24px;
    line-height: 1.08;
}

.estimate-comment-card textarea {
    margin-top: 14px;
    min-height: 170px;
    resize: vertical;
    background: #fff;
}

.estimate-drawer {
    position: sticky;
    top: 0;
    right: 0;
    width: 0;
    height: 100vh;
    overflow: hidden;
    background: #fff;
    border-left: 1px solid rgba(18, 33, 52, 0.08);
    box-shadow: -12px 0 30px rgba(18, 37, 54, 0.08);
    transition: width 0.22s ease;
}

.estimate-drawer[data-open="true"] {
    width: 420px;
}

.estimate-drawer-head,
.estimate-drawer-tabs,
.estimate-drawer-search,
.estimate-drawer-panel {
    opacity: 0;
    transition: opacity 0.18s ease;
}

.estimate-drawer[data-open="true"] .estimate-drawer-head,
.estimate-drawer[data-open="true"] .estimate-drawer-tabs,
.estimate-drawer[data-open="true"] .estimate-drawer-search,
.estimate-drawer[data-open="true"] .estimate-drawer-panel {
    opacity: 1;
}

.estimate-drawer-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 18px 12px;
}

.estimate-drawer-head h3 {
    margin-top: 8px;
    font-size: 26px;
}

.estimate-drawer-close {
    appearance: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #edf3f8;
    color: #172434;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.estimate-drawer-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 18px 12px;
}

.estimate-drawer-tab {
    appearance: none;
    border: 1px solid rgba(18, 33, 52, 0.08);
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: #f6f8fb;
    color: #415265;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.estimate-drawer-tab.is-active {
    background: #172434;
    color: #fff;
}

.estimate-drawer-search {
    padding: 0 18px 12px;
}

.estimate-drawer-panel {
    display: none;
    padding: 0 18px 18px;
}

.estimate-drawer-panel.is-active {
    display: block;
}

.estimate-drawer-note {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f5f7fa;
    color: #66778a;
    line-height: 1.55;
    font-size: 14px;
}

.estimate-library-list {
    margin-top: 14px;
    display: grid;
    gap: 10px;
    max-height: calc(100vh - 240px);
    overflow: auto;
    padding-right: 4px;
}

.estimate-library-card {
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(18, 33, 52, 0.08);
}

.estimate-library-card strong {
    display: block;
    font-size: 15px;
    line-height: 1.4;
    color: #172434;
}

.estimate-library-card p {
    margin-top: 8px;
    color: #66778a;
    line-height: 1.55;
    font-size: 14px;
}

.estimate-library-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.estimate-library-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f3f7fb;
    color: #49627d;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 1700px) {
    .estimate-app-shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .estimate-drawer {
        position: fixed;
        z-index: 30;
        top: 0;
        right: 0;
    }
}

@media (max-width: 1320px) {
    .estimate-app-shell {
        grid-template-columns: 1fr;
    }

    .estimate-rail {
        position: static;
        height: auto;
        grid-template-rows: none;
    }

    .estimate-summary-board,
    .estimate-document-bar,
    .estimate-final-board,
    .estimate-tool-row,
    .estimate-tool-search,
    .estimate-document-grid,
    .estimate-summary-meta,
    .estimate-kpi-grid,
    .estimate-quick-add-panel-fields {
        grid-template-columns: 1fr;
    }

    .estimate-stage-head,
    .estimate-final-head {
        flex-direction: column;
        align-items: start;
    }

    .estimate-stage-totals {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 960px) {
    .estimate-workspace {
        padding: 12px 12px 24px;
    }

    .estimate-header-strip,
    .estimate-summary-board,
    .estimate-document-bar,
    .estimate-stage-board,
    .estimate-final-board,
    .estimate-bottom-bar {
        padding: 18px;
    }

    .estimate-header-strip {
        flex-direction: column;
        align-items: start;
    }

    .estimate-header-user {
        justify-items: start;
    }

    .estimate-stage-totals {
        flex-direction: column;
        align-items: start;
    }

    .estimate-bottom-bar,
    .estimate-bottom-bar-actions,
    .estimate-quick-add-panel-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .estimate-drawer[data-open="true"] {
        width: min(100vw, 420px);
    }
}
