@font-face {
    font-family: "Geist";
    src: url("/fonts/Geist-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Geist";
    src: url("/fonts/Geist-Italic-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

:root {
    color-scheme: light;
    --bg: #f7f8fb;
    --panel: #ffffff;
    --control-bg: #ffffff;
    --panel-muted: #f0f1f4;
    --text: #111318;
    --text-soft: #20242b;
    --muted: #777f8d;
    --line: #e6e8ee;
    --grid-line: #e8ebf0;
    --sidebar: #080b0e;
    --sidebar-soft: #171b20;
    --sidebar-text: #f5f6f8;
    --sidebar-muted: #aab0b8;
    --accent: #a3e635;
    --accent-strong: #65a30d;
    --accent-soft: #ecfccb;
    --accent-contrast: #172407;
    --orange: var(--accent);
    --orange-2: var(--accent-strong);
    --green: #24b84f;
    --amber: #ff9f0a;
    --red: #ff1f1f;
    --red-strong: #cc0000;
    --blue: #4078ff;
    --chart-blue: #2563eb;
    --chart-purple: #8b5cf6;
    --chart-orange: #f97316;
    --tag-red-bg: #ffe4e4;
    --tag-amber-bg: #fff0d8;
    --tag-blue-bg: #e8efff;
    --thumb-start: #111318;
    --thumb-end: #484f5a;
    --shadow: 0 16px 40px rgba(18, 24, 38, 0.08);
    --panel-shadow: 0 1px 2px rgba(18, 24, 38, 0.03);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #090d12;
    --panel: #121821;
    --control-bg: #0f1722;
    --panel-muted: #202938;
    --text: #f4f7fb;
    --text-soft: #e7edf5;
    --muted: #9aa7b7;
    --line: #263244;
    --grid-line: #263244;
    --sidebar: #05070a;
    --sidebar-soft: #10161d;
    --sidebar-text: #f4f7fb;
    --sidebar-muted: #8d9aaa;
    --accent: #a3e635;
    --accent-strong: #bef264;
    --accent-soft: rgba(163, 230, 53, 0.18);
    --accent-contrast: #10170a;
    --green: #4ade80;
    --amber: #fbbf24;
    --red: #fb7185;
    --red-strong: #f43f5e;
    --blue: #60a5fa;
    --tag-red-bg: rgba(251, 113, 133, 0.15);
    --tag-amber-bg: rgba(251, 191, 36, 0.15);
    --tag-blue-bg: rgba(96, 165, 250, 0.15);
    --thumb-start: #1f2937;
    --thumb-end: #475569;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
    --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #090d12;
        --panel: #121821;
        --control-bg: #0f1722;
        --panel-muted: #202938;
        --text: #f4f7fb;
        --text-soft: #e7edf5;
        --muted: #9aa7b7;
        --line: #263244;
        --grid-line: #263244;
        --sidebar: #05070a;
        --sidebar-soft: #10161d;
        --sidebar-text: #f4f7fb;
        --sidebar-muted: #8d9aaa;
        --accent: #a3e635;
        --accent-strong: #bef264;
        --accent-soft: rgba(163, 230, 53, 0.18);
        --accent-contrast: #10170a;
        --green: #4ade80;
        --amber: #fbbf24;
        --red: #fb7185;
        --red-strong: #f43f5e;
        --blue: #60a5fa;
        --tag-red-bg: rgba(251, 113, 133, 0.15);
        --tag-amber-bg: rgba(251, 191, 36, 0.15);
        --tag-blue-bg: rgba(96, 165, 250, 0.15);
        --thumb-start: #1f2937;
        --thumb-end: #475569;
        --shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
        --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    font-family: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

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

.is-hidden {
    display: none !important;
}

.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 34%),
        var(--bg);
}

.login-panel {
    width: min(100%, 420px);
    display: grid;
    gap: 18px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.auth-form {
    display: grid;
    gap: 18px;
}

.brand-mark,
.app-logo {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--accent-contrast);
    font-weight: 900;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
}

.app-logo {
    width: 34px;
    height: 34px;
    font-size: 20px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--orange);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 0;
    font-size: 30px;
    line-height: 1.12;
}

h2 {
    margin-bottom: 0;
    font-size: 17px;
    line-height: 1.2;
}

.field {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.field input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: var(--control-bg);
    color: var(--text);
    outline: none;
}

.field input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-error {
    min-height: 20px;
    margin-bottom: 0;
    color: var(--red);
    font-size: 14px;
    font-weight: 850;
}

.login-panel.is-shaking {
    animation: login-shake 1s ease-in-out;
}

@keyframes login-shake {
    0%,
    100% {
        transform: translateX(0);
        border-color: var(--line);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-9px);
        border-color: var(--red);
        box-shadow: 0 18px 45px rgba(255, 31, 31, 0.18);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(9px);
        border-color: var(--red-strong);
        box-shadow: 0 18px 45px rgba(255, 31, 31, 0.22);
    }
}

