:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-light: #1f2937;
    --text: #f9fafb;
    --muted: #9ca3af;
    --accent: #e30613;
    --accent-dark: #b91c1c;
    --border: #374151;
}

* {
    box-sizing: border-box;
}
.device-actions {
    min-width: 360px;
}

.device-actions details {
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.04);
}

.device-actions summary {
    cursor: pointer;
    font-weight: 700;
    color: #ffffff;
    padding: 4px 2px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.action-grid button {
    width: 100%;
    white-space: normal;
    font-size: 0.85rem;
    padding: 8px 10px;
}
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    padding: 24px 18px;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 30px;
}

.logo span {
    color: var(--accent);
}
.card h3 {
    color: #f9fafb;
}
.nav-link {
    display: block;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 12px;
    color: #d1d5db;
}

.nav-link:hover {
    background: var(--panel-light);
    color: var(--text);
}

.main {
    flex: 1;
    padding: 28px;
}
.btn-secondary {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}
.topbar {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 22px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 22px;
}
.empty-text {
    color: #f3f4f6;
}
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.stat {
    background: var(--panel-light);
    border-radius: 16px;
    padding: 20px;
}

.stat-title {
    color: var(--muted);
    font-size: 14px;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    margin-top: 8px;
}

input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #020617;
    color: var(--text);
    margin-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 11px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
}

button:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    background: var(--panel-light);
}

.btn-secondary:hover {
    background: #374151;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: #cbd5e1;
    font-size: 13px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    color: #f3f4f6;
}

.badge {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #064e3b;
    color: #d1fae5;
}

.error {
    background: #7f1d1d;
    color: #fee2e2;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.login-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 32px;
}
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #020617;
    color: var(--text);
    margin-bottom: 12px;
}
.danger-button {
    background: #7f1d1d;
    color: #fee2e2;
}

.danger-button:hover {
    background: #991b1b;
}
.message-box {
    min-height: 140px;
    resize: vertical;
}

.danger-badge {
    background: #7f1d1d;
    color: #fee2e2;
}
@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
}