:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-alt: #eef3f1;
    --text: #202326;
    --muted: #697179;
    --line: #d9dee3;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --ink: #172033;
}

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

a {
    color: var(--accent-dark);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 2rem;
    font-weight: 720;
}

h2 {
    margin-bottom: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

button,
input {
    font: inherit;
}

input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    background: #fff;
    color: var(--text);
}

label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 650;
}

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

th,
td {
    padding: 0.85rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

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

.page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
    background: var(--ink);
    color: #fff;
}

main {
    min-width: 0;
}

.top-row {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
}

.content {
    width: min(1180px, calc(100vw - 320px));
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.navbar-brand {
    color: #fff;
    font-weight: 760;
    text-decoration: none;
}

.nav-scrollable {
    padding: 1rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 42px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
}

.nav-link.active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-glyph {
    width: 1rem;
    color: #7dd3c7;
    font-size: 0.72rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.eyebrow {
    margin-bottom: 0.25rem;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 760;
    letter-spacing: 0;
    text-transform: uppercase;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(23, 32, 51, 0.05);
}

.metric-card {
    min-height: 136px;
    display: grid;
    align-content: start;
    gap: 0.45rem;
    padding: 1rem;
}

.metric-card span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.metric-card strong {
    font-size: 1.45rem;
    line-height: 1.15;
}

.metric-card small,
.muted {
    color: var(--muted);
}

.field-hint {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.35;
}

.operation-status {
    margin: .75rem 0;
    color: var(--text);
    font-weight: 600;
}

.asset-status {
    display: grid;
    gap: .35rem;
    margin: 1rem 0;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: var(--surface-alt);
}

.draft-identifiers {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin: .75rem 0;
    color: var(--muted);
    font-size: .9rem;
}

.upload-import {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-alt);
}

.upload-import h3,
.upload-import p,
.upload-import ul {
    margin: 0;
}

.upload-import code {
    color: var(--accent-dark);
}

.upload-progress {
    width: 100%;
    height: 0.9rem;
    accent-color: var(--accent);
}

.panel {
    padding: 1rem;
    margin-bottom: 1rem;
}

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

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-grid {
    display: grid;
    gap: 0.85rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.48rem 0.8rem;
    background: #fff;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.button:hover {
    filter: brightness(0.98);
}

.table-wrap {
    overflow-x: auto;
}

.activity-list {
    display: grid;
    gap: 0.7rem;
}

.activity-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 170px;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-alt);
}

.activity-row span,
.activity-row small {
    color: var(--muted);
}

.account-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.account-details span,
.provider-card {
    display: grid;
    gap: .3rem;
}

.account-details strong,
.provider-card small {
    color: var(--muted);
}

.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.provider-card {
    border: 1px solid var(--border);
    border-radius: .5rem;
    padding: 1rem;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #d8dee6;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 700;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

@media (max-width: 850px) {
    .page {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .content {
        width: auto;
        padding: 1rem;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .activity-row {
        grid-template-columns: 1fr;
    }
}
