/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
}

.main-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.main-nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.login-box h2 {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

/* Formularios */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.form-inline {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.form-inline input,
.form-inline select {
    margin-bottom: 0;
}

.form-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h2 {
    margin-bottom: 1rem;
    color: #667eea;
}

.help-text {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* Botones */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Tablas */
.table-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #667eea;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: #667eea;
    margin: 0;
}

.stat-info p {
    color: #666;
    margin: 0;
}

/* Acciones rápidas */
.quick-actions {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quick-actions h2 {
    margin-bottom: 1rem;
    color: #667eea;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Búsqueda */
.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: #e9ecef;
    color: #666;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
    background: white;
    padding: 1.5rem;
    border-radius: 0 8px 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.tab-content.active {
    display: block;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-results {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.result-header h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.result-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.result-content {
    margin: 1rem 0;
}

.result-concordancias {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Chat */
.chat-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

.chat-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
}

.chat-messages {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 4px;
}

.user-message {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.bot-message {
    background: #f1f8e9;
    border-left: 4px solid #8bc34a;
}

.results-message {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.response-content {
    margin-top: 0.5rem;
}

.result-item {
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.result-item h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

/* Footer */
.main-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* Concordancias clicables */
.concordancia-num {
    color: #667eea;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.3s;
    display: inline-block;
}

.concordancia-num:hover {
    background-color: #667eea;
    color: white;
    text-decoration: none;
}

/* Recuadro de concordancias en chat */
.concordancias-box {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

