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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #222;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header h1 { font-size: 1.3rem; font-weight: 700; }

.refresh-info {
    color: #888;
    font-size: 0.82rem;
    margin-left: auto;
}

.box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.box-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: opacity 0.2s;
}

.box-card.offline { opacity: 0.65; border-color: #f5c6cb; }
.box-card.unknown { opacity: 0.45; }

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online  { background: #27ae60; }
.status-dot.offline { background: #e74c3c; }
.status-dot.unknown { background: #bbb; }

.box-id { font-weight: 700; font-size: 1rem; }

.header-badges {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stale-badge {
    font-size: 0.68rem;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    border-radius: 3px;
    padding: 0 3px;
    line-height: 1.4;
}

.ping-badge {
    font-size: 0.65rem;
    border-radius: 3px;
    padding: 1px 5px;
    line-height: 1.5;
    font-weight: 600;
}

.ping-badge.reachable   { background: #d4edda; color: #155724; }
.ping-badge.unreachable { background: #f8d7da; color: #721c24; }

.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.metric {
    border-radius: 5px;
    padding: 0.45rem 0.6rem;
    background: #f4f4f4;
}

.metric.ok   { background: #d4edda; }
.metric.warn { background: #f8d7da; }

.metric-label {
    font-size: 0.68rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}

.metric-range {
    font-size: 0.68rem;
    color: #888;
}

.phase-row {
    font-size: 0.82rem;
    color: #444;
    border-top: 1px solid #f0f0f0;
    padding-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.6rem;
    align-items: center;
}

.drying-on  { color: #e74c3c; font-weight: 600; }
.drying-off { color: #27ae60; }

.waiting-row {
    font-size: 0.82rem;
    color: #aaa;
    font-style: italic;
}

.last-poll {
    font-size: 0.68rem;
    color: #bbb;
    text-align: right;
}

.link-row {
    margin-top: 0.2rem;
}

.box-link {
    display: block;
    text-align: center;
    padding: 0.65rem 1rem;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
}

.box-link:hover { background: #2980b9; }
