:root {
    --bg: #06080b;
    --bg-secondary: #090c10;
    --panel: #0e1319;
    --panel-soft: #111820;

    --border: #222a34;
    --border-soft: #171d24;

    --text: #eef2f6;
    --muted: #8a96a3;
    --subtle: #5f6b77;

    --green: #99efb6;
    --red: #ff8f8f;
    --amber: #efca82;
}

* {
    box-sizing: border-box;
}

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

    background:
        radial-gradient(
            circle at 90% 0%,
            rgba(255,255,255,.035),
            transparent 25%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

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

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

.app-shell {
    display: grid;

    grid-template-columns:
        250px
        minmax(0, 1fr);

    min-height: 100vh;
}


/* SIDEBAR */

.sidebar {
    position: sticky;

    top: 0;

    height: 100vh;

    padding: 20px 14px;

    background:
        linear-gradient(
            180deg,
            #090c10,
            #07090c
        );

    border-right:
        1px solid var(--border);
}

.brand-block {
    display: flex;

    align-items: center;

    gap: 12px;

    padding:
        6px
        8px
        22px;

    border-bottom:
        1px solid var(--border);

    margin-bottom: 18px;
}

.brand-mark {
    width: 30px;
    height: 30px;

    display: grid;

    place-items: center;

    transform:
        rotate(45deg);

    border:
        1px solid #727c87;
}

.brand-mark span {
    transform:
        rotate(-45deg);

    font-size: 11px;

    font-weight: 800;
}

.brand-block strong {
    display: block;

    font-size: 13px;

    letter-spacing: .02em;
}

.brand-block small {
    display: block;

    margin-top: 3px;

    color: var(--subtle);

    font-size: 8px;

    letter-spacing: .16em;
}

.nav-section {
    margin-top: 18px;
}

.nav-label {
    padding: 0 10px;

    margin-bottom: 6px;

    color: #596571;

    font-size: 8px;

    letter-spacing: .18em;
}

.nav-item {
    display: flex;

    align-items: center;

    gap: 10px;

    padding:
        10px
        11px;

    margin-bottom: 3px;

    border-radius: 6px;

    color: #98a4b1;

    font-size: 13px;

    transition:
        .15s ease;
}

.nav-item:hover {
    background: #10161d;

    color: #ffffff;
}

.nav-item.active {
    background: #111820;

    color: #ffffff;
}

.nav-dot {
    width: 6px;
    height: 6px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #3d4752;
}

.nav-item.active .nav-dot {
    background:
        var(--green);

    box-shadow:
        0 0 12px
        rgba(153,239,182,.55);
}

.sidebar-footer {
    position: absolute;

    bottom: 18px;

    left: 22px;

    display: flex;

    align-items: center;

    gap: 8px;

    color: #616d79;

    font-family: monospace;

    font-size: 8px;

    letter-spacing: .12em;
}

.system-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background:
        var(--green);

    box-shadow:
        0 0 10px
        rgba(153,239,182,.45);
}


/* MAIN */

.main-content {
    min-width: 0;
}

.topbar {
    position: sticky;

    top: 0;

    z-index: 20;

    min-height: 66px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        0
        28px;

    background:
        rgba(6,8,11,.9);

    backdrop-filter:
        blur(14px);

    border-bottom:
        1px solid var(--border);
}

.topbar h1 {
    margin: 0;

    font-size: 15px;

    letter-spacing: -.02em;
}

.topbar-actions {
    display: flex;

    gap: 8px;
}

.page {
    width: min(
        1500px,
        calc(100% - 48px)
    );

    margin: 0 auto;

    padding:
        30px 0
        80px;
}

.kicker {
    margin-bottom: 9px;

    color: #66727e;

    font-family: monospace;

    font-size: 8px;

    letter-spacing: .14em;
}

.page h2 {
    margin:
        0
        0
        8px;

    font-size: 36px;

    letter-spacing: -.045em;
}

.page-intro {
    max-width: 760px;

    margin:
        0
        0
        26px;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.7;
}


