:root {
    /* Paleta Corporativa Laizer Mejorada */
    --primary: #0f172a;
    /* Azul Slate muy oscuro para el Sidebar (Elegante) */
    --accent: #0a58ca;
    /* El Azul de tu Logo (Para botones y elementos activos) */
    --primary-dark: #084298;
    --secondary: #fcd34d;
    /* Amarillo suave (menos chillón que el estándar) */

    /* Fondos y Neutros */
    --dark: #1e293b;
    --light: #f1f5f9;
    /* Gris azulado muy suave para el fondo general */
    --white: #ffffff;
    --text-muted: #64748b;

    /* Semántica */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Elevación y Efectos */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    margin: 0;
    line-height: 1.5;
}

/* Sidebar */
:root {
    --sidebar-width: 240px;
}

#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--primary);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding-top: 0;
    overflow-y: auto;
    /* Remover bordes redondeados a la derecha */
}

.sidebar-brand {
    color: var(--white);
    font-size: 20px;
    font-weight: bold;
    padding: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand i {
    font-size: 24px;
    margin-right: 12px;
}

.sidebar-brand-text {
    color: var(--white);
    font-size: 18px;
    letter-spacing: -0.5px;
}

.sidebar-brand-text span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.8;
}

.nav-section {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px 5px 20px;
}

.nav-item {
    width: 100%;
    margin-bottom: 2px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 0 20px 20px 0;
    margin-right: 15px;
}

.nav-link i {
    width: 25px;
    font-size: 16px;
    text-align: center;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.15);
}

.nav-link:hover i,
.nav-link.active i {
    transform: scale(1.1);
}

/* Main Content */
#content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--light);
    padding: 20px;
}

/* Topbar */
.topbar {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    margin: -20px -20px 24px -20px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.search-bar {
    background-color: var(--light);
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    width: 350px;
    border: 1px solid #e2e8f0;
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    margin-left: 10px;
}

.search-bar i {
    color: var(--primary);
}

/* Cards */
.card {
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    /* Pequeña elevación al pasar el mouse */
}

.card-header {
    background-color: transparent;
    border-bottom: none;
    padding: 20px 20px 0 20px;
    font-weight: 600;
    color: var(--dark);
}

.card-body {
    padding: 20px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.btn-primary {
    background-color: var(--accent);
    border: none;
    font-weight: 600;
    padding: 10px 24px;
    box-shadow: 0 2px 4px rgba(10, 88, 202, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-warning {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: var(--dark);
    border-radius: 30px;
    font-weight: 500;
}

/* Utils */
.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--secondary) !important;
}

.text-indigo {
    color: var(--indigo) !important;
}

.text-orange {
    color: var(--orange) !important;
}

/* Responsive Sidebar & Layout Improvements */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.5); /* Semi-transparent Slate Dark */
    backdrop-filter: blur(3px);
    z-index: 999;
    transition: var(--transition);
}

@media (max-width: 991.98px) {
    #sidebar {
        left: -240px;
        transition: left 0.3s ease;
    }
    
    #sidebar.show {
        left: 0;
    }

    #content-wrapper {
        margin-left: 0;
        padding: 15px;
    }

    .topbar {
        margin: -15px -15px 20px -15px;
        padding: 0 15px;
        height: 70px;
    }

    .search-bar {
        width: 100%;
        max-width: 180px;
        padding: 6px 12px;
    }
}

@media (max-width: 575.98px) {
    .topbar h4 {
        font-size: 1.15rem;
    }

    .topbar small {
        display: none; /* Hide page subtitle on phones to save space */
    }

    .search-bar {
        display: none; /* Hide search bar on phones */
    }
    
    /* Make sure cards adjust padding slightly on very small screens */
    .card-body, .panel-card {
        padding: 15px;
    }
}

/* Visualización de textos en mayúsculas en formularios (solo datos de negocio) */
input[type="text"], input[type="search"], textarea, select {
    text-transform: uppercase;
}

/* Excluir explícitamente credenciales, emails y urls de la conversión visual */
input[name="username"], input[type="email"], input[type="password"], input[type="url"] {
    text-transform: none !important;
}