:root {
    --sidebar-width: 260px;
    --primary: #198754;
    --primary-dark: #146c43;
    --sidebar-bg: #1a1d21;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f4f6f9;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #1a1d21 0%, #212529 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.925rem;
    transition: all 0.2s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(25, 135, 84, 0.25);
}

.sidebar .nav-link.active {
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(25,135,84,0.4);
}

.sidebar .nav-header {
    letter-spacing: 0.05em;
    font-size: 0.7rem !important;
}

/* Page content */
#page-content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s ease;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.35rem rgba(0,0,0,0.06);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 600;
}

.stat-card {
    border-left: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Avatar */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #198754, #20c997);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    border-top: none;
}

.table td {
    vertical-align: middle;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
}

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

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

/* Forms */
.form-control, .form-select {
    border-radius: 0.5rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(25,135,84,0.2);
}

/* Login page */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d3b1e 0%, #198754 50%, #20c997 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
}

/* Alertas prioritarias */
.alert-critica { border-left: 4px solid #dc3545; }
.alert-alta { border-left: 4px solid #fd7e14; }
.alert-media { border-left: 4px solid #0dcaf0; }

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    #page-content-wrapper {
        margin-left: 0;
    }
}

/* Charts container */
.chart-container {
    position: relative;
    height: 280px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Custom scrollbar */
.sidebar-body::-webkit-scrollbar {
    width: 5px;
}
.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
}
