﻿/* ===========================================================================
   EchoQuote design system
   Shared styles for the new EchoQuote UI (sidebar shell, cards, tables,
   status chips, forms, buttons). Extracted from the approved design mock
   and reused across every page as they get migrated to this look.
   =========================================================================== */

:root {
    --navy: #1E1B3E;
    --navy-d: #14122C;
    --navy-m: #2C2856;
    --navy-l: #413C72;
    --lime: #A9CF38;
    --lime-d: #8CB223;
    --lime-ink: #5F7D0F;
    --lime-soft: #F3F8E3;
    --amber: #E09B2D;
    --amber-ink: #8A5A08;
    --amber-soft: #FDF3E1;
    --red: #C4453D;
    --red-soft: #FBECEB;
    --bg: #F5F5F8;
    --card: #FFFFFF;
    --line: #E5E5EE;
    --line-s: #EFEFF5;
    --ink: #1E1B3E;
    --mut: #6C6E85;
    --faint: #9698AC;
    --sh: 0 1px 2px rgba(20,18,44,.05), 0 6px 16px -6px rgba(20,18,44,.09);
    --r: 12px;
    --rs: 8px;
}

* {
    box-sizing: border-box
}

html, body {
    margin: 0
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Plus Jakarta Sans",system-ui,sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums
}

h1, h2, h3 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -.02em
}

h1 {
    font-size: 23px
}

h2 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.01em
}

h3 {
    font-size: 13px
}

button, select, input {
    font-family: inherit;
    font-size: 13px
}

button {
    cursor: pointer;
    border-radius: var(--rs)
}

a {
    color: inherit
}

.mono {
    font-family: "IBM Plex Mono",monospace
}

:focus-visible {
    outline: 2px solid var(--lime-d);
    outline-offset: 2px;
    border-radius: 4px
}

@media (prefers-reduced-motion:reduce) {
    * {
        transition: none !important;
        animation: none !important
    }
}

/* ---------- shell ---------- */
.app {
    display: flex;
    min-height: 100vh
}

.side {
    width: 236px;
    flex: none;
    background: var(--navy);
    color: #C9C8DC;
    display: flex;
    flex-direction: column;
    padding: 22px 14px;
    gap: 26px;
    position: sticky;
    top: 0;
    height: 100vh
}

.logo {
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-decoration: none
}

    .logo .brand {
        font-size: 19px;
        font-weight: 800;
        letter-spacing: -.045em;
        color: #fff;
        line-height: 1.1
    }

        .logo .brand i {
            font-style: normal;
            position: relative
        }

            .logo .brand i::after {
                content: "";
                position: absolute;
                top: -3px;
                right: -7px;
                width: 5px;
                height: 5px;
                border-radius: 50%;
                background: var(--lime)
            }

    .logo .sub {
        font-size: 9.5px;
        letter-spacing: .2em;
        text-transform: uppercase;
        color: #7A78A0;
        margin-top: 3px
    }

.grp {
    font-size: 9.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #6B699A;
    padding: 0 8px 7px
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 1px
}

    .nav a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: var(--rs);
        color: #C9C8DC;
        text-decoration: none;
        font-size: 13.5px;
        font-weight: 500;
        border-left: 2px solid transparent;
        transition: background .15s,color .15s
    }

        .nav a svg {
            width: 15px;
            height: 15px;
            flex: none;
            opacity: .75
        }

        .nav a:hover {
            background: var(--navy-m);
            color: #fff
        }

        .nav a.on {
            background: var(--navy-m);
            color: #fff;
            border-left-color: var(--lime)
        }

            .nav a.on svg {
                opacity: 1;
                color: var(--lime)
            }

    .nav .toggle {
        cursor: pointer;
        justify-content: flex-start
    }

        .nav .toggle .chev {
            margin-left: auto;
            width: 12px;
            height: 12px;
            transition: transform .15s
        }

        .nav .toggle.open .chev {
            transform: rotate(90deg)
        }

.sub {
    display: none;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 3px 24px;
    padding-left: 10px;
    border-left: 1px solid var(--navy-l)
}

    .sub.open {
        display: flex
    }

    .sub a {
        display: block;
        padding: 7px 10px;
        border-radius: var(--rs);
        color: #C9C8DC;
        text-decoration: none;
        font-size: 12.5px;
        font-weight: 500;
        transition: background .15s,color .15s
    }

        .sub a:hover {
            background: var(--navy-m);
            color: #fff
        }

        .sub a.on {
            background: var(--navy-m);
            color: #fff
        }

