*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #0f172a, #020617);
    color: #e5e7eb;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-body,
.dashboard-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.glass-card {
    background: rgba(15, 23, 42, 0.75);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(18px);
}

.auth-container {
    width: 100%;
    max-width: 380px;
    padding: 32px 28px;
}

.auth-title {
    font-size: 26px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-form label {
    font-size: 14px;
    color: #cbd5f5;
}

.auth-form input {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    outline: none;
}

.auth-form input:focus {
    border-color: #38bdf8;
}

.btn-primary {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: white;
    cursor: pointer;
    font-weight: 600;
}

.btn-secondary {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: transparent;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 13px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.8);
    color: #e5e7eb;
}

.alert {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 10px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.dashboard-body {
    align-items: stretch;
}

.sidebar {
    width: 260px;
    padding: 24px 18px;
    margin-right: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.brand-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-name {
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #9ca3af;
}

.nav-links {
    list-style: none;
    margin-top: 20px;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    color: #cbd5f5;
}

.nav-links li.active a,
.nav-links a:hover {
    background: rgba(37, 99, 235, 0.25);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(239, 68, 68, 0.8);
    color: #fecaca;
    font-size: 13px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    font-size: 24px;
}

.subtitle {
    font-size: 13px;
    color: #9ca3af;
}

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

.search-form input {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    padding: 7px 12px;
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    min-width: 220px;
}

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

.kpi-card {
    padding: 16px;
}

.kpi-label {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 20px;
    font-weight: 600;
}

.table-section {
    padding: 16px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.log-table th,
.log-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
}

.log-table th {
    text-align: left;
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.5);
    font-size: 11px;
}

.device-cell {
    max-width: 160px;
}

.diff-details {
    margin-top: 6px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 10px;
    padding: 6px 8px;
    border: 1px solid rgba(75, 85, 99, 0.9);
}

.diff-details pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 11px;
}

.muted {
    color: #6b7280;
    font-size: 12px;
}

.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 16px 0;
}

.pagination {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-link {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    font-size: 12px;
}

.page-current {
    font-size: 12px;
    color: #9ca3af;
}

.hidden {
    display: none;
}

@media (max-width: 900px) {
    .dashboard-body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 14px;
    }
}
