:root {
    --bg: #dfe6ee;
    --surface: #ffffff;
    --surface-2: #f4f6f9;
    --text: #171c26;
    --muted: #667085;
    --border: #e4e8ef;
    --primary: #176b91;
    --primary-2: #0f526e;
    --success: #16784e;
    --warning: #996515;
    --danger: #b73939;
    --info: #326db5;
    --shadow: 0 10px 24px rgba(31, 42, 68, 0.08);
    --soft-shadow: 0 3px 12px rgba(31, 42, 68, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

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

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

.sidebar {
    position: relative;
    flex: 0 0 264px;
    width: 264px;
    min-height: 100vh;
    background: var(--surface);
    color: var(--text);
    border-right: 1px solid var(--border);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 20;
    transition: margin-left 180ms ease, transform 180ms ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f2d74;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
}

.brand strong,
.user-chip strong {
    display: block;
    font-size: 14px;
}

.brand small,
.user-chip small {
    color: var(--muted);
    display: block;
    font-size: 12px;
}

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

.nav a,
.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 8px;
    color: #4f5968;
    font-weight: 650;
}

.nav a.active,
.nav a:hover,
.logout-link:hover {
    background: #f1f4f8;
    color: var(--text);
}

.nav svg,
.logout-link svg,
.topbar svg,
.button svg,
.icon-button svg {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f7f9fc;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5f4ef;
    color: #12614e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 100vh;
    padding: 0 28px 28px;
    background: var(--surface);
    transition: margin-left 180ms ease;
}

body.sidebar-collapsed .sidebar {
    margin-left: -264px;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    margin: 0 -28px 22px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
}

.menu-toggle {
    display: inline-flex;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

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

.metric-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--soft-shadow);
}

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

.metric strong {
    display: block;
    font-size: 28px;
    margin-top: 16px;
    letter-spacing: 0;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
}

.panel-header {
    min-height: 58px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-header h2 {
    margin: 0;
    font-size: 16px;
}

.panel-body {
    padding: 16px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.button,
button.button {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.button.dark {
    background: #121722;
    border-color: #121722;
    color: #fff;
}

.button.small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.button.primary:hover {
    background: var(--primary-2);
}

.button.danger {
    border-color: #f0c1c1;
    color: var(--danger);
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

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

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

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

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f8fafc;
}

tr:last-child td {
    border-bottom: 0;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--muted);
    white-space: nowrap;
}

.badge.success {
    background: #e7f5ee;
    color: var(--success);
}

.badge.warning {
    background: #fff2d8;
    color: var(--warning);
}

.badge.danger {
    background: #fde8e8;
    color: var(--danger);
}

.badge.info {
    background: #e8f1fb;
    color: var(--info);
}

.member-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 210px;
}

.member-title strong {
    min-width: 0;
}

.signal-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 750;
    white-space: nowrap;
}

.status-signal {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    display: inline-block;
    background: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.status-signal.active {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.status-signal.online {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.status-signal.available {
    background: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.status-signal.idle {
    background: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16);
}

.status-signal.inactive {
    background: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

.status-signal.offline {
    background: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

.source-split {
    color: var(--muted);
    white-space: nowrap;
}

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

.agent-drilldown-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 800;
}

.action-stack {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.drilldown-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.drilldown-kpis div {
    min-height: 76px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
}

.drilldown-kpis span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.drilldown-kpis strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

.call-day-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
}

.call-day-group + .call-day-group {
    margin-top: 12px;
}

.call-day-group summary {
    min-height: 48px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    cursor: pointer;
    background: #f3f6fa;
    color: var(--muted);
    font-weight: 750;
}

.call-day-group summary strong {
    color: var(--text);
    margin-right: auto;
}

.day-call-table table {
    min-width: 1080px;
}

.live-report-strip {
    min-height: 38px;
    margin-top: 14px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 750;
}

.realtime-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.realtime-kpi {
    min-height: 118px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.realtime-kpi span,
.realtime-kpi small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.realtime-kpi strong {
    color: var(--text);
    font-size: 26px;
    line-height: 1;
    letter-spacing: 0;
}

.realtime-agent-table {
    border: 1px solid var(--border);
    border-radius: 8px;
}

.realtime-agent-table table {
    min-width: 1180px;
}

.realtime-agent-table th {
    background: #f3f6fa;
}

.color-significance .panel-body {
    padding-top: 14px;
}

.color-legend-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(210px, 1fr));
    gap: 10px 16px;
}

.color-legend-grid span {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.legend-chip {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
}

.legend-chip.info {
    background: var(--info);
    box-shadow: 0 0 0 3px rgba(50, 109, 181, 0.12);
}

.legend-chip.neutral {
    background: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.12);
}

.legend-chip.danger {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(183, 57, 57, 0.12);
}

.legend-chip.success {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 120, 78, 0.12);
}

.role-tag {
    margin-left: auto;
    font-size: 11px;
    min-height: 22px;
    padding: 0 7px;
}

.alerts-filter-panel,
.alert-results-panel {
    scroll-margin-top: 16px;
}

.filters,
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

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

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

.field.full {
    grid-column: 1 / -1;
}

label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    padding: 8px 10px;
    outline: none;
}

textarea {
    min-height: 88px;
    resize: vertical;
}

.attachment-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

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

.attachment-editor-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.9fr) minmax(220px, 1.2fr) 38px;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.attachment-editor-row textarea {
    min-height: 40px;
}