.nav .ct {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    background: var(--navy-l);
    padding: 1px 7px;
    border-radius: 9px;
    color: #D8D7E8
}

.nav a.on .ct {
    background: var(--lime);
    color: var(--navy)
}

.who {
    margin-top: auto;
    padding: 0 8px
}

    .who select {
        width: 100%;
        background: var(--navy-m);
        color: #fff;
        border: 1px solid var(--navy-l);
        border-radius: var(--rs);
        padding: 8px 9px;
        font-weight: 500
    }

    .who p {
        font-size: 11.5px;
        color: #7A78A0;
        margin: 8px 2px 0;
        line-height: 1.5
    }

.main {
    flex: 1;
    min-width: 0;
    padding: 24px 30px 24px;
    max-width: 1440px
}

.main-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--faint)
}

    .main-footer .footer-brand {
        color: var(--mut);
        font-weight: 600
    }

.bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px
}

    .bar p {
        margin: 4px 0 0;
        color: var(--mut);
        font-size: 13.5px
    }

.ctl {
    display: flex;
    gap: 9px;
    align-items: center
}

select.pill {
    border: 1px solid var(--line);
    border-radius: var(--rs);
    padding: 8px 11px;
    background: var(--card);
    font-weight: 500;
    box-shadow: var(--sh)
}

/* ---------- cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh)
}

.ch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line-s)
}

    .ch .note {
        font-size: 11.5px;
        color: var(--faint);
        font-weight: 500
    }

/* ---------- pipeline (signature) ---------- */
.pipe {
    padding: 20px 22px 22px;
    margin-bottom: 16px
}

.pipe-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px
}

    .pipe-top h2 {
        font-size: 15px
    }

.pipe-total {
    font-size: 12.5px;
    color: var(--mut)
}

    .pipe-total b {
        font-size: 19px;
        font-weight: 800;
        letter-spacing: -.03em;
        color: var(--ink);
        margin-right: 5px
    }

.stages {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 2px;
    margin-bottom: 13px
}

.stage {
    padding: 0 2px;
    cursor: default;
    transition: opacity .15s
}

    .stage .dot {
        width: 8px;
        height: 8px;
        border-radius: 2px;
        display: inline-block;
        margin-right: 7px;
        vertical-align: 1px
    }

    .stage .lb {
        font-size: 11.5px;
        font-weight: 600;
        color: var(--mut)
    }

    .stage .vl {
        font-size: 20px;
        font-weight: 800;
        letter-spacing: -.032em;
        margin-top: 3px;
        line-height: 1.2
    }

    .stage .ct {
        font-size: 11.5px;
        color: var(--faint);
        font-weight: 500
    }

.pipe.dimmed .stage:not(.hot) {
    opacity: .38
}

.flow {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    gap: 2px;
    background: var(--line-s)
}

    .flow i {
        display: block;
        height: 100%;
        transition: filter .15s;
        cursor: pointer;
        min-width: 3px
    }

        .flow i:hover {
            filter: brightness(1.12)
        }

.flow-x {
    display: flex;
    justify-content: space-between;
    margin-top: 9px;
    font-size: 11px;
    color: var(--faint)
}

/* ---------- kpis ---------- */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(190px,1fr));
    gap: 14px;
    margin-bottom: 16px
}

.k {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 15px 17px;
    box-shadow: var(--sh);
    position: relative;
    overflow: hidden
}

    .k .lb {
        font-size: 11px;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--faint);
        font-weight: 600
    }

    .k .vl {
        font-size: 27px;
        font-weight: 800;
        letter-spacing: -.035em;
        line-height: 1.15;
        margin-top: 5px
    }

    .k .sb {
        font-size: 12px;
        color: var(--mut);
        margin-top: 2px
    }

    .k .tag {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11.5px;
        font-weight: 600;
        padding: 1px 7px;
        border-radius: 20px;
        margin-top: 6px
    }

.t-ok {
    background: var(--lime-soft);
    color: var(--lime-ink)
}

.t-wn {
    background: var(--amber-soft);
    color: var(--amber-ink)
}

.t-bd {
    background: var(--red-soft);
    color: var(--red)
}

.k.hot {
    border-color: #F0C9C6
}

    .k.hot .vl {
        color: var(--red)
    }

