/* Estilos para el módulo de Facturación */

.facturacion-container {
    padding: 10px;
}

/* Tabs de navegación horizontal */
.nav-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    padding: 6px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    white-space: nowrap;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-btn i {
    font-size: 13px;
}

.tab-content {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .nav-tabs {
        padding: 8px;
        gap: 6px;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .tab-btn i {
        font-size: 14px;
    }
}

/* Estilos para el select de estado */
.estado-select {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #dee2e6;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.estado-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Colores para cada estado */
.estado-vacio {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.estado-propietario {
    background-color: #e7e3ff;
    color: #4c3a85;
    border-color: #c8bfe7;
}

.estado-alquilado {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.estado-venta {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.estado-renta {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    transition: right 0.3s ease;
    max-width: 350px;
}

.notification.show {
    right: 20px;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-success i {
    color: #28a745;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-info i {
    color: #17a2b8;
}

.notification-warning {
    border-left: 4px solid #ffc107;
}

.notification-warning i {
    color: #ffc107;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-error i {
    color: #dc3545;
}

/* Conceptos interactivos */
.conceptos-interactive {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.concepto-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.concepto-card.selected {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.concepto-header {
    padding: 15px;
}

.concepto-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.concepto-details {
    flex: 1;
}

.concepto-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.concepto-codigo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.concepto-descripcion {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.concepto-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.concepto-monto-base {
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #667eea;
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Configuración de concepto */
.concepto-config {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.concepto-config.active {
    padding: 15px;
    max-height: 120px;
}

.monto-input-group label {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

.input-with-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-actions .form-control {
    flex: 1;
}

.reset-monto {
    flex-shrink: 0;
    padding: 6px 10px;
}

.no-concepts-placeholder {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.section-description {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Validación de costos */
.cost-validation {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.validation-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.total-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.total-info strong {
    color: #333;
    font-size: 16px;
}

.validation-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.validation-info.valid {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.validation-info.invalid {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.no-concepts-message {
    margin-top: 15px;
}

/* Estilos para las columnas de propietario e inquilino */
.person-cell {
    min-width: 140px;
    padding: 8px 12px;
}

.person-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.person-info i {
    color: #6c757d;
    width: 16px;
    text-align: center;
}

.person-name {
    color: #495057;
    font-weight: 500;
}

.person-cell .person-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Diferentes colores para propietario e inquilino */
.person-info i.fa-user-tie {
    color: #667eea;
}

.person-info i.fa-user {
    color: #28a745;
}

/* Estado cuando no hay persona asignada */
.person-cell .person-name:contains("No asignado") {
    color: #6c757d;
    font-style: italic;
}

/* Nueva interfaz compacta para configuración de costos */
.cost-config-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.cost-config-panel.active {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.panel-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.panel-subtitle {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 2px;
    display: block;
}

.btn-close-panel {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-close-panel:hover {
    background: rgba(255, 255, 255, 0.3);
}

.compact-cost-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    gap: 20px;
}

/* Sección de conceptos compacta */
.concepts-section h5 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.concepts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 2px;
}

.concept-compact {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.concept-compact.selected {
    background: white;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.concept-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.concept-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.toggle-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

.concept-code {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.concept-desc {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.concept-base-price {
    color: #28a745;
    font-weight: 600;
    font-size: 12px;
}

.concept-input {
    margin-top: 8px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.concept-input.active {
    opacity: 1;
    max-height: 40px;
}

.compact-money-input {
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Grid de distribución */
.distribution-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.distribution-item label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.compact-input {
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Resumen compacto */
.cost-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.summary-row:last-of-type {
    margin-bottom: 12px;
}

.summary-row strong {
    font-weight: 600;
    color: #333;
}

.validation-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
}

.validation-compact.valid {
    background: #e8f5e9;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.validation-compact.invalid {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
}

.validation-compact small {
    font-size: 12px;
    margin: 0;
}

/* Botones compactos */
.panel-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.btn-compact {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.no-concepts-compact {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 13px;
}

.no-concepts-compact .btn-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    display: block;
    margin-top: 8px;
}

/* Responsive para panel */
@media (max-width: 768px) {
    .cost-config-panel {
        width: 100%;
        right: 0;
    }
}

/* Dashboard de Facturación */
.facturacion-dashboard {
    padding: 15px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: none;
}

.stat-card:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.stat-content h3 {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin: 3px 0;
}

.stat-label {
    font-size: 12px;
    color: #95a5a6;
}

/* Sección reciente */
.recent-section {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recent-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1rem;
}

/* Vista de facturas */
.facturas-view {
    background: white;
    border-radius: 8px;
    padding: 12px;
}

.filters-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    width: 100%;
    padding: 6px 12px 6px 34px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 12px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 5px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.filter-btn:hover {
    background: #f8f9fa;
}

.filter-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Vista de generar */
.generar-view {
    background: white;
    border-radius: 8px;
    padding: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.generate-options h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.generate-form .form-group {
    margin-bottom: 15px;
}

.generate-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.generate-form .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
}

.generate-form select[multiple] {
    min-height: 120px;
}

/* Vista de conceptos */
.conceptos-view {
    padding: 15px;
}

.conceptos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.conceptos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
}

.concepto-card {
    background: white;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.concepto-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.concepto-card h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1rem;
}

.concepto-card p {
    color: #6c757d;
    font-size: 13px;
    margin: 0 0 12px 0;
}

.concepto-card .precio {
    font-size: 16px;
    font-weight: bold;
    color: #28a745;
}

/* Vista de reportes */
.reportes-view {
    padding: 15px;
}

.reportes-view h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.report-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.report-card {
    background: white;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.report-card i {
    font-size: 32px;
    color: #007bff;
    margin-bottom: 15px;
}

.report-card h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1rem;
}

.report-card p {
    color: #6c757d;
    font-size: 13px;
    margin: 0 0 15px 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Botones pequeños */
.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    margin: 0 2px;
}

/* Tabla responsive */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background: #f8f9fa;
    padding: 5px 8px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.78rem;
}

.data-table tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.78rem;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.text-center {
    text-align: center;
}

/* Formulario de factura */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Vista de costos por apartamento */
.costos-view {
    padding: 15px;
}

.costos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.costos-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.edificios-grid {
    display: grid;
    gap: 30px;
}

.edificio-costos-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.edificio-costos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f8f9fa;
}

.edificio-costos-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
}

.apartamentos-costos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.apartment-cost-card {
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apartment-cost-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.apartment-cost-card.configured {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.apartment-cost-card.not-configured {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffbf0 0%, #fff3cd 100%);
}

.apt-number {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 8px;
}

.cost-summary {
    min-height: 100px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.cost-label {
    color: #6c757d;
    font-weight: 500;
}

.cost-value {
    color: #2c3e50;
    font-weight: bold;
}

.no-config {
    text-align: center;
    color: #856404;
    font-style: italic;
    padding: 20px 0;
}

.btn-config {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add {
    background: #ffc107;
    color: #856404;
}

.btn-add:hover {
    background: #e0a800;
}

.btn-edit {
    background: #28a745;
    color: white;
}

.btn-edit:hover {
    background: #218838;
}

/* Formulario de costos */
.apartment-cost-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.apartment-cost-form {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.form-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: #dee2e6;
    color: #495057;
}

.cost-form {
    padding: 18px;
}

.cost-inputs-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.cost-input-group {
    display: flex;
    flex-direction: column;
}

.cost-input-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cost-input-group label i {
    color: #007bff;
}

.cost-input-group input {
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.cost-input-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.cost-input-group small {
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

.cost-validation {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.validation-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .filter-buttons {
        overflow-x: auto;
    }
    
    .apartamentos-costos-grid {
        grid-template-columns: 1fr;
    }
    
    .apartment-cost-form {
        width: 95%;
        margin: 20px;
    }
    
    .cost-inputs-grid {
        gap: 20px;
    }
}

/* Vista principal de costos - Estilo Excel */
.main-costs-view {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

/* Resumen de estadísticas */
.costs-stats-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #4CAF50;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.stat-value.configured {
    color: #28a745;
}

.stat-value.not-configured {
    color: #ffc107;
}

.stat-value.total {
    color: #0066cc;
    font-size: 18px;
}

/* Tabla principal estilo Excel */
.main-costs-table-container {
    overflow-x: auto;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
}

.main-costs-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    min-width: 1200px;
}

/* Encabezado de tabla principal */
.main-costs-table thead th {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 10px 6px;
    text-align: center;
    font-weight: 700;
    color: #343a40;
    border: 1px solid #bbb;
    border-top: 2px solid #4CAF50;
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Celdas de tabla principal */
.main-costs-table tbody td {
    padding: 8px 6px;
    border: 1px solid #ddd;
    vertical-align: middle;
    text-align: center;
    background: white;
    transition: background-color 0.1s ease;
    font-size: 11px;
}

/* Efecto zebra en tabla principal */
.main-cost-row:nth-child(even) {
    background: #f9f9f9;
}

.main-cost-row:nth-child(odd) {
    background: white;
}

/* Hover en tabla principal */
.main-cost-row:hover {
    background: #e6f3ff !important;
    box-shadow: inset 0 0 0 1px #0066cc;
}

/* Filas configuradas */
.main-cost-row.configured:nth-child(even) {
    background: #f0f8f0;
}

.main-cost-row.configured:nth-child(odd) {
    background: #f8fff8;
}

.main-cost-row.configured:hover {
    background: #e8f5e8 !important;
}

/* Filas no configuradas */
.main-cost-row.not-configured:nth-child(even) {
    background: #fff8f0;
}

.main-cost-row.not-configured:nth-child(odd) {
    background: #fffcf0;
}

.main-cost-row.not-configured:hover {
    background: #fff3cd !important;
}

/* Celdas específicas de la tabla principal */
.edificio-cell {
    text-align: left !important;
    font-weight: 600;
    color: #2c3e50;
    min-width: 100px;
}

.apartment-cell {
    font-weight: 700;
    color: #0066cc;
    min-width: 80px;
}

.config-status-cell {
    min-width: 100px;
}

.amount-cell {
    text-align: right !important;
    font-weight: 600;
    min-width: 80px;
}

.amount-total {
    color: #0066cc;
    font-size: 13px;
}

.amount-propietario {
    color: #28a745;
}

.amount-inquilino {
    color: #fd7e14;
}

.concepts-cell {
    text-align: left !important;
    max-width: 150px;
    font-size: 10px;
}

.concepts-summary {
    color: #6c757d;
    font-style: italic;
}

.date-cell {
    min-width: 80px;
}

.update-date {
    color: #6c757d;
    font-size: 10px;
}

.actions-cell {
    white-space: nowrap;
    min-width: 120px;
}

/* Botones en tabla principal */
.main-costs-table .btn-sm {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    border: 1px solid;
    margin: 1px;
    transition: all 0.1s ease;
}

.main-costs-table .btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border-color: #138496;
}

.main-costs-table .btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #0f6674 100%);
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Lista de apartamentos - Estilo Excel */
.apartment-list-view {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

.list-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.apartments-table-container {
    overflow-x: auto;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
}

.apartments-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
}

/* Encabezado estilo Excel */
.apartments-table thead th {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 8px;
    text-align: center;
    font-weight: 700;
    color: #343a40;
    border: 1px solid #bbb;
    border-top: 2px solid #4CAF50;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Celdas estilo Excel */
.apartments-table tbody td {
    padding: 10px 8px;
    border: 1px solid #ddd;
    vertical-align: middle;
    text-align: center;
    background: white;
    transition: background-color 0.1s ease;
}

/* Efecto zebra como Excel */
.apartment-row:nth-child(even) {
    background: #f9f9f9;
}

.apartment-row:nth-child(odd) {
    background: white;
}

/* Hover efecto Excel */
.apartment-row:hover {
    background: #e6f3ff !important;
    box-shadow: inset 0 0 0 1px #0066cc;
}

/* Celdas de estado configurado */
.apartment-row.configured:nth-child(even) {
    background: #f0f8f0;
}

.apartment-row.configured:nth-child(odd) {
    background: #f8fff8;
}

.apartment-row.configured:hover {
    background: #e8f5e8 !important;
}

/* Celdas no configuradas */
.apartment-row.not-configured:nth-child(even) {
    background: #fff8f0;
}

.apartment-row.not-configured:nth-child(odd) {
    background: #fffcf0;
}

.apartment-row.not-configured:hover {
    background: #fff3cd !important;
}

/* Columna de edificio */
.apartments-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
}

/* Columna de apartamento */
.apartments-table tbody td:nth-child(2) {
    font-weight: 700;
    color: #0066cc;
}

/* Columna de conceptos - alineada a la izquierda */
.apartments-table tbody td:nth-child(6) {
    text-align: left;
    max-width: 200px;
}

/* Columna de acciones */
.apartments-table tbody td:last-child {
    white-space: nowrap;
}

/* Botones estilo Excel */
.apartments-table .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid;
    transition: all 0.1s ease;
    cursor: pointer;
}

.apartments-table .btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    border-color: #004499;
}

.apartments-table .btn-primary:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.apartments-table .btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border-color: #f57c00;
}

.apartments-table .btn-warning:hover {
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Filas seleccionadas efecto Excel */
.apartments-table tbody tr:focus {
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

/* Efectos de sorting en encabezados */
.apartments-table thead th:hover {
    background: linear-gradient(180deg, #e9ecef 0%, #dee2e6 100%);
    cursor: pointer;
}

/* Estilos Excel para badges */
.apt-number-badge {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid #004499;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.configured {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-color: #c3e6cb;
}

.status-badge.not-configured {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-color: #ffeaa7;
}

/* Badges de nivel y estado */
.badge {
    padding: 3px 6px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid;
    display: inline-block;
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border-color: #1e7e34;
}

.badge-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: #0056b3;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    border-color: #e0a800;
}

.badge-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border-color: #5a6268;
}

.concept-tag {
    display: inline-block;
    background: linear-gradient(135deg, #f1f3f4 0%, #e9ecef 100%);
    color: #495057;
    padding: 2px 6px;
    border-radius: 2px;
    margin: 1px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid #dee2e6;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.text-muted {
    color: #6c757d !important;
}

/* Alertas */
.alert {
    padding: 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert h5 {
    margin-top: 0;
    color: inherit;
    font-weight: 600;
}

.alert ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.alert small {
    opacity: 0.8;
    font-style: italic;
}

.no-data-message {
    text-align: center;
    padding: 40px 20px;
}

/* Badges adicionales */
.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-primary {
    background-color: #007bff;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Badge clickeable para toggle de estado */
.status-toggle {
    transition: all 0.3s ease;
    cursor: pointer !important;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.status-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-toggle:active {
    transform: scale(0.95);
}

.status-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.status-toggle:hover::before {
    left: 100%;
}

/* Formulario de conceptos */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.form-section h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h5 {
    margin: 20px 0 15px 0;
    color: #495057;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conceptos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.concepto-input-group {
    display: flex;
    flex-direction: column;
}

.concepto-input-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-remove {
    position: relative;
}

.input-with-remove input {
    padding: 10px 40px 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    width: 100%;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-with-remove input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.btn-remove-concept {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.btn-remove-concept:hover {
    background: #c82333;
}

.concepto-custom {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.custom-concept-row {
    display: grid;
    grid-template-columns: 1fr 120px auto;
    gap: 10px;
    align-items: end;
}

.cost-distribution {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.validation-summary {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.total-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.total-info span {
    color: #495057;
}

.total-info strong {
    color: #2c3e50;
    font-size: 18px;
}

/* Responsive design */
@media (max-width: 768px) {
    /* Tabla principal responsive */
    .main-costs-table {
        min-width: 800px;
        font-size: 10px;
    }
    
    .main-costs-table thead th,
    .main-costs-table tbody td {
        padding: 6px 4px;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Lista de apartamentos responsive */
    .apartments-table-container {
        font-size: 12px;
    }
    
    .apartments-table thead th,
    .apartments-table tbody td {
        padding: 8px 6px;
    }
    
    /* Formularios responsive */
    .conceptos-grid {
        grid-template-columns: 1fr;
    }
    
    .cost-distribution {
        grid-template-columns: 1fr;
    }
    
    .custom-concept-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .apartment-cost-form {
        width: 95%;
        margin: 10px;
    }
    
    .cost-inputs-grid {
        gap: 15px;
    }
}

/* Vista de gestión de conceptos */
.conceptos-view {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.conceptos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

.conceptos-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.conceptos-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #4CAF50;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Tabla de conceptos estilo Excel */
.conceptos-table-container {
    overflow-x: auto;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
}

.conceptos-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
}

.conceptos-table thead th {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 8px;
    text-align: center;
    font-weight: 700;
    color: #343a40;
    border: 1px solid #bbb;
    border-top: 2px solid #4CAF50;
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.conceptos-table tbody td {
    padding: 10px 8px;
    border: 1px solid #ddd;
    vertical-align: middle;
    text-align: center;
    background: white;
    transition: background-color 0.1s ease;
}

/* Filas de conceptos */
.concepto-row:nth-child(even) {
    background: #f9f9f9;
}

.concepto-row:nth-child(odd) {
    background: white;
}

.concepto-row:hover {
    background: #e6f3ff !important;
    box-shadow: inset 0 0 0 1px #0066cc;
}

.concepto-row.active:nth-child(even) {
    background: #f0f8f0;
}

.concepto-row.active:nth-child(odd) {
    background: #f8fff8;
}

.concepto-row.inactive:nth-child(even) {
    background: #f8f8f8;
}

.concepto-row.inactive:nth-child(odd) {
    background: #f0f0f0;
}

/* Celdas específicas de conceptos */
.code-cell {
    text-align: center !important;
    min-width: 80px;
    font-weight: 600;
}

.concepto-code {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.concepto-name-cell {
    text-align: left !important;
    min-width: 150px;
}

.concepto-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.concepto-icon {
    color: #4CAF50;
    font-size: 14px;
}

.concepto-amount {
    color: #0066cc;
    font-size: 14px;
}

.description-cell {
    text-align: left !important;
    max-width: 200px;
    font-size: 11px;
}

.concepto-description {
    color: #6c757d;
    font-style: italic;
}

.status-cell {
    min-width: 80px;
}

.usage-cell {
    min-width: 80px;
}

.usage-count {
    color: #495057;
    font-weight: 600;
}

.date-cell {
    min-width: 80px;
}

.creation-date {
    color: #6c757d;
    font-size: 10px;
}

.actions-cell {
    white-space: nowrap;
    min-width: 200px;
}

/* Mensaje sin conceptos */
.no-conceptos {
    text-align: center;
    padding: 40px 20px;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Formulario de conceptos */
.concepto-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.concepto-form {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.concept-form {
    padding: 25px;
}

.concept-form .form-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 25px;
}

.concept-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.concept-form .form-group.full-width {
    grid-column: span 2;
}

.concept-form .form-group {
    display: flex;
    flex-direction: column;
}

.concept-form label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.concept-form .form-control {
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.concept-form .form-control:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.concept-form textarea {
    resize: vertical;
    min-height: 80px;
}

.concept-form small {
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

/* Checkbox personalizado */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600 !important;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #4CAF50;
    border-color: #4CAF50;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Modal Overlay para Conceptos */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.modal-content form {
    padding: 20px;
}

.form-row-inline {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.codigo-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .conceptos-table {
        font-size: 10px;
    }
    
    .conceptos-table thead th,
    .conceptos-table tbody td {
        padding: 8px 4px;
    }
    
    .concept-form .form-row {
        flex-direction: column;
    }
    
    .concept-form .form-row .form-group {
        width: 100% !important;
    }
    
    .concept-form .form-grid {
        grid-template-columns: 1fr;
    }
    
    .concept-form .form-group.full-width {
        grid-column: span 1;
    }
}