:root {
    --bg: #121212;
    --bg-depth: #20365f;
    --bg-accent-a: rgba(255, 95, 87, 0.12);
    --bg-accent-b: rgba(77, 163, 255, 0.14);
    --station-background-image: none;
    --station-background-position: center center;
    --station-background-size: cover;
    --surface: rgba(18, 24, 36, 0.86);
    --surface-strong: rgba(14, 18, 28, 0.94);
    --surface-soft: rgba(255, 255, 255, 0.06);
    --surface-border: rgba(255, 255, 255, 0.08);
    --text: #edf2fb;
    --text-strong: #ffffff;
    --muted: #9fb0ca;
    --shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
    --hot: #ff5f57;
    --blue: #4da3ff;
    --green: #39c98a;
    --orange: #ff9f43;
    --rain: #2d7ff9;
    --warning: #ffcf5a;
    --chart-text: #dce7f7;
    --chart-text-soft: #90a4c2;
    --chart-text-strong: #ffffff;
    --chart-grid: rgba(255, 255, 255, 0.05);
    --chart-tooltip-bg: rgba(11, 18, 32, 0.94);
}

[data-theme="light"] {
    --bg: #eef3f9;
    --bg-depth: #c9dff7;
    --bg-accent-a: rgba(255, 95, 87, 0.08);
    --bg-accent-b: rgba(77, 163, 255, 0.08);
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: rgba(255, 255, 255, 0.98);
    --surface-soft: rgba(15, 23, 42, 0.05);
    --surface-border: rgba(15, 23, 42, 0.08);
    --text: #152033;
    --text-strong: #07111f;
    --muted: #5f718d;
    --shadow: 0 18px 36px rgba(24, 39, 75, 0.12);
    --chart-text: #26354d;
    --chart-text-soft: #70829f;
    --chart-text-strong: #07111f;
    --chart-grid: rgba(21, 32, 51, 0.08);
    --chart-tooltip-bg: rgba(255, 255, 255, 0.96);
}

[data-theme="light"] body {
    color-scheme: light;
}

body[data-color-palette="ocean"] {
    --bg: #0e1726;
    --bg-depth: #1d4f8f;
    --bg-accent-a: rgba(33, 150, 243, 0.22);
    --bg-accent-b: rgba(64, 201, 255, 0.20);
    --surface: rgba(11, 26, 44, 0.88);
    --surface-strong: rgba(7, 20, 36, 0.95);
    --surface-soft: rgba(115, 196, 255, 0.11);
    --surface-border: rgba(121, 196, 255, 0.18);
    --muted: #9fbedf;
    --shadow: 0 26px 54px rgba(4, 13, 26, 0.42);
    --hot: #ff6b57;
    --blue: #49b1ff;
    --green: #39d3a2;
    --orange: #ffab5c;
    --rain: #1f8fff;
}

body[data-color-palette="sunset"] {
    --bg: #1d1411;
    --bg-depth: #6d3422;
    --bg-accent-a: rgba(255, 127, 80, 0.28);
    --bg-accent-b: rgba(255, 209, 102, 0.24);
    --surface: rgba(43, 22, 17, 0.88);
    --surface-strong: rgba(34, 17, 13, 0.95);
    --surface-soft: rgba(255, 169, 111, 0.12);
    --surface-border: rgba(255, 183, 120, 0.22);
    --text: #fff4ea;
    --text-strong: #fffaf5;
    --muted: #e0b59a;
    --shadow: 0 26px 54px rgba(29, 12, 7, 0.42);
    --hot: #ff7a45;
    --blue: #ffc14d;
    --green: #ffe082;
    --orange: #ff9654;
    --rain: #ff6f61;
    --chart-text: #ffe8d8;
    --chart-text-soft: #d8b195;
    --chart-grid: rgba(255, 210, 168, 0.12);
    --chart-tooltip-bg: rgba(47, 22, 16, 0.96);
}