/* ---------- layout ---------- */
.cols {
    display: grid;
    grid-template-columns: 1fr 372px;
    gap: 16px;
    align-items: start
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0
}

/* ---------- segmented ---------- */
.seg {
    display: inline-flex;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--rs);
    padding: 2px;
    gap: 2px
}

    .seg button {
        border: 0;
        background: transparent;
        padding: 5px 12px;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--mut);
        border-radius: 6px;
        transition: background .15s,color .15s
    }

        .seg button:hover {
            color: var(--ink)
        }

        .seg button.on {
            background: var(--navy);
            color: #fff
        }

/* ---------- chart ---------- */
.plot {
    padding: 16px 18px 4px;
    overflow-x: auto;
    position: relative
}

    .plot svg {
        display: block
    }

.gl {
    stroke: var(--line-s);
    stroke-width: 1
}

.gz {
    stroke: var(--line);
    stroke-width: 1
}

.tk {
    font-size: 9.5px;
    fill: var(--faint);
    font-family: "IBM Plex Mono",monospace
}

.br {
    fill: var(--lime);
    transition: fill .12s
}

    .br:hover {
        fill: var(--lime-d)
    }

.bn {
    font-size: 9.5px;
    fill: var(--mut);
    font-weight: 600
}

.tip {
    position: absolute;
    pointer-events: none;
    background: var(--navy);
    color: #fff;
    padding: 7px 10px;
    border-radius: var(--rs);
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(20,18,44,.28);
    opacity: 0;
    transition: opacity .12s;
    white-space: nowrap;
    z-index: 5
}

    .tip.on {
        opacity: 1
    }

    .tip b {
        color: var(--lime);
        font-weight: 700
    }

.foot {
    display: flex;
    gap: 16px;
    padding: 4px 18px 15px;
    font-size: 11.5px;
    color: var(--faint);
    font-weight: 500
}

    .foot span {
        display: flex;
        align-items: center;
        gap: 6px
    }

    .foot i {
        width: 9px;
        height: 9px;
        border-radius: 2px
    }

/* ---------- tabs + pending ---------- */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--line-s)
}

    .tabs button {
        flex: 1;
        border: 0;
        background: none;
        padding: 12px 8px;
        font-size: 13px;
        font-weight: 600;
        color: var(--mut);
        border-bottom: 2px solid transparent;
        border-radius: 0;
        transition: color .15s
    }

        .tabs button:hover {
            color: var(--ink)
        }

        .tabs button.on {
            color: var(--ink);
            border-bottom-color: var(--lime)
        }

    .tabs em {
        font-style: normal;
        font-size: 11px;
        background: var(--line-s);
        padding: 1px 7px;
        border-radius: 9px;
        margin-left: 5px;
        color: var(--mut)
    }

    .tabs button.on em {
        background: var(--lime);
        color: var(--navy)
    }

.pl {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 352px;
    overflow-y: auto
}

    .pl li {
        display: flex;
        gap: 11px;
        padding: 12px 18px;
        border-bottom: 1px solid var(--line-s);
        cursor: pointer;
        transition: background .12s
    }

        .pl li:last-child {
            border-bottom: 0
        }

        .pl li:hover {
            background: #FAFAFC
        }

.av {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--navy);
    color: #fff;
    letter-spacing: -.02em
}

    .av.w {
        background: var(--amber)
    }

    .av.b {
        background: var(--red)
    }

.pb {
    flex: 1;
    min-width: 0
}

.p1 {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline
}

    .p1 b {
        font-weight: 600;
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap
    }

    .p1 .v {
        font-weight: 700;
        flex: none;
        letter-spacing: -.02em
    }

.p2 {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11.5px;
    color: var(--mut);
    margin-top: 1px
}

    .p2 .ag {
        font-weight: 600;
        flex: none
    }

.ag.w {
    color: var(--amber-ink)
}

.ag.b {
    color: var(--red)
}

/* ---------- rows ---------- */
.rows {
    list-style: none;
    margin: 0;
    padding: 0
}

    .rows li {
        padding: 12px 18px;
        border-bottom: 1px solid var(--line-s)
    }

        .rows li:last-child {
            border-bottom: 0
        }

.rl {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline
}

    .rl .n {
        font-weight: 700;
        letter-spacing: -.02em;
        flex: none
    }

.trk {
    height: 5px;
    background: var(--line-s);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 7px
}

    .trk i {
        display: block;
        height: 100%;
        background: var(--lime);
        border-radius: 3px
    }

.mrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line-s)
}

    .mrow:last-child {
        border-bottom: 0
    }

    .mrow .ml {
        font-size: 13px;
        font-weight: 500
    }

    .mrow .ms {
        font-size: 11.5px;
        color: var(--faint)
    }

    .mrow .mv {
        font-size: 17px;
        font-weight: 800;
        letter-spacing: -.03em;
        flex: none
    }

.empty {
    padding: 40px 18px;
    text-align: center;
    color: var(--mut);
    font-size: 13px
}

.hide {
    display: none !important
}

.empty b {
    display: block;
    color: var(--ink);
    font-weight: 600;
    margin-bottom: 3px
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 12px 18px;
    border-top: 1px solid var(--line-s)
}

    .pager .pinfo {
        margin-right: auto;
        font-size: 12.5px;
        color: var(--faint)
    }

    .pager button {
        border: 1px solid var(--line);
        background: #fff;
        color: var(--ink);
        min-width: 30px;
        height: 30px;
        padding: 0 8px;
        border-radius: var(--rs);
        font-size: 12.5px;
        font-weight: 600;
        cursor: pointer
    }

        .pager button:hover:not(:disabled) {
            border-color: #CFCFDE;
            background: #FCFCFE
        }

        .pager button:disabled {
            opacity: .4;
            cursor: not-allowed
        }

        .pager button.on {
            background: var(--navy);
            border-color: var(--navy);
            color: #fff
        }

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    background: var(--navy);
    color: #fff;
    padding: 11px 16px;
    border-radius: var(--rs);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 28px rgba(20,18,44,.3);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s,transform .2s;
    pointer-events: none;
    z-index: 9
}

    .toast.on {
        opacity: 1;
        transform: none
    }

th.sortable {
    cursor: pointer;
    user-select: none
}

    th.sortable:hover {
        color: var(--ink)
    }

    th.sortable::after {
        content: "";
        display: inline-block;
        width: 0;
        height: 0;
        margin-left: 5px;
        vertical-align: 2px;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        opacity: .3
    }

    th.sortable.asc::after {
        border-bottom: 5px solid currentColor;
        opacity: 1
    }

    th.sortable.desc::after {
        border-top: 5px solid currentColor;
        opacity: 1
    }

.chklist {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--rs)
}

.chkrow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13.5px;
    color: var(--ink);
    border-bottom: 1px solid var(--line-s);
    cursor: pointer
}

    .chkrow:last-child {
        border-bottom: 0
    }

    .chkrow:hover {
        background: var(--bg)
    }

    .chkrow input {
        width: 15px;
        height: 15px;
        accent-color: var(--navy);
        flex: none;
        margin: 0
    }

    .chkrow.hide {
        display: none
    }

.pgn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--line-s);
    font-size: 12.5px;
    color: var(--mut)
}

    .pgn .btn {
        padding: 6px 11px
    }

    .pgn select {
        border: 1px solid var(--line);
        border-radius: var(--rs);
        padding: 5px 8px;
        background: #fff
    }

/* ---------- modal ---------- */
.modal-ov {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20,18,44,.45);
    z-index: 30;
    align-items: center;
    justify-content: center;
    padding: 20px
}

    .modal-ov.open {
        display: flex
    }

.modal-card {
    background: var(--card);
    border-radius: var(--r);
    box-shadow: 0 20px 60px rgba(20,18,44,.35);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto
}

    .modal-card.lg {
        max-width: 860px
    }

tr.mismatch td {
    background: var(--amber-soft)
}

.modal-card .ch {
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 1
}

.modal-close {
    border: 0;
    background: none;
    color: var(--faint);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    flex: none
}

    .modal-close:hover {
        background: var(--line-s);
        color: var(--ink)
    }

.menubtn {
    display: none
}

.hamb {
    display: none;
    position: fixed;
    left: 14px;
    top: 14px;
    z-index: 15
}

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

@media(max-width:860px) {
    .side {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 20;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 0 0 0 rgba(0,0,0,0)
    }

        .side.open {
            transform: translateX(0);
            box-shadow: 14px 0 32px rgba(20,18,44,.28)
        }

    .scrim {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(20,18,44,.4);
        z-index: 19
    }

        .scrim.on {
            display: block
        }

    .main {
        padding: 18px;
        padding-top: 64px
    }

    .hamb {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 1px solid var(--line);
        background: #fff;
        border-radius: var(--rs);
        box-shadow: var(--sh)
    }

    .menubtn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: 1px solid var(--navy-l);
        background: var(--navy-m);
        color: #fff;
        border-radius: var(--rs)
    }

    .stages {
        grid-template-columns: repeat(2,1fr);
        gap: 14px 2px
    }
}

