:root {
    /* Professional Color Palette */
    --primary-color: #2c3e50; /* Deep Blue/Gray */
    --secondary-color: #34495e; /* Lighter Blue/Gray */
    --accent-color: #3498db; /* Bright Blue for actions */
    --success-color: #27ae60;
    --danger-color: #c0392b;
    --warning-color: #f39c12;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --sidebar-width: 260px;
    --header-height: 60px;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    background-color: var(--primary-color) !important; /* Override standard dark */
    width: var(--sidebar-width);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto; /* FIX: Enable scrolling inside sidebar */
}

/* --- Brand / Logo dentro del sidebar --- */
.sidebar .brand-section{
  height: 70px;                /* ajustá a gusto: 60-80 suele ir perfecto */
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;            /* evita que “pise” el menú si el logo es grande */
  border-bottom: 1px solid rgba(255,255,255,.12); /* opcional */
}

.sidebar .brand-link{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sidebar .brand-logo{
  max-height: 60px;            /* tamaño real del logo */
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;         /* clave: no deforma y siempre entra */
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.8rem 1.5rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
    border-left-color: var(--accent-color);
}

.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease-in-out;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-navbar {
    height: var(--header-height);
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 99;
}

.content-container {
    padding: 2rem;
    flex: 1;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border-radius: 8px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* DataTables refined */
.table thead th {
    background-color: #fff;
    border-bottom: 2px solid #e9ecef;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.page-item.active .page-link {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}