/* BUTTONS */

.btn {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 38px;

    padding:
        0
        13px;

    border:
        1px solid var(--border);

    border-radius:
        6px;

    background:
        #11171e;

    color:
        #dbe3ea;

    cursor:
        pointer;

    font-size:
        11px;

    font-weight:
        700;
}

.btn:hover {
    border-color:
        #3b4651;
}

.btn-primary {
    background:
        #edf2f6;

    color:
        #081015;

    border-color:
        #edf2f6;
}


/* CARDS */

.grid {
    display:
        grid;

    gap:
        14px;
}

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

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

.card {
    background:
        var(--panel);

    border:
        1px solid var(--border);

    border-radius:
        8px;

    padding:
        18px;
}

.metric-value {
    display:
        block;

    margin-bottom:
        7px;

    font-size:
        32px;

    font-weight:
        700;

    letter-spacing:
        -.04em;
}

.metric-label {
    color:
        #6c7884;

    font-family:
        monospace;

    font-size:
        8px;

    letter-spacing:
        .1em;
}


/* SECTION */

.section {
    margin-top:
        16px;
}

.section-header {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        12px;

    margin-bottom:
        12px;
}

.section-header h3 {
    margin:
        0;

    font-size:
        15px;
}


/* PILLS */

.pill {
    display:
        inline-flex;

    align-items:
        center;

    padding:
        5px
        8px;

    border:
        1px solid var(--border);

    border-radius:
        999px;

    color:
        #8c98a4;

    font-size:
        9px;
}

.pill-green {
    color:
        #a6f0be;

    border-color:
        #294c37;
}


/* NEXT ACTION */

.next-action {
    padding:
        16px;

    border:
        1px solid #27343d;

    border-left:
        3px solid var(--green);

    border-radius:
        6px;

    background:
        #0b1116;

    color:
        #aeb9c3;

    font-size:
        13px;

    line-height:
        1.6;
}


/* TABLE */

.table-wrap {
    overflow:
        auto;

    border:
        1px solid var(--border);

    border-radius:
        8px;
}

table {
    width:
        100%;

    border-collapse:
        collapse;
}

th,
td {
    padding:
        11px
        12px;

    text-align:
        left;

    border-bottom:
        1px solid var(--border-soft);
}

th {
    background:
        #0d1117;

    color:
        #687480;

    font-family:
        monospace;

    font-size:
        8px;

    letter-spacing:
        .1em;
}

td {
    color:
        #cbd3db;

    font-size:
        11px;
}


/* RESPONSIVE */

@media (max-width: 1000px) {

    .app-shell {
        grid-template-columns:
            1fr;
    }

    .sidebar {
        position:
            relative;

        height:
            auto;

        border-right:
            0;

        border-bottom:
            1px solid var(--border);
    }

    .sidebar-footer {
        display:
            none;
    }

    .grid-4,
    .grid-2 {
        grid-template-columns:
            1fr;
    }
}

/* =========================================================
   PROSPECTING HUB
   ========================================================= */

.prospecting-channels {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-bottom: 18px;
}

.prospecting-channel {
    display: inline-flex;

    align-items: center;

    gap: 9px;

    min-height: 40px;

    padding: 0 13px;

    border:
        1px solid var(--border);

    border-radius: 6px;

    background:
        #0c1116;

    color:
        #8e9aa6;

    font-size:
        11px;

    transition:
        .15s ease;
}

.prospecting-channel:hover {
    color:
        #ffffff;

    border-color:
        #3a4652;
}

.prospecting-channel.active {
    color:
        #081015;

    background:
        #edf2f6;

    border-color:
        #edf2f6;
}

.channel-dot {
    width:
        6px;

    height:
        6px;

    border-radius:
        50%;

    background:
        #48535e;
}

.prospecting-channel.active
.channel-dot {
    background:
        #111820;
}


/* HEADER */

.prospecting-header {
    display: flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        30px;

    margin-bottom:
        14px;

    padding:
        22px;

    background:
        linear-gradient(
            135deg,
            #10161d,
            #0a0f14
        );

    border:
        1px solid var(--border);

    border-radius:
        8px;
}

