* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.back-link {
    background: #f5f5f5;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #e5e5e5;
    transition: all 0.2s ease;
}

.back-link:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

.stats {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #666;
    font-size: 1rem;
}

/* Numbers Section */
.numbers-section {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #e5e5e5;
    color: #666;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.filter-tab:hover:not(.active) {
    border-color: #ccc;
    color: #1a1a1a;
}

.numbers-container {
    padding: 1.5rem;
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.5rem;
}

.number-card {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid #e5e5e5;
}

.number-card.available {
    background: #fff;
    color: #1a1a1a;
}

.number-card.available:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.number-card.occupied {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #e5e5e5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1rem;
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    background: #fafafa;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    padding-right: 2rem;
}

.modal-header p {
    color: #666;
    font-size: 0.875rem;
}

.close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: #999;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.1);
}

.modal-body {
    padding: 1.5rem 2rem 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1a1a1a;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    color: #1a1a1a;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.file-upload {
    position: relative;
    margin-bottom: 1rem;
}

.file-upload input[type=file] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 1rem;
    border: 2px dashed #ccc;
    border-radius: 6px;
    text-align: center;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.file-upload-label:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
    background: #f5f5f5;
}

.file-upload-label.selected {
    border-color: #1a1a1a;
    color: #1a1a1a;
    background: #f5f5f5;
}

/* Buttons */
.buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    font-family: inherit;
}

.btn-primary {
    background: #1a1a1a;
    color: #fff;
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e5e5e5;
}

.btn-secondary:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* Alerts */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-size: 0.875rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.alert-success {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #7dd3fc;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Admin Panel Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: #666;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-section {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.875rem;
}

th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

td {
    color: #1a1a1a;
}

tr:hover {
    background: #fafafa;
}

.number-badge {
    background: #1a1a1a;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.images-preview {
    display: flex;
    gap: 0.5rem;
}

.image-thumbnail {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-thumbnail:hover {
    border-color: #1a1a1a;
    transform: scale(1.1);
}

.whatsapp-link {
    color: #25d366;
    text-decoration: none;
    font-weight: 500;
}

.whatsapp-link:hover {
    text-decoration: underline;
}

.no-data {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-data h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

/* Modal para ver imágenes - VERSIÓN MEJORADA */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    box-sizing: border-box;
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    max-width: 600px;
    max-height: 700px;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: zoom-in;
}

.image-modal img.zoomed {
    cursor: zoom-out;
    transform: scale(1.5);
}

.image-modal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* Indicador de carga para imágenes grandes */
.image-modal::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 999;
}

.image-modal.loaded::before {
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #e5e5e5;
    color: #666;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.filter-btn:hover:not(.active) {
    border-color: #ccc;
    color: #1a1a1a;
}

.risk-badge {
    display: inline-block;
    padding: 0.125rem 0.4rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    background: #dc2626;
    color: white;
}

.proxy-info {
    font-size: 0.65rem;
    color: #666;
    margin-top: 0.25rem;
}

.duplicate-link {
    font-size: 0.65rem;
    color: #dc2626;
    margin-top: 0.25rem;
    font-weight: bold;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
}

.info-section h4 {
    margin: 0 0 0.75rem 0;
    color: #1a1a1a;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #666;
    font-size: 0.8rem;
    min-width: 80px;
}

.info-value {
    color: #1a1a1a;
    font-size: 0.8rem;
    word-break: break-word;
    text-align: right;
    max-width: 60%;
}

.fingerprint-hash {
    font-family: 'Courier New', monospace;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    word-break: break-all;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .logo-img {
        height: 28px;
    }
    
    .stats {
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding: 1rem;
    }
    
    .numbers-container {
        padding: 0.75rem;
    }
    
    .numbers-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 0.4rem;
    }
    
    .number-card {
        font-size: 0.75rem;
    }
    
    /* Modal Mobile */
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 100%;
        max-width: none;
        border-radius: 8px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
        padding-right: 2rem;
    }
    
    .close {
        top: 1rem;
        right: 1rem;
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn {
        padding: 0.875rem;
        font-size: 0.875rem;
    }
    
    /* Table Responsive */
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding: 1rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .images-preview {
        flex-direction: column;
    }
    
    .image-thumbnail {
        width: 24px;
        height: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .info-value {
        text-align: left;
        max-width: 100%;
    }
    
    /* Image Modal Mobile */
    .image-modal {
        padding: 10px;
    }
    
    .image-modal-content {
        max-width: 90vw;
        max-height: 90vh;
    }
    
    .image-modal img {
        max-width: 100%;
        max-height: 100%;
        max-width: 350px;
        max-height: 500px;
    }
    
    .image-modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 24px;
    }
    
    .numbers-grid {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
        gap: 0.3rem;
    }
    
    .number-card {
        font-size: 0.7rem;
    }
    
    .modal-content {
        margin: 1% auto;
        max-height: 98vh;
    }
}

.residential-badge {
    display: inline-block;
    padding: 0.125rem 0.4rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    background: #10b981; /* Color verde */
    color: white;
    margin-left: 0.25rem;
}