body[data-color-palette="forest"] {
    --bg: #0d1711;
    --bg-depth: #18442b;
    --bg-accent-a: rgba(72, 187, 120, 0.24);
    --bg-accent-b: rgba(38, 166, 154, 0.20);
    --surface: rgba(15, 35, 24, 0.88);
    --surface-strong: rgba(11, 28, 20, 0.95);
    --surface-soft: rgba(97, 214, 150, 0.11);
    --surface-border: rgba(105, 214, 158, 0.18);
    --text: #ecf8f0;
    --text-strong: #f7fff9;
    --muted: #a9ccb6;
    --shadow: 0 26px 54px rgba(7, 18, 12, 0.4);
    --hot: #f48c5c;
    --blue: #46c2b4;
    --green: #6ecb63;
    --orange: #d9a35f;
    --rain: #24a995;
    --chart-text: #dcefe3;
    --chart-text-soft: #9cbfac;
    --chart-grid: rgba(180, 233, 195, 0.10);
    --chart-tooltip-bg: rgba(12, 30, 21, 0.96);
}

[data-theme="light"] body[data-color-palette="ocean"] {
    --bg: #edf5ff;
    --bg-depth: #b8dafc;
    --bg-accent-a: rgba(73, 177, 255, 0.18);
    --bg-accent-b: rgba(57, 211, 162, 0.12);
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: rgba(248, 252, 255, 0.98);
    --surface-soft: rgba(73, 177, 255, 0.08);
    --surface-border: rgba(73, 177, 255, 0.16);
    --text: #12243c;
    --text-strong: #07131f;
    --muted: #557391;
    --shadow: 0 18px 38px rgba(25, 72, 122, 0.16);
}

[data-theme="light"] body[data-color-palette="sunset"] {
    --bg: #fff4eb;
    --bg-depth: #f6d1ae;
    --bg-accent-a: rgba(255, 140, 92, 0.18);
    --bg-accent-b: rgba(255, 214, 102, 0.16);
    --surface: rgba(255, 250, 245, 0.94);
    --surface-strong: rgba(255, 253, 249, 0.98);
    --surface-soft: rgba(255, 149, 84, 0.08);
    --surface-border: rgba(232, 153, 91, 0.16);
    --text: #422619;
    --text-strong: #27140b;
    --muted: #8f664e;
    --shadow: 0 18px 38px rgba(152, 93, 38, 0.14);
    --chart-text: #533121;
    --chart-text-soft: #936f59;
    --chart-grid: rgba(111, 64, 33, 0.10);
    --chart-tooltip-bg: rgba(255, 249, 243, 0.98);
}

[data-theme="light"] body[data-color-palette="forest"] {
    --bg: #eff8f1;
    --bg-depth: #c7e5cf;
    --bg-accent-a: rgba(61, 145, 64, 0.16);
    --bg-accent-b: rgba(38, 166, 154, 0.13);
    --surface: rgba(250, 255, 250, 0.94);
    --surface-strong: rgba(253, 255, 253, 0.98);
    --surface-soft: rgba(70, 194, 180, 0.07);
    --surface-border: rgba(66, 153, 104, 0.14);
    --text: #173024;
    --text-strong: #0b1b13;
    --muted: #4e6e5b;
    --shadow: 0 18px 38px rgba(34, 93, 56, 0.14);
    --chart-text: #1d3a2a;
    --chart-text-soft: #648775;
    --chart-grid: rgba(32, 74, 52, 0.09);
    --chart-tooltip-bg: rgba(251, 255, 251, 0.98);
}

* {
    box-sizing: border-box;
}

body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    color: var(--text);
    color-scheme: dark;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at top left, var(--bg-accent-a), transparent 30%),
        radial-gradient(circle at top right, var(--bg-accent-b), transparent 25%),
        linear-gradient(145deg, var(--bg) 0%, var(--bg-depth) 100%);
    background-image:
        radial-gradient(circle at top left, var(--bg-accent-a), transparent 30%),
        radial-gradient(circle at top right, var(--bg-accent-b), transparent 25%),
        linear-gradient(145deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 62%, var(--bg-depth)) 100%);
    background-position: top left, top right, center center;
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-size: auto, auto, auto;
    background-attachment: fixed, fixed, fixed;
    overflow-x: hidden;
    transition: background 220ms ease, color 220ms ease;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: var(--station-background-image);
    background-position: var(--station-background-position);
    background-repeat: no-repeat;
    background-size: var(--station-background-size);
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 240ms ease;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 12, 20, 0.18), rgba(9, 12, 20, 0.28));
    pointer-events: none;
    z-index: 0;
}

body.has-station-background::before {
    opacity: 0.9;
}

[data-theme="light"] body::after,
[data-theme="light"] body.has-station-background::before {
    opacity: 1;
}

[data-theme="light"] body::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.24));
}

[data-theme="light"] body.has-station-background::before {
    opacity: 0.42;
}

