:root {
    --bg: #06171f;
    --panel: #0a222d;
    --panel-soft: #0d2a36;
    --line: rgba(160, 201, 216, 0.14);
    --text: #f3f8fa;
    --muted: #8eabb6;
    --mint: #55e6b5;
    --cyan: #55c9ee;
    --orange: #ff9f66;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 78% 8%, rgba(38, 160, 171, 0.16), transparent 28rem),
        radial-gradient(circle at 5% 70%, rgba(60, 225, 171, 0.08), transparent 25rem),
        var(--bg);
}

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 48px; }

.topbar {
    min-height: 96px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-weight: 900;
    font-size: 22px;
    color: #05251d;
    background: linear-gradient(135deg, var(--mint), #b7ffe7);
    box-shadow: 0 0 30px rgba(85, 230, 181, 0.24);
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 18px; letter-spacing: -0.02em; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.18em; }
.eyebrow.accent { color: var(--mint); margin-bottom: 14px; }

.connection {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #84959c; box-shadow: 0 0 12px currentColor; }
.connection.online { color: var(--mint); border-color: rgba(85, 230, 181, 0.25); }
.connection.offline { color: #ff8d78; border-color: rgba(255, 141, 120, 0.25); }
.connection.online .status-dot, .connection.offline .status-dot { background: currentColor; }

.hero-copy {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    align-items: end;
    gap: 48px;
    padding: 54px 0 34px;
}

h2 { font-size: clamp(38px, 6vw, 68px); line-height: 0.98; letter-spacing: -0.055em; }
.description { max-width: 480px; color: var(--muted); line-height: 1.65; font-size: 15px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }

.metric-card {
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 18px;
    align-items: center;
    min-height: 152px;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(15, 47, 60, 0.9), rgba(8, 31, 41, 0.88));
    box-shadow: var(--shadow);
}

.metric-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    right: -45px;
    top: -50px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.06;
    filter: blur(4px);
}

.temperature-card { color: var(--orange); }
.humidity-card { color: var(--cyan); }
.update-card { color: var(--mint); }
.metric-card > div:last-child { display: flex; flex-direction: column; }
.metric-card p { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.metric-card strong { color: var(--text); font-size: 38px; line-height: 1; letter-spacing: -0.04em; }
.metric-card strong small { color: currentColor; font-size: 16px; font-weight: 800; }
.metric-card .time-value { font-size: 32px; }
.metric-note { color: var(--muted); font-size: 11px; margin-top: 9px; }

.metric-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    color: currentColor;
    background: color-mix(in srgb, currentColor 12%, transparent);
    border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    font-size: 25px;
    font-weight: 800;
}
.metric-icon.drop { font-size: 17px; transform: rotate(45deg); }
.metric-icon.drop + div { transform: none; }

.chart-panel {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(8, 31, 41, 0.84);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chart-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.chart-header h3 { margin-top: 5px; font-size: 20px; letter-spacing: -0.02em; }

.date-control { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
input[type="date"] { color-scheme: dark; padding: 10px 12px; color: var(--text); background: #0c2834; border: 1px solid var(--line); border-radius: 10px; font: inherit; outline: none; }
input[type="date"]:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(85, 230, 181, 0.1); }

.chart-wrap { position: relative; height: 410px; padding: 22px 20px 12px; }
.empty-state { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 8px; background: rgba(8, 31, 41, 0.75); }
.empty-state[hidden] { display: none; }
.empty-state strong { font-size: 17px; }
.empty-state span { color: var(--muted); font-size: 13px; }
.chart-footer { display: flex; justify-content: space-between; padding: 15px 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

@media (max-width: 760px) {
    .page-shell { width: min(100% - 22px, 1180px); }
    .topbar { min-height: 82px; }
    .connection span:last-child { display: none; }
    .hero-copy { grid-template-columns: 1fr; gap: 20px; padding-top: 38px; }
    .metrics { grid-template-columns: 1fr; }
    .metric-card { min-height: 125px; }
    .chart-header { align-items: flex-start; flex-direction: column; }
    .date-control { width: 100%; justify-content: space-between; }
    .chart-wrap { height: 340px; padding-left: 8px; }
    .chart-footer { gap: 12px; flex-direction: column; }
}
