/* =====================================================
   CONFIGURACION - Pagina de configuracion
   ===================================================== */

/* --- Page Header --- */
.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title-section h1 {
    font-size: 28px;
    font-weight: 700;
    color: #4459D7;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: #6b6b6b;
}

/* --- Tabs --- */
.tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    background: #fafafa;
}

.tab-button {
    padding: 16px 32px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: #6b6b6b;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: none;
    align-items: center;
    gap: 8px;
}

.tab-button.visible {
    display: flex;
}

.tab-button:hover {
    background: rgba(68, 89, 215, 0.05);
    color: #4459D7;
}

.tab-button.active {
    color: #4459D7;
    background: white;
    border-bottom-color: #4459D7;
}

.tab-content {
    padding: 32px;
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Section Header --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 20px;
}

.section-header > div {
    flex: 1;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

/* --- Custom Fields Filters --- */
.custom-fields-filters {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.custom-fields-filters .filter-group {
    max-width: 280px;
}

.custom-fields-filters .filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.custom-fields-filters .module-selector {
    border-radius: 8px;
}

/* --- Custom Fields Grid --- */
.custom-fields-grid {
    margin-top: 20px;
}

.custom-fields-grid .e-grid {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.custom-fields-grid .e-gridheader {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.custom-fields-grid .e-headercell {
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    padding: 14px 16px;
}

.custom-fields-grid .e-rowcell {
    font-size: 14px;
    color: #2d3748;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.custom-fields-grid .e-row:hover {
    background: #f8fafc;
}

/* --- Field Name Code Style --- */
.field-name-code {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* --- Custom Field Modal --- */
.custom-field-modal .e-dlg-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 24px;
}

.custom-field-modal .e-dlg-header-content {
    background: linear-gradient(135deg, #4459D7 0%, #6366f1 100%);
    padding: 16px 24px;
}

.custom-field-modal .e-dlg-header {
    color: white;
    font-weight: 600;
}

.custom-field-modal .e-dlg-closeicon-btn {
    color: white;
}

.custom-field-modal .form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.custom-field-modal .form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.custom-field-modal .form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #4459D7;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-field-modal .form-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #4459D7 0%, #6366f1 100%);
    border-radius: 2px;
}

.custom-field-modal .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.custom-field-modal .form-row:last-child {
    margin-bottom: 0;
}

.custom-field-modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-field-modal .form-group.full-width {
    grid-column: span 2;
}

.custom-field-modal .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.custom-field-modal .form-group .required {
    color: #dc3545;
    margin-left: 2px;
}

.custom-field-modal .form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

.custom-field-modal .e-input-group,
.custom-field-modal .e-textbox {
    border-radius: 8px;
}

/* --- Modal Footer --- */
/* Estilos base en modals.css */

/* --- Field Type Badge --- */
.field-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.type-text {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.type-number {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.type-date {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.type-boolean {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #6b21a8;
}

.type-select {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
    color: #0e7490;
}

.type-multiselect {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #9d174d;
}

.type-url {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
}

.type-default {
    background: #f1f5f9;
    color: #475569;
}

/* --- Yes/No Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-required {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.badge-optional {
    background: #f1f5f9;
    color: #64748b;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .tab-button {
        padding: 12px 16px;
        font-size: 13px;
    }

    .tab-content {
        padding: 16px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .custom-field-modal .form-row {
        grid-template-columns: 1fr;
    }

    .custom-field-modal .form-group.full-width {
        grid-column: span 1;
    }

    .custom-field-modal .e-dialog {
        width: 95% !important;
        max-width: 95% !important;
    }
}
