:root {
    --bg: #f8fafc;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --card: #fff;
    --navy: #020617;
    --blue: #2563eb;
    --blue2: #1d4ed8;
    --amber: #fffbeb;
    --amberText: #78350f
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif
}

.app-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px
}

.hero {
    overflow: hidden;
    border-radius: 32px;
    background: radial-gradient(circle at 15% 0%,#1e3a8a 0%,#020617 38%,#020617 100%);
    color: white;
    box-shadow: 0 22px 70px rgba(15,23,42,.2);
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 32px;
    padding: 36px
}

.brand-logo {
    display: block;
    width: 190px;
    max-width: 100%;
    height: auto;
    margin-bottom: 0;
    margin-left: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    padding: 6px 12px;
    font-size: 14px;
    color: #dbeafe
}

.hero h1 {
    margin: 16px 0 0;
    font-size: clamp(34px,5vw,56px);
    letter-spacing: -.04em;
    line-height: 1
}

.hero p {
    max-width: 760px;
    margin: 18px 0 0;
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.75
}

.hero-summary {
    align-self: start;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.1);
    border-radius: 28px;
    padding: 24px;
    backdrop-filter: blur(14px)
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #cbd5e1
}

    .summary-header img {
        width: 24px;
        height: 24px;
        filter: brightness(0) invert(1);
        opacity: .8
    }

.hero-total {
    margin-top: 18px;
    font-size: 42px;
    font-weight: 850;
    letter-spacing: -.03em
}

.hero-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px
}

    .hero-metrics div {
        border-radius: 18px;
        background: rgba(255,255,255,.1);
        padding: 14px
    }

    .hero-metrics span {
        display: block;
        color: #cbd5e1;
        font-size: 13px;
        margin-bottom: 6px
    }

.layout-grid {
    display: grid;
    grid-template-columns: 400px minmax(0,1fr) 340px;
    gap: 24px;
    margin-top: 24px
}

.card {
    background: var(--card);
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 28px;
    box-shadow: 0 8px 30px rgba(15,23,42,.06);
    padding: 22px
}

.card-title-row, .section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px
}

    .card h2, .section-title-row h2 {
        margin: 0;
        font-size: 22px;
        letter-spacing: -.02em
    }

    .section-title-row p {
        margin: 5px 0 0;
        color: var(--muted);
        font-size: 14px
    }

.plus, .bars {
    color: #94a3b8;
    font-weight: 800;
    font-size: 24px
}

.catalog-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    font: inherit;
    text-align: left;
    cursor: pointer
}

.catalog-toggle:focus-visible {
    outline: 3px solid #bfdbfe;
    outline-offset: 6px;
    border-radius: 14px
}

.catalog-toggle .plus {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 999px;
    background: #f1f5f9;
    line-height: 1;
    transition: .16s ease
}

.catalog-toggle:hover .plus {
    background: #e2e8f0;
    color: #475569
}

.catalog-content {
    display: block
}

.catalog-panel.is-collapsed {
    align-self: start
}

.catalog-panel.is-collapsed .catalog-content {
    display: none
}


.control-stack {
    display: grid;
    gap: 12px;
    margin: 18px 0
}

.search-control {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    padding: 10px 12px
}

    .search-control img {
        width: 18px;
        height: 18px
    }

    .search-control input {
        border: 0;
        outline: 0;
        width: 100%;
        font: inherit;
        background: transparent;
        color: var(--ink)
    }

select, input[type=number], .line-label {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 11px 12px;
    font: inherit;
    color: var(--ink);
    outline: 0;
    width: 100%
}

    select:focus, input:focus {
        border-color: #94a3b8
    }

.catalog-list {
    max-height: 640px;
    overflow: auto;
    display: grid;
    gap: 12px;
    padding-right: 4px
}

.catalog-card {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: .16s ease
}

    .catalog-card:hover {
        border-color: #93c5fd;
        box-shadow: 0 10px 26px rgba(37,99,235,.11);
        transform: translateY(-1px)
    }

.catalog-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px
}

.catalog-name-row {
    display: flex;
    gap: 10px;
    min-width: 0
}

.icon-box {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f1f5f9;
    display: grid;
    place-items: center;
    flex: 0 0 auto
}

    .icon-box img {
        width: 21px;
        height: 21px
    }

