:root {
    color-scheme: light;
    --ink: #1f2933;
    --paper: #fbfbf2;
    --blue: #4c6fff;
    --orange: #f9703e;
    --line: rgba(31, 41, 51, 0.13);
    --muted: rgba(31, 41, 51, 0.62);
    --green: #158f65;
    --yellow: #b98300;
    --shadow: 0 18px 55px rgba(31, 41, 51, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        linear-gradient(90deg, rgba(31, 41, 51, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(31, 41, 51, 0.05) 1px, transparent 1px),
        var(--paper);
    background-size: 36px 36px;
    color: var(--ink);
    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: 236px minmax(0, 1fr);
    min-height: 100svh;
}

.rail {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 22px;
    background: var(--ink);
    color: var(--paper);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    font-weight: 800;
}

.brand img {
    width: 42px;
    height: 42px;
}

.nav {
    display: grid;
    gap: 6px;
}

.nav__item {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    background: transparent;
    color: rgba(251, 251, 242, 0.72);
    text-align: left;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav__item:hover,
.nav__item.is-active {
    background: rgba(251, 251, 242, 0.1);
    color: var(--paper);
    transform: translateX(2px);
}

.rail__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(251, 251, 242, 0.62);
    font-size: 13px;
}

.pulse {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--orange);
    box-shadow: 0 0 0 0 rgba(249, 112, 62, 0.55);
    animation: ping 1.8s infinite;
}

@keyframes ping {
    70% { box-shadow: 0 0 0 12px rgba(249, 112, 62, 0); }
    100% { box-shadow: 0 0 0 0 rgba(249, 112, 62, 0); }
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 312px;
    align-content: start;
    gap: 18px;
    padding: 22px;
}

.topbar,
.summaryRow,
.screen {
    grid-column: 1 / 2;
}

.topbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 13px;
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(29px, 4vw, 56px);
    line-height: 0.98;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 12px;
    font-size: 18px;
}

.topbar__actions {
    display: flex;
    align-items: end;
    gap: 10px;
}

.search {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.search input,
.requestForm input,
.requestForm textarea,
.requestForm select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.64);
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

.search input:focus,
.requestForm input:focus,
.requestForm textarea:focus,
.requestForm select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(76, 111, 255, 0.14);
}

.iconBtn,
.primaryBtn,
.secondaryBtn,
.segmented button {
    border: 0;
    border-radius: 8px;
    min-height: 40px;
}

.iconBtn {
    width: 42px;
    background: var(--ink);
    color: var(--paper);
    font-size: 20px;
}

.primaryBtn {
    padding: 0 16px;
    background: var(--orange);
    color: #fff;
    font-weight: 800;
}

.secondaryBtn {
    padding: 0 12px;
    background: rgba(76, 111, 255, 0.1);
    color: var(--blue);
    font-weight: 750;
}

.summaryRow {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--line);
    box-shadow: var(--shadow);
}

.summaryRow article {
    min-height: 112px;
    display: grid;
    align-content: center;
    padding: 16px;
    background: rgba(251, 251, 242, 0.94);
}

.summaryRow span,
.summaryRow small {
    color: var(--muted);
    font-size: 12px;
}

.summaryRow strong {
    margin: 4px 0;
    font-size: clamp(30px, 5vw, 50px);
    line-height: 0.94;
}

.summaryRow__risk strong {
    color: var(--orange);
}

.screen {
    display: none;
    animation: lift 220ms ease both;
}

.screen.is-active {
    display: block;
}

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

.radar {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 1fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.radar__graph {
    position: relative;
    min-height: 260px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 50%, rgba(76, 111, 255, 0.17), transparent 33%),
        var(--ink);
    overflow: hidden;
}

.radar__graph::before,
.radar__graph::after {
    content: "";
    position: absolute;
    inset: 28px;
    border: 1px solid rgba(251, 251, 242, 0.13);
    border-radius: 50%;
}

.radar__graph::after {
    inset: 62px;
}

.node {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 66px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid rgba(251, 251, 242, 0.28);
    border-radius: 8px;
    background: rgba(251, 251, 242, 0.1);
    color: var(--paper);
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.26);
}

.node--core {
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    background: var(--orange);
    font-size: 32px;
}

.node--a { left: 10%; top: 17%; }
.node--b { right: 9%; top: 21%; }
.node--c { left: 14%; bottom: 14%; }
.node--d { right: 11%; bottom: 17%; }