.prospecting-header h3 {
    margin:
        0
        0
        6px;

    font-size:
        22px;

    letter-spacing:
        -.03em;
}

.prospecting-header p {
    max-width:
        720px;

    margin:
        0;

    color:
        #84919e;

    font-size:
        12px;

    line-height:
        1.6;
}

.prospecting-counter {
    min-width:
        130px;

    text-align:
        right;
}

.prospecting-counter strong {
    display:
        block;

    font-size:
        31px;

    letter-spacing:
        -.04em;
}

.prospecting-counter span {
    color:
        #63707c;

    font-family:
        monospace;

    font-size:
        8px;

    letter-spacing:
        .1em;
}


/* CATEGORY */

.category-bar {
    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        7px;

    margin:
        14px
        0;
}

.category-chip {
    display:
        inline-flex;

    padding:
        7px
        10px;

    border:
        1px solid var(--border);

    border-radius:
        999px;

    color:
        #8996a2;

    background:
        #0a0e13;

    font-size:
        9px;
}

.category-chip:hover {
    color:
        #fff;
}

.category-chip.active {
    color:
        #a9f2c0;

    border-color:
        #31513c;

    background:
        #0b1410;
}


/* QUERY TOOLBAR */

.query-toolbar {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        15px;

    margin:
        18px
        0
        12px;
}

.query-toolbar input {
    max-width:
        340px;
}

.query-help {
    color:
        #64717d;

    font-family:
        monospace;

    font-size:
        8px;

    letter-spacing:
        .08em;
}

.query-help a {
    color:
        #cbd8e3;

    margin-left:
        8px;
}


/* QUERY GRID */

.query-grid {
    display:
        grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap:
        10px;
}

.query-card {
    display:
        flex;

    flex-direction:
        column;

    min-height:
        165px;

    padding:
        15px;

    background:
        #0b1015;

    border:
        1px solid var(--border);

    border-radius:
        7px;

    transition:
        .15s ease;
}

.query-card:hover {
    border-color:
        #394651;

    background:
        #0e141a;
}

.query-card-top {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        10px;

    margin-bottom:
        16px;
}

.query-category {
    color:
        #65717d;

    font-family:
        monospace;

    font-size:
        8px;

    letter-spacing:
        .09em;

    text-transform:
        uppercase;
}

.query-id {
    color:
        #46515c;

    font-family:
        monospace;

    font-size:
        8px;
}

.query-card code {
    display:
        block;

    flex:
        1;

    color:
        #d0d9e2;

    font-family:
        monospace;

    font-size:
        12px;

    line-height:
        1.55;

    word-break:
        break-word;
}

.query-actions {
    display:
        flex;

    align-items:
        center;

    gap:
        7px;

    margin-top:
        18px;
}

.query-actions .btn {
    min-height:
        33px;

    font-size:
        9px;
}

.empty-query {
    grid-column:
        1 / -1;

    padding:
        50px;

    text-align:
        center;

    border:
        1px solid var(--border);

    color:
        #65717d;
}


/* RESPONSIVE */

@media (max-width: 900px) {

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

    .prospecting-header {
        align-items:
            flex-start;

        flex-direction:
            column;
    }

    .prospecting-counter {
        text-align:
            left;
    }

    .query-toolbar {
        align-items:
            stretch;

        flex-direction:
            column;
    }

    .query-toolbar input {
        max-width:
            none;
    }

}

/* =========================================================
   MESSAGE LIBRARY
   ========================================================= */

.message-filter {
    display: grid;

    grid-template-columns:
        minmax(220px, 1fr)
        220px
        160px
        auto
        auto;

    gap: 8px;

    margin-bottom:
        14px;
}

.message-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 12px;
}

.message-card {
    display: flex;

    flex-direction:
        column;

    padding:
        18px;

    border:
        1px solid var(--border);

    border-radius:
        8px;

    background:
        #0b1015;
}