.catalog-name {
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.catalog-category {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px
}

.catalog-rate {
    text-align: right;
    font-weight: 850;
    white-space: nowrap
}

    .catalog-rate small {
        display: block;
        color: #94a3b8;
        margin-top: 2px
    }

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700
}

.builder-section {
    min-width: 0
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 11px 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: .16s ease
}

.btn-outline {
    background: #fff;
    color: #0f172a;
    border: 1px solid var(--line)
}

    .btn-outline:hover {
        border-color: #94a3b8
    }

.btn-primary {
    background: linear-gradient(135deg,var(--blue),var(--blue2));
    color: white;
    box-shadow: 0 10px 24px rgba(37,99,235,.22)
}

    .btn-primary img {
        width: 18px;
        height: 18px
    }

.btn-full {
    width: 100%;
    margin-top: 18px
}

.empty-state {
    min-height: 320px;
    border: 1px dashed #cbd5e1;
    border-radius: 28px;
    background: #fff;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 42px
}

    .empty-state img {
        width: 64px;
        height: 64px;
        margin-bottom: 16px
    }

    .empty-state h3 {
        margin: 0;
        font-size: 22px
    }

    .empty-state p {
        margin: 10px 0 0;
        color: var(--muted)
    }

.line-list {
    display: grid;
    gap: 14px
}

.line-card {
    background: #fff;
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(15,23,42,.06);
    padding: 20px
}

.line-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px
}

.line-left {
    display: flex;
    gap: 12px;
    min-width: 0
}

.line-label {
    border: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 850
}

.monthly {
    text-align: right;
    font-size: 21px;
    font-weight: 850
}

    .monthly span {
        display: block;
        color: var(--muted);
        font-size: 12px;
        font-weight: 700
    }

.icon-btn {
    margin-top: 8px;
    border: 0;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 12px;
    padding: 9px;
    cursor: pointer
}

    .icon-btn img {
        width: 18px;
        height: 18px
    }

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

.field span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px
}

.input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 0 10px
}

    .input-wrap input {
        border: 0;
        padding: 11px 0
    }

    .input-wrap em {
        font-style: normal;
        color: #94a3b8;
        font-size: 12px
    }

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px
}

    .summary-grid div, .summary-line {
        border-radius: 18px;
        background: #f8fafc;
        padding: 14px
    }

    .summary-grid span {
        display: block;
        color: var(--muted);
        font-size: 12px;
        margin-bottom: 4px
    }

    .summary-grid strong {
        font-size: 22px
    }

.summary-items {
    display: grid;
    gap: 10px;
    margin-top: 16px
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

    .summary-row strong:last-child {
        white-space: nowrap
    }

.summary-line small {
    display: block;
    color: var(--muted);
    margin-top: 5px
}

.summary-totals {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 18px;
    display: grid;
    gap: 10px
}

    .summary-totals div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: var(--muted);
        font-size: 14px
    }

    .summary-totals .grand-total {
        color: var(--ink);
        font-size: 18px
    }

.note-card {
    margin-top: 22px;
    background: var(--amber);
    color: var(--amberText)
}

    .note-card h3 {
        margin: 0
    }

    .note-card p {
        margin: 10px 0 0;
        line-height: 1.65
    }

.hidden {
    display: none !important
}

@media(max-width:1200px) {
    .layout-grid {
        grid-template-columns: 1fr
    }

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

    .catalog-list {
        max-height: none
    }
}

@media(max-width:720px) {
    .app-shell {
        padding: 14px
    }

    .hero {
        padding: 24px
    }

    .fields, .hero-metrics {
        grid-template-columns: 1fr
    }

    .brand-logo {
        width: 150px
    }

    .line-top {
        display: block
    }

    .monthly {
        text-align: left;
        margin-top: 14px
    }
}

@media print {
    .catalog-panel, .btn, .note-card {
        display: none !important
    }

    .layout-grid {
        grid-template-columns: 1fr
    }

    .hero, .card, .line-card {
        box-shadow: none
    }

    .app-shell {
        padding: 0
    }
}

.csv-status{font-size:12px;opacity:.75;padding:8px 16px;text-align:center;}
