:root {
    --bg-light: #ffffff;
    --bg-accent: #f9fafb;
    --text-primary: #20B042;
    --text-secondary: #0A4F13;
    --accent-primary: #35342E;
    --accent-secondary: #93c5fd;
    --border-color: #e5e7eb;
    --success: #20B042;
    --warning: #0A4F13;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-light);
    box-shadow: var(--shadow-sm);
    padding: 1.2rem 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
	max-width:40%;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent-primary);
}

nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

nav a:hover, a.active {
    color: var(--text-primary);
}

nav a.active::after, nav a:hover::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
}

/* Main Content */
main {
    flex: 1;
    padding: 3rem 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
	
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
	padding-bottom:60px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* Dashboard */
.dashboard {
    background: var(--bg-light);
    border-radius: 1.4rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
	margin-top:-80px;
}

.dashboard-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h2 {
    font-size: 1.75rem;
    font-weight: 7极;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-secondary);
}

.dashboard-body {
    padding: 1rem;
	
}

.search-section {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

select, input {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
    width: 100%;
    padding: 0.9rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.search-btn:hover {
    background: #20B042 ;
    transform: translateY(-2px);
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    margin: 0.5rem 0;
    display: none;
}

/* Service Cards */
.services-section {
    display: none;
    padding: 2rem 0;
}

.section-header {
    margin-bottom: 1.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.service-id {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.service-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.status-active {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.service-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.service-details {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.service-price {
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Invoice Table */
.invoices-section {
    display: none;
    padding: 2rem 0;
}

.invoices-section .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.invoices-section #invoices-table {
    min-width: 920px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

thead th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-accent);
}

tbody tr:hover td {
    background: var(--bg-accent);
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.paid {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Footer */
footer {
			background-color: #f8f9fa;
            padding: 1px 0;
            text-align: center;
            border-top: 2px solid #fc8640;
            position: fixed; /* Fija el footer en la parte inferior */
            bottom: 0; /* Alinea el footer al fondo */
            width: 100%; /* Asegura que el footer ocupe todo el ancho */
}
.logof{
	margin-top:2%;
	height: auto; 
	max-width: 60%;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-column h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 3rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: rgba(40, 167, 69, 0.1); /* Color de fondo suave (verde claro) */
    border-radius: 1rem; /* Bordes redondeados */
    padding: 2rem; /* Espaciado interno */
    text-align: center; /* Centrar el texto */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Sombra suave */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Transiciones suaves */
    position: relative; /* Para efectos de pseudo-elementos */
}

.stat-card:hover {
    transform: translateY(-5px); /* Elevar la tarjeta al pasar el mouse */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* Aumentar la sombra al pasar el mouse */
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1rem; /* Bordes redondeados */
    background: rgba(255, 255, 255, 0.1); /* Capa blanca semi-transparente */
    z-index: 0; /* Colocar detrás del contenido */
}

.stat-card h3 {
    margin: 0; /* Eliminar margen */
    font-size: 1.5rem; /* Tamaño de fuente */
    color: var(--text-primary); /* Color del texto */
    z-index: 1; /* Colocar encima del pseudo-elemento */
    position: relative; /* Para que el z-index funcione */
}

.stat-card p {
    margin-top: 0.5rem; /* Espaciado superior */
    color: var(--text-secondary); /* Color del texto secundario */
    z-index: 1; /* Colocar encima del pseudo-elemento */
    position: relative; /* Para que el z-index funcione */
}


.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Loader */
.loader-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.status-paid {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid #f59e0b;
}
#invoice-detail-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(2px);
    z-index: 9999;
}

#invoice-detail-modal > .modal-content {
    width: min(940px, 96vw);
    max-height: 90vh;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
    padding: 0;
    display: flex;
    flex-direction: column;
}

#invoice-detail-modal #modal-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#invoice-detail-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .95rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #14532d 100%);
    color: #fff;
}

#invoice-detail-modal .modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

#invoice-detail-modal .close-modal-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

#invoice-detail-modal .close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.04);
}

#invoice-detail-modal .invoice-detail-content {
    overflow: auto;
    padding: 1rem 1.1rem 1.1rem;
    background: #f8fafc;
}

#invoice-detail-modal .modal-body {
    padding: 0;
    background: transparent;
}

#invoice-detail-modal .invoice-summary {
    margin-bottom: .9rem;
}