.page-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    backdrop-filter: blur(2px);
}

.app-nav {
    background: var(--surface-strong);
    background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
    border-bottom: 1px solid var(--surface-border);
    backdrop-filter: blur(18px);
}

.navbar-brand {
    color: var(--text);
    letter-spacing: 0.04em;
}

.navbar-toggler {
    border-color: var(--surface-border);
    background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--blue) 28%, transparent);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(237,242,251,0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.4' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="light"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(21,32,51,0.92)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.4' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    color: var(--text);
    color: color-mix(in srgb, var(--text) 76%, transparent);
    border-radius: 999px;
    padding: 0.65rem 1rem;
}

.nav-link.active,
.nav-link:hover {
    color: var(--text-strong);
    background: var(--surface-soft);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    padding: 0.6rem 0.95rem;
}

.theme-toggle:hover {
    background: var(--blue);
    background: color-mix(in srgb, var(--surface-soft) 85%, var(--blue));
    color: var(--text-strong);
}

.dashboard-hero,
.filter-panel,
.forecast-panel,
.chart-panel,
.table-card,
.mini-stat-card,
.filter-card,
.chart-card,
.system-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow);
}

.dashboard-hero,
.hero-panel {
    padding: 1.6rem;
    border-radius: 28px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.settings-login-card {
    max-width: 780px;
}

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: var(--blue);
    margin-bottom: 0.7rem;
}

.display-title {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(2rem, 3vw, 3.5rem);
    line-height: 1;
    color: var(--text-strong);
}

.hero-copy,
.mini-label,
.table-card-head p,
.text-secondary {
    color: var(--muted) !important;
}

.hero-meta,
.compact-meta,
.hero-metrics {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

.hero-chip {
    min-width: 120px;
    padding: 0.9rem 1rem;
    border-radius: 20px;
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
}

.hero-chip-label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.hero-chip strong {
    font-size: 1rem;
}

.hero-actions {
    display: flex;
    align-items: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.9rem;
}

.status-pill.muted {
    background: var(--surface-soft);
    background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
    color: var(--muted);
}

.filter-panel,
.filter-card,
.forecast-panel,
.chart-panel,
.chart-card,
.table-card,
.mini-stat-card,
.system-card {
    border-radius: 24px;
    padding: 1.35rem;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.system-card h2 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.health-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.health-badge.is-ok {
    background: rgba(57, 201, 138, 0.16);
    color: #7ce1b1;
}

.health-badge.is-warn {
    background: rgba(255, 207, 90, 0.16);
    color: #ffd978;
}

.health-badge.is-error {
    background: rgba(255, 95, 87, 0.16);
    color: #ff9a94;
}

.definition-list {
    display: grid;
    grid-template-columns: minmax(110px, 150px) 1fr;
    gap: 0.65rem 1rem;
    margin: 0;
}

.definition-list dt {
    color: var(--muted);
    font-weight: 500;
}

.definition-list dd {
    margin: 0;
    color: var(--text);
    word-break: break-word;
}

.system-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 767.98px) {
    .definition-list {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
}

.filter-summary {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.preset-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-filter {
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
    color: var(--text);
    padding-inline: 1rem;
}

.btn-filter.active,
.btn-filter:hover {
    background: rgba(255, 159, 67, 0.16);
    border-color: rgba(255, 159, 67, 0.35);
    background: color-mix(in srgb, var(--orange) 20%, transparent);
    border-color: color-mix(in srgb, var(--orange) 45%, transparent);
    color: var(--text-strong);
}

.kpi-card {
    height: 100%;
    border-radius: 24px;
    padding: 1.25rem;
    background: var(--surface-strong);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    animation: fadeUp 500ms ease both;
}

.kpi-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 26px 42px rgba(0, 0, 0, 0.2);
}

.kpi-card::after {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    right: -50px;
    top: -45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

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

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: var(--surface-soft);
}

.kpi-label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-left: auto;
}

.kpi-value-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
}

.kpi-value {
    font-size: clamp(2rem, 3vw, 2.7rem);
    font-weight: 700;
    line-height: 1;
}

