/* VARIABLES GLOBALES (Modificables por cliente) */
:root {
    --primary-color: #D4AF37;
    --primary-hover: #b5952f;
    --sidebar-bg: #000000;
    --sidebar-text: #D4AF37;
    --sidebar-active: rgba(212, 175, 55, 0.15);
    --header-bg: #000000;
    --bg-color: #0a0a0a;
    --text-color: #e9ecef;
    --font-family: 'Outfit', sans-serif;
    --border-radius: 8px;
    --border-color: #333333;
}

body,
body.dashboard,
h1, h2, h3, h4, h5, h6,
p, span, a, li, th, td,
input, button, select, textarea {
    font-family: var(--font-family) !important;
}

body {
    margin: 0;
    background: var(--bg-color);
    background-attachment: fixed;
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR MASTER */
.sidebar-master {
    width: 260px;
    background: #000000;
    color: #D4AF37;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 30px rgba(0,0,0,0.5); 
    border-right: 1px solid rgba(212, 175, 55, 0.1);
    z-index: 10;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* Soporte para Firefox */
    scrollbar-color: var(--primary-color) transparent;
    scrollbar-width: thin;
}

/* Custom Scrollbar para navegadores Webkit (Chrome, Edge, Safari) */
.sidebar-master::-webkit-scrollbar {
    width: 6px;
}
.sidebar-master::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-master::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}
.sidebar-master::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.sidebar-logo {
    padding: 20px;
    text-align: center;
    border-bottom: none;
}
.sidebar-logo a { color: #D4AF37; text-decoration: none; }
.sidebar-logo h3 { margin: 0; font-size: 1.2rem; }

.sidebar-nav { flex-grow: 1; padding: 15px 0; }
.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.nav-title {
    padding: 10px 20px;
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 10px;
}

.nav-link { 
    display: flex; 
    align-items: center; 
    gap: 14px; 
    padding: 10px 18px; 
    margin: 4px 12px; 
    color: #a1a1aa;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}
.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 0;
    width: 3px;
    background: #D4AF37;
    transition: all 0.3s ease;
    border-radius: 0 4px 4px 0;
    opacity: 0;
}
.nav-link i { 
    width: 24px; 
    font-size: 1.1rem; 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease, text-shadow 0.3s ease;
    color: #a1a1aa;
    text-align: center;
}
.nav-link:hover { 
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.02) 100%); 
    color: #ffffff !important; 
    transform: translateX(5px);
    box-shadow: inset 1px 0 0 rgba(212, 175, 55, 0.5);
}
.nav-link:hover::before {
    height: 60%;
    opacity: 1;
}
.nav-link:hover i {
    transform: scale(1.2);
    color: #D4AF37 !important;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
}
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-color: #fcfcfb; /* Fondo blanco-hueso súper claro para contraste */
}

/* TOP HEADER (Igualado al Sidebar) */
.top-header { height: 60px; flex-shrink: 0; background-color: #000000 !important; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid transparent !important; border-image: linear-gradient(90deg, #D4AF37 0%, #F9E596 50%, #8A6D1C 100%) 1 !important; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.top-header a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}
.top-header a:hover {
    color: var(--primary-hover);
}
.header-left h2 { margin: 0; font-size: 1.3rem; font-weight: 600; color: var(--primary-color) !important; }
.header-right { display: flex; align-items: center; gap: 20px; color: var(--primary-color) !important; }
.header-right a { color: var(--primary-color) !important; font-weight: bold; }
.header-right a:hover { color: var(--primary-hover) !important; text-shadow: 0 0 5px rgba(212, 175, 55, 0.5); }
.header-right i, .header-right span { color: var(--primary-color) !important; }
#reloj-tiempo-real { font-family: var(--font-family); font-size: 0.85rem; font-weight: 600; color: var(--primary-color) !important; }
.user-profile-badge { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--primary-color) !important; }
.user-profile-badge a { color: var(--primary-color); text-decoration: none; font-size: 0.9rem; margin-left: 10px; font-weight: bold; transition: color 0.2s; }
.user-profile-badge a:hover { color: var(--primary-hover); text-decoration: underline; }

/* AREA DE CONTENIDO */
.content-area {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

/* UTILIDADES BASE HTMX/UI */
.card-module {
    background: #1e1e1e;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}
.button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}
.button:hover { background-color: var(--primary-hover); }

/* CUSTOM SCROLLBAR ELEGANTE PARA EL SIDEBAR Y CONTENIDO */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(145, 77, 89, 0.3); /* Rose Gold sutil */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(145, 77, 89, 0.6);
}

/* Se removió la regla que forzaba el color Rose Gold en los iconos del sidebar a petición del usuario para mostrar los colores por categoría */

/* BOTONES GLOBALES DORADOS DEGRADADOS */

button, .button, input[type="submit"], input[type="button"], input[type="reset"], .submit-row input, .submit-row a.button {
    background: linear-gradient(135deg, #E2C044 0%, #C5A030 100%) !important;
    color: #000000 !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
}
button:hover, .button:hover, input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover, .submit-row input:hover, .submit-row a.button:hover {
    background: linear-gradient(135deg, #F3D054 0%, #D4AF37 100%) !important;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4) !important;
    transform: translateY(-1px);
}

/* SUBMENUS COLAPSABLES */
.nav-title {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    margin: 5px 10px 0px 10px;
    color: #D4AF37;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.nav-title:hover {
    background-color: rgba(212, 175, 55, 0.1);
    color: #ffffff;
}
.submenu {
    display: none;
    list-style: none;
    padding: 0 0 0 20px;
    margin: 0;
}
.submenu.open {
    display: block;
}
.toggle-icon {
    transition: transform 0.3s ease;
}
.nav-title.open .toggle-icon {
    transform: rotate(180deg);
}

