:root {
    background: #10131b;
    color: #e7eaf2;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    display: grid;
    grid-template-columns: 230px 1fr;
    margin: 0;
    min-height: 100vh;
}

aside {
    display: flex;
    flex-direction: column;
    gap: 40px;
    border-right: 1px solid #2c3242;
    background: #171b27;
    padding: 32px 24px;
}

aside nav {
    display: grid;
    gap: 10px;
}

a {
    border-radius: 7px;
    padding: 10px;
    text-decoration: none;
    color: #aeb6cb;
}

a:hover,
a:focus-visible {
    outline: 2px solid #7189ff;
    background: #262d3d;
    color: #fff;
}

.wordmark {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
}

.shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
}

.shell > header,
.shell > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2c3242;
    background: #141824;
    padding: 0 36px;
    min-height: 74px;
}

.shell > footer {
    border-top: 1px solid #2c3242;
    border-bottom: 0;
}

header p,
.page-heading p {
    margin: 0 0 5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #828ba2;
    font-size: 0.72rem;
}

button {
    border: 1px solid #394258;
    border-radius: 7px;
    background: #242b3b;
    padding: 0 14px;
    min-height: 38px;
    color: #dce1ef;
    font: inherit;
    cursor: pointer;
}

button:hover,
button:focus-visible {
    outline: 2px solid #7189ff;
    background: #313a50;
}

.history-controls,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

main {
    outline: none;
    padding: 36px;
}

.page-heading {
    display: flex;
    gap: 24px;
    align-items: end;
    justify-content: space-between;
}

.page-heading > div > span {
    display: block;
    margin-top: 7px;
    color: #929bb0;
}

.compatibility-controls {
    position: relative;
}

.compatibility-controls summary {
    border: 1px solid #394258;
    border-radius: 7px;
    background: #242b3b;
    padding: 10px 14px;
    color: #dce1ef;
    cursor: pointer;
}

.compatibility-controls[open] .actions {
    display: grid;
    position: absolute;
    right: 0;
    z-index: 2;
    margin-top: 8px;
    border: 1px solid #394258;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgb(0 0 0 / 35%);
    background: #171b27;
    padding: 10px;
    width: 210px;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.operations-visual {
    position: relative;
    margin: 32px 0 16px;
    border: 1px solid #2d3446;
    border-radius: 12px;
    background: #181d2a;
    overflow: hidden;
}

.operations-visual img {
    display: block;
    opacity: 0.78;
    filter: saturate(0.65) contrast(1.08);
    width: 100%;
    height: clamp(220px, 32vw, 400px);
    object-fit: cover;
}

.operations-visual figcaption {
    position: absolute;
    right: 14px;
    bottom: 14px;
    border-radius: 6px;
    background: rgb(10 13 20 / 82%);
    padding: 8px 10px;
    color: #c7cede;
    font-size: 0.72rem;
}

.operations-visual figcaption a {
    padding: 0;
    text-decoration: underline;
    color: inherit;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.metric,
.table-card {
    border: 1px solid #2d3446;
    border-radius: 12px;
    background: #181d2a;
    padding: 24px;
}

.section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 22px;
}

.section-heading p {
    margin: 0 0 5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #828ba2;
    font-size: 0.72rem;
}

.section-heading h2 {
    margin: 0;
}

.section-heading > span {
    border-radius: 999px;
    background: #28324c;
    padding: 7px 11px;
    color: #aebdf2;
    font-size: 0.76rem;
    font-weight: 700;
}

.metric span,
.metric small {
    display: block;
    color: #8f98ad;
}

.metric strong {
    display: block;
    margin: 15px 0 8px;
    font-size: 2rem;
}

.rows > div {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    border-top: 1px solid #2d3446;
    padding: 16px 0;
}

.rows time {
    color: #8f98ad;
}

.order-workspace {
    margin-top: 32px;
}

.order-search {
    display: grid;
    gap: 8px;
    margin-bottom: 26px;
}

.order-search label {
    font-size: 0.82rem;
    font-weight: 700;
}

.order-search > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.order-search input {
    outline: none;
    border: 1px solid #394258;
    border-radius: 7px 0 0 7px;
    background: #101521;
    padding: 0 14px;
    min-height: 44px;
    color: #eef1f8;
    font: inherit;
}

.order-search input:focus {
    border-color: #7189ff;
    box-shadow: 0 0 0 2px #7189ff;
}

.order-search button {
    border-radius: 0 7px 7px 0;
}

.order-search output {
    color: #929bb0;
    font-size: 0.82rem;
}

.order-table {
    border: 1px solid #2d3446;
    border-radius: 9px;
    overflow: hidden;
}

.order-row {
    display: grid;
    grid-template-columns: 0.8fr 1.6fr 0.9fr 0.7fr;
    gap: 18px;
    align-items: center;
    border-top: 1px solid #2d3446;
    padding: 16px 18px;
}

.order-row:first-child {
    border-top: 0;
}

.order-row > span:last-child {
    text-align: right;
}

.order-row small {
    display: block;
    margin-top: 4px;
    color: #828ba2;
}

.order-header {
    background: #111622;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #828ba2;
    font-size: 0.72rem;
    font-weight: 800;
}

.order-status {
    justify-self: start;
    border-radius: 999px;
    background: #28324c;
    padding: 6px 9px;
    color: #b8c7ff;
    font-size: 0.75rem;
    font-weight: 700;
}

.order-status[data-status='delivered'] {
    background: #183b33;
    color: #8ee1c5;
}

.order-status[data-status='exception'] {
    background: #493027;
    color: #ffb59b;
}

.order-status[data-status='awaiting-stock'] {
    background: #4a4022;
    color: #ffe19a;
}

.order-status[data-status='processing'] {
    background: #30304f;
    color: #c9c3ff;
}

.empty-state {
    margin: 0;
    padding: 36px 18px;
    text-align: center;
    color: #929bb0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 32px;
}

.team-grid article {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    border: 1px solid #2d3446;
    border-radius: 12px;
    background: #181d2a;
    padding: 22px;
}

.team-grid h2,
.team-grid p {
    margin: 0;
}

.team-grid p {
    margin: 4px 0 7px;
    color: #aeb6cb;
}

.team-grid small {
    color: #7fcbaf;
}

.avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #7189ff, #a873e8);
    width: 48px;
    height: 48px;
    color: #fff;
    font-weight: 800;
}