.kpi-unit {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.kpi-context {
    color: var(--muted);
    min-height: 2.8rem;
    position: relative;
    z-index: 1;
}

.kpi-trend {
    font-size: 0.92rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.trend-up { color: #80ed99; }
.trend-down { color: #ff8b8b; }
.trend-flat { color: #b9c9e4; }

.theme-hot .kpi-icon,
.theme-hot .panel-eyebrow { color: var(--hot); }
.theme-blue .kpi-icon,
.theme-blue .panel-eyebrow { color: var(--blue); }
.theme-green .kpi-icon,
.theme-green .panel-eyebrow { color: var(--green); }
.theme-orange .kpi-icon,
.theme-orange .panel-eyebrow { color: var(--orange); }
.theme-rain .kpi-icon,
.theme-rain .panel-eyebrow { color: var(--rain); }

.theme-hot { background: linear-gradient(180deg, color-mix(in srgb, var(--hot) 22%, transparent), color-mix(in srgb, var(--surface-strong) 96%, transparent)); }
.theme-blue { background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 22%, transparent), color-mix(in srgb, var(--surface-strong) 96%, transparent)); }
.theme-green { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 22%, transparent), color-mix(in srgb, var(--surface-strong) 96%, transparent)); }
.theme-orange { background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 22%, transparent), color-mix(in srgb, var(--surface-strong) 96%, transparent)); }
.theme-rain { background: linear-gradient(180deg, color-mix(in srgb, var(--rain) 24%, transparent), color-mix(in srgb, var(--surface-strong) 96%, transparent)); }

[data-theme="light"] .theme-hot { background: linear-gradient(180deg, color-mix(in srgb, var(--hot) 16%, white), rgba(255,255,255,0.98)); }
[data-theme="light"] .theme-blue { background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 16%, white), rgba(255,255,255,0.98)); }
[data-theme="light"] .theme-green { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 16%, white), rgba(255,255,255,0.98)); }
[data-theme="light"] .theme-orange { background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 16%, white), rgba(255,255,255,0.98)); }
[data-theme="light"] .theme-rain { background: linear-gradient(180deg, color-mix(in srgb, var(--rain) 16%, white), rgba(255,255,255,0.98)); }

.panel-eyebrow {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
}

.chart-panel {
    min-height: 390px;
    animation: fadeUp 700ms ease both;
}

.forecast-panel {
    animation: fadeUp 620ms ease both;
}

.forecast-head {
    align-items: flex-start;
}

.forecast-copy {
    color: var(--muted);
    max-width: 58ch;
}

.forecast-status {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px dashed var(--surface-border);
    background: var(--surface-soft);
    background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
    color: var(--muted);
}

.forecast-status.is-error {
    border-color: rgba(255, 95, 87, 0.3);
    color: #ffb4af;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.forecast-day {
    border-radius: 22px;
    padding: 1.1rem;
    border: 1px solid var(--surface-border);
    background: linear-gradient(180deg, var(--surface-soft), var(--surface));
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 96%, transparent), color-mix(in srgb, var(--surface) 92%, transparent));
    min-height: 100%;
}

.forecast-day-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.forecast-day-name {
    display: block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.forecast-day-date {
    display: block;
    font-weight: 600;
    color: var(--text-strong);
}

.forecast-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(77, 163, 255, 0.14);
    background: color-mix(in srgb, var(--blue) 14%, transparent);
    color: var(--text-strong);
    font-size: 1.3rem;
}

.forecast-summary {
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.85rem;
}

.forecast-temps {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.forecast-temp-max {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-strong);
}

.forecast-temp-min {
    font-size: 1rem;
    color: var(--muted);
}

.forecast-details {
    display: grid;
    gap: 0.5rem;
}

.forecast-detail {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.92rem;
}

.forecast-detail span:first-child {
    color: var(--muted);
}

.forecast-detail span:last-child {
    color: var(--text);
    font-weight: 600;
}

.alert-stack {
    display: grid;
    gap: 0.85rem;
}

.weather-alert {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    border-radius: 20px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: fadeUp 420ms ease both;
}

.weather-alert strong {
    color: var(--text-strong);
    display: block;
    margin-bottom: 0.15rem;
}

.weather-alert p {
    color: var(--muted);
}

.weather-alert-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex: 0 0 42px;
}

.weather-alert-danger {
    border-color: color-mix(in srgb, var(--hot) 38%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--hot) 18%, transparent), var(--surface));
}

.weather-alert-danger .weather-alert-icon {
    color: #fff3f2;
    background: color-mix(in srgb, var(--hot) 24%, transparent);
}

.weather-alert-warning {
    border-color: color-mix(in srgb, var(--warning) 36%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 18%, transparent), var(--surface));
}

