html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #f4f3ee;
    color: #1a1a1a;
    min-height: 100vh;
}

header {
    background: white;
    border-bottom: 0.5px solid #e0dfd6;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left h1 {
    font-size: 1.1rem;
    font-weight: 500;
}

.header-left p {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

form {
    display: flex;
    align-items: center;
    gap: 8px;
}

    form label {
        font-size: 13px;
        color: #666;
    }

    form select {
        font-size: 13px;
        border: 0.5px solid #ccc;
        border-radius: 6px;
        padding: 5px 10px;
        background: white;
        cursor: pointer;
    }

main {
    padding: 1.5rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.calibration-panel {
    background: #fff;
    border: 1px dashed #bbb;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.calibration-title {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
}

.cal-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

    .cal-input-group input {
        width: 70px;
        padding: 4px 8px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-weight: 600;
    }

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 1.5rem;
}

.metric {
    background: white;
    border-radius: 10px;
    border: 0.5px solid #e0dfd6;
    padding: 0.9rem 1rem;
}

.metric-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1;
}

.metric-unit {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

.metric.highlight {
    border: 1.5px solid #185fa5;
    background: #f0f7ff;
}

    .metric.highlight .metric-label {
        color: #185fa5;
        font-weight: 700;
    }

    .metric.highlight .metric-value {
        color: #185fa5;
    }

.charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.chart-card {
    background: white;
    border-radius: 12px;
    border: 0.5px solid #e0dfd6;
    padding: 1.25rem;
}

    .chart-card.full {
        grid-column: 1 / -1;
    }

    .chart-card h2 {
        font-size: 0.8rem;
        font-weight: 500;
        color: #777;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 1rem;
    }

.legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

    .legend span {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 11px;
        color: #666;
    }

    .legend i {
        display: inline-block;
        width: 20px;
        height: 3px;
        border-radius: 2px;
    }

.chart-wrap {
    position: relative;
    height: 200px;
}

    .chart-wrap.tall {
        height: 240px;
    }

.no-data {
    text-align: center;
    padding: 4rem;
    color: #aaa;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    padding: 2rem;
}

@@media (max-width: 640px) {
    main {
        padding: 1rem;
    }

    .charts {
        grid-template-columns: 1fr;
    }

    .chart-card.full {
        grid-column: 1;
    }
}

.sensors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 1rem;
}

.sensor-card {
    display: block;
    background: #ffffff;
    border: 0.5px solid #e0dfd6;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: inherit;
    transition: 0.2s ease;
}

    .sensor-card:hover {
        border-color: #185fa5;
        box-shadow: 0 0 0 2px rgba(24,95,165,0.15);
        transform: translateY(-2px);
    }

.sensor-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.sensor-id {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 8px;
    word-break: break-all;
}

.sensor-tag {
    display: inline-block;
    background: #f0f7ff;
    color: #185fa5;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 6px;
    border: 1px solid rgba(24,95,165,0.3);
}