.message-card-header {
    display: flex;

    align-items:
        flex-start;

    justify-content:
        space-between;

    gap:
        14px;

    margin-bottom:
        16px;
}

.message-category {
    color:
        #65717d;

    font-family:
        monospace;

    font-size:
        8px;

    letter-spacing:
        .1em;

    text-transform:
        uppercase;
}

.message-card h3 {
    margin:
        6px 0 0;

    font-size:
        16px;
}

.message-channel {
    padding:
        5px 7px;

    border:
        1px solid var(--border);

    border-radius:
        4px;

    color:
        #8693a0;

    font-family:
        monospace;

    font-size:
        8px;
}

.message-subject {
    padding:
        10px 12px;

    margin-bottom:
        10px;

    border:
        1px solid var(--border);

    border-radius:
        5px;

    background:
        #090d11;
}

.message-subject span {
    display:
        block;

    margin-bottom:
        5px;

    color:
        #596672;

    font-family:
        monospace;

    font-size:
        7px;

    letter-spacing:
        .1em;
}

.message-subject strong {
    font-size:
        11px;

    color:
        #d8e0e7;
}

.message-body {
    flex:
        1;

    margin:
        0;

    padding:
        14px;

    min-height:
        190px;

    border:
        1px solid var(--border-soft);

    border-radius:
        5px;

    background:
        #080c10;

    color:
        #b8c3cd;

    font-family:
        inherit;

    font-size:
        11px;

    line-height:
        1.65;

    white-space:
        pre-wrap;

    word-break:
        break-word;
}

.message-actions {
    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        7px;

    margin-top:
        12px;
}

.message-actions .btn {
    min-height:
        33px;

    font-size:
        9px;
}


@media (max-width: 1000px) {

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

    .message-filter {
        grid-template-columns:
            1fr
            1fr;
    }

}


@media (max-width: 650px) {

    .message-filter {
        grid-template-columns:
            1fr;
    }

}

/* =========================================================
   MESSAGE BUILDER
   ========================================================= */

.builder-grid {
    display: grid;

    grid-template-columns:
        320px
        minmax(0, 1fr);

    gap: 14px;
}

.builder-sidebar {
    align-self: start;
}

.builder-first-title {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

.builder-prospect-info {
    margin-top: 14px;

    border:
        1px solid var(--border);

    border-radius:
        6px;

    background:
        #090d11;
}

.builder-info-row {
    display: flex;

    align-items: center;

    justify-content:
        space-between;

    gap: 10px;

    padding:
        10px 11px;

    border-bottom:
        1px solid var(--border-soft);
}

.builder-info-row:last-child {
    border-bottom: 0;
}

.builder-info-row span {
    color:
        #5f6b77;

    font-family:
        monospace;

    font-size:
        7px;

    letter-spacing:
        .1em;
}

.builder-info-row strong {
    max-width:
        180px;

    color:
        #cbd5de;

    font-size:
        10px;

    text-align:
        right;

    overflow:
        hidden;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;
}

.variable-list {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;
}

.variable-list code {
    padding:
        6px 8px;

    border:
        1px solid var(--border);

    border-radius:
        4px;

    background:
        #090d11;

    color:
        #94d6aa;

    font-size:
        9px;
}

.builder-main {
    min-width: 0;
}

.builder-main textarea {
    min-height: 380px;

    font-size:
        13px;

    line-height:
        1.65;
}

.builder-action-intro {
    margin-bottom: 14px;
}

.builder-send-links {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}


@media (max-width: 900px) {

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

}

.followup-overdue {
    color: #ffb0b0;
    font-weight: 600;
}

/* =========================================================
   SPRINT MODE
   ========================================================= */

.sprint-page {
    max-width: 1200px;
}

.sprint-status-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.sprint-action-card {
    padding: 26px;

    border:
        1px solid #33424d;

    border-left:
        3px solid var(--green);

    border-radius: 8px;

    background:
        linear-gradient(
            135deg,
            #10171d,
            #090e13
        );

    margin-bottom: 16px;
}

.sprint-action-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.sprint-action-label {
    color: #65727e;
    font-family: monospace;
    font-size: 8px;
    letter-spacing: .14em;
}

.sprint-action-card h3 {
    margin: 18px 0 12px;
    font-size: 30px;
    letter-spacing: -.04em;
}

.sprint-action-description {
    margin-bottom: 20px;
}

.sprint-action-description p {
    margin: 0;
    color: #9ba7b2;
    font-size: 13px;
    line-height: 1.6;
}

.sprint-query-label {
    display: block;
    margin-bottom: 8px;
    color: #596672;
    font-family: monospace;
    font-size: 8px;
    letter-spacing: .1em;
}

.sprint-action-description code {
    display: block;
    padding: 14px;

    background: #070b0f;

    border:
        1px solid var(--border);

    border-radius: 6px;

    color: #d7e1e9;

    font-size: 13px;

    white-space: pre-wrap;
}

.sprint-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sprint-main-button {
    min-width: 170px;
}

.sprint-progress-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 12px;
}