/* ---------- forms ---------- */
.fg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 18px
}

.f {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0
}

    .f.w {
        grid-column: 1/-1
    }

    .f label {
        font-size: 11px;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--faint);
        font-weight: 600
    }

    .f input, .f select, .f textarea {
        border: 1px solid var(--line);
        border-radius: var(--rs);
        padding: 9px 11px;
        background: #fff;
        width: 100%;
        color: var(--ink);
        transition: border-color .15s,box-shadow .15s
    }

        .f input:hover, .f select:hover, .f textarea:hover {
            border-color: #CFCFDE
        }

        .f input:focus, .f select:focus, .f textarea:focus {
            border-color: var(--navy);
            box-shadow: 0 0 0 3px rgba(30,27,62,.07);
            outline: 0
        }

        .f input:disabled {
            background: var(--bg);
            color: var(--mut)
        }

        .f input:read-only {
            background: var(--bg);
            color: var(--mut)
        }

    .f .hint {
        font-size: 11.5px;
        color: var(--faint)
    }

.err {
    font-size: 12px;
    color: var(--red);
    font-weight: 500;
    display: none
}

    .err.on {
        display: block
    }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--rs);
    background: #fff;
    color: var(--ink);
    padding: 8px 14px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: var(--sh);
    text-decoration: none;
    line-height: 1.3;
    transition: border-color .15s,background .15s
}

    .btn:hover {
        border-color: #CFCFDE;
        background: #FCFCFE;
        text-decoration: none
    }

.btn-p {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff
}

    .btn-p:hover {
        background: var(--navy-m);
        border-color: var(--navy-m)
    }

.btn-d {
    background: var(--red);
    border-color: var(--red);
    color: #fff
}

    .btn-d:hover {
        background: #A93A33;
        border-color: #A93A33
    }

.btn-w {
    background: var(--amber);
    border-color: var(--amber);
    color: #fff
}

    .btn-w:hover {
        background: #C4830E;
        border-color: #C4830E
    }

.btn-s {
    padding: 4px 10px;
    font-size: 12px;
    box-shadow: none
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed
}

.acts {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    padding: 15px 18px;
    border-top: 1px solid var(--line-s)
}

/* ---------- tables ---------- */
table {
    width: 100%;
    border-collapse: collapse
}

th {
    text-align: left;
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 700;
    padding: 11px 18px;
    border-bottom: 1px solid var(--line-s);
    white-space: nowrap
}

td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line-s);
    vertical-align: top
}

tbody tr:last-child td {
    border-bottom: 0
}

tr.clk:hover {
    background: #FAFAFC;
    cursor: pointer
}

.r {
    text-align: right
}

.chip {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap
}

.c-dr {
    background: var(--line-s);
    color: var(--mut)
}

.c-pn {
    background: var(--amber-soft);
    color: var(--amber-ink)
}

.c-ap {
    background: var(--lime-soft);
    color: var(--lime-ink)
}

.c-rj {
    background: var(--red-soft);
    color: var(--red)
}

.c-po {
    background: #E8E7F2;
    color: var(--navy-l)
}

.rev {
    background: var(--line-s);
    color: var(--mut);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px
}

/* ---------- line items ---------- */
.items th, .items td {
    padding: 9px 11px;
    font-size: 13px
}

    .items th:first-child, .items td:first-child {
        padding-left: 18px
    }

.items input, .items select {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 6px 8px;
    width: 100%;
    background: var(--bg);
    color: var(--ink);
    font-size: 13px
}

    .items input:hover, .items select:hover {
        border-color: var(--line)
    }

    .items input:focus, .items select:focus {
        border-color: var(--navy);
        background: #fff;
        outline: 0
    }

    .items input.n {
        text-align: right
    }

    .items input[type=checkbox] {
        width: 16px;
        height: 16px;
        padding: 0;
        border: 0;
        background: none;
        accent-color: var(--navy)
    }

.items tr.excluded {
    opacity: .45
}