.primary-button,
.secondary-button,
.refresh-button,
.date-button,
.select-button {
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 0 18px;
    font-weight: 800;
}

.primary-button,
.refresh-button {
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: var(--accent-contrast);
}

.secondary-button,
.date-button,
.select-button {
    background: var(--control-bg);
    color: var(--text);
    border-color: var(--line);
}

.link-button {
    width: max-content;
    min-height: 32px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--orange);
    font-weight: 850;
}

.link-button:hover {
    text-decoration: underline;
}

.dashboard-view {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    transition: grid-template-columns 180ms ease;
}

.dashboard-view.is-sidebar-collapsed {
    grid-template-columns: 92px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 14px 16px 12px;
    transition: padding 180ms ease;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 42%),
        var(--sidebar);
    color: var(--sidebar-text);
}

.sidebar-brand,
.account-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand {
    min-height: 40px;
    padding: 0 8px;
}

.brand-copy {
    min-width: 0;
}

.sidebar-brand strong {
    font-size: 19px;
}

.main-nav {
    display: grid;
    gap: 2px;
    margin-top: 12px;
}

.nav-item {
    min-height: 40px;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    white-space: normal;
    line-height: 1.1;
    transition: background 160ms ease, padding 180ms ease;
}

.nav-icon {
    color: currentColor;
    font-size: 16px;
}

.nav-item:hover,
.nav-item.is-active {
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: var(--accent-contrast);
}

.nav-item em {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--orange);
    color: var(--accent-contrast);
    font-style: normal;
}

.sidebar-controls {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--sidebar-soft);
}

.sidebar-controls-title {
    color: var(--sidebar-muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.sidebar-controls .theme-toggle {
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-controls .theme-option {
    color: var(--sidebar-muted);
}

.sidebar-controls .refresh-button {
    width: 100%;
    min-height: 38px;
    justify-content: center;
    padding: 0 12px;
}

.tariff-card,
.account-card {
    margin-top: auto;
    border-radius: 8px;
    background: var(--sidebar-soft);
}

.tariff-card {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    color: var(--sidebar-muted);
}

.tariff-card strong,
.tariff-card b {
    color: var(--sidebar-text);
}

.tariff-card span,
.tariff-card p {
    margin: 0;
    color: var(--sidebar-muted);
    font-size: 13px;
}

.tariff-progress {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.tariff-progress span {
    width: 62%;
    height: 100%;
    display: block;
    background: var(--orange);
}

.account-card {
    margin-top: 12px;
    padding: 12px;
}

.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: var(--accent-contrast);
    font-weight: 900;
}

.account-card strong,
.account-card span {
    display: block;
}

.account-card span {
    margin-top: 3px;
    color: var(--sidebar-muted);
    font-size: 13px;
}

.account-menu,
.collapse-button {
    border: 0;
    background: transparent;
    color: var(--sidebar-text);
}

.account-menu {
    margin-left: auto;
    font-size: 18px;
}

.collapse-button {
    width: 32px;
    height: 32px;
    display: grid;
    flex: 0 0 32px;
    place-items: center;
    margin-left: auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
    font-size: 22px;
    font-weight: 750;
    cursor: pointer;
    transition: background 160ms ease, transform 180ms ease;
}

.collapse-button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.dashboard-view.is-sidebar-collapsed .sidebar {
    padding-right: 10px;
    padding-left: 10px;
}

.dashboard-view.is-sidebar-collapsed .sidebar-brand {
    gap: 6px;
    justify-content: center;
    padding: 0;
}

.dashboard-view.is-sidebar-collapsed .brand-copy,
.dashboard-view.is-sidebar-collapsed .nav-label,
.dashboard-view.is-sidebar-collapsed .nav-item em,
.dashboard-view.is-sidebar-collapsed .sidebar-controls-title,
.dashboard-view.is-sidebar-collapsed .refresh-label,
.dashboard-view.is-sidebar-collapsed .tariff-card,
.dashboard-view.is-sidebar-collapsed .account-card {
    display: none;
}

.dashboard-view.is-sidebar-collapsed .collapse-button {
    margin-left: 0;
    transform: rotate(180deg);
}

.dashboard-view.is-sidebar-collapsed .main-nav {
    width: 100%;
}

.dashboard-view.is-sidebar-collapsed .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
}

.dashboard-view.is-sidebar-collapsed .nav-icon {
    font-size: 18px;
}

.dashboard-view.is-sidebar-collapsed .sidebar-controls {
    gap: 8px;
    padding: 8px 4px;
    background: transparent;
}

.dashboard-view.is-sidebar-collapsed .sidebar-controls .theme-toggle {
    grid-template-columns: repeat(3, 20px);
    min-height: 26px;
    padding: 2px;
}

.dashboard-view.is-sidebar-collapsed .sidebar-controls .theme-option {
    width: 20px;
    height: 22px;
    font-size: 12px;
}

.dashboard-view.is-sidebar-collapsed .sidebar-controls .refresh-button {
    min-height: 34px;
    padding: 0;
}

.workspace {
    min-width: 0;
    height: 100vh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) minmax(0, 1.24fr);
    gap: 12px;
    overflow: hidden;
    padding: 16px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.page-header h1 {
    font-size: 24px;
}

.page-header p {
    margin: 3px 0 0;
    color: var(--muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.date-button,
.refresh-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 34px);
    gap: 2px;
    min-height: 36px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--control-bg);
}

.theme-option {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    font-weight: 900;
}

.theme-option.is-active {
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: var(--accent-contrast);
    box-shadow: 0 6px 18px rgba(101, 163, 13, 0.25);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 10px;
    min-height: 0;
}

.metric-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--panel-shadow);
}