.progress-track {
    width: 100%;
    height: 7px;

    overflow: hidden;

    border-radius: 999px;

    background: #090d11;

    border:
        1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: var(--green);
}

.sprint-progress-copy {
    margin:
        11px
        0
        0;

    color: #7e8a96;

    font-size: 11px;
}

.sprint-rule-grid {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0,1fr)
        );

    gap: 10px;
}

.sprint-rule-grid div {
    padding: 14px;

    border:
        1px solid var(--border);

    border-radius: 6px;

    background: #090d11;
}

.sprint-rule-grid strong {
    display: block;

    margin-bottom: 8px;

    color: var(--green);

    font-family: monospace;

    font-size: 9px;
}

.sprint-rule-grid span {
    color: #9aa6b1;

    font-size: 11px;

    line-height: 1.5;
}

@media (max-width: 900px) {

    .sprint-status-grid,
    .sprint-progress-grid,
    .sprint-rule-grid {
        grid-template-columns: 1fr;
    }

    .sprint-action-card h3 {
        font-size: 24px;
    }

}

/* =========================================================
   METRICS
   ========================================================= */

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

.funnel-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.funnel-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.funnel-meta span {
    color: #7d8995;
    font-size: 10px;
}

.funnel-meta strong {
    color: #dfe6ec;
    font-size: 11px;
}

.funnel-track {
    height: 7px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #090d11;
}

.funnel-fill {
    height: 100%;
    background: var(--green);
}

.metric-ratio-list {
    display: flex;
    flex-direction: column;
}

.metric-ratio-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 12px 0;

    border-bottom:
        1px solid var(--border-soft);
}

.metric-ratio-list > div:last-child {
    border-bottom: 0;
}

.metric-ratio-list span {
    color: #788490;
    font-size: 10px;
}

.metric-ratio-list strong {
    color: #e0e7ed;
    font-size: 13px;
}


/* ACTIVITY CHART */

.activity-chart {
    display: grid;

    grid-template-columns:
        repeat(14, minmax(0, 1fr));

    gap: 8px;

    min-height: 240px;

    align-items: end;
}

.activity-column {
    display: flex;
    flex-direction: column;
    align-items: center;

    min-width: 0;
}

.activity-value {
    margin-bottom: 6px;

    color: #7d8995;

    font-family: monospace;
    font-size: 8px;
}

.activity-bar-wrap {
    position: relative;

    width: 100%;
    height: 170px;

    display: flex;
    align-items: flex-end;

    border-bottom:
        1px solid var(--border);
}

.activity-bar {
    width: 100%;

    min-height: 3px;

    border-radius:
        3px 3px 0 0;

    background: var(--green);

    opacity: .75;
}

.activity-label {
    margin-top: 7px;

    color: #596672;

    font-family: monospace;
    font-size: 7px;

    white-space: nowrap;
}


/* TIER PERFORMANCE */

