* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background: #f5f7fb;
    color: #222;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #111827;
    color: white;
    padding: 24px 16px;
}

.sidebar .logo {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 24px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar nav a {
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
}

.sidebar nav a:hover {
    background: #1f2937;
    color: white;
}

.content {
    flex: 1;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 28px;
    font-weight: bold;
}

.admin-user {
    color: #666;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.card h3 {
    font-size: 15px;
    color: #666;
    margin-bottom: 8px;
}

.card p {
    font-size: 28px;
    font-weight: bold;
}

.table-box {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.table-box h2 {
    margin-bottom: 16px;
    font-size: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

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

.login-box {
    width: 380px;
    background: white;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.login-box h1 {
    margin-bottom: 24px;
    font-size: 24px;
}

.login-box label {
    display: block;
    margin-bottom: 8px;
    margin-top: 14px;
    font-size: 14px;
    color: #444;
}

.login-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
}

.login-box button {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: #2563eb;
    border: none;
    color: white;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
}

.login-box button:hover {
    background: #1d4ed8;
}

.error-box {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.device-page-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
    margin-bottom:16px;
}
.device-page-subtitle{
    margin-top:6px;
    color:#6b7280;
    font-size:14px;
}
.btn-primary,.btn-secondary,.btn-warning,.btn-danger{
    border:none;
    border-radius:10px;
    padding:10px 14px;
    cursor:pointer;
    font-size:14px;
    text-decoration:none;
}
.btn-primary{background:#2563eb;color:#fff;}
.btn-secondary{background:#e5e7eb;color:#111827;}
.btn-warning{background:#f59e0b;color:#fff;}
.btn-danger{background:#dc2626;color:#fff;}
.inline-actions{
    display:flex;
    gap:8px;
    justify-content:flex-end;
    flex-wrap:wrap;
}
.actions-col{
    white-space:nowrap;
}
.expand-btn{
    width:32px;
    height:32px;
    border:none;
    border-radius:8px;
    background:#e5e7eb;
    cursor:pointer;
    font-weight:700;
}
.device-create-panel,
.device-edit-box{
    margin-bottom:18px;
    padding:16px;
    border:1px solid #e5e7eb;
    border-radius:14px;
    background:#f9fafb;
}
.device-detail-wrap{
    display:flex;
    flex-direction:column;
    gap:18px;
}
.device-detail-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0,1fr));
    gap:12px;
}
.device-detail-grid > div{
    background:#f9fafb;
    border:1px solid #eef2f7;
    border-radius:12px;
    padding:12px;
}
.device-detail-grid strong{
    display:block;
    margin-bottom:6px;
    font-size:12px;
    color:#6b7280;
}
.device-form-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0,1fr));
    gap:12px;
}
.device-form-grid label{
    display:block;
    margin-bottom:6px;
    font-size:13px;
    color:#374151;
}
.device-form-grid input,
.device-form-grid select{
    width:100%;
    padding:10px 12px;
    border:1px solid #d1d5db;
    border-radius:10px;
    background:#fff;
}
.device-form-actions{
    display:flex;
    align-items:end;
}
.status-chip{
    display:inline-flex;
    align-items:center;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}
.status-online{background:#dcfce7;color:#166534;}
.status-offline{background:#fee2e2;color:#991b1b;}
.status-disabled{background:#e5e7eb;color:#374151;}
.device-detail-row td{
    background:#fcfcfd;
}
