/* Estilos para el m¨Ždulo de tablas de BD */
.bd-tablas-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.bd-header {
    background: #2c3e50;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.bd-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.bd-info-panel {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.bd-info-item {
    background: rgba(255,255,255,0.2);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.bd-total-tablas {
    background: #e8f4fc;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Acceso denegado */
.bd-acceso-denegado {
    background: #ffe6e6;
    border: 2px solid #ff3333;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    max-width: 800px;
    margin: 50px auto;
}

.bd-acceso-icono {
    font-size: 50px;
    margin-bottom: 15px;
}

.bd-acceso-denegado h3 {
    color: #cc0000;
    margin-bottom: 15px;
    font-size: 28px;
}

.bd-acceso-denegado p {
    font-size: 18px;
    margin-bottom: 20px;
}

.bd-acceso-info {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: left;
    border: 1px solid #ddd;
}

.bd-acceso-info ul {
    margin: 15px 0;
    padding-left: 20px;
}

.bd-acceso-info li {
    margin: 8px 0;
    font-size: 16px;
}

.bd-acceso-info code {
    background: #f1f1f1;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

.bd-acceso-advertencia {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
}

.bd-acceso-botones {
    margin-top: 20px;
}

.bd-btn-intentar {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.bd-btn-intentar:hover {
    background: #2980b9;
}

/* Lista de tablas */
.bd-tablas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.bd-tabla-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.bd-tabla-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.bd-tabla-card .bd-tabla-icono {
    font-size: 24px;
    margin-bottom: 10px;
}

.bd-tabla-card h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.bd-tabla-card p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* Detalle de tabla */
.bd-tabla-detalle {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.bd-tabla-header {
    background: #34495e;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bd-tabla-header h3 {
    margin: 0;
    font-size: 18px;
}

.bd-tabla-header small {
    opacity: 0.8;
    font-size: 14px;
}

.bd-btn-cerrar {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Secciones colapsables */
.bd-seccion {
    margin: 0;
}

.bd-seccion-titulo {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

.bd-seccion-titulo h4 {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bd-flecha {
    transition: transform 0.3s;
}

.bd-seccion-titlo.activo .bd-flecha {
    transform: rotate(180deg);
}

.bd-seccion-contenido {
    padding: 15px;
    display: none;
}

.bd-seccion-contenido.activo {
    display: block;
}

.bd-orden-info {
    background: #e8f4fc;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Tabla de campos */
.bd-campos-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.bd-campos-table th {
    background: #ecf0f1;
    padding: 10px;
    text-align: left;
    font-weight: bold;
}

.bd-campos-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

.bd-campos-table tr.bd-pk {
    background: #ffeaa7;
}

.bd-campos-table tr.bd-fk {
    background: #a29bfe;
}

.bd-campos-table tr.bd-unique {
    background: #81ecec;
}

.bd-campos-table tr:hover {
    background: #f1f2f6;
}

.bd-campos-table code {
    background: #2c3e50;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
}

/* Tabla de registros */
.bd-registros-container {
    overflow-x: auto;
}

.bd-registros-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.bd-registros-table th {
    background: #2c3e50;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: bold;
}

.bd-registros-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    max-width: 200px;
    word-wrap: break-word;
}

.bd-registros-table tr:hover {
    background: #f8f9fa;
}

.bd-registros-table td.bd-fecha {
    color: #e74c3c;
    font-weight: bold;
}

/* Footer */
.bd-footer {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 6px;
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
}

.bd-advertencia {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .bd-tablas-grid {
        grid-template-columns: 1fr;
    }
    
    .bd-info-panel {
        flex-direction: column;
    }
    
    .bd-acceso-denegado {
        margin: 20px;
        padding: 20px;
    }
    
    .bd-acceso-denegado h3 {
        font-size: 22px;
    }
    
    .bd-btn-intentar {
        display: block;
        width: 100%;
        text-align: center;
    }
}