.metric-card {
    min-height: 86px;
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
}

.metric-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--orange);
    color: var(--accent-contrast);
    font-size: 18px;
    font-weight: 900;
}

.metric-icon.green {
    background: var(--green);
}

.metric-icon.amber {
    background: var(--amber);
}

.metric-card span {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
    line-height: 1.05;
}

.metric-card p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

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

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

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(460px, 1.45fr) minmax(340px, 1fr) minmax(260px, 0.85fr);
    gap: 10px;
    min-height: 0;
}

.panel {
    min-height: 0;
    overflow: hidden;
    padding: 14px;
}

.panel-header {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.panel-header a,
.see-all-button,
.results-panel a {
    border: 0;
    background: transparent;
    color: var(--orange);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.panel-header h2 span {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--panel-muted);
    color: var(--text-soft);
    font-size: 13px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
}

.chart-legend span::before {
    content: "";
    width: 18px;
    height: 3px;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 99px;
    background: var(--chart-blue);
}

.chart-legend .line-purple::before {
    background: var(--chart-purple);
}

.chart-legend .line-orange::before {
    background: var(--chart-orange);
}

.line-chart {
    width: 100%;
    height: calc(100% - 56px);
    min-height: 150px;
}

.grid-lines line {
    stroke: var(--grid-line);
}

.axis-labels {
    fill: var(--muted);
    font-size: 13px;
}

.series {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.blue-series {
    stroke: var(--chart-blue);
}

.purple-series {
    stroke: var(--chart-purple);
}

.orange-series {
    stroke: var(--chart-orange);
}

.donut-layout {
    display: grid;
    grid-template-columns: 142px 1fr;
    align-items: center;
    gap: 14px;
    height: calc(100% - 38px);
}

.donut-chart {
    width: 142px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--green) 0 36.8%, var(--orange) 36.8% 84.7%, var(--amber) 84.7% 95.8%, #9da3ad 95.8% 100%);
}

.donut-chart::before {
    content: "";
    position: absolute;
}

.donut-chart > div {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background: var(--panel);
}

.donut-chart strong {
    font-size: 21px;
}

.donut-chart span {
    font-size: 11px;
    text-transform: uppercase;
}

.recommendation-list,
.event-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.recommendation-list {
    display: grid;
    gap: 9px;
}

.recommendation-list li {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 12px;
}

.recommendation-list i {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--green);
}

