/* Admin Panel Styles */
:root {
    --primary-color: #D4A574;
    --gold-orange: #D4A574;
    --text-dark: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --bg-light: #f5f5f5;
    --bg-dark: #1a1a1a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.admin-container {
    min-height: 100vh;
    padding-bottom: 40px;
}

/* Header */
.admin-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #B8824F 100%);
    color: var(--white);
    padding: 25px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-header h1 {
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.header-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-refresh,
.btn-back,
.btn-add {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--white);
    background: rgba(255, 255, 255, 0.2);
}

.btn-refresh:hover,
.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-refresh:disabled,
.btn-back:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

.btn-refresh:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

.btn-refresh i.fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Stats Dashboard */
.stats-dashboard {
    max-width: 1400px;
    margin: 0 auto 24px;
    padding: 0 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.stat-card {
    background: var(--white);
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: var(--white);
    font-size: 18px;
    flex-shrink: 0;
}

.stat-icon.icon-basica {
    background: #4CAF50;
}

.stat-icon.icon-amplia {
    background: #2196F3;
}

.stat-icon.icon-gps {
    background: #FF9800;
}

.stat-info {
    min-width: 0;
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
    line-height: 1.1;
}

.stat-info p {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.25;
    word-break: break-word;
    margin: 0;
}

#statsCoberturas {
    display: contents;
}

.stat-card--sin-cobertura .stat-icon {
    background: #9e9e9e;
}

/* Catálogo de Agentes */
.agentes-section {
    max-width: 1400px;
    margin: 0 auto 28px;
    padding: 0 30px;
}

.agentes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.agentes-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.agentes-hint {
    font-size: 13px;
    color: var(--text-light);
    margin: 0 0 14px;
}

.btn-add-agente {
    padding: 10px 16px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-add-agente:hover {
    background: var(--primary-dark, #c62828);
}

.agentes-panel-hidden,
.panel-hidden {
    display: none;
}

.agentes-loading,
.agentes-empty {
    background: var(--white);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    color: var(--text-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.agentes-empty i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.catalogo-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.catalogo-selector-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px 18px;
}

.catalogo-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.catalogo-selector-header label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.catalogo-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(211, 47, 47, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
}

.catalogo-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: auto;
}

.catalogo-select:hover {
    border-color: #ccc;
}

.catalogo-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
    background: var(--white);
}

.catalogo-detail {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-left: 4px solid var(--primary-color);
}

.catalogo-detail-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.catalogo-detail-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.catalogo-detail-icon--cobrador {
    background: #2e7d32;
}

.cobradores-section .catalogo-detail {
    border-left-color: #2e7d32;
}

.cobradores-section .catalogo-count {
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.1);
}

.excel-guide-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 22px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.excel-guide-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.excel-guide-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}
.excel-guide-header h2 i {
    color: #15803d;
    margin-right: 6px;
}
.excel-guide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.excel-guide-rules {
    margin: 0 0 14px;
    padding-left: 1.2rem;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.5;
}
.excel-guide-rules li {
    margin-bottom: 6px;
}
.excel-guide-rules code,
.excel-cols-table code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #0f172a;
}
.excel-guide-cols {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}
.excel-guide-cols summary {
    cursor: pointer;
    font-weight: 600;
    color: #1e293b;
    user-select: none;
    padding: 4px 0;
}
.excel-guide-cols summary:hover {
    color: #15803d;
}
.excel-guide-cols[open] summary {
    margin-bottom: 10px;
}
.excel-cols-table td:first-child {
    font-weight: 600;
    white-space: nowrap;
}
.excel-cols-table td:nth-child(2) {
    text-align: center;
    width: 4.5rem;
}

.import-excel-section {
    border-top: 3px solid #2e7d32;
    padding-top: 28px;
    margin-top: 8px;
}

.import-excel-section .agentes-header h2 i {
    color: #2e7d32;
}

.delete-excel-section {
    border-top: 3px solid #c62828;
    padding-top: 28px;
    margin-top: 8px;
}

.delete-excel-section .agentes-header h2 i {
    color: #c62828;
}

.delete-excel-panel {
    border: 1px solid #ffcdd2;
}

.btn-delete-upload {
    background: #c62828 !important;
}

