body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

.topbar {
    background: #111827;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
}

.topbar a {
    color: #fff;
    text-decoration: none;
}

.container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #111827;
}

.login-card {
    background: #fff;
    padding: 30px;
    width: 360px;
    border-radius: 12px;
}

.login-card input,
.form-card input,
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0 14px;
    box-sizing: border-box;
}

button,
.button-link {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.button-link:hover {
    background: #1d4ed8;
}

button.danger {
    background: #dc2626;
}

button.danger:hover {
    background: #b91c1c;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.success {
    background: #dcfce7;
    color: #166534;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 6px;
}

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

.device-card,
.form-card,
.setup-box {
    background: #fff;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.device-card code {
    background: #eef2ff;
    padding: 4px 6px;
    border-radius: 4px;
}

textarea {
    min-height: 100px;
}

.setup-box textarea {
    width: 100%;
    height: 120px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-top: 15px;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.actions form {
    display: inline;
    margin: 0;
}

@media (max-width: 700px) {
    .topbar {
        gap: 10px;
        font-size: 14px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .login-card {
        width: calc(100% - 40px);
    }
}
