/* ============================================
   SUI 360 – FUAC  |  Standard Left Sidebar
   ============================================ */

:root {
    --primary: #5A8DEE;
    --secondary: #475F7B;
    --success: #39DA8A;
    --danger: #FF5B5C;
    --warning: #FDAC41;
    --info: #00CFDD;
    --sidebar-width: 250px;
}

/* === Sidebar — Fixed left, always visible === */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 100;
    background: #fff;
    border-right: 1px solid #eee;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu {
    padding: 0.5rem 0;
}

.sidebar-menu .menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-title {
    padding: 1rem 1.25rem 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-item {
    list-style: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 1.25rem;
    color: #555;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(90, 141, 238, 0.06);
    color: var(--primary);
}

.sidebar-link span {
    margin-left: 0.75rem;
    font-weight: 500;
}

.sidebar-item.active > .sidebar-link {
    background: rgba(90, 141, 238, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-toggler {
    display: none;
}

/* === Main — Full remaining width === */
#main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f4f6f9;
}

/* === Navbar === */
.navbar-header {
    padding: 0.6rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

/* === Content === */
.page-content {
    flex: 1;
    padding: 1.5rem;
}

/* === Login === */
#login-screen .page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5A8DEE 0%, #475F7B 100%);
}

#login-screen .card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* === KPI Cards === */
.kpi-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-left: 4px solid var(--primary);
    transition: transform 0.15s;
}

.kpi-card:hover {
    transform: translateY(-2px);
}

.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card .kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-top: 2px;
}

.kpi-card.border-success,
.kpi-card.semaforo-verde   { border-left-color: var(--success); }
.kpi-card.border-warning,
.kpi-card.semaforo-amarillo { border-left-color: var(--warning); }
.kpi-card.border-danger,
.kpi-card.semaforo-rojo    { border-left-color: var(--danger); }

/* === Charts === */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* === Filter Bar === */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
    align-items: end;
}

.filter-bar .form-control,
.filter-bar .form-select {
    min-width: 150px;
}

/* === Semaforo === */
.semaforo {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.semaforo.verde   { background: var(--success); }
.semaforo.amarillo { background: var(--warning); }
.semaforo.rojo    { background: var(--danger); }

/* === Restricted Banner === */
.restricted-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #664d03;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* === Bootstrap Table === */
.table-sui {
    font-size: 0.85rem;
}

.table-sui thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table-sui tbody td {
    vertical-align: middle;
    padding: 0.5rem 0.75rem;
}

.table-sui tbody tr:hover {
    background: rgba(90, 141, 238, 0.04);
}

.table-sui .badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.3em 0.6em;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background: #e9ecef;
}

.table-responsive {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.pagination-sm .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* === Cards === */
.card {
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-radius: 8px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

/* === Footer === */
.footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background: #fff;
    font-size: 0.8rem;
    color: #888;
}

/* === Responsive — Sidebar hidden on mobile === */
@media (max-width: 991px) {
    #sidebar {
        left: -260px;
        transition: left 0.3s ease;
    }
    #sidebar.active {
        left: 0;
    }
    #main {
        margin-left: 0 !important;
    }
    .sidebar-toggler {
        display: block;
    }
}

@media (max-width: 767px) {
    .kpi-card .kpi-value {
        font-size: 1.4rem;
    }
    .chart-container {
        height: 250px;
    }
    .filter-bar {
        flex-direction: column;
    }
    .filter-bar .form-control,
    .filter-bar .form-select {
        width: 100%;
    }
}