.ib {
    border: 0;
    background: none;
    color: var(--faint);
    padding: 4px 7px;
    font-size: 16px;
    line-height: 1;
    border-radius: 6px
}

    .ib:hover {
        color: var(--red);
        background: var(--red-soft)
    }

/* ---------- costing ladder ---------- */
.lad {
    position: sticky;
    top: 24px
}

.lr {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 9px 18px;
    font-size: 13px
}

    .lr span {
        color: var(--mut)
    }

    .lr b {
        font-weight: 600;
        letter-spacing: -.01em
    }

.int {
    background: var(--bg)
}

    .int .lr span {
        color: var(--faint)
    }

.curt {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 18px;
    background: var(--bg);
    border-top: 1px dashed var(--line);
    border-bottom: 1px dashed var(--line);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 700
}

    .curt::after {
        content: "";
        flex: 1;
        border-top: 1px dashed var(--line)
    }

.ltot {
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: baseline
}

    .ltot b {
        font-size: 21px;
        font-weight: 800;
        letter-spacing: -.03em
    }

.vin {
    width: 48px;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 2px 5px;
    text-align: right;
    font-size: 12px
}

/* ---------- attachments ---------- */
.drop {
    margin: 0 18px 18px;
    border: 1px dashed var(--line);
    border-radius: var(--r);
    padding: 18px;
    text-align: center;
    background: var(--bg)
}

    .drop.miss {
        border-color: var(--red);
        background: var(--red-soft)
    }

    .drop p {
        margin: 0 0 10px;
        font-size: 12.5px;
        color: var(--mut)
    }

.files {
    list-style: none;
    margin: 11px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px
}

    .files li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--rs);
        padding: 7px 11px;
        font-size: 12.5px;
        text-align: left
    }

    .files b {
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap
    }

    .files .sz {
        color: var(--faint);
        flex: none;
        font-family: "IBM Plex Mono",monospace;
        font-size: 11px
    }

/* ---------- meta + timeline ---------- */
.meta {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
    gap: 16px;
    padding: 18px
}

    .meta div > span {
        display: block;
        font-size: 10.5px;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--faint);
        font-weight: 700
    }

    .meta div > b {
        font-weight: 600
    }

.tl {
    padding: 8px 18px 18px;
    margin: 0;
    list-style: none
}

    .tl li {
        position: relative;
        padding: 9px 0 9px 22px;
        font-size: 13px
    }

        .tl li::before {
            content: "";
            position: absolute;
            left: 2px;
            top: 15px;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--lime);
            box-shadow: 0 0 0 3px var(--lime-soft)
        }

        .tl li::after {
            content: "";
            position: absolute;
            left: 5.5px;
            top: 25px;
            bottom: -6px;
            width: 1px;
            background: var(--line)
        }

        .tl li:last-child::after {
            display: none
        }

        .tl li.w::before {
            background: var(--line);
            box-shadow: 0 0 0 3px var(--bg)
        }

        .tl li b {
            font-weight: 600
        }

    .tl time {
        display: block;
        font-size: 11px;
        color: var(--faint);
        font-family: "IBM Plex Mono",monospace
    }

.reason {
    background: var(--red-soft);
    border-left: 3px solid var(--red);
    padding: 12px 15px;
    margin: 18px 18px 0;
    font-size: 13px
}

    .reason span {
        display: block;
        font-size: 10px;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--red);
        font-weight: 700;
        margin-bottom: 3px
    }

.warn {
    background: var(--amber-soft);
    border-left: 3px solid var(--amber);
    padding: 12px 15px;
    margin: 16px 18px;
    font-size: 12.5px;
    color: var(--amber-ink)
}

    .warn b {
        font-weight: 700
    }

/* ---------- mail ---------- */
.mail {
    border: 1px solid var(--line);
    border-radius: var(--r);
    margin: 0 18px 14px;
    overflow: hidden
}

.mh {
    background: var(--bg);
    padding: 9px 13px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px
}

.mb {
    padding: 13px;
    font-size: 12.5px;
    color: var(--mut);
    white-space: pre-wrap;
    line-height: 1.6
}

.att {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--rs);
    padding: 6px 10px;
    margin-top: 10px;
    font-size: 12px;
    background: var(--bg);
    color: var(--ink)
}

/* ---------- document ---------- */
.doc {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 38px 42px;
    max-width: 760px;
    margin: 0 auto;
    box-shadow: var(--sh)
}

