:root {
    --bg: #f4f6f9;
    --panel: #ffffff;
    --navy: #081b35;
    --navy2: #102848;
    --gold: #e1ad3d;
    --text: #172033;
    --muted: #728096;
    --line: #e6eaf0;
    --good: #16794f;
    --goodbg: #e8f7f0;
    --warn: #9b6814;
    --warnbg: #fff5df;
    --danger: #a73636;
    --dangerbg: #ffeded;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

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

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

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 245px 1fr;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 245px;
    background:
        linear-gradient(
            180deg,
            #07182e,
            #0b2342
        );
    color: white;
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 28px;
}

.brand-mark,
.login-logo {
    width: 43px;
    height: 43px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 20px;
    color: #0c203c;
    background:
        linear-gradient(
            145deg,
            #f3ca6e,
            #d89d2d
        );
    box-shadow:
        0 8px 24px
        rgba(225,173,61,.25);
}

.brand-name {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -.2px;
}

.brand-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #9fb0c7;
}

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

nav a {
    padding: 12px 13px;
    border-radius: 11px;
    color: #bac7d8;
    font-size: 14px;
    font-weight: 650;
    transition: .15s ease;
}

nav a:hover {
    background: rgba(255,255,255,.07);
    color: white;
}

nav a.active {
    color: white;
    background: rgba(225,173,61,.16);
    box-shadow:
        inset 3px 0 0
        var(--gold);
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 10px 4px;
    border-top:
        1px solid
        rgba(255,255,255,.08);
}

.mini-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #8193ab;
}

.sidebar-user {
    margin: 5px 0 12px;
    font-size: 14px;
    font-weight: 700;
}

.logout {
    font-size: 12px;
    color: #9fb0c7;
}

.main {
    grid-column: 2;
    width: 100%;
    max-width: 1450px;
    padding: 38px 42px 70px;
}

.mobile-brand {
    display: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 5px 0 6px;
    font-size: 31px;
    letter-spacing: -.7px;
}

.page-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    color: #9a711f;
}

.btn {
    min-height: 42px;
    padding: 0 17px;
    border: none;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 750;
    font-size: 13px;
    cursor: pointer;
}

.btn.primary {
    background: var(--navy);
    color: white;
    box-shadow:
        0 6px 15px
        rgba(8,27,53,.12);
}

.btn.primary:hover {
    background: #102b50;
}

.btn.secondary {
    color: #28374b;
    background: #edf0f4;
}

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

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

.stat-card,
.panel,
.summary-card {
    background: var(--panel);
    border:
        1px solid
        rgba(225,229,236,.95);
    border-radius: var(--radius);
    box-shadow:
        0 6px 24px
        rgba(22,38,63,.035);
}

.stat-card {
    padding: 21px;
}

.stat-label,
.summary-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.stat-number,
.stat-money {
    margin-top: 9px;
    font-size: 28px;
    font-weight: 850;
    letter-spacing: -.6px;
}

.stat-money {
    font-size: 25px;
}

.stat-note {
    margin-top: 7px;
    color: #94a0b1;
    font-size: 11px;
}

.warning-card {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fffaf0
        );
}

.two-column {
    display: grid;
    grid-template-columns:
        minmax(0,1.4fr)
        minmax(300px,.75fr);
    gap: 20px;
    margin-bottom: 20px;
}

.panel {
    padding: 22px;
    margin-bottom: 20px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-head h2 {
    margin: 0;
    font-size: 16px;
}

.panel-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.panel-head > a {
    font-size: 12px;
    font-weight: 700;
    color: #8a6420;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 11px 10px;
    color: #8b96a7;
    font-size: 10px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--line);
}

td {
    padding: 14px 10px;
    border-bottom: 1px solid #edf0f4;
    font-size: 13px;
    vertical-align: middle;
}

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

.customer-link {
    font-weight: 750;
    color: #142e51;
}

.customer-link:hover {
    text-decoration: underline;
}

.small {
    margin-top: 3px;
    color: #8995a6;
    font-size: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
}

.pill.good {
    color: var(--good);
    background: var(--goodbg);
}

.pill.pending {
    color: var(--warn);
    background: var(--warnbg);
}

.activity-row,
.integration-row,
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.activity-row:last-child,
.integration-row:last-child,
.info-row:last-child {
    border-bottom: 0;
}

.activity-money {
    font-size: 13px;
    font-weight: 800;
}

.empty-state {
    padding: 28px 5px;
    text-align: center;
    color: #8c98aa;
    font-size: 13px;
}

.searchbar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.searchbar input {
    flex: 1;
}

.form-layout {
    max-width: 1000px;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field.span-2 {
    grid-column: span 2;
}

label {
    font-size: 11px;
    font-weight: 750;
    color: #4c5b70;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #dce2ea;
    border-radius: 10px;
    padding: 11px 12px;
    background: white;
    color: #162237;
    font: inherit;
    font-size: 13px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #9eafc5;
    box-shadow:
        0 0 0 3px
        rgba(16,40,72,.06);
}

textarea {
    resize: vertical;
}

.hint {
    color: #9aa5b5;
    font-size: 10px;
}

.section-title {
    margin-bottom: 17px;
    font-size: 14px;
    font-weight: 800;
}

.callout {
    margin: 16px 0;
    border-left: 3px solid var(--gold);
    border-radius: 9px;
    padding: 11px 13px;
    background: #fff9eb;
    color: #6e5a30;
    font-size: 11px;
    line-height: 1.55;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 5px 0 30px;
}

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

.summary-card {
    padding: 20px;
}

.summary-big {
    margin-top: 8px;
    font-size: 20px;
    font-weight: 800;
}

.info-row span {
    color: var(--muted);
    font-size: 12px;
}

.info-row strong {
    font-size: 12px;
}

.notes {
    color: #4e5d71;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.input-addon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-addon input {
    width: 100px;
}

.input-addon span {
    color: var(--muted);
    font-size: 11px;
}

.flash {
    margin-bottom: 18px;
    padding: 12px 15px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 650;
}

.flash.success {
    color: var(--good);
    background: var(--goodbg);
}

.flash.error {
    color: var(--danger);
    background: var(--dangerbg);
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 25px;
    background:
        radial-gradient(
            circle at 25% 20%,
            #183d69 0,
            #0a1d37 35%,
            #061426 100%
        );
}

.login-card {
    width: min(410px,100%);
    padding: 38px;
    border-radius: 22px;
    background: rgba(255,255,255,.98);
    box-shadow:
        0 25px 90px
        rgba(0,0,0,.28);
}

.login-card h1 {
    margin: 20px 0 3px;
    font-size: 27px;
    color: #0e2340;
}

.login-sub {
    margin: 0 0 26px;
    color: #8390a2;
    font-size: 12px;
}

.login-card label {
    display: block;
    margin: 14px 0 7px;
}

@media (max-width: 1050px) {

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

    .two-column {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 760px) {

    .shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: auto;
        height: auto;
        padding: 14px;
    }

    .brand {
        padding-bottom: 14px;
    }

    nav {
        display: grid;
        grid-template-columns:
            repeat(3,minmax(0,1fr));
    }

    nav a {
        text-align: center;
        padding: 10px 5px;
        font-size: 11px;
    }

    .sidebar-footer {
        display: none;
    }

    .main {
        padding: 24px 16px 55px;
    }

    .page-header {
        flex-direction: column;
    }

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

    .customer-summary {
        grid-template-columns: 1fr;
    }

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

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

    .panel {
        padding: 17px;
    }

}