#invoice-detail-modal .invoice-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

#invoice-detail-modal .info-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .65rem .75rem;
}

#invoice-detail-modal .info-label {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: #64748b;
    margin-bottom: .2rem;
    font-weight: 700;
}

#invoice-detail-modal .info-value {
    font-size: .98rem;
    color: #0f172a;
    font-weight: 800;
}

#invoice-detail-modal .invoice-articulos {
    margin-top: .8rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: auto;
}

#invoice-detail-modal .invoice-articulos table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
}

#invoice-detail-modal .invoice-articulos thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f1f5f9;
    color: #334155;
    font-size: .78rem;
    font-weight: 800;
    border-bottom: 1px solid #e2e8f0;
}

#invoice-detail-modal .invoice-articulos td {
    color: #0f172a;
    font-size: .9rem;
    border-bottom: 1px solid #f1f5f9;
}

#invoice-detail-modal .invoice-articulos tbody tr:last-child td {
    border-bottom: 0;
}

#detalle-modal > .modal-content {
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

#modalPago .modal-dialog {
    margin: 1.25rem auto;
    max-width: 860px;
    width: calc(100% - 2rem);
}

#modalPago .modal-content {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2.5rem);
}

#modalPago .modal-header {
    background: linear-gradient(135deg, #16a34a 0%, #0f766e 100%) !important;
    color: #fff;
    border-bottom: 0;
    padding: 1rem 1.25rem;
}

#modalPago .modal-title {
    font-size: 1.05rem;
    letter-spacing: .2px;
}

#modalPago .modal-body {
    padding: 1rem 1.25rem 1.25rem;
    background: #f8fafc;
    overflow-y: auto;
}

#modalPago .modal-footer {
    border-top: 1px solid #e2e8f0;
    background: #fff;
    padding: .95rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .6rem;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.pay-modern-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .9rem;
    margin-bottom: 1rem;
}

.pay-modern-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .85rem;
}

.pay-modern-card-header label {
    margin-bottom: .5rem;
    color: #0f172a;
    font-weight: 700;
    font-size: .92rem;
}

.pay-copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .45rem;
}

.pay-copy-row p {
    margin: 0;
    color: #334155;
    font-size: .92rem;
}

.copy-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: .55rem;
}

.copy-btn {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
    padding: .35rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all .2s ease;
}

.copy-btn:hover {
    background: #dcfce7;
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}

.input-copy-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.copy-btn.inline {
    white-space: nowrap;
}

#modalPago .form-control {
    border-radius: 14px;
    border: 1.5px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    min-height: 46px;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

#modalPago .form-control:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .18);
    background: #ffffff;
}

/* Scoped modal styles to avoid global collisions */
#modalPago .modal-header {
    background-color: #28a745 !important;
    color: white;
    border-bottom: none;
}

#modalPago .modal-title {
    font-weight: bold;
}

#modalPago .modal-body {
    padding: 20px;
}

#modalPago .form-group label {
    font-weight: 700;
    color: #0f172a;
    font-size: .9rem;
    margin-bottom: .35rem;
}

#modalPago .form-control {
    border-radius: 14px;
    border: 1.5px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    min-height: 46px;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

#modalPago .form-control:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .18);
    background: #ffffff;
}

#modalPago .btn-primary {
    background-color: #16a34a !important;
    border: 1px solid #15803d !important;
    color: #fff !important;
    border-radius: 10px !important;
    min-height: 40px;
    padding: 0.45rem 1rem !important;
    font-weight: 700;
}

#modalPago .btn-primary:hover {
    background-color: #15803d !important;
    border-color: #166534 !important;
}

#modalPago .btn-secondary {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    border-radius: 10px !important;
    min-height: 40px;
    padding: 0.45rem 1rem !important;
    font-weight: 600;
}

#modalPago .btn-secondary:hover {
    background-color: #f8fafc !important;
    border-color: #94a3b8 !important;
}

#payment-status {
    margin: 20px 0; /* Add margin */
}

