@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
    --bg: #0f1a1f;
    --bg-alt: #14222a;
    --card: #1a2b35;
    --card-alt: #1f3340;
    --text: #e8f1f5;
    --muted: #9fb2bc;
    --accent: #7bd389;
    --accent-strong: #46c06f;
    --warning: #f6c85f;
    --danger: #ff7b7b;
    --outline: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(1200px circle at 20% 0%, rgba(85, 199, 219, 0.15), transparent 60%),
        radial-gradient(1200px circle at 80% 20%, rgba(123, 211, 137, 0.2), transparent 60%),
        linear-gradient(150deg, #0a1216 0%, #0f1a1f 40%, #0c151a 100%);
    line-height: 1.6;
}

.page {
    padding: 28px 22px 60px;
}

.shell {
    max-width: 1100px;
    margin: 0 auto;
}

.hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.hero-top {
    display: flex;
    justify-content: flex-start;
}

.storage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 26, 31, 0.7);
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.storage-badge.warn {
    background: rgba(246, 200, 95, 0.15);
    color: var(--warning);
    border-color: rgba(246, 200, 95, 0.4);
}

.storage-badge.danger {
    background: rgba(255, 123, 123, 0.18);
    color: var(--danger);
    border-color: rgba(255, 123, 123, 0.4);
}

.hero .eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    color: var(--muted);
}

.hero h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    letter-spacing: -0.02em;
}

.hero p {
    margin: 0;
    color: var(--muted);
    max-width: 620px;
}

.hero .actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}

.card + .card {
    margin-top: 18px;
}

.card-title {
    margin: 0 0 16px;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.subheading {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

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

.stats-grid {
    margin-bottom: 18px;
}

.stat-card {
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 140px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.stat-value.accent {
    color: var(--accent);
}

.stat-value.danger {
    color: var(--danger);
}

.stat-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.activity-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-head {
    justify-content: space-between;
    align-items: flex-end;
}

.range-select {
    min-width: 220px;
}

.chart-shell {
    position: relative;
    width: 100%;
    height: 280px;
}

.label {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
    display: block;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--card);
    color: var(--text);
    font-size: 0.95rem;
}

button {
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #0b1a12;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(70, 192, 111, 0.3);
}

button:disabled {
    background: rgba(255, 255, 255, 0.15);
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
}

button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.1);
}

button.danger {
    background: linear-gradient(135deg, #ff8a8a, #ff5c5c);
    color: #2b0b0b;
}

.metrics-list {
    display: grid;
    gap: 10px;
    font-size: 0.95rem;
}

.metrics-list span.value {
    font-weight: 600;
    color: var(--text);
}

.slider-row {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

input[type="range"] {
    width: 100%;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #0b1a12;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #0b1a12;
}

.device-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.device-list li {
    background: var(--card-alt);
    border: 1px solid var(--outline);
    border-radius: 14px;
    padding: 14px 16px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.device-list li:hover {
    transform: translateY(-2px);
    border-color: rgba(123, 211, 137, 0.5);
}

.device-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-row .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 0.85rem;
}

.device-row .meta span {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.device-list a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(123, 211, 137, 0.2);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.dashboard-link {
    padding: 10px 18px;
    font-size: 0.95rem;
    background: rgba(123, 211, 137, 0.3);
    border: 1px solid rgba(123, 211, 137, 0.4);
}

.badge.offline {
    background: rgba(255, 123, 123, 0.2);
    color: var(--danger);
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.timeline li {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--outline);
    background: rgba(15, 26, 31, 0.6);
    display: grid;
    gap: 6px;
}

.timeline .title {
    font-weight: 600;
}

.timeline .meta {
    color: var(--muted);
    font-size: 0.85rem;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.timeline .empty {
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .hero .actions {
        flex-direction: column;
        align-items: stretch;
    }

    body {
        font-size: 16px;
    }

    .page {
        padding: 20px 16px 48px;
    }

    .shell {
        max-width: 100%;
    }

    .slider-row {
        grid-template-columns: 60px 1fr 36px;
    }
}