.tier-performance {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tier-performance > div {
    display: grid;

    grid-template-columns:
        45px
        1fr;

    gap:
        3px
        10px;

    align-items: center;

    padding: 11px;

    border:
        1px solid var(--border);

    border-radius: 6px;

    background: #090d11;
}

.tier-performance strong {
    color: #d4dde5;
    font-size: 11px;
}

.tier-performance small {
    grid-column: 2;

    color: #697681;

    font-size: 9px;
}


/* RECENT WINS */

.recent-win-list {
    display: flex;
    flex-direction: column;
}

.recent-win-list a {
    display: flex;

    align-items: center;

    justify-content:
        space-between;

    gap: 14px;

    padding:
        11px 0;

    border-bottom:
        1px solid var(--border-soft);
}

.recent-win-list a:last-child {
    border-bottom: 0;
}

.recent-win-list strong {
    display: block;

    color: #dbe3ea;

    font-size: 11px;
}

.recent-win-list small {
    display: block;

    margin-top: 4px;

    color: #66727e;

    font-size: 8px;

    text-transform: uppercase;
}

.recent-win-list > a > span {
    color: var(--green);

    font-family: monospace;

    font-size: 11px;
}


@media (max-width: 900px) {

    .metrics-grid-2 {
        grid-template-columns: 1fr;
    }

    .activity-chart {
        overflow-x: auto;

        grid-template-columns:
            repeat(14, 50px);
    }

}


/* =========================================================
   AUTH / SESSION
   ========================================================= */

.auth-body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    background: var(--bg);
    color: var(--text);
}

.auth-shell {
    width: min(440px, calc(100% - 32px));
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.auth-brand strong {
    display: block;
    font-size: 13px;
    letter-spacing: .12em;
}

.auth-brand small {
    display: block;
    margin-top: 3px;
    color: #697681;
    font-size: 8px;
    letter-spacing: .12em;
}

.auth-card {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
}

.auth-card h1 {
    margin: 12px 0 8px;
    font-size: 26px;
}

.auth-card p {
    margin: 0 0 20px;
    color: #74808c;
    font-size: 11px;
}

.auth-card label {
    display: block;
    margin: 14px 0 6px;
    color: #8f9aa5;
    font-size: 9px;
    letter-spacing: .06em;
}

.auth-card input {
    width: 100%;
}

.auth-submit {
    width: 100%;
    justify-content: center;
    margin-top: 18px;
}

.sidebar-session {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.sidebar-user strong {
    display: block;
    color: #cbd5dd;
    font-size: 9px;
}

.sidebar-user small {
    display: block;
    margin-top: 2px;
    color: #596672;
    font-size: 7px;
    letter-spacing: .08em;
}

.sidebar-logout {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: transparent;
    color: #7b8792;
    font: inherit;
    font-size: 8px;
    cursor: pointer;
    text-align: left;
}

.sidebar-logout:hover {
    color: #d6dee5;
    border-color: #394651;
}


/* =========================================================
   AUDIT TRACKER
   ========================================================= */

.audit-finding-form {
    display: grid;
    grid-template-columns:
        minmax(220px, 2fr)
        130px
        minmax(150px, 1fr)
        minmax(180px, 1.4fr)
        auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 16px;
}

.audit-finding-form input,
.audit-finding-form select {
    width: 100%;
}

@media (max-width: 1000px) {

    .audit-finding-form {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   BASTION COMMAND — COMMON UI REPAIR
   Restores shared styles used by CRM, forms, dashboard,
   prospect detail, timeline, auth and audit modules.
   ========================================================= */

/* FORM CONTROLS */

label {
    display: block;
    margin-bottom: 6px;
    color: #7f8b97;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    background: #090d12;
    color: #dce4eb;
    transition:
        border-color .15s ease,
        background .15s ease,
        box-shadow .15s ease;
}

textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
    color: #4d5965;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #475561;
    background: #0b1016;
    box-shadow:
        0 0 0 3px
        rgba(153,239,182,.045);
}

select {
    cursor: pointer;
}

option {
    background: #0b1016;
    color: #dce4eb;
}

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

.form-section-title {
    margin-top: 22px;
    margin-bottom: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
    color: #71808d;
    font-family: monospace;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}


/* ALERTS */

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.55;
}

.alert-success {
    border-color: #31533d;
    background: #0c1711;
    color: #a9efbf;
}

.alert-error {
    border-color: #5a3437;
    background: #1a0e10;
    color: #ffb1b1;
}


/* FILTERS */

.filter-bar {
    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        180px
        150px
        130px
        auto
        auto;
    gap: 8px;
    margin: 18px 0 14px;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    min-width: 0;
}


/* TABLE HELPERS */

.empty-row {
    padding: 30px !important;
    text-align: center;
    color: #626e7a;
}

.table-action {
    color: #b9c7d2;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.table-action:hover {
    color: #ffffff;
}

.contact-links {
    display: table-cell;
    white-space: nowrap;
}

.contact-links a {
    margin-right: 8px;
    color: #9db7c9;
    font-size: 9px;
}

.contact-links a:hover {
    color: #ffffff;
}


/* TIER BADGES */

.tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: monospace;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
}

.tier-a {
    border-color: #31543d;
    background: #0c1711;
    color: #a8efbf;
}

.tier-b {
    border-color: #555039;
    background: #16140c;
    color: #ead58d;
}

.tier-c {
    border-color: #343d47;
    background: #0d1116;
    color: #85919d;
}


/* STATUS BADGES */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border: 1px solid #303a44;
    border-radius: 999px;
    background: #0c1117;
    color: #8996a3;
    font-family: monospace;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .07em;
    white-space: nowrap;
}

