:root {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111;
    background: #f5f6fa;
}

body {
    margin: 0;
    background: #f5f6fa;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #0d1b2a;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header h1 {
    margin: 0;
    font-size: 1.6rem;
}

.tagline {
    margin: 0.25rem 0 0;
    color: #bcd2f7;
    font-size: 0.95rem;
}

.nav-toggle {
    font-size: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: none;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-menu.open {
    display: flex;
}

.nav-link {
    border: none;
    background: transparent;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem 2rem;
}

.panel {
    display: none;
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.1);
}

.panel + .panel {
    margin-top: 1.5rem;
}

.panel.active {
    display: block;
}

h2 {
    margin-top: 0;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    color: #14213d;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.card,
.info-card,
.sensor-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    background: #fff;
}

.info-card h3,
.card h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #0d1b2a;
}

.info-card p,
.card p {
    margin: 0.3rem 0;
}

.label {
    font-weight: 600;
    color: #5f6c7b;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

input,
textarea,
select {
    padding: 0.55rem;
    border-radius: 6px;
    border: 1px solid #cbd5f5;
    font-size: 1rem;
}

button {
    padding: 0.65rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    background: #0070f3;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

button:hover {
    opacity: 0.85;
}

.status-line {
    min-height: 1.2rem;
    font-weight: 600;
    color: #0070f3;
}

.sensor-reading {
    font-size: 1.2rem;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0.25rem 0;
}

.sensor-reading .unit {
    color: #8892b0;
    font-size: 0.9rem;
}

.sensor-meta {
    margin: 0;
    font-size: 0.85rem;
    color: #5f6c7b;
}

.error-count {
    font-size: 0.85rem;
    color: #5f6c7b;
    margin-left: 0.4rem;
}

.sensor-name-editor {
    display: flex;
    gap: 0.5rem;
    margin: 0.4rem 0 0.8rem;
    flex-wrap: wrap;
}

.sensor-name-editor input {
    flex: 1 1 160px;
}

.sensor-name-editor button {
    flex: 0 0 auto;
}

.sensor-actions {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sensor-actions.top {
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.sensor-timestamp {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: #14213d;
}

.quality-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
    background: #e5e7eb;
    color: #111;
    min-width: 3.5rem;
    justify-content: center;
}

.quality-chip.good {
    background: #d1fae5;
    color: #065f46;
}

.quality-chip.fair {
    background: #fef3c7;
    color: #92400e;
}

.quality-chip.warn {
    background: #fde68a;
    color: #92400e;
}

.quality-chip.critical {
    background: #fee2e2;
    color: #b91c1c;
}


@media (max-width: 720px) {
    .nav-toggle {
        display: block;
    }
    .nav-menu {
        position: absolute;
        top: 64px;
        right: 16px;
        background: #0d1b2a;
        flex-direction: column;
        padding: 0.5rem;
        border-radius: 8px;
        display: none;
    }
    .nav-menu.open {
        display: flex;
    }
}
:root {
    /* existing rules unaffected */
}

.hidden {
    display: none !important;
}
.button-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.button-row button {
    flex: 1 1 auto;
}
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #0070f3, #00c6ff);
    transition: width 0.2s ease;
}
