*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Montserrat', Helvetica, Arial, sans-serif;
    background: #F8FAFC;
    color: #1E293B;
    min-height: 100vh;
    padding-bottom: 24px;
}

/* Site header */
.site-header {
    background: #fff;
    text-align: center;
    padding-top: 28px;
}

.site-header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-logo {
    display: inline-block;
    font-size: 3rem;
    font-weight: 700;
    color: #004d92;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.site-logo .dot {
    color: #ecb800;
}

.site-tagline {
    font-size: 0.7rem;
    font-weight: 500;
    color: #666;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

.site-nav {
    margin-top: 24px;
}

.site-nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-menu li a {
    display: block;
    padding: 12px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(0,0,0,0.6);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-menu li a:hover {
    color: #004d92;
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #004d92;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.nav-social a:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .site-logo { font-size: 2rem; }
    .site-tagline { font-size: 0.55rem; letter-spacing: 0.5px; }
    .site-nav-inner { flex-direction: column; gap: 0; }
    .nav-menu { gap: 0; }
    .nav-menu li a { padding: 8px 10px; font-size: 0.7rem; }
    .nav-social { margin-left: 0; padding-bottom: 8px; }
}

/* Page header */
.page-header {
    text-align: center;
    padding: 20px 16px 4px;
    background: #fff;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #004d92;
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Range selector */
.range-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.range-label {
    font-size: 14px;
    color: #64748B;
    font-weight: 500;
}

.range-select {
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 36px 8px 12px;
    font-size: 14px;
    color: #1E293B;
    cursor: pointer;
    transition: border-color 0.2s;
}

.range-select:focus {
    outline: none;
    border-color: #3B82F6;
}

/* Chart card */
.chart-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Chart toolbar */
.chart-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.reset-zoom-btn {
    background: none;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    color: #64748B;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.reset-zoom-btn:hover {
    border-color: #3B82F6;
    color: #3B82F6;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
}

.stat-sensor {
    font-size: 12px;
    font-weight: 600;
    color: #3B82F6;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.stat-row--current {
    padding: 4px 6px;
    background: #EFF6FF;
    border-radius: 6px;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 12px;
    color: #94A3B8;
    width: 28px;
    font-weight: 500;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
}

.stat-time {
    font-size: 11px;
    color: #94A3B8;
    margin-left: auto;
}

/* Loader */
.loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(248, 250, 252, 0.75);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E2E8F0;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Custom date selection */
.custom-range {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.custom-range-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.custom-range-title {
    font-size: 12px;
    color: #64748B;
    font-weight: 600;
    width: 100%;
}

.custom-range-group label {
    font-size: 12px;
    color: #94A3B8;
}

.custom-select {
    appearance: none;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    color: #1E293B;
    cursor: pointer;
}

.custom-select:focus {
    outline: none;
    border-color: #3B82F6;
}

.apply-btn {
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.apply-btn:hover {
    background: #2563EB;
}