.status-new,
.status-researched,
.status-ready,
.status-draft {
    color: #9eabb6;
}

.status-contacted,
.status-in_progress {
    border-color: #3e4d58;
    color: #b9c7d2;
}

.status-replied {
    border-color: #355646;
    background: #0d1712;
    color: #a7edbf;
}

.status-audit_sent,
.status-sent {
    border-color: #36505d;
    background: #0c1418;
    color: #a9d9eb;
}

.status-call {
    border-color: #544d35;
    background: #17140c;
    color: #e7ce7e;
}

.status-offer {
    border-color: #564336;
    background: #18110d;
    color: #e9b889;
}

.status-won,
.status-closed {
    border-color: #2c5a3b;
    background: #0b1810;
    color: #99efb6;
}

.status-lost {
    border-color: #563234;
    background: #180d0f;
    color: #e69b9b;
}


/* PROSPECT VIEW */

.prospect-view-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.prospect-view-head h2 {
    margin-bottom: 5px;
}

.prospect-view-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

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

.detail-list {
    display: flex;
    flex-direction: column;
}

.detail-list > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-soft);
}

.detail-list > div:last-child {
    border-bottom: 0;
}

.detail-list span {
    color: #65727e;
    font-family: monospace;
    font-size: 8px;
    letter-spacing: .08em;
}

.detail-list strong {
    max-width: 64%;
    color: #d5dde5;
    font-size: 10px;
    text-align: right;
    overflow-wrap: anywhere;
}

.detail-list strong a {
    color: #aabfce;
}

.detail-list strong a:hover {
    color: #ffffff;
}

.prospect-contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.quick-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-notes {
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: #090d11;
    color: #aeb9c3;
    font-size: 11px;
    line-height: 1.7;
}


/* TIMELINE */

.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns:
        18px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 18px;
}

.timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 11px;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-dot {
    position: relative;
    z-index: 1;
    width: 11px;
    height: 11px;
    margin-top: 3px;
    border: 2px solid #0e1319;
    border-radius: 50%;
    background: var(--green);
    box-shadow:
        0 0 0 1px #31503c;
}

.timeline-content {
    min-width: 0;
    padding:
        0
        0
        3px;
}

.timeline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.timeline-head strong {
    color: #dbe3ea;
    font-size: 11px;
}

.timeline-head span {
    color: #586571;
    font-family: monospace;
    font-size: 7px;
    white-space: nowrap;
}

