:root {
    --sidebar-width: 260px;
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #2563eb;
    --body-bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--body-bg);
    color: #334155;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.layout-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 62px);
}

.sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - 62px);
    max-height: calc(100vh - 62px);
    position: sticky;
    top: 62px;
    background-color: var(--sidebar-bg);
    padding-top: 1rem;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 1000;
}

.sidebar .nav-link {
    color: #cbd5e1;
    padding: 0.85rem 1.25rem;
    margin: 0.15rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar .nav-link.active {
    background-color: var(--sidebar-active);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 2rem;
    background-color: var(--body-bg);
}

.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

.card-dashboard {
    border-left: 5px solid;
    border-radius: 0.75rem;
}

.card-dashboard .card-body {
    padding: 1.25rem;
}

.card-dashboard h2 {
    font-weight: 700;
    font-size: 2.25rem;
    margin-bottom: 0.25rem;
}

.card-dashboard p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.card-dashboard.online { border-left-color: #10b981; }
.card-dashboard.warning { border-left-color: #f59e0b; }
.card-dashboard.offline { border-left-color: #ef4444; }
.card-dashboard.maintenance { border-left-color: #6b7280; }
.card-dashboard.primary { border-left-color: #0d6efd; }
.card-dashboard.danger { border-left-color: #ef4444; }
.card-dashboard.info { border-left-color: #0dcaf0; }

.card-dashboard .icon-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.dashboard-header p {
    color: #64748b;
}

.chart-doughnut-wrapper {
    position: relative;
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
}

.chart-line-wrapper {
    position: relative;
    height: 260px;
    width: 100%;
}

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
}

.chart-empty i {
    opacity: 0.5;
}

.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.table {
    --bs-table-bg: transparent;
}

.table thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
}

.table tbody td {
    padding: 1rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

.table-actions {
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-online { background-color: #d1fae5; color: #065f46; }
.status-warning { background-color: #fef3c7; color: #92400e; }
.status-offline { background-color: #fee2e2; color: #991b1b; }
.status-maintenance { background-color: #e5e7eb; color: #374151; }
.status-unknown { background-color: #f3f4f6; color: #6b7280; }

.badge {
    font-weight: 500;
    padding: 0.4em 0.65em;
    border-radius: 0.375rem;
}

.page-header {
    margin-bottom: 1.75rem;
}

.page-header h1 {
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: #d1d5db;
    padding: 0.55rem 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.alert {
    border-radius: 0.75rem;
    border: none;
}

.pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 0.15rem;
    border: none;
    color: #475569;
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
}

@media (max-width: 991.98px) {
    .layout-wrapper {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 62px;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        padding: 1rem;
        width: 100%;
    }
}