.message-composer {
    margin-top: 18px;
    border: 1px solid #3d4660;
    border-radius: 12px;
    background: #181d2a;
    padding: 24px;
}

.message-composer h2,
.message-composer p {
    margin: 0;
}

.message-composer > p {
    margin-top: 6px;
    color: #929bb0;
}

.message-form {
    display: grid;
    gap: 9px;
    margin-top: 20px;
}

.message-form label {
    font-size: 0.82rem;
    font-weight: 700;
}

.message-form textarea {
    outline: none;
    border: 1px solid #394258;
    border-radius: 7px;
    background: #101521;
    padding: 12px 14px;
    min-height: 110px;
    resize: vertical;
    color: #eef1f8;
    font: inherit;
}

.message-form textarea:focus {
    border-color: #7189ff;
    box-shadow: 0 0 0 2px #7189ff;
}

.message-actions {
    display: flex;
    gap: 8px;
    justify-content: end;
}

.message-actions button:last-child {
    background: transparent;
}

.message-confirmation {
    border-radius: 8px;
    background: #183b33;
    padding: 18px;
    color: #a7eed6;
}

.message-confirmation p {
    margin-top: 7px;
    color: #8acdb7;
}

.activity-feed {
    margin-top: 32px;
}

.activity-feed ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-feed li {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 22px;
    border-top: 1px solid #2d3446;
    padding: 20px 0;
}

.activity-feed time,
.activity-feed p {
    color: #8f98ad;
}

.activity-feed p {
    margin: 6px 0 0;
}

.large-dom {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 4px;
}

.large-dom div {
    border: 1px solid #30384c;
    background: #1b2130;
    padding: 12px;
    color: #b8c2dc;
}

@media (width <= 760px) {
    body {
        display: block;
    }

    aside {
        position: static;
    }

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

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

    .order-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .order-header {
        display: none;
    }

    .order-row > span:last-child {
        text-align: left;
    }

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