:root {
    --theme-primary: #0077B6;
    --sidebar-bg: #1a3a5c;
    --sidebar-width: 250px;

    /* Personalización de colores de Bootstrap */
    --bs-primary: #0077B6;
    --bs-primary-rgb: 0, 119, 182;
    --bs-primary-bg-subtle: #cce7f3;
    --bs-primary-border-subtle: #66b3d9;
    --bs-primary-text-emphasis: #004d76;
    --bs-link-color: #0077B6;
    --bs-link-hover-color: #005a8a;
}

body {
    overflow-x: hidden;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

.bg-sidebar {
    background-color: var(--sidebar-bg) !important;
}

.bg-theme-primary {
    background-color: var(--theme-primary) !important;
}

/* Navbar consistency */
.navbar {
    min-height: 60px;
    height: 60px;
}

.navbar-brand {
    font-weight: 500;
    font-size: 1.1rem;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    z-index: 1040;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    min-height: 60px;
}

/* Navbar buttons consistency */
.navbar .btn {
    height: 38px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar .btn-close {
    height: auto;
}

/* Sidebar cerrado en móvil por defecto */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }
}

/* Sidebar abierto en desktop por defecto */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }

    .sidebar.hide {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: var(--sidebar-width);
        transition: margin-left 0.3s ease-in-out;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    .navbar {
        margin-left: var(--sidebar-width);
        transition: margin-left 0.3s ease-in-out;
    }

    .navbar.expanded {
        margin-left: 0;
    }
}

/* Overlay para móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    transition: opacity 0.3s ease-in-out;
}

.sidebar-overlay.show {
    display: block;
}

@media (max-width: 575.98px) {
    .navbar-brand {
        position: static !important;
        transform: none !important;
        margin: 0 !important;
    }
}

/* Mejorar hover en enlaces del sidebar */
.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link {
    transition: background-color 0.2s ease;
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

.sidebar-header .tracking-wide {
    letter-spacing: 0.08em;
}

/* Botón Volver - altura consistente con navbar */
.back-button {
    height: 38px;
    display: flex !important;
    align-items: center !important;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 0.25rem;
}


/* Table header styling */
.table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: #6b7280;
}

/* Card hover - shared across index/dashboard pages */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 .25rem .5rem rgba(0, 0, 0, .15) !important;
}

.card-disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* HTMX Indicators */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
}

.htmx-request .button-text {
    display: none;
}