*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }
header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid #1e293b;
    padding: 1.5rem 0;
}
header h1 { font-size: 1.5rem; font-weight: 600; }
header p { color: #94a3b8; font-size: 0.875rem; margin-top: 0.25rem; }
.back-link {
    color: #60a5fa; text-decoration: none; font-size: 0.8rem;
    display: inline-block; margin-bottom: 0.5rem;
}
.back-link:hover { text-decoration: underline; }
main { padding: 2rem 0; }
.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-header h2 { margin-bottom: 0; }
.search-wrap { display: flex; align-items: center; gap: 0.5rem; }
.search-toggle {
    background: none; border: 1px solid #334155; color: #94a3b8;
    border-radius: 0.375rem; padding: 0.4rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.search-toggle:hover, .search-toggle.active { border-color: #60a5fa; color: #e2e8f0; }
.search-input {
    background: #0f172a; border: 1px solid #334155; color: #e2e8f0;
    border-radius: 0.375rem; padding: 0.4rem 0.75rem;
    font-family: 'Inter', system-ui, sans-serif; font-size: 0.85rem;
    width: 220px; outline: none; transition: border-color 0.15s;
}
.search-input:focus { border-color: #60a5fa; }
.search-input.hidden { display: none; }
.chart-wrap { position: relative; width: 100%; max-height: 400px; }
.chart-wrap canvas { width: 100% !important; }
.status-msg {
    text-align: center; padding: 2rem; color: #94a3b8; font-size: 0.9rem;
}
table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
th {
    text-align: left; padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #334155; color: #94a3b8;
    font-weight: 500; text-transform: uppercase; font-size: 0.75rem;
    letter-spacing: 0.05em;
}
td {
    padding: 0.6rem 0.75rem; border-bottom: 1px solid #1e293b;
}
tr:hover td { background: rgba(96, 165, 250, 0.05); }
.badge {
    display: inline-block; padding: 0.15rem 0.5rem;
    border-radius: 9999px; font-size: 0.75rem; font-weight: 500;
}
.badge-yes { background: #166534; color: #bbf7d0; }
.badge-no  { background: #7f1d1d; color: #fecaca; }
.badge-dup { background: #92400e; color: #fde68a; margin-left: 0.4rem; }
.badge-temp { background: #1e3a5f; color: #93c5fd; margin-left: 0.4rem; }
.summary {
    display: flex; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.summary-stat {
    background: #0f172a; border: 1px solid #334155;
    border-radius: 0.5rem; padding: 1rem 1.25rem; flex: 1; min-width: 140px;
}
.summary-stat .label { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.summary-stat .value { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }
.value-temp { color: #f59e0b; }
.value-max  { color: #60a5fa; }
.value-date { color: #e2e8f0; font-size: 1.1rem; }
.value-logged-in { color: #22c55e; }
.value-not-logged{ color: #f87171; }
.value-remaining { color: #a78bfa; }

.range-buttons {
    display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.range-buttons button {
    background: #0f172a; border: 1px solid #334155; color: #94a3b8;
    border-radius: 0.375rem; padding: 0.35rem 0.75rem;
    font-family: 'Inter', system-ui, sans-serif; font-size: 0.8rem;
    cursor: pointer; transition: all 0.15s;
}
.range-buttons button:hover { border-color: #60a5fa; color: #e2e8f0; }
.range-buttons button.active {
    background: #1d4ed8; border-color: #3b82f6; color: #fff;
}

.chart-stats {
    display: flex; gap: 1.5rem; flex-wrap: wrap;
    margin-top: 0.75rem; padding-top: 0.75rem;
    border-top: 1px solid #334155;
    font-size: 0.8rem; color: #94a3b8;
}
.chart-stats strong { color: #e2e8f0; }

.date-col { text-align: right; }
.clickable { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.clickable:hover { opacity: 0.8; }

#login-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    display: flex; align-items: center; justify-content: center;
}
.login-card {
    background: #1e293b; border: 1px solid #334155;
    border-radius: 0.75rem; padding: 2rem; width: 100%; max-width: 360px;
    text-align: center;
}
.login-card h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.25rem; }
.login-card p { color: #94a3b8; font-size: 0.85rem; margin-bottom: 1.5rem; }
.login-card input[type="password"] {
    width: 100%; padding: 0.6rem 0.75rem;
    background: #0f172a; border: 1px solid #334155; color: #e2e8f0;
    border-radius: 0.375rem; font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9rem; outline: none; margin-bottom: 0.75rem;
}
.login-card input[type="password"]:focus { border-color: #60a5fa; }
.login-card button {
    width: 100%; padding: 0.6rem;
    background: #1d4ed8; border: none; color: #fff;
    border-radius: 0.375rem; font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9rem; font-weight: 500; cursor: pointer;
    transition: background 0.15s;
}
.login-card button:hover { background: #2563eb; }
.login-error { color: #f87171; font-size: 0.8rem; margin-top: 0.75rem; min-height: 1.2em; }

.desc-row { display: none; }

@media (max-width: 600px) {
    .desc-col, .date-col { display: none; }
    .desc-row { display: table-row; }
    .desc-row td {
        padding: 0 0.75rem 0.6rem;
        border-bottom: 1px solid #334155;
        color: #94a3b8;
        font-size: 0.8rem;
    }
    .main-row td { border-bottom: none; padding: 0.4rem 0.5rem; }
    .main-row td:nth-child(2) { white-space: nowrap; }
    #ward-stats-wrap td:first-child { white-space: nowrap; }
}