.weather-alert-warning .weather-alert-icon {
    color: #fff8e1;
    background: color-mix(in srgb, var(--warning) 24%, transparent);
}

.weather-alert-neutral .weather-alert-icon {
    color: #d2ffe3;
    background: color-mix(in srgb, var(--green) 20%, transparent);
}

.chart-panel h2,
.chart-card h2,
.table-card h2 {
    font-size: 1.15rem;
    margin-bottom: 0;
}

.mini-stat-card {
    height: 100%;
}

.mini-stat-card strong {
    font-size: 1.8rem;
    display: block;
    margin-top: 0.35rem;
}

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

.table-card {
    overflow: hidden;
}

.historico-table-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.historico-table-shell .dt-container,
.historico-table-shell .dataTables_wrapper {
    width: 100%;
    max-width: 100%;
}

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-hover-color: var(--text-strong);
    --bs-table-hover-bg: var(--surface-soft);
    --bs-table-hover-bg: color-mix(in srgb, var(--surface-soft) 88%, transparent);
    --bs-table-border-color: var(--surface-border);
}

.table > :not(caption) > * > * {
    padding: 0.95rem 0.85rem;
}

.historico-table {
    min-width: 1180px;
    table-layout: auto;
}

@media (max-width: 430px) {
    .historico-table {
        min-width: 100%;
    }

    .historico-table > thead > tr > th,
    .historico-table > tbody > tr > td {
        padding: 0.75rem 0.5rem;
        font-size: 0.7rem !important;
    }
}

.historico-table > thead > tr > th {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    /* letter-spacing: 0.12em; */
    color: var(--muted) !important;
}

.historico-table > tbody > tr > td {
    white-space: nowrap;
    font-size: 0.75rem !important;
    font-weight: 300 !important;
}

.pagination-dark .page-link {
    background: var(--surface-soft);
    border-color: var(--surface-border);
    color: var(--text);
}

.pagination-dark .page-item.active .page-link {
    background: var(--orange);
    border-color: var(--orange);
    color: #1f1300;
}

.historico-table-shell .dt-layout-row:last-child {
    margin-top: 0.85rem;
}

.historico-table-shell .pagination {
    gap: 0.25rem;
}

.historico-table-shell .page-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    line-height: 1.1;
    min-width: 2rem;
}

.historico-table-shell .dt-info,
.historico-table-shell .dt-length label,
.historico-table-shell .dt-search label {
    font-size: 0.82rem;
}

@media (max-width: 575.98px) {
    .historico-table-shell .page-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.72rem;
        min-width: 1.8rem;
    }
}

.form-control,
.btn,
.page-link {
    border-radius: 14px;
}

.form-control {
    background: var(--surface-soft);
    border-color: var(--surface-border);
    color: var(--text);
}

select.form-control {
    color: var(--text);
    background-color: var(--surface-soft);
}

select.form-control option,
select.form-control optgroup {
    color: var(--text-strong);
    background: color-mix(in srgb, var(--surface-strong) 96%, black 4%);
}

.form-control:focus {
    background: var(--surface-soft);
    background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
    color: var(--text);
    border-color: var(--orange);
    border-color: color-mix(in srgb, var(--orange) 62%, transparent);
    box-shadow: 0 0 0 0.25rem rgba(255, 159, 67, 0.16);
}

.btn-primary {
    background: linear-gradient(135deg, #ffb347, #ff8c42);
    border: none;
    color: #23160b;
    font-weight: 700;
}

.btn-outline-light,
.btn-outline-secondary {
    border-color: var(--surface-border);
    color: var(--text);
}

.btn-outline-light:hover,
.btn-outline-secondary:hover {
    background: var(--surface-soft);
    border-color: var(--surface-border);
    border-color: color-mix(in srgb, var(--surface-border) 90%, transparent);
    color: var(--text-strong);
}

.chart-card h2,
.table-card h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

canvas {
    width: 100% !important;
    height: 320px !important;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .dashboard-hero,
    .hero-panel,
    .forecast-head,
    .table-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-metrics {
        width: 100%;
    }

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

}

@media (max-width: 575.98px) {
    .dashboard-hero,
    .hero-panel,
    .filter-panel,
    .filter-card,
    .forecast-panel,
    .chart-panel,
    .chart-card,
    .table-card,
    .mini-stat-card,
    .kpi-card {
        border-radius: 20px;
    }

    .display-title {
        font-size: 2.1rem;
    }

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

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