#validation-result-container {
    margin-top: 15px; /* Add margin */
}
.bank-info {
    margin-bottom: 15px; /* Espaciado entre los bloques de información del banco */
}

.bank-info hr {
    border: 1px solid #007bff; /* Color de la línea horizontal */
    margin: 10px 0; /* Espaciado arriba y abajo de la línea */
}

.bank-label {
    background-color: #f8f9fa; /* Color de fondo claro */
    color: #343a40; /* Color del texto */
    padding: 10px; /* Espaciado interno */
    border-radius: 5px; /* Bordes redondeados */
    margin-bottom: 10px; /* Espaciado entre etiquetas */
    display: flex; /* Usar flexbox para alinear el ícono y el texto */
    align-items: center; /* Centrar verticalmente el contenido */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra para dar profundidad */
}
.bank-label i {
    margin-right: 10px; /* Espaciado entre el ícono y el texto */
    color: #28a745;  /* Color del ícono */
    font-size: 1.2em; /* Tamaño del ícono */
}
strong {
    color: #28a745; /* Color azul para el texto en negrita */
}
#invoice-detail-modal .close-modal {
    display: none !important;
}
.invoice-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background-color: var(--bg-accent);
    color: var(--accent-primary);
}

.download-btn {
    color: var(--success);
}

.pay-btn {
    color: var(--warning);
}

.view-details-btn {
    color: var(--accent-primary);
}

/* Tabla de facturas - diseño mejorado */
#invoices-table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: .78rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
}

#invoices-table tbody td {
    padding: .85rem .95rem;
    color: #0f172a;
    vertical-align: middle;
}

#invoices-table tbody tr {
    transition: background-color .2s ease;
}

#invoices-table tbody tr:hover {
    background: #f8fafc;
}

/* Estado de factura moderno */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .36rem .72rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-pill::before {
    content: '';
    width: .42rem;
    height: .42rem;
    border-radius: 999px;
    background: currentColor;
    opacity: .85;
}

.status-pill-paid {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.status-pill-pending {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}

.status-pill-neutral {
    color: #475569;
    background: #f1f5f9;
    border-color: #e2e8f0;
}
/* Media Query para pantallas móviles */
@media (max-width: 768px) {
    #modalPago .modal-dialog {
        width: calc(100% - 1rem);
        margin: .5rem auto;
    }
    #modalPago .modal-content {
        max-height: calc(100vh - 1rem);
    }
    .pay-modern-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 2.5rem; /* Tamaño de fuente más pequeño para móviles */
		padding-bottom:20px;
    }
    .logo {
        max-width: 70%; /* Aumentar el tamaño del logo en móviles */
        font-size: 2.2rem; /* Tamaño de fuente más grande para móviles */
    }
	 .dashboard {
        margin-top: -40px; /* Ajustar el margen superior en móviles */
		max-width:100%;
    }
    .dashboard-header {
        padding: 1rem; /* Reducir el padding en móviles */
    }
    .dashboard-header h2 {
        font-size: 1.5rem; /* Tamaño de fuente más pequeño para móviles */
    }
    .dashboard-header p {
        font-size: 0.9rem; /* Tamaño de fuente más pequeño para el texto secundario */
    }
    .dashboard-body {
        padding: 0.5rem; /* Reducir el padding en el cuerpo del dashboard */
    }
	.container {
        max-width: 100%; /* Ancho completo en móviles */
        padding: 0 0.5rem; /* Reducir el padding horizontal en móviles */
    }
	#invoices-table th, 
    #invoices-table td {
        font-size: 0.9rem; /* Reducir el tamaño de la fuente */
        padding: 0.5rem; /* Reducir el padding */
    }
    /* Alinear acciones en la fila correspondiente */
    #invoices-table td:last-child {
        display: table-cell;
        white-space: nowrap;
    }

    #invoices-table thead th {
        white-space: nowrap;
    }

    .status-pill {
        font-size: .72rem;
        padding: .3rem .55rem;
    }
	   
     .items-table th, 
    .items-table td {
        font-size: 0.9rem; /* Asegurarse de que el tamaño de la fuente sea adecuado */
    }
	 #invoice-detail-modal > .modal-content,
     #detalle-modal > .modal-content {
        max-width: 99%;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
    }
	 .items-table {
    overflow-x: auto; /* Permitir el scroll horizontal */
    -webkit-overflow-scrolling: touch; /* Mejora el scroll en dispositivos táctiles */
}
	
}

