/* ===== VARIABLES Y TEMA ===== */
:root {
    --primary-color: #0d6efd;
    --sidebar-width: 250px;
    --header-height: 70px;
}

/* ===== RESET Y ESTILOS GLOBALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
}

/* ===== LAYOUT FLEX ===== */
.min-vh-100 {
    display: flex;
    flex-direction: column;
}

.flex-grow-1 {
    flex: 1;
}

/* ===== HEADER ===== */
header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    z-index: 1000;
}

header .navbar-brand {
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

header .navbar-brand i {
    margin-right: 0.5rem;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    padding: 0;
    overflow-y: auto;
    background-color: #f8f9fa;
    position: fixed;
    top: var(--header-height);
    left: 0;
    border-right: 1px solid #dee2e6;
}

.sidebar-content {
    padding-top: 1rem;
}

.sidebar-header {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
}

.sidebar .nav-link {
    color: #495057;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: #e7f1ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 1.1rem;
}

/* ===== MAIN CONTENT ===== */
main {
    padding: 2rem;
    background-color: #f8f9fa;
    margin-left: var(--sidebar-width);
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
        margin-left: 0;
    }
    
    .sidebar {
        width: 0;
        position: fixed;
        height: calc(100vh - var(--header-height));
        overflow: hidden;
        transition: width 0.3s ease;
    }
    
    .sidebar.show {
        width: var(--sidebar-width);
        z-index: 999;
    }
}

/* ===== FOOTER ===== */
footer {
    margin-top: auto;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

footer a {
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
}

/* ===== COMPONENTES ===== */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.375rem;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0b5ed7;
}

/* ===== HOME PAGE ===== */
.home-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 200px);
}

.home-content h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -1px;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== UTILIDADES ===== */
.text-truncate-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 200px;
    }
}

@media (max-width: 576px) {
    main {
        padding: 1rem 0.5rem;
    }
    
    .home-content h1 {
        font-size: 2rem;
    }
    
    .sidebar {
        position: absolute;
        height: calc(100vh - var(--header-height));
        top: var(--header-height);
        left: 0;
        z-index: 999;
    }
}