.link {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36%;
    height: 2px;
    background: linear-gradient(90deg, rgba(249, 112, 62, 0), rgba(249, 112, 62, 0.9));
    transform-origin: left center;
}

.link--one { transform: rotate(211deg); }
.link--two { transform: rotate(325deg); }
.link--three { transform: rotate(145deg); }
.link--four { transform: rotate(35deg); }

.radar__copy {
    display: grid;
    align-content: center;
    border-top: 3px solid var(--blue);
    padding: 22px 0;
}

.radar__copy h2 {
    max-width: 600px;
    font-size: clamp(26px, 4.2vw, 48px);
    line-height: 1;
}

.radar__copy p {
    max-width: 620px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.5;
}

.tablePanel,
.requestForm,
.flowList,
.actionFeed {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(251, 251, 242, 0.88);
}

.panelHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.panelHead h2 {
    margin-bottom: 0;
}

.segmented {
    display: flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(31, 41, 51, 0.04);
}

.segmented button {
    padding: 0 10px;
    background: transparent;
    color: var(--muted);
}

.segmented button.is-active {
    background: var(--ink);
    color: var(--paper);
}

.tableWrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.meter {
    display: inline-flex;
    width: 84px;
    height: 7px;
    margin-right: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(31, 41, 51, 0.12);
    vertical-align: middle;
}

.meter i {
    display: block;
    background: var(--blue);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
}

.badge--critical {
    background: rgba(249, 112, 62, 0.16);
    color: #b63210;
}

.badge--watch {
    background: rgba(185, 131, 0, 0.16);
    color: var(--yellow);
}

.badge--ok {
    background: rgba(21, 143, 101, 0.13);
    color: var(--green);
}

.split {
    display: grid;
    grid-template-columns: minmax(260px, 390px) minmax(0, 1fr);
    gap: 18px;
}

.requestForm,
.flowList {
    padding: 16px;
}

.requestForm {
    display: grid;
    gap: 13px;
}

.requestForm label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
}

.flowItem,
.docItem,
.financeItem,
.signal {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.flowItem:last-child,
.docItem:last-child,
.financeItem:last-child,
.signal:last-child {
    border-bottom: 0;
}

.flowItem strong,
.flowItem span,
.signal strong,
.signal span {
    display: block;
}

.flowItem p,
.flowItem small,
.docItem small,
.financeItem span,
.signal span,
.signal small,
.statusLine {
    color: var(--muted);
}

.documentGrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.docItem {
    min-height: 142px;
    display: grid;
    align-content: space-between;
    padding: 16px;
    background: var(--paper);
    border-bottom: 0;
}

.docItem--missing {
    box-shadow: inset 4px 0 0 var(--orange);
}

.docItem--pending {
    box-shadow: inset 4px 0 0 var(--yellow);
}

.docItem--signed {
    box-shadow: inset 4px 0 0 var(--green);
}

.financeList {
    padding: 0 16px;
}

.financeItem {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.financeItem .meter {
    grid-column: 1 / -1;
    width: 100%;
    margin-right: 0;
}

.money,
.financeTotal {
    font-weight: 850;
}

.actionFeed {
    position: sticky;
    top: 22px;
    grid-column: 2 / 3;
    grid-row: 1 / span 3;
    align-self: start;
    overflow: hidden;
}

#actionsList {
    padding: 0 16px;
}

.signal {
    position: relative;
}

.signal::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 14px;
    width: 5px;
    height: calc(100% - 28px);
    border-radius: 99px;
    background: var(--green);
}

.signal--watch::before {
    background: var(--yellow);
}

.signal--critical::before {
    background: var(--orange);
}

.empty {
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1120px) {
    .workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .actionFeed {
        position: static;
        grid-column: 1;
        grid-row: auto;
    }
}

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

    .rail {
        position: static;
        height: auto;
        gap: 14px;
        padding: 14px;
    }

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

    .nav__item {
        min-height: 38px;
        padding: 0 8px;
        text-align: center;
        font-size: 13px;
    }

    .workspace {
        padding: 14px;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar__actions {
        align-items: end;
    }

    .search {
        flex: 1;
    }

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

    .radar,
    .split,
    .documentGrid {
        grid-template-columns: 1fr;
    }

    .radar__graph {
        min-height: 230px;
    }
}

@media (max-width: 520px) {
    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .panelHead,
    .financeItem {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .segmented {
        overflow-x: auto;
    }
}

