:root {
    color-scheme: dark;
    --bg: #070b14;
    --bg-2: #0b1220;
    --panel: rgba(16, 24, 39, 0.86);
    --panel-strong: rgba(22, 33, 52, 0.96);
    --border: rgba(148, 163, 184, 0.18);
    --border-strong: rgba(148, 163, 184, 0.32);
    --text: #eef5ff;
    --muted: #96a3b8;
    --muted-2: #657287;
    --accent: #6ee7f9;
    --accent-2: #a78bfa;
    --good: #34d399;
    --warn: #fbbf24;
    --bad: #fb7185;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius: 24px;
    --radius-sm: 16px;
    --max-width: 1420px;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% -10%, rgba(103, 232, 249, 0.18), transparent 34rem),
        radial-gradient(circle at 88% 8%, rgba(167, 139, 250, 0.14), transparent 32rem),
        linear-gradient(140deg, #060914 0%, #0a1020 52%, #060914 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 78%);
}

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

.app-shell {
    width: min(100% - 32px, var(--max-width));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.hero__main,
.status-panel,
.section-card,
.metric-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(18, 27, 43, 0.92), rgba(10, 16, 28, 0.88));
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero__main {
    min-height: 300px;
    padding: 38px;
    border-radius: 32px;
}

.hero__main::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -90px;
    width: 300px;
    height: 300px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(110, 231, 249, 0.18), rgba(167, 139, 250, 0.12));
    filter: blur(4px);
}

.eyebrow,
.section-kicker {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.08;
}

h1 {
    max-width: 780px;
    font-size: clamp(3rem, 7vw, 6.6rem);
    letter-spacing: -0.075em;
}

h2 {
    font-size: clamp(1.2rem, 2vw, 1.85rem);
    letter-spacing: -0.035em;
}

.hero__text {
    max-width: 760px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.65;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.78);
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:hover {
    transform: translateY(-1px);
    border-color: rgba(110, 231, 249, 0.5);
    background: rgba(22, 33, 52, 0.95);
}

.button:active {
    transform: translateY(0);
}

.button--primary {
    color: #04111f;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-weight: 800;
}

.button--ghost {
    min-height: 36px;
    padding-inline: 14px;
    font-size: 0.9rem;
}

.status-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
    padding: 26px;
    border-radius: 32px;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.02rem;
}

.status-dot {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: var(--muted-2);
    box-shadow: 0 0 0 6px rgba(101, 114, 135, 0.14);
}

.status-dot--fresh {
    background: var(--good);
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.15), 0 0 24px rgba(52, 211, 153, 0.52);
}

.status-dot--loading {
    background: var(--warn);
    box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.14), 0 0 24px rgba(251, 191, 36, 0.42);
}

.status-dot--error {
    background: var(--bad);
    box-shadow: 0 0 0 6px rgba(251, 113, 133, 0.16), 0 0 24px rgba(251, 113, 133, 0.46);
}

.status-list {
    display: grid;
    gap: 14px;
    margin: 34px 0 0;
}

.status-list div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.status-list dt {
    color: var(--muted);
    font-size: 0.85rem;
}

.status-list dd {
    margin: 0;
    font-weight: 800;
    text-align: right;
}

.section-card {
    padding: 24px;
    border-radius: var(--radius);
}

.item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

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

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    min-height: 150px;
    padding: 20px;
    border-radius: var(--radius-sm);
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto -30px -44px auto;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(110, 231, 249, 0.07);
}

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

.metric-card strong {
    display: block;
    margin: 14px 0 4px;
    font-size: clamp(1.45rem, 2.8vw, 2.35rem);
    letter-spacing: -0.045em;
}

.metric-card small {
    color: var(--muted-2);
    font-weight: 700;
}

.metric-card--highlight {
    background: linear-gradient(180deg, rgba(23, 37, 62, 0.98), rgba(10, 18, 33, 0.95));
    border-color: rgba(110, 231, 249, 0.22);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(320px, 0.9fr);
    gap: 20px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.trend-card {
    display: flex;
    flex-direction: column;
}

.trend-text {
    margin: 18px 0 0;
    color: #dbeafe;
    font-size: 1.12rem;
    line-height: 1.72;
}

.trend-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 24px;
}

.trend-meta span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.64);
    font-size: 0.88rem;
    font-weight: 800;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}

th:first-child,
td:first-child {
    text-align: left;
}

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

td {
    color: #dbeafe;
}

tbody tr:hover td {
    background: rgba(148, 163, 184, 0.05);
}

@media (max-width: 1160px) {
    .hero,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .status-panel {
        min-height: auto;
    }

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

@media (max-width: 760px) {
    .app-shell {
        width: min(100% - 20px, var(--max-width));
        padding-top: 16px;
    }

    .hero__main,
    .status-panel,
    .section-card {
        border-radius: 20px;
        padding: 20px;
    }

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

    .item-card,
    .section-header {
        align-items: stretch;
        flex-direction: column;
    }

    h1 {
        font-size: clamp(2.5rem, 16vw, 4.2rem);
    }
}
