:root {
    --ink: #1b1b3a;
    --paper: #fbfefb;
    --coral: #ff6b6b;
    --mint: #4ecdc4;
    --line: rgba(27, 27, 58, 0.13);
    --muted: #667085;
    --soft: #eef5f1;
    --shadow: 0 18px 50px rgba(27, 27, 58, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--ink);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(90deg, var(--ink) 0 282px, var(--paper) 282px),
        var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

button {
    cursor: pointer;
}

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

.filters {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px;
    color: var(--paper);
    background:
        linear-gradient(180deg, rgba(78, 205, 196, 0.12), transparent 36%),
        var(--ink);
}

.brand {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.brand img {
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.brand strong,
h1,
h2,
h3 {
    margin: 0;
    line-height: 1.02;
    letter-spacing: 0;
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand small {
    display: block;
    margin-top: 4px;
    color: rgba(251, 254, 251, 0.68);
    line-height: 1.3;
}

.overline {
    display: block;
    margin-bottom: 8px;
    color: color-mix(in srgb, currentColor 58%, transparent);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.filter-block,
.field,
.source {
    display: block;
    min-width: 0;
}

.segmented,
.view-tabs {
    display: grid;
    gap: 8px;
}

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

.seg,
.view-tab,
.ghost,
.primary {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 14px;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.seg,
.view-tab,
.ghost {
    color: inherit;
    background: rgba(251, 254, 251, 0.08);
    border-color: rgba(251, 254, 251, 0.12);
}

.seg:hover,
.view-tab:hover,
.ghost:hover,
.asset-card:hover,
.lane:hover,
.primary:hover {
    transform: translateY(-1px);
}

.seg.is-active,
.view-tab.is-active {
    color: var(--ink);
    background: var(--mint);
}

.field input,
.field select,
.request-form input,
.request-form select,
.request-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--paper);
    outline: none;
}

.filters .field input,
.filters .field select {
    color: var(--paper);
    background: rgba(251, 254, 251, 0.08);
    border-color: rgba(251, 254, 251, 0.16);
}

.filters .field input::placeholder {
    color: rgba(251, 254, 251, 0.52);
}

.view-tabs {
    margin-top: auto;
}

.source {
    padding: 14px;
    border: 1px solid rgba(251, 254, 251, 0.12);
    border-radius: 8px;
    background: rgba(251, 254, 251, 0.07);
}

.source strong {
    word-break: break-word;
}

.workspace {
    min-width: 0;
    padding: 24px;
}

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

h1 {
    max-width: 760px;
    font-size: clamp(30px, 4vw, 56px);
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 18px;
}

p {
    line-height: 1.45;
}

.toolbar,
.form-row,
.section-head {
    display: flex;
    gap: 10px;
    align-items: center;
}

.section-head {
    justify-content: space-between;
    margin-bottom: 14px;
}

.primary {
    color: var(--paper);
    background: var(--ink);
    border-color: var(--ink);
    font-weight: 800;
}

.primary.full {
    width: 100%;
}

.workspace .ghost {
    color: var(--ink);
    background: white;
    border-color: var(--line);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.metrics article {
    min-width: 0;
    padding: 18px;
    background: white;
}

.metrics strong {
    display: block;
    margin-bottom: 4px;
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1;
}

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

.lanes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.lane {
    position: relative;
    overflow: hidden;
    min-height: 86px;
    padding: 14px;
    text-align: left;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
}

.lane span,
.lane strong,
.lane small {
    position: relative;
    z-index: 1;
    display: block;
}

.lane strong {
    margin: 4px 0;
    font-size: 30px;
}

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

.lane i {
    position: absolute;
    inset: auto 0 0 0;
    height: 5px;
    background: var(--mint);
}

.pane {
    display: none;
}

.pane.is-visible {
    display: block;
    animation: rise 220ms ease both;
}

.portfolio {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

#registryPane {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
}

#registryPane.is-visible {
    display: grid;
}

.asset-card {
    display: block;
    width: 100%;
    min-height: 238px;
    padding: 18px;
    text-align: left;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
}

.asset-card.is-selected {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.16);
}

.asset-card.is-hot {
    border-color: rgba(255, 107, 107, 0.56);
}

.asset-code,
.stage {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin: 0 6px 14px 0;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.asset-code {
    color: var(--paper);
    background: var(--ink);
}

.stage {
    color: var(--ink);
    background: var(--mint);
}

.asset-card p {
    min-height: 48px;
    margin: 10px 0 16px;
    color: #394150;
}

.bar {
    overflow: hidden;
    height: 7px;
    border-radius: 999px;
    background: var(--soft);
}

.bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--mint), var(--coral));
}

dl {
    margin: 0;
}

.asset-card dl,
.finance-card dl,
.inspector dl {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.asset-card dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

dd {
    margin: 3px 0 0;
    min-width: 0;
    word-break: break-word;
}

.inspector {
    position: sticky;
    top: 24px;
    align-self: start;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.inspector p {
    color: #394150;
}

.progress-ring {
    position: relative;
    width: 128px;
    height: 128px;
    margin: 18px auto;
}

.progress-ring svg {
    width: 128px;
    height: 128px;
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke: var(--soft);
    stroke-width: 12;
}

.progress-ring #ringValue {
    stroke: var(--coral);
    stroke-linecap: round;
    stroke-dasharray: 302;
    stroke-dashoffset: 302;
    transition: stroke-dashoffset 260ms ease;
}

.progress-ring strong {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 26px;
}

.request-form {
    display: grid;
    gap: 14px;
    max-width: 760px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.request-form label {
    display: grid;
    gap: 7px;
    min-width: 0;
    font-weight: 800;
}

.request-form p,
.status-line {
    color: var(--muted);
}

.form-row {
    align-items: stretch;
}

.form-row label {
    flex: 1 1 0;
}

.timeline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.event,
.finance-card,
.table-row,
.empty {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.event p {
    margin: 8px 0;
    color: #394150;
}

.event time,
.table-row time {
    color: var(--muted);
    font-size: 13px;
}

.table {
    display: grid;
    gap: 8px;
}

.table-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 90px 130px 110px;
    gap: 12px;
    align-items: center;
}

.table-row em {
    font-style: normal;
    color: var(--coral);
    font-weight: 800;
}

.finance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.finance-card h3 {
    margin-bottom: 12px;
}

.finance-card dl {
    margin-bottom: 14px;
}

.finance-card dl div,
.inspector dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1120px) {
    body {
        background: var(--paper);
    }

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

    .filters {
        position: static;
        height: auto;
    }

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

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

    #registryPane.is-visible {
        grid-template-columns: 1fr;
    }

    .inspector {
        position: static;
    }

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

@media (max-width: 760px) {
    .workspace,
    .filters {
        padding: 16px;
    }

    .topbar,
    .toolbar,
    .form-row,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar {
        width: 100%;
    }

    .toolbar > *,
    .primary,
    .ghost {
        width: 100%;
    }

    .segmented,
    .view-tabs,
    .metrics,
    .lanes,
    .portfolio,
    .timeline,
    .finance-grid {
        grid-template-columns: 1fr;
    }

    .asset-card {
        min-height: 0;
    }

    .asset-card dl {
        grid-template-columns: 1fr;
    }

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