:root {
    --ink: #0b1020;
    --ink-2: #12192b;
    --ink-3: #1a2338;
    --surface: #ffffff;
    --canvas: #f3f5f8;
    --canvas-2: #e9edf3;
    --line: #e2e7ee;
    --text: #141b2d;
    --muted: #6d7689;
    --soft: #929aab;
    --coral: #ff5c35;
    --coral-soft: #fff0eb;
    --lime: #dfff68;
    --lime-deep: #bdd842;
    --lime-soft: #f5ffd6;
    --blue: #68b9ff;
    --blue-soft: #e8f4ff;
    --danger: #dc3e31;
    --sidebar: 16.75rem;
    --topbar: 4.75rem;
    --radius-sm: 0.75rem;
    --radius: 1.1rem;
    --radius-lg: 1.5rem;
    --shadow: 0 16px 46px rgba(14, 23, 43, 0.07);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--canvas);
    font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.has-overlay {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

button,
a,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    display: block;
}

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

h1,
h2,
h3 {
    text-wrap: balance;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    z-index: 400;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.75rem 1rem;
    color: #fff;
    background: var(--ink);
    border-radius: 0.75rem;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 120;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
        radial-gradient(circle at 15% 0%, rgba(255, 92, 53, 0.15), transparent 24%),
        var(--ink);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-head {
    min-height: var(--topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    width: 2.5rem;
    aspect-ratio: 1;
    position: relative;
    flex: 0 0 auto;
    background: var(--coral);
    border-radius: 0.82rem;
    transform: rotate(-5deg);
    box-shadow: 0 10px 22px rgba(255, 92, 53, 0.25);
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    background: var(--ink);
    border-radius: 999px;
    transform: translate(-50%, -50%);
}

.brand-mark::before {
    width: 1.25rem;
    height: 0.32rem;
}

.brand-mark::after {
    width: 0.32rem;
    height: 1.25rem;
}

.brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-copy strong {
    font-size: 1.28rem;
    font-weight: 850;
    letter-spacing: -0.055em;
}

.brand-copy strong span {
    color: var(--coral);
}

.brand-copy small {
    margin-top: 0.27rem;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.environment-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 1.1rem 0.2rem;
    padding: 0.65rem 0.75rem;
    color: rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    font-size: 0.72rem;
    line-height: 1.3;
}

.environment-chip i,
.live-chip i {
    width: 0.5rem;
    aspect-ratio: 1;
    flex: 0 0 auto;
    background: var(--lime);
    border-radius: 50%;
    box-shadow: 0 0 0 0.25rem rgba(223, 255, 104, 0.1);
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 0.7rem 0.85rem 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.nav-label {
    margin: 1.15rem 0 0.45rem;
    padding-inline: 0.7rem;
    color: rgba(255, 255, 255, 0.32);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-item {
    min-height: 2.85rem;
    display: grid;
    grid-template-columns: 1.2rem 1fr auto;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.18rem;
    padding: 0.65rem 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 0.78rem;
    font-size: 0.88rem;
    font-weight: 650;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item svg {
    width: 1.18rem;
    height: 1.18rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item:hover,
.nav-item:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.nav-item.is-active {
    color: var(--ink);
    background: var(--coral);
    box-shadow: 0 10px 24px rgba(255, 92, 53, 0.17);
}

.nav-item b {
    min-width: 1.55rem;
    padding: 0.14rem 0.38rem;
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 0.67rem;
    text-align: center;
}

.nav-item.is-active b {
    color: var(--ink);
    background: rgba(11, 16, 32, 0.12);
}

.nav-item .badge-coral {
    color: #fff;
    background: var(--coral);
}

.nav-item .badge-lime {
    color: var(--ink);
    background: var(--lime);
}

.sidebar-footer {
    padding: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.operator-card,
.topbar-profile {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
}

.operator-card {
    padding: 0.55rem;
    color: #fff;
    border-radius: 0.8rem;
    transition: background 160ms ease;
}

.operator-card:hover,
.operator-card:focus-visible {
    background: rgba(255, 255, 255, 0.07);
}

.operator-card > span:nth-child(2),
.profile-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.operator-card strong,
.topbar-profile strong {
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.operator-card small,
.topbar-profile small {
    color: rgba(255, 255, 255, 0.43);
    font-size: 0.68rem;
}

.operator-card > svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.avatar {
    width: 2.15rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--ink);
    background: var(--lime);
    border-radius: 0.72rem;
    font-size: 0.7rem;
    font-weight: 850;
}

.sidebar-close,
.mobile-menu,
.mobile-search-button,
.sidebar-overlay {
    display: none;
}

.workspace {
    min-width: 0;
    margin-left: var(--sidebar);
}

.topbar {
    height: var(--topbar);
    position: sticky;
    z-index: 100;
    top: 0;
    display: grid;
    grid-template-columns: minmax(13rem, 1fr) minmax(20rem, 34rem) auto;
    align-items: center;
    gap: 1.25rem;
    padding: 0 1.75rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.breadcrumb i {
    color: #c5cad4;
    font-style: normal;
}

.breadcrumb strong {
    color: var(--text);
}

.global-search,
.table-search,
.table-filter {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.global-search {
    height: 2.75rem;
    gap: 0.65rem;
    padding: 0 0.55rem 0 0.85rem;
    background: var(--canvas);
    border-radius: 0.8rem;
}

.global-search:focus-within,
.table-search:focus-within,
.table-filter:focus-within {
    background: #fff;
    border-color: rgba(255, 92, 53, 0.7);
    box-shadow: 0 0 0 0.2rem rgba(255, 92, 53, 0.08);
}

.global-search svg,
.table-search svg,
.table-filter svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.global-search input,
.table-search input {
    min-width: 0;
    flex: 1;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 0.82rem;
}

.global-search input::placeholder,
.table-search input::placeholder {
    color: var(--soft);
}

.global-search kbd {
    padding: 0.23rem 0.42rem;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 0.38rem;
    font-family: inherit;
    font-size: 0.65rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.icon-button {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, border 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
    color: var(--text);
    background: var(--canvas);
    border-color: #cfd5df;
    transform: translateY(-1px);
}

.icon-button svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-button.sidebar-close,
.icon-button.mobile-menu,
.icon-button.mobile-search-button {
    display: none;
}

.notification-button {
    position: relative;
}

.notification-button > span {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    min-width: 1.1rem;
    height: 1.1rem;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--coral);
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
}

.topbar-profile {
    width: auto;
    min-width: 10.5rem;
    padding-left: 0.25rem;
}

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

.popover {
    position: fixed;
    z-index: 180;
    top: calc(var(--topbar) - 0.35rem);
    right: 1.75rem;
    width: min(23rem, calc(100vw - 1.5rem));
    padding: 0.55rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 22px 65px rgba(13, 22, 41, 0.17);
}

.popover[hidden] {
    display: none;
}

.popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.65rem 0.8rem;
    border-bottom: 1px solid var(--line);
}

.popover-head strong {
    font-size: 0.9rem;
}

.popover-head span {
    color: var(--coral);
    font-size: 0.72rem;
    font-weight: 750;
}

.notification-popover > button,
.profile-popover > button {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem 0.65rem;
    background: transparent;
    border: 0;
    border-radius: 0.7rem;
    cursor: pointer;
    text-align: left;
}

.notification-popover > button:hover,
.notification-popover > button:focus-visible,
.profile-popover > button:hover,
.profile-popover > button:focus-visible {
    background: var(--canvas);
}

.notification-popover button > span {
    display: flex;
    flex-direction: column;
}

.notification-popover strong {
    font-size: 0.79rem;
}

.notification-popover small {
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.7rem;
}

.notice-dot {
    width: 0.55rem;
    aspect-ratio: 1;
    margin-top: 0.32rem;
    flex: 0 0 auto;
    border-radius: 50%;
}

.notice-dot-coral { background: var(--coral); }
.notice-dot-lime { background: var(--lime-deep); }
.notice-dot-blue { background: var(--blue); }

.profile-popover {
    width: 13rem;
}

.profile-popover > button {
    font-size: 0.78rem;
}

.profile-popover hr {
    height: 1px;
    margin: 0.3rem 0;
    background: var(--line);
    border: 0;
}

.main-content {
    max-width: 105rem;
    margin-inline: auto;
    padding: 2rem;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.6rem;
}

.page-kicker,
.panel-kicker {
    margin-bottom: 0.38rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.3;
    text-transform: uppercase;
}

.page-kicker {
    display: flex;
    align-items: center;
    gap: 0.48rem;
}

.page-kicker span {
    width: 0.45rem;
    aspect-ratio: 1;
    background: var(--coral);
    border-radius: 50%;
    box-shadow: 0 0 0 0.23rem rgba(255, 92, 53, 0.1);
}

.page-head h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1;
}

.page-head p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.page-actions,
.table-tools {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.scope-select select {
    min-height: 2.75rem;
    padding: 0.65rem 2.2rem 0.65rem 0.85rem;
    color: var(--text);
    background-color: #fff;
    border: 1px solid var(--line);
    border-radius: 0.78rem;
    outline: 0;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 650;
}

.button {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.65rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.78rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 750;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
}

.button-primary {
    color: var(--ink);
    background: var(--coral);
    box-shadow: 0 8px 22px rgba(255, 92, 53, 0.18);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: var(--lime);
    box-shadow: 0 9px 24px rgba(223, 255, 104, 0.2);
}

.button-primary > span {
    min-width: 1.35rem;
    padding: 0.1rem 0.3rem;
    background: rgba(11, 16, 32, 0.12);
    border-radius: 999px;
    font-size: 0.68rem;
}

.button-secondary {
    color: var(--text);
    background: #fff;
    border-color: var(--line);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.metric-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(15, 25, 45, 0.025);
}

.metric-card {
    min-height: 10.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.15rem;
    overflow: hidden;
}

.metric-dark {
    position: relative;
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
}

.metric-dark::after {
    content: "";
    position: absolute;
    right: -3rem;
    bottom: -4.2rem;
    width: 9rem;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.metric-head,
.metric-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.metric-head > span:first-child {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.metric-dark .metric-head > span:first-child {
    color: rgba(255, 255, 255, 0.6);
}

.metric-icon {
    width: 2.2rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--coral);
    border-radius: 0.7rem;
}

.metric-icon svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.metric-icon-lime { background: var(--lime-soft); }
.metric-icon-coral { background: var(--coral-soft); color: var(--coral); }
.metric-icon-blue { background: var(--blue-soft); color: #2788d6; }

.metric-card > strong {
    margin: 0.4rem 0 0.2rem;
    font-size: 2.35rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
}

.metric-foot {
    position: relative;
    z-index: 1;
}

.metric-foot small {
    color: var(--soft);
    font-size: 0.66rem;
}

.metric-dark .metric-foot small {
    color: rgba(255, 255, 255, 0.42);
}

.trend,
.status-inline {
    font-size: 0.67rem;
    font-weight: 750;
}

.trend-up {
    color: var(--lime);
}

.trend-down {
    color: var(--coral);
}

.status-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    color: #5f7414;
}

.status-inline i {
    width: 0.45rem;
    aspect-ratio: 1;
    background: var(--lime-deep);
    border-radius: 50%;
}

.status-inline-blue {
    color: #277dbc;
}

.status-inline-blue i {
    background: var(--blue);
}

.spark-bars {
    width: 5.2rem;
    height: 2.1rem;
    position: absolute;
    right: 1rem;
    bottom: 2.4rem;
    display: flex;
    align-items: flex-end;
    gap: 0.22rem;
    opacity: 0.34;
}

.spark-bars i {
    flex: 1;
    background: var(--coral);
    border-radius: 0.15rem 0.15rem 0 0;
}

.dashboard-grid {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.dashboard-grid-top {
    grid-template-columns: minmax(0, 1.65fr) minmax(18.5rem, 0.75fr);
}

.dashboard-grid-middle {
    grid-template-columns: minmax(0, 1.35fr) minmax(19rem, 0.65fr);
}

.panel {
    min-width: 0;
    padding: 1.25rem;
}

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

.panel-head h2 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.025em;
}

.panel-kicker {
    color: var(--soft);
}

.segmented-control {
    display: flex;
    padding: 0.18rem;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 0.7rem;
}

.segmented-control button {
    padding: 0.42rem 0.65rem;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
}

.segmented-control button:hover,
.segmented-control button:focus-visible {
    color: var(--text);
}

.segmented-control button.is-active {
    color: var(--text);
    background: #fff;
    box-shadow: 0 3px 10px rgba(12, 21, 40, 0.08);
}

.chart-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.chart-summary > div {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chart-summary > div:first-child {
    margin-right: auto;
}

.chart-summary > div:first-child {
    align-items: baseline;
}

.chart-summary strong {
    font-size: 1.55rem;
    letter-spacing: -0.04em;
}

.chart-summary span {
    color: var(--muted);
    font-size: 0.67rem;
}

.legend-dot,
.donut-legend i {
    width: 0.5rem;
    aspect-ratio: 1;
    display: inline-block;
    border-radius: 50%;
}

.legend-coral { background: var(--coral); }
.legend-lime { background: var(--lime-deep); }
.legend-blue { background: var(--blue); }
.legend-ink { background: var(--ink); }

.chart-wrap {
    min-height: 15.5rem;
    position: relative;
    padding: 0.2rem 0 1.55rem 2.1rem;
}

.line-chart {
    width: 100%;
    height: 14rem;
    overflow: visible;
}

.chart-grid-lines line {
    stroke: var(--line);
    stroke-width: 1;
    stroke-dasharray: 4 5;
}

.area {
    stroke: none;
}

.area-orders { fill: url(#orders-fill); }
.area-deliveries { fill: url(#deliveries-fill); }

.line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.line-orders { stroke: var(--coral); }
.line-deliveries { stroke: var(--lime-deep); }

.chart-point {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 3;
}

.chart-y-axis {
    position: absolute;
    top: 0.45rem;
    bottom: 1.9rem;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--soft);
    font-size: 0.6rem;
}

.chart-x-axis {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 2.1rem;
    display: flex;
    justify-content: space-between;
    color: var(--soft);
    font-size: 0.6rem;
}

.chart-tooltip {
    position: absolute;
    z-index: 3;
    min-width: 7rem;
    display: flex;
    flex-direction: column;
    padding: 0.55rem 0.65rem;
    color: #fff;
    background: var(--ink);
    border-radius: 0.55rem;
    box-shadow: 0 10px 28px rgba(11, 16, 32, 0.2);
    pointer-events: none;
    transform: translate(-50%, -115%);
}

.chart-tooltip strong {
    font-size: 0.7rem;
}

.chart-tooltip span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.62rem;
}

.live-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.55rem;
    color: #607514;
    background: var(--lime-soft);
    border: 1px solid rgba(189, 216, 66, 0.35);
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 750;
}

.live-chip i {
    box-shadow: none;
}

.health-score {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0 1rem;
}

.score-ring {
    width: 6rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: conic-gradient(var(--coral) calc(var(--score) * 1%), var(--canvas-2) 0);
    border-radius: 50%;
}

.score-ring::before {
    content: "";
    grid-area: 1 / 1;
    width: 4.7rem;
    aspect-ratio: 1;
    background: #fff;
    border-radius: 50%;
}

.score-ring span {
    grid-area: 1 / 1;
    position: relative;
    display: flex;
    align-items: baseline;
}

.score-ring strong {
    font-size: 1.55rem;
    letter-spacing: -0.05em;
}

.score-ring small {
    color: var(--soft);
    font-size: 0.6rem;
}

.health-score > div:last-child strong {
    font-size: 0.88rem;
}

.health-score p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.health-list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    list-style: none;
}

.health-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem 0.8rem;
    font-size: 0.72rem;
}

.health-list li > span {
    color: var(--muted);
}

.health-list li > strong {
    font-size: 0.72rem;
}

.health-list li > div {
    height: 0.32rem;
    grid-column: 1 / -1;
    overflow: hidden;
    background: var(--canvas-2);
    border-radius: 999px;
}

.health-list li i {
    height: 100%;
    display: block;
    background: linear-gradient(90deg, var(--coral), var(--lime-deep));
    border-radius: inherit;
}

.text-button {
    padding: 0.85rem 0 0;
    color: var(--text);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 750;
}

.text-button:hover,
.text-button:focus-visible {
    color: var(--coral);
}

.queue-list {
    display: grid;
}

.queue-item {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    cursor: pointer;
    text-align: left;
}

.queue-item:first-child {
    border-top: 0;
}

.queue-item:hover .queue-copy strong,
.queue-item:focus-visible .queue-copy strong {
    color: var(--coral);
}

.queue-icon {
    width: 2.55rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--canvas);
    border-radius: 0.78rem;
}

.queue-icon svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.queue-icon-coral { color: var(--coral); background: var(--coral-soft); }
.queue-icon-lime { color: #637b12; background: var(--lime-soft); }
.queue-icon-blue { color: #277dbc; background: var(--blue-soft); }

.queue-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.queue-copy strong {
    font-size: 0.78rem;
    transition: color 160ms ease;
}

.queue-copy small,
.queue-meta small {
    margin-top: 0.18rem;
    color: var(--soft);
    font-size: 0.66rem;
}

.queue-meta {
    min-width: 4.8rem;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
}

.queue-meta b {
    padding: 0.22rem 0.42rem;
    color: var(--danger);
    background: var(--coral-soft);
    border-radius: 999px;
    font-size: 0.6rem;
}

.queue-meta .tag-dark { color: var(--text); background: var(--canvas-2); }
.queue-meta .tag-blue { color: #277dbc; background: var(--blue-soft); }
.queue-meta .tag-neutral { color: var(--muted); background: var(--canvas); }

.donut-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1.4rem;
    padding: 0.55rem 0 1rem;
}

.donut {
    width: 9rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--coral) 0 38%, var(--lime-deep) 38% 81%, var(--blue) 81% 93%, var(--ink) 93% 100%);
    border-radius: 50%;
    transform: rotate(-18deg);
}

.donut::before {
    content: "";
    width: 6.4rem;
    aspect-ratio: 1;
    grid-area: 1 / 1;
    background: #fff;
    border-radius: 50%;
}

.donut > div {
    grid-area: 1 / 1;
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: column;
    line-height: 1.1;
    transform: rotate(18deg);
}

.donut strong {
    font-size: 1.55rem;
    letter-spacing: -0.05em;
}

.donut span {
    color: var(--soft);
    font-size: 0.66rem;
}

.donut-legend {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.donut-legend li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.7rem;
}

.donut-legend strong {
    color: var(--text);
    font-size: 0.72rem;
}

.distribution-note {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    background: var(--canvas);
    border-radius: 0.72rem;
    font-size: 0.7rem;
}

.distribution-note svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.8;
}

.distribution-note span {
    color: var(--muted);
}

.table-panel {
    margin-bottom: 1rem;
    padding: 0;
    overflow: hidden;
}

.table-panel-head {
    align-items: center;
    margin: 0;
    padding: 1.2rem 1.25rem;
}

.table-search {
    width: 13rem;
    min-height: 2.45rem;
    gap: 0.5rem;
    padding: 0 0.7rem;
    background: var(--canvas);
    border-radius: 0.7rem;
}

.table-filter {
    min-height: 2.45rem;
    gap: 0.45rem;
    padding-left: 0.7rem;
    background: var(--canvas);
    border-radius: 0.7rem;
}

.table-filter select {
    height: 100%;
    padding: 0 1.8rem 0 0;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
    cursor: pointer;
    font-size: 0.7rem;
}

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

table {
    width: 100%;
    min-width: 52rem;
    border-collapse: collapse;
}

th,
td {
    padding: 0.82rem 1.25rem;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--soft);
    background: var(--canvas);
    border-block: 1px solid var(--line);
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

td {
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    font-size: 0.72rem;
}

tbody tr {
    transition: background 160ms ease;
}

tbody tr:hover {
    background: #fafbfc;
}

td > strong,
td > small {
    display: block;
}

td > strong {
    color: var(--text);
    font-size: 0.72rem;
}

td > small {
    margin-top: 0.12rem;
    color: var(--soft);
    font-size: 0.64rem;
}

.business-cell {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.business-cell > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.business-cell strong {
    color: var(--text);
    font-size: 0.75rem;
}

.business-cell small {
    color: var(--soft);
    font-size: 0.62rem;
}

.business-logo {
    width: 2.2rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--ink);
    border-radius: 0.68rem;
    font-size: 0.65rem;
    font-style: normal;
    font-weight: 850;
}

.logo-coral { background: var(--coral); }
.logo-lime { background: var(--lime); }
.logo-blue { background: var(--blue); }
.logo-ink { color: #fff; background: var(--ink); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    font-size: 0.63rem;
    font-weight: 750;
    white-space: nowrap;
}

.status-badge i {
    width: 0.42rem;
    aspect-ratio: 1;
    background: currentColor;
    border-radius: 50%;
}

.status-active { color: #5f7514; background: var(--lime-soft); }
.status-review { color: #297ebd; background: var(--blue-soft); }
.status-attention { color: var(--danger); background: var(--coral-soft); }

.row-action {
    width: 2.1rem;
    height: 2.1rem;
}

.table-empty {
    min-height: 14rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--muted);
    text-align: center;
}

.table-empty[hidden] {
    display: none;
}

.table-empty svg {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.65rem;
    fill: none;
    stroke: var(--soft);
    stroke-width: 1.5;
}

.table-empty strong {
    color: var(--text);
    font-size: 0.8rem;
}

.table-empty span {
    margin-top: 0.25rem;
    font-size: 0.68rem;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    color: var(--soft);
    font-size: 0.67rem;
}

.table-footer button {
    padding: 0;
    color: var(--text);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 750;
}

.table-footer button:hover,
.table-footer button:focus-visible {
    color: var(--coral);
}

.detail-drawer {
    width: min(31rem, calc(100% - 1rem));
    max-width: none;
    height: 100dvh;
    max-height: none;
    position: fixed;
    inset: 0 0 0 auto;
    margin: 0;
    padding: 0;
    color: var(--text);
    background: #fff;
    border: 0;
    border-left: 1px solid var(--line);
    box-shadow: -24px 0 70px rgba(11, 16, 32, 0.15);
}

.detail-drawer::backdrop {
    background: rgba(8, 13, 26, 0.42);
    backdrop-filter: blur(2px);
}

.detail-drawer[open] {
    display: grid;
    grid-template-rows: auto 1fr auto;
    animation: drawer-in 220ms ease both;
}

.drawer-head,
.drawer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.035em;
}

.drawer-content {
    min-height: 0;
    padding: 1.25rem;
    overflow-y: auto;
}

.drawer-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.drawer-status small {
    color: var(--soft);
    font-size: 0.65rem;
}

.drawer-content section {
    margin-bottom: 1.4rem;
}

.drawer-content h3 {
    margin-bottom: 0.6rem;
    font-size: 0.78rem;
}

.drawer-content p {
    color: var(--muted);
    font-size: 0.78rem;
}

.drawer-content dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}

.drawer-content dl > div {
    padding: 0.8rem;
    background: var(--canvas);
    border-radius: 0.7rem;
}

.drawer-content dt {
    margin-bottom: 0.25rem;
    color: var(--soft);
    font-size: 0.62rem;
}

.drawer-content dd {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
}

.drawer-timeline ol {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.drawer-timeline li {
    position: relative;
    display: flex;
    gap: 0.7rem;
    padding-bottom: 1.1rem;
}

.drawer-timeline li:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 0.55rem;
    bottom: 0;
    left: 0.26rem;
    width: 1px;
    background: var(--line);
}

.drawer-timeline i {
    width: 0.55rem;
    aspect-ratio: 1;
    position: relative;
    z-index: 1;
    margin-top: 0.25rem;
    flex: 0 0 auto;
    background: var(--coral);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--coral);
}

.drawer-timeline span {
    display: flex;
    flex-direction: column;
}

.drawer-timeline strong {
    font-size: 0.72rem;
}

.drawer-timeline small {
    margin-top: 0.15rem;
    color: var(--soft);
    font-size: 0.64rem;
}

.drawer-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.toast {
    position: fixed;
    z-index: 350;
    right: 1.25rem;
    bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    color: #fff;
    background: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.85rem;
    box-shadow: 0 18px 50px rgba(11, 16, 32, 0.25);
    font-size: 0.74rem;
    animation: toast-in 180ms ease both;
}

.toast[hidden] {
    display: none;
}

.toast-icon {
    width: 1.5rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--lime);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 900;
}

@keyframes drawer-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(0.6rem); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1220px) {
    .topbar {
        grid-template-columns: minmax(11rem, 1fr) minmax(17rem, 28rem) auto;
    }

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

    .dashboard-grid-top,
    .dashboard-grid-middle {
        grid-template-columns: minmax(0, 1.35fr) minmax(17.5rem, 0.65fr);
    }

    .topbar-profile {
        min-width: auto;
    }

    .profile-copy {
        display: none;
    }
}

@media (max-width: 980px) {
    :root {
        --sidebar: 16.75rem;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 200ms ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 24px 0 60px rgba(7, 13, 27, 0.24);
    }

    .sidebar-close,
    .mobile-menu {
        display: inline-grid;
    }

    .icon-button.sidebar-close,
    .icon-button.mobile-menu {
        display: inline-grid;
    }

    .sidebar-close {
        color: rgba(255, 255, 255, 0.65);
        background: rgba(255, 255, 255, 0.07);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 110;
        inset: 0;
        display: block;
        background: rgba(8, 13, 26, 0.48);
        opacity: 0;
        visibility: hidden;
        transition: opacity 180ms ease, visibility 180ms ease;
    }

    .sidebar-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }

    .workspace {
        margin-left: 0;
    }

    .topbar {
        grid-template-columns: auto 1fr minmax(15rem, 23rem) auto;
        padding-inline: 1.25rem;
    }

    .breadcrumb span,
    .breadcrumb i {
        display: none;
    }

    .dashboard-grid-top,
    .dashboard-grid-middle {
        grid-template-columns: 1fr;
    }

    .health-panel,
    .distribution-panel {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .topbar {
        grid-template-columns: auto 1fr auto;
        gap: 0.65rem;
        padding-inline: 0.8rem;
    }

    .breadcrumb {
        min-width: 0;
    }

    .breadcrumb strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .global-search {
        position: fixed;
        z-index: 170;
        top: calc(var(--topbar) + 0.5rem);
        right: 0.75rem;
        left: 0.75rem;
        display: none;
        box-shadow: var(--shadow);
    }

    .global-search.is-open {
        display: flex;
    }

    .topbar-actions {
        gap: 0.45rem;
    }

    .mobile-search-button {
        display: inline-grid;
    }

    .icon-button.mobile-search-button {
        display: inline-grid;
    }

    .topbar-profile {
        display: none;
    }

    .main-content {
        padding: 1.1rem 0.8rem;
    }

    .page-head {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .page-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .scope-select select,
    .page-actions .button {
        width: 100%;
    }

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

    .metric-card {
        min-height: 9.8rem;
    }

    .panel {
        padding: 1rem;
    }

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

    .segmented-control {
        align-self: flex-start;
    }

    .chart-summary {
        flex-wrap: wrap;
    }

    .chart-summary > div:first-child {
        width: 100%;
    }

    .chart-wrap {
        padding-left: 1.7rem;
        overflow: hidden;
    }

    .line-chart {
        min-width: 0;
    }

    .chart-x-axis {
        left: 1.7rem;
    }

    .donut-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .donut-legend {
        width: min(100%, 15rem);
    }

    .queue-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .queue-meta {
        grid-column: 2;
        align-items: flex-start;
        flex-direction: row;
        gap: 0.5rem;
    }

    .table-panel-head {
        padding: 1rem;
    }

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

    .table-search {
        width: 100%;
    }

    .drawer-content dl {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .page-actions,
    .table-tools {
        grid-template-columns: 1fr;
    }

    .page-head h1 {
        font-size: 2rem;
    }

    .segmented-control {
        width: 100%;
    }

    .segmented-control button {
        flex: 1;
    }

    .health-score {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
