:root {
    --brand: #a81878;
    --brand-strong: #81125f;
    --brand-bright: #d51a8d;
    --brand-soft: #f9eaf4;
    --brand-border: #e9bddb;
    --accent: #e39c22;
    --success: #15966e;
    --success-soft: #e8f7f1;
    --danger: #bd3b51;
    --danger-soft: #fff0f2;
    --text-primary: #251e27;
    --text-secondary: #5c5260;
    --text-muted: #817783;
    --surface: #fff;
    --surface-subtle: #f7f6f8;
    --surface-muted: #f1eff2;
    --border-soft: #e8e3e9;
    --border: #ddd6df;
    --shadow-sm: 0 3px 12px rgba(38, 24, 39, .05);
    --shadow-md: 0 12px 34px rgba(46, 25, 45, .08);
    --shadow-lg: 0 22px 60px rgba(39, 18, 39, .16);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text-primary);
    background: var(--surface-subtle);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--text-primary); background: var(--surface-subtle); }
button, input { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1:focus { outline: none; }

/* Shared typography and controls */
.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--brand);
    font-size: .69rem;
    font-weight: 700;
    letter-spacing: .15em;
}

.eyebrow.light { color: #e8a7d1; }

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: .79rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, color .14s, background .14s, border-color .14s;
}

