:root {
    --bg: #f2f5fa;
    --surface: #ffffff;
    --text: #0f1a2e;
    --muted: #64708a;
    --line: #e3e8f1;
    --accent: #2f6bff;
    --accent-soft: #e6eeff;
    --on: #16b47e;
    --warn: #e59a00;
    --off: #e5484d;
    --shadow: 0 1px 2px rgba(15, 26, 46, .05), 0 8px 24px rgba(15, 26, 46, .06);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1120;
        --surface: #131b2e;
        --text: #e8edf7;
        --muted: #8b97b0;
        --line: #232d44;
        --accent: #5b8cff;
        --accent-soft: #1b2a4d;
        --shadow: none;
        color-scheme: dark;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.01em;
}

.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 35% 70%, #fff 0 3px, transparent 3.5px),
        radial-gradient(circle at 62% 45%, #fff 0 4px, transparent 4.5px),
        radial-gradient(circle at 45% 25%, rgba(255, 255, 255, .7) 0 2px, transparent 2.5px),
        linear-gradient(140deg, #5b8cff, #2f6bff 55%, #1c4fd6);
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.logout {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
}

.logout:hover {
    background: var(--surface);
    color: var(--text);
}

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex: 1 0 auto;
    text-align: center;
    padding: 9px 14px;
    border-radius: 9px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: var(--accent);
    color: #fff;
}

.dates {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.dates label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    flex: 1 1 140px;
}

input,
button {
    font: inherit;
}

input[type="date"],
input[type="password"] {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    width: 100%;
}

input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

button {
    padding: 10px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.08);
}

.total {
    margin: 22px 0 16px;
    padding: 22px;
    border-radius: 18px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .18), transparent 40%),
        linear-gradient(135deg, #3b77ff, #1c4fd6);
    box-shadow: 0 12px 32px rgba(47, 107, 255, .25);
}

.total-label {
    font-weight: 600;
    opacity: .85;
    font-size: 14px;
}

.total-num {
    font-size: clamp(44px, 9vw, 64px);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.05;
    margin: 6px 0 2px;
    font-variant-numeric: tabular-nums;
}

.total-sub {
    opacity: .85;
}

.washes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.wash {
    position: relative;
    padding: 16px 16px 16px 20px;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.wash::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--c);
}

.wash-name {
    font-weight: 700;
}

.wash-num {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 2px 0 6px;
    font-variant-numeric: tabular-nums;
}

.wash-state {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
}

.wash-state::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.wash-state.on::before {
    background: var(--on);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--on) 25%, transparent);
}

.wash-state.warn::before {
    background: var(--warn);
}

.wash-state.off::before {
    background: var(--off);
}

.wash-state.off {
    color: var(--off);
}

.wash-meta {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.card {
    margin-top: 16px;
    padding: 18px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.card h2 {
    margin: 0 0 12px;
    font-size: 16px;
}

.chart {
    position: relative;
    height: 300px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

th,
td {
    padding: 8px 10px;
    text-align: right;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

th:first-child,
td:first-child {
    text-align: left;
}

th {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

tbody tr:hover {
    background: var(--accent-soft);
}

tfoot td {
    font-weight: 800;
    border-bottom: 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
}

.login {
    width: 100%;
    max-width: 340px;
    padding: 28px 24px;
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login .logo {
    margin-bottom: 12px;
}

.login label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.login button {
    margin-top: 6px;
    padding: 12px;
}

.error {
    margin: 0;
    color: var(--off);
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .total {
        padding: 18px;
        margin-top: 16px;
    }

    .chart {
        height: 240px;
    }

    .tab {
        padding: 8px 10px;
        font-size: 14px;
    }

    .washes {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .wash {
        padding: 14px 12px 14px 16px;
    }

    .wash-num {
        font-size: 28px;
    }

    .wash-state,
    .wash-meta {
        font-size: 12px;
    }

    .card {
        padding: 14px;
    }
}
