:root {
    --bg: #071016;
    --panel: #0e1b23;
    --panel-2: #142630;
    --line: rgba(148, 163, 184, .24);
    --text: #eff6ff;
    --muted: #91a6b8;
    --cyan: #22d3ee;
    --green: #34d399;
    --yellow: #fbbf24;
    --orange: #fb923c;
    --gold: #facc15;
    --red: #fb7185;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    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;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
    padding: 0 clamp(1rem, 4vw, 2rem);
    background: rgba(7, 16, 22, .92);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 850;
}

.topbar nav {
    display: flex;
    gap: .45rem;
}

.topbar nav a {
    padding: .5rem .75rem;
    border-radius: 8px;
    color: var(--muted);
}

.topbar nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .08);
}

.shell {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 2.4rem) 0 4rem;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.panel,
.metric-card,
.status-strip,
.login-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.panel,
.login-card {
    padding: clamp(1rem, 3vw, 1.35rem);
    margin-bottom: 1rem;
}

.login-card {
    width: min(440px, 100%);
}

.page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.page-head h1,
.login-card h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
    letter-spacing: 0;
}

.page-head p,
.login-card p,
.panel p {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 .4rem;
    color: var(--cyan);
    font-size: .8rem;
    font-weight: 850;
    text-transform: uppercase;
}

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

.alert {
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.alert-success {
    border-color: rgba(52, 211, 153, .45);
}

.alert-warning,
.alert-danger {
    border-color: rgba(251, 113, 133, .48);
}

.status-pill,
.bridge-panel .panel-head span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 96px;
    padding: .45rem .8rem;
    border-radius: 8px;
    font-weight: 850;
}

.status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.status-strip div {
    padding: 1rem;
    background: rgba(255, 255, 255, .025);
}

.status-strip small,
.metric-card small,
.data-list dt {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

.status-strip strong,
.metric-card strong {
    display: block;
    margin-top: .35rem;
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    overflow-wrap: anywhere;
}

.bridge-panel {
    border-left: 4px solid var(--muted);
}

.bridge-gray {
    border-color: rgba(148, 163, 184, .34);
    border-left-color: #94a3b8;
}

.bridge-green {
    border-left-color: var(--green);
}

.bridge-yellow {
    border-left-color: var(--yellow);
}

.bridge-orange {
    border-left-color: var(--orange);
}

.bridge-gold {
    border-left-color: var(--gold);
}

.bridge-gray.status-pill,
.bridge-gray .panel-head span {
    background: rgba(148, 163, 184, .14);
    color: #d8e3ee;
}

.bridge-green.status-pill,
.bridge-green .panel-head span {
    background: rgba(52, 211, 153, .14);
    color: #bbf7d0;
}

.bridge-yellow.status-pill,
.bridge-yellow .panel-head span {
    background: rgba(251, 191, 36, .15);
    color: #fde68a;
}

.bridge-orange.status-pill,
.bridge-orange .panel-head span {
    background: rgba(251, 146, 60, .16);
    color: #fed7aa;
}

.bridge-gold.status-pill,
.bridge-gold .panel-head span {
    background: rgba(250, 204, 21, .18);
    color: #fef08a;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.metric-grid-compact {
    margin: 1rem 0 0;
}

.metric-card {
    min-height: 132px;
    padding: 1rem;
}

.metric-card span {
    display: block;
    margin-top: .35rem;
    color: var(--muted);
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.bridge-chart-wrap {
    margin-top: 1rem;
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    overflow-x: auto;
}

.bridge-quote-chart {
    display: block;
    width: 100%;
    min-width: 760px;
    height: auto;
}

.bridge-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1rem;
    margin: .1rem 0 .7rem;
    color: #c7d8e5;
    font-size: .82rem;
    font-weight: 800;
}

.bridge-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.bridge-chart-legend i {
    width: .75rem;
    height: .75rem;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .08);
}

.bridge-quote-grid {
    stroke: rgba(199, 216, 229, .24);
    stroke-width: .8;
}

.bridge-quote-axis {
    fill: #c7d8e5;
    font-size: 15px;
    font-weight: 750;
}

.bridge-quote-x-label {
    text-anchor: middle;
}

.bridge-quote-area {
    fill: rgba(103, 232, 249, .22);
}

.bridge-quote-line {
    fill: none;
    stroke: #67e8f9;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bridge-quote-point {
    fill: var(--bg);
    stroke: #a5f3fc;
    stroke-width: 1.3;
}

.bridge-chart-empty {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
}

.data-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin: 1rem 0 0;
}

.data-list div {
    padding: .8rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.data-list dd {
    margin: .3rem 0 0;
    font-weight: 760;
    overflow-wrap: anywhere;
}

.form-stack,
.notification-form,
.password-form,
.inline-actions {
    display: grid;
    gap: .75rem;
}

.password-form {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
}

.notification-form {
    grid-template-columns: auto minmax(220px, 1fr) auto;
    align-items: end;
}

.inline-actions {
    grid-template-columns: minmax(240px, 1fr) auto;
}

label {
    display: grid;
    gap: .25rem;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 800;
}

.checkline {
    display: flex;
    gap: .5rem;
    align-items: center;
    min-height: 2.4rem;
}

input {
    width: 100%;
    min-height: 40px;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
}

button {
    min-height: 40px;
    padding: .55rem .85rem;
    border: 0;
    border-radius: 8px;
    background: var(--cyan);
    color: #06252e;
    font-weight: 850;
    cursor: pointer;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}

.file-grid a {
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    overflow-wrap: anywhere;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.split-grid h3 {
    margin: 0 0 .65rem;
    font-size: .98rem;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
}

th,
td {
    padding: .65rem .75rem;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
}

td {
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .page-head,
    .status-strip,
    .metric-grid,
    .data-list,
    .file-grid,
    .split-grid,
    .notification-form,
    .password-form,
    .inline-actions {
        grid-template-columns: 1fr;
    }

    .panel-head {
        display: grid;
        align-items: start;
    }
}