.attachment-summary {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    min-width: 240px;
}

.attachment-summary div {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.attachment-summary strong,
.attachment-summary small {
    display: block;
}

.attachment-summary strong {
    font-size: 13px;
}

.attachment-summary small {
    margin-top: 2px;
    color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 106, 143, 0.12);
}

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    background: #fff;
}

.alert.success {
    border-color: #b8e4cf;
    background: #ecf9f3;
    color: var(--success);
}

.alert.danger {
    border-color: #efc0c0;
    background: #fff0f0;
    color: var(--danger);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background: linear-gradient(135deg, #f5f7fb 0%, #e8f1ef 100%);
}

.login-box {
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 26px;
}

.login-box h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.login-box p {
    margin: 0 0 20px;
    color: var(--muted);
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.chart-bars {
    display: grid;
    gap: 12px;
}

.chart-bar {
    display: grid;
    grid-template-columns: 130px 1fr 52px;
    gap: 10px;
    align-items: center;
}

.bar-track {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
}

.dashboard-toolbar {
    min-height: 62px;
    border-bottom: 1px solid var(--border);
    margin: -22px -28px 26px;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--surface);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fresh-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #15935f;
    font-weight: 750;
    padding: 0 10px;
    min-height: 34px;
}

.fresh-chip svg {
    width: 17px;
    height: 17px;
}

.live-updated {
    animation: livePulse 0.5s ease;
}

@keyframes livePulse {
    0% {
        background-color: rgba(35, 153, 213, 0.14);
    }
    100% {
        background-color: transparent;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.dashboard-main {
    display: grid;
    gap: 18px;
}

.dashboard-main .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0;
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.trend {
    min-height: 24px;
    padding: 2px 10px;
    border-radius: 999px;
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
}

.trend.good {
    background: #dff5eb;
    color: #126e4b;
}

.trend.info {
    background: #e8f1fb;
    color: #175d86;
}

.chart-panel .panel-header {
    border-bottom: 0;
    padding-bottom: 0;
}

.chart-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chart-help {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.chart-help svg {
    width: 17px;
    height: 17px;
}

.range-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: #f7f9fc;
    color: #9aa4b2;
}

.range-tabs span {
    min-width: 42px;
    min-height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 750;
}

.range-tabs .active {
    background: #fff;
    color: var(--text);
    box-shadow: var(--soft-shadow);
}

.line-chart {
    min-height: 260px;
    padding: 22px 28px 18px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
    background:
        linear-gradient(to top, rgba(228, 232, 239, 0.7) 1px, transparent 1px) 0 0 / 100% 25%;
}

.trend-column {
    position: relative;
    height: 220px;
    display: grid;
    grid-template-rows: 1fr 22px;
    align-items: end;
    justify-items: center;
    gap: 8px;
}

.trend-bar {
    width: min(100%, 34px);
    min-height: 18px;
    border-radius: 999px 999px 4px 4px;
    background: linear-gradient(180deg, #2399d5 0%, #0f5f84 100%);
    box-shadow: 0 10px 18px rgba(23, 107, 145, 0.16);
}

.trend-column small {
    color: #98a2b3;
    font-weight: 700;
}

.tooltip-target {
    position: relative;
}

.tooltip-target::after,
.tooltip-target::before {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.tooltip-target::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translate(-50%, 6px);
    z-index: 30;
    width: max-content;
    max-width: min(310px, calc(100vw - 56px));
    padding: 10px 12px;
    border: 1px solid rgba(15, 82, 110, 0.18);
    border-radius: 8px;
    background: #101828;
    color: #fff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
}

.tooltip-target::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translate(-50%, 6px);
    z-index: 31;
    border: 6px solid transparent;
    border-top-color: #101828;
}

.tooltip-target:hover::after,
.tooltip-target:hover::before,
.tooltip-target:focus-visible::after,
.tooltip-target:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.trend-column:hover .trend-bar,
.trend-column:focus-visible .trend-bar {
    box-shadow: 0 14px 24px rgba(23, 107, 145, 0.26);
    filter: saturate(1.12);
}

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

.panel-header.compact {
    min-height: 54px;
    padding: 14px 16px;
}

.pipeline-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pipeline-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.pipeline-card span {
    display: block;
    width: 34px;
    height: 5px;
    border-radius: 999px;
    background: #2399d5;
    margin-bottom: 14px;
}

.pipeline-card:nth-child(2) span {
    background: #176b91;
}

.pipeline-card:nth-child(3) span {
    background: #0f526e;
}

.pipeline-card:nth-child(4) span {
    background: #c9d2de;
}

.pipeline-card strong {
    display: block;
    margin-bottom: 6px;
}

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

.chart-bars.modern {
    gap: 14px;
}

.dashboard-side {
    display: grid;
    gap: 18px;
}

.date-pill {
    min-height: 32px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 750;
    color: var(--muted);
    background: #fff;
}

.date-picker {
    min-height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    background: #fff;
    cursor: pointer;
}

.date-picker svg {
    width: 17px;
    height: 17px;
}

.date-picker input {
    width: 126px;
    min-height: 32px;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

.date-picker input:focus {
    border-color: transparent;
    box-shadow: none;
}

.agenda-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
}

.agenda-list div {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    background: #fbfcfe;
}

.agenda-list small {
    color: var(--muted);
    font-weight: 700;
}

.agenda-list strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
}

.schedule-list,
.activity-feed {
    padding: 14px;
    display: grid;
    gap: 10px;
}

.schedule-card {
    display: grid;
    gap: 3px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfe;
}

.schedule-card span,
.schedule-card small {
    color: var(--muted);
}

.activity-item {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.activity-item > span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2399d5;
    margin-top: 5px;
}

.activity-item strong {
    text-transform: capitalize;
}

.activity-item p {
    margin: 2px 0;
    color: var(--muted);
}

.activity-item small {
    color: #98a2b3;
}

.empty.slim {
    padding: 16px;
}

.dashboard-table {
    margin-top: 20px;
}

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

@media (max-width: 1100px) {
    .realtime-kpis,
    .color-legend-grid,
    .drilldown-kpis,
    .metric-row,
    .dashboard-main .metric-row,
    .dashboard-lower,
    .grid.four,
    .grid.three,
    .filters,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 760px) {
    body {
        display: block;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        min-height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        margin-left: 0;
        transform: translateX(-100%);
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        padding: 0 16px 18px;
    }

    body.sidebar-collapsed .main {
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar {
        margin-left: 0;
        transform: translateX(-100%);
    }

    .topbar {
        margin: 0 -16px 18px;
        padding: 0 16px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .metric-row,
    .realtime-kpis,
    .color-legend-grid,
    .drilldown-kpis,
    .dashboard-main .metric-row,
    .dashboard-lower,
    .agenda-list,
    .grid.two,
    .grid.three,
    .grid.four,
    .filters,
    .form-grid,
    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .timeline-item,
    .chart-bar {
        grid-template-columns: 1fr;
    }

    .dashboard-toolbar {
        align-items: flex-start;
        flex-direction: column;
        margin: -18px -16px 18px;
        padding: 12px 16px;
    }

    .attachment-header,
    .attachment-editor-row {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .attachment-header {
        flex-direction: column;
    }

    .line-chart {
        gap: 8px;
        padding-inline: 14px;
    }
}