#invoices-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#invoices-table th,
#invoices-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
    vertical-align: middle;
}

#invoices-table th:nth-child(1), #invoices-table td:nth-child(1) { width: 12%; } /* ID */
#invoices-table th:nth-child(2), #invoices-table td:nth-child(2) { width: 14%; } /* Emisión */
#invoices-table th:nth-child(3), #invoices-table td:nth-child(3) { width: 24%; } /* Descripción */
#invoices-table th:nth-child(4), #invoices-table td:nth-child(4) { width: 14%; } /* Monto */
#invoices-table th:nth-child(5), #invoices-table td:nth-child(5) { width: 20%; } /* Estado */
#invoices-table th:nth-child(6), #invoices-table td:nth-child(6) { width: 16%; } /* Acciones */

#invoices-table thead th {
    white-space: nowrap;
}

#invoices-table tbody td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-responsive {
    overflow-x: auto; /* Permitir el scroll horizontal */
    -webkit-overflow-scrolling: touch; /* Mejora el scroll en dispositivos táctiles */
}

.items-table {
    width: 100%; /* Asegurarse de que la tabla ocupe el 100% del contenedor */
    border-collapse: collapse; /* Colapsar bordes para una mejor apariencia */
}

.items-table th, 
.items-table td {
    padding: 0.5rem; /* Espaciado interno para celdas */
    text-align: left; /* Alinear texto a la izquierda */
    border: 1px solid var(--border-color); /* Bordes para celdas */
    font-size: 0.9rem; /* Reducir el tamaño de la fuente en móviles */
}

/* Tabs */
.tabs {
    width: 100%;
}

.tab-header {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tab-btn {
    padding: 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--secondary-color);
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}
.phone-input, .id-input {
    display: flex;
    gap: 0.5rem;
}

.phone-input select, .id-input select {
    width: 120px;
}

.phone-input input, .id-input input {
    flex: 1;
}

/* Validation */
input:invalid, select:invalid {
    border-color: var(--error-color);
}

/* ===== Desktop layout improvements: formulario + servicios ===== */
/* Forzar layout de 1 columna para que "Estado del sistema" quede debajo de "Servicios del cliente" */
@media (min-width: 1280px) {
    main > section > .grid.gap-6.xl\:grid-cols-3 {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    main > section > .grid.gap-6.xl\:grid-cols-3 > .xl\:col-span-1,
    main > section > .grid.gap-6.xl\:grid-cols-3 > .xl\:col-span-2 {
        width: 100% !important;
        max-width: 100% !important;
    }

    .xl\:col-span-1 #search-view {
        min-height: 300px;
    }

    #services-view {
        min-height: 360px;
    }

    #services-view .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    #services-view .service-card {
        min-height: 185px;
    }
}

/* Contenedores principales */
#search-view,
#loading-view,
#services-view,
#invoices-view {
    border-radius: 16px;
}

/* Formulario más completo (como imagen 3) */
#search-view .space-y-4 {
    gap: 0.9rem;
}

#search-view label {
    font-weight: 600;
    color: #334155;
}

#search-view select,
#search-view input {
    min-height: 46px;
}

#search-view #search-btn {
    min-height: 44px;
}

/* Servicios: mejor ocupación y legibilidad */
#services-view .services-grid {
    align-items: stretch;
}

#services-view .service-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

#services-view .service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

#services-view .service-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-start;
}

#services-view .pay-contract-btn {
    border: 1px solid #16a34a;
    background: #16a34a;
    color: #fff;
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    font-weight: 700;
    font-size: 0.86rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all .2s ease;
}

#services-view .pay-contract-btn:hover {
    background: #15803d;
    border-color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(21, 128, 61, 0.25);
}

/* Mantener comportamiento móvil/tablet */
@media (max-width: 1279px) {
    #services-view .services-grid {
        grid-template-columns: 1fr;
    }
}