.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--brand-bright), var(--brand-strong)); box-shadow: 0 8px 20px rgba(168,24,120,.18); }
.button-primary:hover { box-shadow: 0 10px 24px rgba(168,24,120,.26); }
.button-secondary { color: var(--brand); border-color: var(--brand-border); background: #fff; }
.button-secondary:hover { background: var(--brand-soft); }
.button-ghost { color: var(--text-secondary); border-color: var(--border-soft); background: transparent; }
.button-small { min-height: 36px; padding-inline: 13px; font-size: .73rem; }

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.page-header h1 {
    margin-bottom: 7px;
    font-size: clamp(1.75rem, 2.5vw, 2.35rem);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.page-header p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.result-count { padding: 8px 12px; border: 1px solid var(--border-soft); border-radius: 99px; color: var(--text-muted); background: #fff; font-size: .72rem; font-weight: 600; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: .76rem;
    font-weight: 600;
    text-decoration: none;
}
.back-link:hover { color: var(--brand); }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 10px;
    font-size: .8rem;
    line-height: 1.45;
}
.alert-error { color: #8e263a; border-color: #f0c5cd; background: var(--danger-soft); }

.loading-panel {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.loading-panel.tall { min-height: 300px; }
.loading-panel div { display: grid; gap: 3px; }
.loading-panel strong { font-size: .84rem; }
.loading-panel small { color: var(--text-muted); font-size: .72rem; }

.spinner {
    width: 24px;
    height: 24px;
    display: inline-block;
    flex: 0 0 auto;
    border: 2px solid #ecdbe7;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.route-loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 11px; color: var(--text-muted); font-size: .8rem; }

.empty-state {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    text-align: center;
    background: rgba(255,255,255,.65);
}
.empty-state.inline { min-height: 220px; margin-bottom: 22px; }
.empty-state h1, .empty-state h2 { margin: 14px 0 7px; font-size: 1.15rem; }
.empty-state p { max-width: 500px; margin: 0; color: var(--text-muted); font-size: .8rem; }
.empty-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 16px; color: var(--brand); background: var(--brand-soft); }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: var(--surface-subtle); }
.login-panel { width: 100%; display: grid; place-items: center; }
.login-card { width: min(100%, 420px); padding: 34px; border: 1px solid var(--border-soft); border-radius: 16px; background: #fff; box-shadow: var(--shadow-md); }
.login-logo { width: 215px; max-width: 72%; height: auto; display: block; margin: 0 0 34px; }
.login-card h1 { margin-bottom: 10px; font-size: 2rem; letter-spacing: -.04em; }
.module-meta .status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #51d89a; box-shadow: 0 0 0 4px rgba(81,216,154,.12); }
.login-card .alert { margin-bottom: 20px; }
.login-form { display: flex; flex-direction: column; }
.login-form > label:not(.remember-option) { margin: 17px 0 8px; color: var(--text-secondary); font-size: .73rem; font-weight: 650; }
.input-with-icon { position: relative; color: #9a8e9b; }
.input-with-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.input-with-icon input { width: 100%; height: 48px; padding: 0 14px 0 44px; border: 1px solid var(--border); border-radius: 9px; color: var(--text-primary); outline: 0; background: #fff; font-size: .82rem; transition: border-color .15s, box-shadow .15s; }
.input-with-icon input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(168,24,120,.09); }
.input-with-icon input::placeholder { color: #aaa0aa; }
.remember-option { display: flex; align-items: center; gap: 9px; margin: 17px 0 24px; color: var(--text-secondary); font-size: .73rem; cursor: pointer; }
.remember-option input { width: 15px; height: 15px; accent-color: var(--brand); }
.login-submit { width: 100%; min-height: 48px; }
.login-submit svg { margin-left: auto; }

/* Home */
.home-header { align-items: center; }
.today-card { display: flex; align-items: center; gap: 12px; min-width: 210px; padding: 13px 16px; border: 1px solid var(--border-soft); border-radius: 11px; color: var(--brand); background: #fff; box-shadow: var(--shadow-sm); }
.today-card div { display: grid; gap: 2px; }
.today-card small { color: var(--text-muted); font-size: .6rem; font-weight: 700; letter-spacing: .12em; }
.today-card strong { color: var(--text-primary); font-size: .75rem; text-transform: capitalize; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.module-card { position: relative; min-height: 330px; overflow: hidden; display: flex; flex-direction: column; padding: 30px; border: 1px solid var(--border-soft); border-radius: 17px; color: inherit; background: #fff; box-shadow: var(--shadow-sm); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.module-card::after { content: ""; position: absolute; right: -70px; bottom: -110px; width: 250px; height: 250px; border-radius: 50%; background: var(--brand-soft); transition: transform .25s ease; }
.module-card:hover { transform: translateY(-4px); border-color: var(--brand-border); box-shadow: var(--shadow-md); }
.module-card:hover::after { transform: scale(1.12); }
.silos-card::after { background: #eaf6f2; }
.module-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.module-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 16px; color: var(--brand); background: var(--brand-soft); }
.silos-card .module-icon { color: #168063; background: #e8f6f1; }
.module-arrow { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border-soft); border-radius: 50%; color: var(--text-muted); }
.module-copy { position: relative; z-index: 1; margin: 34px 0 auto; }
.module-kicker { color: var(--brand); font-size: .65rem; font-weight: 700; letter-spacing: .13em; }
.silos-card .module-kicker { color: #168063; }
.module-copy h2 { margin: 6px 0 12px; font-size: 1.65rem; letter-spacing: -.035em; }
.module-copy p { max-width: 520px; margin: 0; color: var(--text-muted); font-size: .8rem; line-height: 1.65; }
.module-meta { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--border-soft); font-size: .69rem; }
.module-meta span { display: flex; align-items: center; gap: 9px; color: var(--text-muted); }
.module-meta strong { color: var(--brand); font-size: .72rem; }
.silos-card .module-meta strong { color: #168063; }

/* Location lists */
.location-stack { display: grid; gap: 20px; }
.location-card { overflow: hidden; border: 1px solid var(--border-soft); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.location-card-header { min-height: 78px; display: flex; align-items: center; gap: 13px; padding: 15px 22px; border-bottom: 1px solid var(--border-soft); background: linear-gradient(90deg, #fff, #fcf8fb); }
.location-heading-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.location-card-header > div:nth-child(2) { display: grid; gap: 2px; }
.location-card-header span:not(.location-total) { color: var(--text-muted); font-size: .59rem; font-weight: 700; letter-spacing: .12em; }
.location-card-header h2 { margin: 0; font-size: 1rem; }
.location-total { margin-left: auto; color: var(--text-muted); font-size: .68rem; }
.silo-heading .location-heading-icon { color: var(--success); background: var(--success-soft); }
.room-list { padding: 5px 22px; }
.room-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--border-soft); }
.room-row:last-child { border-bottom: 0; }
.room-title { display: grid; align-content: start; gap: 4px; padding-top: 8px; }
.room-title small { color: var(--text-muted); font-size: .58rem; font-weight: 700; letter-spacing: .11em; }
.room-title strong { font-size: .8rem; }
.department-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 9px; }
.department-chip { min-height: 52px; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid var(--border-soft); border-radius: 10px; text-decoration: none; transition: border-color .15s, background .15s, transform .15s; }
.department-chip:hover { transform: translateY(-1px); border-color: var(--brand-border); background: #fdf9fc; }
.department-copy { min-width: 0; display: grid; flex: 1; }
.department-chip strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.department-chip > svg { color: #aa9fac; }
.silo-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 11px; padding: 19px 22px 22px; }
.silo-select-card { display: flex; align-items: center; gap: 13px; min-height: 82px; padding: 12px 13px; border: 1px solid var(--border-soft); border-radius: 11px; text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.silo-select-card:hover { transform: translateY(-2px); border-color: #b9dfd3; box-shadow: var(--shadow-sm); }
.silo-illustration { width: 48px; height: 53px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--success); background: var(--success-soft); }
.silo-select-copy { min-width: 0; display: grid; flex: 1; gap: 3px; }
.silo-select-copy small { color: var(--success); font-size: .57rem; font-weight: 700; letter-spacing: .11em; }
.silo-select-copy strong { overflow: hidden; font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.round-arrow { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--text-muted); background: var(--surface-subtle); }

/* Detail pages */
.detail-hero { position: relative; overflow: hidden; min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 27px 30px; border-radius: 15px; color: #fff; background: linear-gradient(125deg, #32152f, #771658 70%, #a51c76); box-shadow: var(--shadow-md); }
.detail-hero::after { content: ""; position: absolute; right: -70px; top: -120px; width: 290px; height: 290px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.035), 0 0 0 78px rgba(255,255,255,.025); }
.detail-hero.silo-hero { background: linear-gradient(125deg, #12362e, #17644f 70%, #168369); }
.detail-hero > div { position: relative; z-index: 1; }
.detail-breadcrumb { margin-bottom: 8px; color: #d8bcd0; font-size: .69rem; font-weight: 500; }
.silo-hero .detail-breadcrumb { color: #b7dbd0; }
.detail-breadcrumb span { margin: 0 7px; opacity: .55; }
.detail-hero h1 { margin: 0 0 17px; font-size: clamp(1.55rem, 2.5vw, 2.25rem); letter-spacing: -.035em; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tags > span { padding: 6px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 7px; color: #e5d8e2; background: rgba(255,255,255,.07); font-size: .66rem; }
.silo-hero .detail-tags > span { color: #d8ebe5; }
.detail-tags strong { color: #fff; }
.hero-icon { width: 67px; height: 67px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; background: rgba(255,255,255,.09); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 13px; margin-bottom: 20px; }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { min-height: 127px; display: flex; flex-direction: column; padding: 19px; border: 1px solid var(--border-soft); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.metric-card.featured { color: #fff; border-color: transparent; background: linear-gradient(140deg, #b8197c, #83115f); }
.metric-card.featured.green { background: linear-gradient(140deg, #168c69, #11644f); }
.metric-label { color: var(--text-muted); font-size: .58rem; font-weight: 700; letter-spacing: .11em; }
.metric-card.featured .metric-label { color: rgba(255,255,255,.7); }
.metric-card > strong { margin: 11px 0 auto; font-size: 1.65rem; line-height: 1; letter-spacing: -.04em; }
.metric-card > strong small { font-size: .72rem; font-weight: 600; letter-spacing: 0; }
.metric-foot { margin-top: 12px; color: var(--text-muted); font-size: .63rem; }
.metric-card.featured .metric-foot { color: rgba(255,255,255,.7); }
.panel { overflow: hidden; margin-bottom: 20px; border: 1px solid var(--border-soft); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.panel-header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border-soft); }
.panel-header > div { display: flex; align-items: center; gap: 11px; }
.panel-header > div > div { display: grid; gap: 3px; }
.panel-header h2 { margin: 0; font-size: .9rem; }
.panel-header p { margin: 0; color: var(--text-muted); font-size: .65rem; }
.panel-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); }
.panel-body { padding: 20px; }
.chart-body { min-height: 340px; padding: 17px 18px 10px; }
.weight-chart-panel .chart-body { min-height: 450px; }
.weight-chart-panel .line-chart svg { height: 415px; }

/* Charts */
.line-chart { width: 100%; min-height: 300px; }
.line-chart svg { width: 100%; height: 305px; overflow: visible; }
.chart-legend { min-height: 27px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 15px; padding: 1px 9px 0; }
.chart-legend span { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: .63rem; font-weight: 600; }
.chart-legend i { width: 17px; height: 3px; display: inline-block; border-radius: 2px; }
.chart-grid { stroke: #ebe7ec; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-grid-vertical { stroke-dasharray: 3 5; opacity: .65; }
.chart-axis { stroke: #cfc8d1; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-label { fill: #8b818c; font-size: 11px; font-family: Inter, sans-serif; }
.chart-axis-title { fill: #706671; font-size: 11px; font-weight: 600; font-family: Inter, sans-serif; }
.chart-series-line { fill: none; stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { stroke: #fff; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.empty-chart { min-height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--text-muted); font-size: .75rem; }

/* Tables */
.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .72rem; white-space: nowrap; }
.data-table th { height: 42px; padding: 0 14px; color: var(--text-muted); background: #faf9fa; border-bottom: 1px solid var(--border-soft); font-size: .59rem; font-weight: 700; letter-spacing: .055em; text-align: left; text-transform: uppercase; }
.data-table td { height: 49px; padding: 0 14px; color: var(--text-secondary); border-bottom: 1px solid #f0edf1; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fdfbfc; }
.data-table .number { font-variant-numeric: tabular-nums; text-align: right; }
.data-table .strong { color: var(--text-primary); font-weight: 650; }
.data-table.compact td { height: 44px; }
.day-badge, .hour-badge { min-width: 30px; height: 25px; display: inline-grid; place-items: center; padding: 0 7px; border-radius: 7px; color: var(--brand); background: var(--brand-soft); font-size: .66rem; font-weight: 700; }
.day-badge.subtle { color: var(--text-secondary); background: var(--surface-muted); }
.hour-badge { min-width: 53px; color: var(--success); background: var(--success-soft); }
.value-pill { display: inline-block; min-width: 58px; padding: 5px 7px; border-radius: 7px; color: #157f61; background: var(--success-soft); font-weight: 650; text-align: center; }
.pagination { min-height: 61px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 10px 15px; border-top: 1px solid var(--border-soft); }
.pagination span { color: var(--text-muted); font-size: .67rem; }
.pagination span strong { color: var(--text-secondary); }
.pagination button { min-height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--text-secondary); background: #fff; font-size: .67rem; font-weight: 600; cursor: pointer; }
.pagination button:hover:not(:disabled) { color: var(--brand); border-color: var(--brand-border); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Silo detail */
.filter-bar { display: flex; align-items: flex-end; gap: 11px; margin-bottom: 20px; padding: 16px 18px; border: 1px solid var(--border-soft); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.date-field { display: grid; gap: 6px; }
.date-field label { color: var(--text-muted); font-size: .62rem; font-weight: 700; letter-spacing: .045em; }
.date-field > div { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--brand); }
.date-picker-control { position: relative; min-width: 170px; cursor: pointer; }
.date-value { min-width: 112px; color: var(--text-primary); font-size: .75rem; font-variant-numeric: tabular-nums; }
.date-picker-control input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; opacity: 0; cursor: pointer; }
.selected-date { margin-left: auto; display: grid; gap: 3px; text-align: right; }
.selected-date small { color: var(--text-muted); font-size: .55rem; font-weight: 700; letter-spacing: .11em; }
.selected-date strong { font-size: .73rem; text-transform: capitalize; }
.silo-overview { display: grid; grid-template-columns: minmax(260px, .78fr) minmax(540px, 2.22fr); gap: 13px; margin-bottom: 20px; }
.level-card { min-height: 267px; display: flex; justify-content: space-between; overflow: hidden; padding: 23px; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #173d34, #176b55); box-shadow: var(--shadow-md); }
.level-card-copy { display: flex; flex-direction: column; align-items: flex-start; }
.level-card .metric-label { color: rgba(255,255,255,.68); }
.level-card-copy > strong { margin: auto 0 7px; font-size: 1.75rem; letter-spacing: -.04em; }
.level-card-copy > span:last-child { color: rgba(255,255,255,.66); font-size: .65rem; }
.level-gauge { position: relative; width: 78px; height: 190px; align-self: center; overflow: hidden; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.35); border-radius: 38px 38px 13px 13px; color: rgba(255,255,255,.9); background: rgba(255,255,255,.08); }
.level-fill { position: absolute; inset: auto 0 0; background: linear-gradient(to top, rgba(62,219,165,.65), rgba(96,235,188,.34)); }
.level-gauge svg { position: relative; z-index: 1; }
.silo-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }

/* State pages */
.state-page { min-height: 65vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.state-page h1 { margin: 12px 0 9px; font-size: 1.7rem; letter-spacing: -.04em; }
.state-page p { max-width: 540px; margin-bottom: 23px; color: var(--text-muted); font-size: .82rem; line-height: 1.6; }
.state-icon { width: 68px; height: 68px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 20px; }
.state-icon.warning { color: #9d6d17; background: #fff5dc; }
.state-icon.danger { color: var(--danger); background: var(--danger-soft); }
.state-code { color: var(--brand); font-size: 4.2rem; font-weight: 700; letter-spacing: -.07em; }
.request-id { margin: -12px 0 22px; color: var(--text-muted); }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

@media (max-width: 1180px) {
    .metric-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .silo-overview { grid-template-columns: 1fr; }
    .level-card { min-height: 210px; }
    .level-gauge { height: 160px; }
}

@media (max-width: 900px) {
    .module-grid { grid-template-columns: 1fr; }
    .module-card { min-height: 300px; }
    .room-row { grid-template-columns: 1fr; gap: 11px; }
    .room-title { padding-top: 0; }
    .chart-body { min-height: 300px; padding-inline: 8px; }
    .line-chart svg { height: 280px; }
    .weight-chart-panel .chart-body { min-height: 380px; }
    .weight-chart-panel .line-chart svg { height: 345px; }
    .silo-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .login-page { padding: 18px; }
    .login-card { padding: 27px 22px; }
    .page-header { align-items: flex-start; flex-direction: column; gap: 14px; }
    .home-header .today-card { width: 100%; }
    .module-card { min-height: 320px; padding: 23px; }
    .location-card-header { padding-inline: 15px; }
    .room-list { padding-inline: 15px; }
    .department-links { grid-template-columns: 1fr; }
    .silo-card-grid { grid-template-columns: 1fr; padding-inline: 14px; }
    .detail-hero { align-items: flex-start; padding: 23px 20px; }
    .hero-icon { display: none; }
    .metric-grid.four, .silo-metrics { grid-template-columns: 1fr; }
    .metric-card { min-height: 112px; }
    .panel-header.wrap { align-items: flex-start; flex-direction: column; }
    .panel-header.wrap .button { width: 100%; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .date-field > div, .date-picker-control input { width: 100%; }
    .selected-date { margin: 5px 0 0; text-align: left; }
    .level-card { min-height: 200px; }
    .line-chart { min-width: 610px; }
    .chart-body { overflow-x: auto; }
    .pagination { justify-content: space-between; gap: 7px; }
    .pagination span { text-align: center; }
}