.timeline-meta {
    margin-top: 4px;
    color: #5f6c78;
    font-family: monospace;
    font-size: 7px;
    letter-spacing: .07em;
}

.timeline-subject {
    margin-top: 9px;
    color: #d0d8df;
    font-size: 10px;
    font-weight: 700;
}

.timeline-message {
    margin-top: 7px;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    background: #090d11;
    color: #9eabb6;
    font-size: 10px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.timeline-followup {
    margin-top: 7px;
    color: #87a995;
    font-family: monospace;
    font-size: 8px;
}


/* DASHBOARD COMMAND CENTER */

.dashboard-command {
    max-width: 1500px;
}

.dashboard-action-card {
    padding: 22px;
    border: 1px solid #34434d;
    border-left: 3px solid var(--green);
    border-radius: 8px;
    background:
        linear-gradient(
            135deg,
            #10171d,
            #090e13
        );
}

.dashboard-action-copy {
    max-width: 820px;
    color: #b8c3cd;
    font-size: 16px;
    line-height: 1.6;
}

.dashboard-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

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

.dashboard-mini-grid > div {
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: #090d11;
}

.dashboard-mini-grid strong {
    display: block;
    margin-bottom: 5px;
    color: #e0e7ed;
    font-size: 22px;
}

.dashboard-mini-grid span {
    color: #687580;
    font-size: 9px;
}

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

.dashboard-pipeline > div {
    padding: 11px;
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    background: #090d11;
}

.dashboard-pipeline span {
    display: block;
    color: #64717c;
    font-family: monospace;
    font-size: 7px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.dashboard-pipeline strong {
    display: block;
    margin-top: 7px;
    color: #dce4eb;
    font-size: 18px;
}

.dashboard-activity-list {
    display: flex;
    flex-direction: column;
}

.dashboard-activity-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
}

.dashboard-activity-list a:last-child {
    border-bottom: 0;
}

.dashboard-activity-list strong {
    display: block;
    color: #d7e0e7;
    font-size: 10px;
}

.dashboard-activity-list small {
    display: block;
    margin-top: 4px;
    color: #687580;
    font-size: 8px;
}

.dashboard-activity-list > a > span {
    color: #596672;
    font-family: monospace;
    font-size: 7px;
    white-space: nowrap;
}

.dashboard-command-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}


/* SIDEBAR SESSION REPAIR */

.sidebar-session {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    align-items: stretch;
    letter-spacing: normal;
}

.sidebar-user {
    min-width: 0;
}

.sidebar-user > div {
    min-width: 0;
}

.sidebar-user strong,
.sidebar-user small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-session form {
    width: 100%;
}


/* SMALL POLISH */

button:disabled,
.btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.card > label:not(:first-child) {
    margin-top: 14px;
}

.prospect-table small,
table td small {
    display: block;
    margin-top: 4px;
    color: #65717d;
    font-size: 8px;
}

.followup-overdue {
    color: #ffaaaa;
}


/* RESPONSIVE REPAIR */

@media (max-width: 1100px) {

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

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

}

@media (max-width: 900px) {

    .form-grid,
    .prospect-detail-grid {
        grid-template-columns: 1fr;
    }

    .prospect-view-head {
        flex-direction: column;
    }

    .prospect-view-badges {
        justify-content: flex-start;
    }

}

@media (max-width: 650px) {

    .page {
        width: min(
            100% - 24px,
            1500px
        );
        padding-top: 20px;
    }

    .topbar {
        padding:
            10px
            12px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .topbar-actions {
        flex-wrap: wrap;
    }

    .page h2 {
        font-size: 29px;
    }

    .filter-bar,
    .dashboard-mini-grid,
    .dashboard-pipeline {
        grid-template-columns: 1fr;
    }

    .detail-list > div {
        flex-direction: column;
        gap: 5px;
    }

    .detail-list strong {
        max-width: 100%;
        text-align: left;
    }

    .timeline-head {
        flex-direction: column;
        gap: 4px;
    }

}