.dh {
    display: flex;
    justify-content: space-between;
    gap: 26px;
    border-bottom: 2px solid var(--navy);
    padding-bottom: 16px
}

    .dh .t {
        font-size: 21px;
        font-weight: 800;
        letter-spacing: -.03em
    }

.lbl {
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 700
}

.dp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    padding: 20px 0
}

.doc table {
    margin-top: 8px;
    font-size: 13px
}

.doc th {
    background: var(--bg);
    padding: 9px 11px;
    border-bottom: 1px solid var(--line);
    color: var(--mut)
}

.doc td {
    padding: 10px 11px;
    border-bottom: 1px solid var(--line-s)
}

.doc tfoot td {
    border-bottom: 0;
    padding: 6px 11px
}

.doc tfoot tr.gt td {
    border-top: 2px solid var(--navy);
    padding-top: 10px;
    font-weight: 800
}

.dfoot {
    margin-top: 24px;
    padding-top: 15px;
    border-top: 1px solid var(--line-s);
    font-size: 11.5px;
    color: var(--mut);
    line-height: 1.7
}

.wm {
    text-align: center;
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--amber-ink);
    background: var(--amber-soft);
    padding: 7px;
    border-radius: var(--rs);
    margin-bottom: 18px;
    font-weight: 700
}

/* ---------- admin ---------- */
.filt {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line-s);
    background: #FCFCFD
}

    .filt select, .filt input {
        border: 1px solid var(--line);
        border-radius: var(--rs);
        padding: 7px 10px;
        background: #fff
    }

.band {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr 1.2fr 38px;
    gap: 9px;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line-s)
}

    .band input, .band select {
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 7px 9px;
        width: 100%;
        background: #fff
    }

.bandh {
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 700;
    background: #FCFCFD
}

.sw {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--line);
    border-radius: 10px;
    flex: none;
    display: inline-block;
    transition: background .18s;
    cursor: pointer
}

    .sw.on {
        background: var(--lime-d)
    }

    .sw i {
        position: absolute;
        top: 2px;
        left: 2px;
        width: 16px;
        height: 16px;
        background: #fff;
        border-radius: 50%;
        transition: transform .18s;
        box-shadow: 0 1px 2px rgba(0,0,0,.2)
    }

    .sw.on i {
        transform: translateX(16px)
    }

.tog {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line-s)
}

    .tog:last-child {
        border-bottom: 0
    }

    .tog div {
        flex: 1
    }

    .tog b {
        display: block;
        font-weight: 600;
        font-size: 13px
    }

    .tog span {
        font-size: 12px;
        color: var(--mut)
    }

.tok {
    display: inline-block;
    background: var(--lime-soft);
    color: var(--lime-ink);
    font-family: "IBM Plex Mono",monospace;
    font-size: 11.5px;
    padding: 3px 8px;
    border-radius: 5px;
    margin: 0 5px 5px 0;
    cursor: pointer;
    font-weight: 500
}

    .tok:hover {
        background: #E7F1CE
    }

.tpl {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line-s)
}

    .tpl:last-child {
        border-bottom: 0
    }

    .tpl input, .tpl textarea {
        width: 100%;
        border: 1px solid var(--line);
        border-radius: var(--rs);
        padding: 9px 11px;
        font-size: 13px;
        background: #fff;
        margin-top: 6px;
        color: var(--ink)
    }

    .tpl textarea {
        font-family: "IBM Plex Mono",monospace;
        font-size: 12px;
        line-height: 1.65
    }

.aud {
    list-style: none;
    margin: 0;
    padding: 0
}

    .aud li {
        display: flex;
        gap: 14px;
        padding: 12px 18px;
        border-bottom: 1px solid var(--line-s);
        font-size: 13px
    }

        .aud li:last-child {
            border-bottom: 0
        }

    .aud time {
        font-family: "IBM Plex Mono",monospace;
        font-size: 11px;
        color: var(--faint);
        flex: none;
        width: 106px
    }

    .aud b {
        font-weight: 600
    }

.g2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start
}

.split {
    display: grid;
    grid-template-columns: 1fr 356px;
    gap: 16px;
    align-items: start
}

@media(max-width:1080px) {
    .g2, .split {
        grid-template-columns: 1fr
    }
}

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

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

@media print {
    .side, .acts, .bar, .noprint {
        display: none !important
    }

    .main {
        padding: 0
    }

    .doc {
        border: 0;
        box-shadow: none
    }
}