.btn-delete-upload:hover {
    background: #b71c1c !important;
}

.is-hidden {
    display: none !important;
}

.catalogo-detail-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.catalogo-detail-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.catalogo-detail-info strong {
    font-size: 18px;
    color: var(--text-dark);
    word-break: break-word;
}

.catalogo-detail-meta {
    font-size: 12px;
    color: var(--text-light);
}

.catalogo-detail-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-catalogo-action {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-catalogo-action:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-catalogo-edit {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-catalogo-delete {
    background: #ffebee;
    color: #c62828;
}

.agentes-table-wrap {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

.agentes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.agentes-table th,
.agentes-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.agentes-table th {
    background: #f8f8f8;
    font-weight: 600;
    color: var(--text-dark);
}

.agentes-table tbody tr:hover {
    background: #fafafa;
}

.agentes-th-actions {
    width: 140px;
    text-align: center !important;
}

.agentes-td-actions {
    text-align: center;
    white-space: nowrap;
}

.btn-agente-icon {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
    transition: opacity 0.2s;
}

.btn-agente-edit {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-agente-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-agente-icon:hover {
    opacity: 0.85;
}

.modal-small {
    max-width: 480px;
}

/* Filters Section */
.filters-section {
    max-width: 1400px;
    margin: 0 auto 30px;
    padding: 0 30px;
}

.filters-section h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group input,
.filter-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-clear-filters {
    padding: 12px 20px;
    background: #f44336;
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    margin-top: 20px;
}

.btn-clear-filters:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* Loading & Empty States */
.loading-indicator,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
}

.empty-state.is-visible {
    display: flex;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-indicator i {
    font-size: 48px;
    color: var(--primary-color);
}

.empty-state i {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

/* Table Section */
.registros-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.table-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

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

.registros-table thead {
    background: var(--primary-color);
    color: var(--white);
}

.registros-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.registros-table th i {
    margin-right: 8px;
}

.registros-table th.col-checkbox {
    width: 40px;
}

.registros-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.registros-table tbody tr:hover {
    background: #f9f9f9;
}

.registros-table tbody tr.selected-row {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
}

.registros-table tbody tr.selected-row:hover {
    background: #bbdefb;
}

.row-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin: 0;
    cursor: pointer;
}

.row-checkbox:hover {
    transform: scale(1.1);
}

#selectAll {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin: 0;
}

.registros-table td:first-child {
    text-align: center;
    width: 50px;
    padding: 15px 10px;
}

.registros-table td {
    padding: 15px;
    font-size: 14px;
    color: var(--text-dark);
}

.phone-link,
.email-link {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.phone-link:hover,
.email-link:hover {
    color: #B8824F;
    text-decoration: underline;
}

.plan-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-badge.plan-basica {
    background: #E8F5E9;
    color: #2E7D32;
}

.plan-badge.plan-amplia {
    background: #E3F2FD;
    color: #1565C0;
}

.plan-badge.plan-gps {
    background: #FFF3E0;
    color: #E65100;
}

/* Action Buttons */
.btn-action {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 5px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-view {
    background: #2196F3;
    color: var(--white);
}

.btn-view:hover {
    background: #1976D2;
    transform: scale(1.05);
}

.btn-whatsapp {
    background: #25D366;
    color: var(--white);
}

.btn-whatsapp:hover {
    background: #128C7E;
    transform: scale(1.05);
}

.btn-payments {
    background: #4CAF50;
    color: var(--white);
}

.btn-payments:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-delete {
    background: #f44336;
    color: var(--white);
}

.btn-delete:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

.btn-edit {
    background: #FF9800;
    color: var(--white);
}

.btn-edit:hover {
    background: #F57C00;
    transform: scale(1.05);
}

/* Pagination */
.pagination-container {
    max-width: 1400px;
    margin: 30px auto 0;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.pagination-info {
    color: var(--text-light);
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-pagination {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-pagination:hover:not(:disabled) {
    background: #B8824F;
    transform: translateY(-2px);
}

.btn-pagination:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

#currentPageInfo {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.3s;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
}

.detail-item p {
    font-size: 16px;
    color: var(--text-dark);
}

.detail-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.detail-item a:hover {
    text-decoration: underline;
}

.detail-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-detail {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--white);
}

.btn-call {
    background: #4CAF50;
}

.btn-call:hover {
    background: #45a049;
}

.btn-email {
    background: #2196F3;
}

.btn-email:hover {
    background: #1976D2;
}

.btn-whatsapp-modal {
    background: #25D366;
}

.btn-whatsapp-modal:hover {
    background: #128C7E;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input::placeholder {
    color: #999;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-submit,
.btn-cancel {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-submit {
    background: var(--primary-color);
    color: var(--white);
}

.btn-submit:hover:not(:disabled) {
    background: #B8824F;
    transform: translateY(-2px);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-cancel {
    background: #f5f5f5;
    color: var(--text-dark);
    border: 2px solid #ddd;
}

.btn-cancel:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

/* Responsive Design - Admin Panel */
@media (max-width: 1024px) {
    .header-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .stats-dashboard {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
    
    .table-container {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .admin-container {
        padding: 0;
    }
    
    .admin-header {
        padding: 15px 0;
    }
    
    .header-content {
        padding: 0 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .admin-header h1 {
        font-size: 20px;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .header-actions .btn-refresh,
    .header-actions .btn-back {
        width: 100%;
        justify-content: center;
    }
    
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 15px;
    }
    
    .stat-card {
        padding: 12px;
        gap: 10px;
    }
    
    .catalogo-detail {
        flex-direction: column;
        align-items: stretch;
    }

    .catalogo-detail-actions {
        width: 100%;
    }

    .btn-catalogo-action {
        flex: 1;
        justify-content: center;
    }

    .filters-section {
        padding: 0 15px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .registros-section {
        padding: 0 15px;
    }
    
    .registros-table {
        min-width: 800px;
        font-size: 12px;
    }
    
    .registros-table th,
    .registros-table td {
        padding: 8px 5px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 100%;
        margin: 20px auto;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .pagination-container {
        padding: 0 15px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .btn-detail {
        width: 100%;
        justify-content: center;
    }
}

/* Responsive para móviles pequeños */
@media (max-width: 480px) {
    .admin-header h1 {
        font-size: 18px;
    }
    
    .stats-dashboard {
        padding: 0 10px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .stat-info h3 {
        font-size: 20px;
    }
    
    .filters-section {
        padding: 0 10px;
    }
    
    .registros-section {
        padding: 0 10px;
    }
    
    .modal-content {
        width: calc(100% - 20px);
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .registros-table {
        font-size: 11px;
        min-width: 700px;
    }
    
    .pagination-container {
        padding: 0 10px;
    }
}

/* ============================================
   ESTILOS PARA SISTEMA DE PAGOS
   ============================================ */

.modal-large {
    max-width: 900px;
    width: 95%;
}

.pagos-cliente-info {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.cliente-card {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}

.cliente-card h3 {
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 20px;
}

.cliente-card p {
    margin: 5px 0;
    color: var(--text-light);
    font-size: 14px;
}

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

.pagos-header h3 {
    font-size: 20px;
    color: var(--text-dark);
}

.btn-add-pago {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-add-pago:hover {
    background: #B8824F;
    transform: translateY(-2px);
}

.pagos-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-pendiente {
    color: #FF9800;
}

.pagos-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.pagos-table thead {
    background: var(--primary-color);
    color: var(--white);
}

.pagos-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

.pagos-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.pagos-table tbody tr:hover {
    background: #f9f9f9;
}

.pagos-table td {
    padding: 12px;
    font-size: 13px;
    color: var(--text-dark);
}

.estado-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.estado-completado {
    background: #E8F5E9;
    color: #2E7D32;
}

.estado-pendiente {
    background: #FFF3E0;
    color: #E65100;
}

.estado-cancelado {
    background: #FFEBEE;
    color: #C62828;
}

.pagos-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Responsive para pagos */
@media (max-width: 768px) {
    .modal-large {
        width: 98%;
        max-height: 95vh;
    }
    
    .pagos-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .pagos-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagos-table {
        font-size: 11px;
    }
    
    .pagos-table th,
    .pagos-table td {
        padding: 8px 4px;
    }
}

/* Importar contratos Excel */
.import-excel-panel {
    background: var(--white);
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.import-excel-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.import-file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f3f0eb;
    border: 1px dashed #c4b5a0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.import-file-label:hover {
    background: #ebe4da;
}

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

.import-file-name {
    font-size: 13px;
    color: var(--text-light);
    flex: 1 1 180px;
    min-width: 140px;
}

.import-excel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-import-upload {
    background: #2e7d32 !important;
}

.btn-import-upload:hover {
    background: #1b5e20 !important;
}

.import-clear-btn {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.import-status {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    background: #f5f5f5;
}

.import-status--info { background: #eef5ff; color: #1a4a7a; }
.import-status--ok { background: #e8f5e9; color: #1b5e20; }
.import-status--warn { background: #fff8e1; color: #8a6d00; }
.import-status--error { background: #fdecea; color: #8b1a1a; }

.import-progress {
    margin-top: 12px;
}

.import-progress-track {
    height: 8px;
    background: #ececec;
    border-radius: 999px;
    overflow: hidden;
}

.import-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), #B8824F);
    transition: width 0.2s ease;
}

.import-progress-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.import-verdict {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border-left: 4px solid #999;
    background: #fafafa;
}

.import-verdict strong {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.import-verdict p {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
}

.import-verdict--ok {
    border-left-color: #2e7d32;
    background: #e8f5e9;
}

.import-verdict--warn {
    border-left-color: #f9a825;
    background: #fff8e1;
}

.import-verdict--error {
    border-left-color: #c62828;
    background: #fdecea;
}

.import-report {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.import-block {
    border-radius: 10px;
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid #eee;
}

.import-block h4 {
    margin: 0 0 8px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-block--error { border-color: #f5c6cb; background: #fff5f5; }
.import-block--warn { border-color: #ffe082; background: #fffdf5; }
.import-block--map { border-color: #c5cae9; background: #f7f8ff; }
.import-block--summary { border-color: #b0bec5; background: #f7fafc; }

.import-block--obs {
    border-color: #ffb74d;
    background: #fffaf0;
}

.import-obs-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.import-obs-header h4 {
    margin: 0;
}

.btn-omitir-todas {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #c48a2a;
    background: #fff;
    color: #8a5a00;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.btn-omitir-todas:hover {
    background: #fff3e0;
}

.import-obs-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 12px;
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid #ffe0a3;
    background: #fff;
}

.import-obs-card.is-omitted {
    opacity: 0.72;
    border-color: #c8e6c9;
    background: #f4faf4;
}

.import-obs-title {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.import-obs-loc {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #6d4c41;
    margin-bottom: 6px;
}

.import-obs-main p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--text-dark);
}

.import-obs-k {
    font-weight: 700;
    color: #5d4037;
}

.import-obs-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 110px;
}

.btn-obs-omitir,
.btn-obs-deshacer {
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.btn-obs-omitir {
    background: #ef6c00;
    color: #fff;
}

.btn-obs-omitir:hover {
    background: #e65100;
}

.btn-obs-deshacer {
    background: #eceff1;
    color: #37474f;
}

.import-obs-ok {
    font-size: 12px;
    font-weight: 700;
    color: #2e7d32;
    text-align: center;
}

.import-summary-sec {
    margin-top: 10px;
}

.import-summary-sec strong {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.import-map-suggest {
    display: block;
    font-size: 12px;
    color: #5d6b7a;
    margin-top: 4px;
}

@media (max-width: 700px) {
    .import-obs-card {
        grid-template-columns: 1fr;
    }
}

.import-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    max-height: 220px;
    overflow: auto;
}

.import-list li {
    margin-bottom: 4px;
}

.import-loc {
    display: inline-block;
    font-weight: 700;
    color: #5d4037;
    margin-right: 4px;
}

.import-map-hint {
    font-size: 12px;
    color: var(--text-light);
    margin: 0 0 12px;
}

.import-map-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(200px, 1.4fr);
    gap: 12px;
    align-items: end;
    padding: 10px 0;
    border-top: 1px solid #e4e7f0;
}

.import-map-row:first-of-type {
    border-top: none;
    padding-top: 0;
}

.import-map-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    margin-bottom: 2px;
}

.import-map-to label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.import-map-select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

@media (max-width: 700px) {
    .import-map-row {
        grid-template-columns: 1fr;
    }
}
