/* Vacuum Monitor — Dashboard Styles */

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --orange: #f97316;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.nav-left { display: flex; align-items: center; gap: 1rem; }
.nav-customer { color: var(--text-muted); font-size: 0.875rem; }
.nav-right { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; }
nav a { color: var(--accent); text-decoration: none; }
nav a:hover { text-decoration: underline; }

/* Main */
main { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
h1 { margin-bottom: 1.5rem; font-size: 1.5rem; }
h2 { margin-bottom: 1rem; font-size: 1.125rem; color: var(--text-muted); }
section { margin-bottom: 2rem; }

/* Gauge Cards */
.gauges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.gauge-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}
.gauge-label { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.125rem; }
.gauge-type { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; }
.gauge-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.gauge-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.gauge-value { font-size: 1.5rem; font-weight: 700; }
.gauge-age { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.gauge-age.stale { color: var(--orange); }

/* Tables */
.device-table { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 0.5rem;
    overflow: hidden;
}
th, td { padding: 0.625rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
td { font-size: 0.875rem; }
tr:last-child td { border-bottom: none; }
.battery-ok { color: var(--green); }
.battery-low { color: var(--orange); }
.battery-critical { color: var(--red); font-weight: 600; }

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}
.auth-card h1 { text-align: center; margin-bottom: 0.25rem; }
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; }

/* Forms */
label { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; margin-top: 0.75rem; }
input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text);
    font-size: 0.95rem;
}
input:focus { outline: none; border-color: var(--accent); }
button {
    display: block;
    width: 100%;
    padding: 0.625rem;
    margin-top: 1.25rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
button:hover { opacity: 0.9; }
table button { width: auto; margin-top: 0; padding: 0.375rem 0.75rem; font-size: 0.8rem; }
table input[type="text"] { padding: 0.375rem 0.5rem; font-size: 0.85rem; }

.auth-link { text-align: center; margin-top: 1rem; font-size: 0.875rem; color: var(--text-muted); }
.auth-link a { color: var(--accent); text-decoration: none; }

/* Messages */
.error { background: #7f1d1d; color: #fca5a5; padding: 0.625rem; border-radius: 0.375rem; margin-bottom: 1rem; font-size: 0.875rem; }
.success { background: #14532d; color: #86efac; padding: 0.625rem; border-radius: 0.375rem; margin-bottom: 1rem; font-size: 0.875rem; }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state h2 { color: var(--text); margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 0.5rem; }
code.api-key {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    word-break: break-all;
    margin: 0.5rem 0;
}

/* Footer */
footer { text-align: center; padding: 1rem; color: var(--text-muted); font-size: 0.75rem; }

/* Responsive */
@media (max-width: 640px) {
    nav { flex-direction: column; gap: 0.5rem; text-align: center; }
    .gauges { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    main { padding: 1rem; }
    th, td { padding: 0.5rem; font-size: 0.8rem; }
}
