/* Variables de Tema */
:root {
    --accent: #ff6600;
    --accent-hover: #ff8533;
    --bs-body-bg: #0a0a0a; /* Fondo general más oscuro */
}

/* Personalización Bootstrap Dark */
.bg-body-tertiary { background-color: #111 !important; } /* Sidebar un poco más claro que el fondo */
.text-accent { color: var(--accent) !important; }
.border-accent { border-color: var(--accent) !important; }

/* Estado Activo del Sidebar */
.nav-pills .nav-link.active {
    background-color: var(--accent) !important;
    color: white !important;
    font-weight: bold;
}

.nav-pills .nav-link {
    transition: all 0.2s ease;
}

/* === COMPORTAMIENTO RESPONSIVO === */

/* En Móviles (por defecto) */
.sidebar-container {
    border-bottom: 1px solid #333;
    /* En móvil es una barra superior normal */
}
.content-area {
    min-height: calc(100vh - 70px); /* Altura mínima */
}

/* En Pantallas Grandes (Escritorio - LG breakpoint >= 992px) */
@media (min-width: 992px) {
    body {
        overflow: hidden; /* Evita doble scrollbar en PC */
    }
    .sidebar-container {
        height: 100vh; /* Altura completa */
        position: sticky;
        top: 0;
        border-bottom: none;
        border-right: 1px solid #333 !important;
        z-index: 1000;
    }
    .content-area {
        height: 100vh; /* Altura completa */
        overflow-y: auto; /* Scroll interno solo para el contenido */
    }
}

/* === COMPONENTES DEL MÓDULO === */

/* Cuadrícula de Botones Responsiva */
/* Se adapta automáticamente: 2 columnas en móvil muy pequeño, 3-4 en tablets, 6 en PC */
.btn-group-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.btn-group-responsive .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 5px;
    font-size: 0.9em;
    white-space: normal; /* Permite que el texto baje de línea si es largo */
}

.btn-group-responsive .btn i {
    font-size: 1.4em;
    margin-bottom: 5px;
}

/* Etiquetas de Inputs Dinámicos */
.dyn-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Contenedores con scroll horizontal para que no rompan el diseño en móvil */
.table-responsive {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #333 #111;
}
/* Webkit scrollbar styling */
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-track { background: #111; }
.table-responsive::-webkit-scrollbar-thumb { background-color: #333; border-radius: 4px; }

/* Nav Tabs con scroll horizontal en móvil */
.nav-tabs-scrollable {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Ocultar scrollbar en Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
}
.nav-tabs-scrollable::-webkit-scrollbar { display: none; /* Safari and Chrome */ }

/* --- BOTONES DE SELECCIÓN (GRID HORIZONTAL) --- */
/* Esto hace que los iconos se vean separados y de costado */
.selection-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.type-option-btn {
    flex: 1 0 auto; /* Crece para llenar espacio, pero respeta el contenido */
    min-width: 110px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: #aaa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.type-option-btn i {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: #555;
    transition: color 0.2s;
}

.type-option-btn:hover {
    background-color: #252525;
    border-color: #555;
    color: white;
    transform: translateY(-2px);
}

.type-option-btn.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.25);
}

.type-option-btn.active i { color: white; }

/* --- INPUTS DINÁMICOS CON ESPACIO --- */
/* El contenedor gris donde van los inputs */
.dyn-container {
    background-color: #161616;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
}

/* Estilo de los inputs dentro de Bootstrap Grid */
.dyn-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
    font-weight: bold;
    display: block;
}

.dyn-input {
    background: #000;
    border: 1px solid #444;
    color: white;
    font-family: monospace;
}
.dyn-input:focus {
    border-color: var(--accent);
    box-shadow: none;
}

/* Separador visual para grupos grandes (como Items) */
.separator {
    width: 100%;
    height: 1px;
    background: #333;
    margin: 10px 0;
}

/* ... (Mantén todo tu CSS anterior y agrega esto al final) ... */

/* =========================================
   NUEVO: BOTONES DE SELECCIÓN (GRID)
   ========================================= */

/* Contenedor de la cuadrícula de opciones */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Adaptable */
    gap: 8px;
    margin-bottom: 15px;
    background: #111;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 5px;
}

/* El botón de opción individual */
.type-btn {
    background: #222;
    color: #aaa;
    border: 1px solid #444;
    padding: 10px 5px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column; /* Icono arriba, texto abajo si quisieras poner iconos */
    align-items: center;
    justify-content: center;
}

.type-btn:hover {
    background: #333;
    color: white;
    border-color: #666;
}

/* Estado Activo (Seleccionado) */
.type-btn.active {
    background: var(--accent); /* Naranja */
    color: white;
    border-color: var(--accent-hover);
    box-shadow: 0 0 8px rgba(255, 102, 0, 0.4);
    transform: translateY(-1px);
}

/* Ajuste para el botón de Añadir que ahora está separado */
.action-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 10px;
    border-top: 1px solid #333;
    padding-top: 10px;
}