* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Arial, sans-serif;
    background: #f1f5f9;
    color: #172033;
    font-size: 14px;
}

header {
    background: #0f172a;
    color: white;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.brand {
    font-size: 21px;
    font-weight: 700;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

main {
    max-width: 1600px;
    margin: auto;
    padding: 30px;
}

h1 {
    font-size: 28px;
    margin: 0 0 12px;
}

h2 {
    font-size: 19px;
    margin-top: 0;
}

.muted {
    color: #64748b;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.stat, .panel, .login-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 3px 12px #0f172a08;
}

.stat span {
    display: block;
    color: #64748b;
    margin-bottom: 12px;
}

.stat strong {
    font-size: 34px;
}

.green {
    color: #15803d;
}

.red {
    color: #dc2626;
}

.panel {
    margin-bottom: 24px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
}

details form {
    margin-top: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

label {
    display: block;
    margin: 12px 0 7px;
    font-weight: 600;
}

input, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font: inherit;
    background: white;
    margin-bottom: 12px;
}

textarea {
    overflow-wrap: anywhere;
}

button, .button-link {
    display: inline-block;
    border: 0;
    background: #2563eb;
    color: white;
    padding: 12px 20px;
    border-radius: 7px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

button:hover {
    background: #1d4ed8;
}

button.secondary {
    background: #334155;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

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

th {
    color: #64748b;
    background: #f8fafc;
    font-size: 12px;
}

.status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.online {
    color: #166534;
    background: #dcfce7;
}

.offline {
    color: #475569;
    background: #e2e8f0;
}

.empty {
    text-align: center;
    color: #64748b;
    padding: 50px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 420px;
    max-width: 100%;
    padding: 36px;
}

.login-card.wide {
    width: 600px;
}

.login-card button {
    width: 100%;
    margin-top: 10px;
}

.logo {
    width: 56px;
    height: 56px;
    background: #2563eb;
    color: white;
    font-size: 23px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border-radius: 12px;
    margin-bottom: 22px;
}

.error {
    color: #dc2626;
    background: #fef2f2;
    padding: 12px;
    border-radius: 7px;
}

footer {
    color: #64748b;
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

@media (max-width: 800px) {
    main {
        padding: 16px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    header {
        padding: 16px;
    }
}
