:root {
    --ink: #132235;
    --muted: #64748b;
    --line: #dce4ec;
    --surface: #ffffff;
    --canvas: #f3f6f8;
    --navy: #10263f;
    --navy-2: #173a5e;
    --aqua: #1b8e9d;
    --aqua-soft: #e5f5f6;
    --heat: #df7a31;
    --heat-soft: #fff1e5;
    --success: #22845f;
    --danger: #b64141;
    --radius: 16px;
    --shadow: 0 12px 34px rgba(22, 45, 68, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100vh;
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.55;
}

a { color: var(--navy-2); }
.app-shell { width: min(1380px, calc(100% - 2rem)); margin-inline: auto; }
.app-navbar { background: var(--navy); color: #fff; box-shadow: 0 8px 24px rgba(16, 38, 63, .16); }
.navbar-brand { display: inline-flex; align-items: center; gap: .7rem; color: #fff !important; font-weight: 760; letter-spacing: -.02em; }
.brand-mark { width: 2rem; height: 2rem; border-radius: 10px; display: flex; align-items: end; justify-content: center; gap: 2px; padding: 6px; background: linear-gradient(145deg, #23a9b5, #176d8e); }
.brand-mark span { width: 4px; border-radius: 4px; background: #fff; }
.brand-mark span:nth-child(1) { height: 55%; }.brand-mark span:nth-child(2) { height: 90%; }.brand-mark span:nth-child(3) { height: 70%; }
.app-nav-links { gap: .2rem; margin-left: 1.4rem; }
.app-navbar .nav-link { color: rgba(255,255,255,.72); font-size: .92rem; font-weight: 580; border-radius: 9px; padding: .55rem .72rem !important; }
.app-navbar .nav-link:hover, .app-navbar .nav-link:focus { color: #fff; background: rgba(255,255,255,.08); }
.app-navbar .nav-link.active { color: #fff; background: rgba(65, 196, 205, .18); }
.navbar-toggler { border-color: rgba(255,255,255,.25); }.navbar-toggler-icon { filter: invert(1); }
.navbar-user { display: flex; align-items: center; gap: .75rem; }
.user-meta { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; min-width: 0; }
.user-meta strong, .user-meta small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: .88rem; }.user-meta small { color: rgba(255,255,255,.62); font-size: .76rem; }
.user-avatar { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--navy); font-weight: 750; }
.btn-quiet { color: #fff; border: 1px solid rgba(255,255,255,.25); }.btn-quiet:hover { color: #fff; background: rgba(255,255,255,.1); }

.app-main { min-height: calc(100vh - 130px); padding: 2rem 0 3rem; }
.app-footer { padding: 1.2rem 0; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); background: rgba(255,255,255,.55); }
.app-footer .app-shell { display: flex; justify-content: space-between; gap: 1rem; }

.page-head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: end; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.25rem); letter-spacing: -.035em; font-weight: 760; }
.page-head p { margin: .3rem 0 0; color: var(--muted); max-width: 68ch; }
.eyebrow { color: var(--aqua); font-size: .76rem; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }

.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 1rem 1.2rem; font-weight: 700; }
.card-body { padding: 1.25rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.metric { padding: 1.15rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.metric small { color: var(--muted); font-weight: 600; }.metric strong { display: block; margin-top: .25rem; font-size: 1.65rem; line-height: 1.15; letter-spacing: -.03em; }
.metric.water { border-top: 4px solid var(--aqua); }.metric.heat { border-top: 4px solid var(--heat); }.metric.warning { border-top: 4px solid #d6a51e; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 1.25rem; align-items: start; }
.stack { display: grid; gap: 1.25rem; }

.table { --bs-table-bg: transparent; margin: 0; }.table > :not(caption) > * > * { padding: .82rem .75rem; border-bottom-color: #e7edf2; vertical-align: middle; }
.table thead th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .055em; font-weight: 720; border-bottom-width: 1px; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.badge-soft { display: inline-flex; align-items: center; padding: .35rem .58rem; border-radius: 999px; font-size: .76rem; font-weight: 700; background: #edf2f6; color: #40576d; }
.badge-soft.success { background: #e5f5ee; color: #176b4a; }.badge-soft.warning { background: #fff4d4; color: #795c00; }.badge-soft.danger { background: #fdeaea; color: #943535; }.badge-soft.water { background: var(--aqua-soft); color: #126c76; }.badge-soft.heat { background: var(--heat-soft); color: #a24b13; }

.btn { border-radius: 10px; font-weight: 650; padding: .58rem .9rem; }.btn-primary { --bs-btn-bg: var(--navy-2); --bs-btn-border-color: var(--navy-2); --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy); }
.btn-aqua { color: #fff; background: var(--aqua); border-color: var(--aqua); }.btn-aqua:hover { color: #fff; background: #147783; border-color: #147783; }
.form-control, .form-select { min-height: 44px; border-color: #cdd8e2; border-radius: 10px; }.form-control:focus, .form-select:focus { border-color: var(--aqua); box-shadow: 0 0 0 .2rem rgba(27,142,157,.14); }
.form-label { font-size: .88rem; font-weight: 680; }.form-text { color: var(--muted); }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .85rem; }.section-title h2 { margin: 0; font-size: 1.15rem; font-weight: 730; }
.empty-state { padding: 3rem 1.25rem; text-align: center; border: 1px dashed #bdcbd7; border-radius: var(--radius); background: rgba(255,255,255,.66); }.empty-state h1, .empty-state h2 { font-size: 1.35rem; }.empty-state p { color: var(--muted); max-width: 55ch; margin-inline: auto; }
.callout { padding: 1rem 1.1rem; border-radius: 12px; background: #eaf3fa; border-left: 4px solid #3f7dab; }.callout.warning { background: #fff7df; border-left-color: #d3a018; }.callout.success { background: #e8f7f0; border-left-color: var(--success); }

.mini-bars { display: flex; align-items: end; gap: .65rem; min-height: 190px; padding-top: 1rem; overflow-x: auto; }
.bar-item { flex: 1 0 58px; display: grid; grid-template-rows: 145px auto; gap: .5rem; text-align: center; color: var(--muted); font-size: .72rem; }
.bar-track { display: flex; align-items: end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--line); }
.bar { width: 13px; min-height: 3px; border-radius: 5px 5px 0 0; background: var(--aqua); }.bar.hot { background: var(--heat); }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: .82rem; }.legend span::before { content: ''; width: .7rem; height: .7rem; display: inline-block; margin-right: .4rem; border-radius: 3px; background: var(--aqua); }.legend .hot::before { background: var(--heat); }

@media (max-width: 991.98px) {
    .app-nav-links { margin: 1rem 0; }.navbar-user { padding: .75rem 0 1rem; border-top: 1px solid rgba(255,255,255,.12); justify-content: space-between; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .app-shell { width: min(100% - 1rem, 1380px); }.app-main { padding-top: 1.2rem; }.page-head { align-items: stretch; flex-direction: column; }.metric-grid { grid-template-columns: 1fr; }
    .app-footer .app-shell { flex-direction: column; }.card-body { padding: 1rem; }
}