.recommendation-list .orange-dot {
    background: var(--orange);
}

.recommendation-list .amber-dot {
    background: var(--amber);
}

.recommendation-list .gray-dot {
    background: #9da3ad;
}

.recommendation-list strong,
.recommendation-list span {
    display: block;
    white-space: nowrap;
}

.recommendation-list span {
    margin-top: 3px;
    color: var(--muted);
}

.quick-actions {
    display: grid;
    gap: 7px;
}

.quick-actions button {
    min-height: 35px;
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control-bg);
    color: var(--text);
    padding: 0 14px;
    text-align: left;
    font-weight: 700;
}

.quick-actions span {
    color: var(--orange);
    font-size: 20px;
}

.inline-product-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.lower-grid {
    display: grid;
    grid-template-columns: minmax(520px, 1.45fr) minmax(300px, 0.75fr) minmax(300px, 0.75fr);
    gap: 10px;
    min-height: 0;
}

.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
}

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

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

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

td {
    font-size: 13px;
}

.product-cell {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 8px;
    align-items: center;
    min-width: 210px;
}

.product-thumb {
    width: 28px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: var(--sidebar-text);
    font-size: 17px;
    background: linear-gradient(135deg, var(--thumb-start), var(--thumb-end));
}

.product-cell strong,
.product-cell span {
    display: block;
}

.product-cell span {
    color: var(--muted);
}

.issue-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 5px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.issue-red {
    background: var(--tag-red-bg);
    color: var(--red);
}

.issue-amber {
    background: var(--tag-amber-bg);
    color: #d57700;
}

.issue-blue {
    background: var(--tag-blue-bg);
    color: var(--blue);
}

.price-current,
.price-down,
.price-up {
    font-weight: 850;
    white-space: nowrap;
}

.price-down {
    color: var(--red);
}

.price-up {
    color: var(--green);
}

.row-action {
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--control-bg);
    color: var(--text);
    padding: 0 12px;
    font-weight: 750;
}

.see-all-button {
    display: block;
    margin: 8px auto 0;
    font-size: 14px;
}

.review-table tbody tr:nth-child(n+4),
.rule-list label:nth-child(n+5),
.event-list li:nth-child(n+5) {
    display: none;
}

.empty-state {
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.rule-list {
    display: grid;
}

.rule-list label {
    min-height: 47px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.rule-list label:last-child {
    border-bottom: 0;
}

.rule-list strong,
.rule-list em {
    display: block;
}

.rule-list em {
    margin-top: 4px;
    color: var(--muted);
    font-style: normal;
}

.rule-list input {
    appearance: none;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: var(--orange);
    position: relative;
}

.rule-list input::after {
    content: "";
    width: 14px;
    height: 14px;
    position: absolute;
    top: 2px;
    right: 2px;
    border-radius: 50%;
    background: var(--panel);
}

.event-list {
    display: grid;
    gap: 10px;
}

.event-list li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    align-items: start;
}

.event-list i {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--orange);
    color: var(--accent-contrast);
    font-style: normal;
    font-weight: 900;
}

.event-list .event-green {
    background: var(--green);
}

.event-list span,
.event-list em {
    display: block;
}

.event-list em {
    margin-top: 4px;
    color: var(--muted);
    font-style: normal;
}

.results-panel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.result-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.result-metrics span {
    min-width: 180px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    font-weight: 900;
}

.result-metrics em {
    color: var(--muted);
    font-style: normal;
    font-weight: 650;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

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

    .quick-panel,
    .products-panel,
    .events-panel,
    .results-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1400px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

@media (max-width: 900px) {
    .dashboard-view {
        grid-template-columns: 1fr;
    }

    .dashboard-view.is-sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        min-height: auto;
        overflow: visible;
        padding: 14px;
    }

    .main-nav {
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        overflow-x: auto;
    }

    .tariff-card,
    .account-card,
    .collapse-button {
        display: none;
    }

    .workspace {
        height: auto;
        display: block;
        overflow: visible;
        padding: 16px;
    }

    .page-header,
    .header-actions,
    .results-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .kpi-grid,
    .dashboard-grid,
    .lower-grid,
    .donut-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .metric-card {
        grid-template-columns: 42px 1fr;
        padding: 18px;
    }

    .metric-card strong {
        font-size: 23px;
    }

    .panel {
        padding: 16px;
    }

    h1 {
        font-size: 26px;
    }
}
