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

/* Reset completo para enlaces */
a,
a:link,
a:visited,
a:hover,
a:active {
    text-decoration: none !important;
    color: inherit !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-brand i {
    font-size: 1.8rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ===================================== */
/* BOTONES DE NAVEGACIÓN EN NAVBAR      */
/* ===================================== */
.navbar .nav-links {
    display: flex;
    gap: 10px;
    margin-right: 15px;
}

.navbar .nav-links .nav-btn {
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    border: none;
    font-weight: 500;
    line-height: normal;
}

.navbar .nav-links .nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

.navbar .nav-links .nav-btn.active {
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.navbar .nav-links .nav-btn i {
    font-size: 1rem;
    color: inherit;
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #c0392b;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.main-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.2rem;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

.login-box h2 {
    color: #7f8c8d;
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #3498db;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #2980b9;
}

.error-message {
    background-color: #ffeaea;
    color: #c0392b;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Clientes List */
.clientes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.cliente-item {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s;
}

.cliente-item:hover {
    transform: translateY(-5px);
}

.btn-cliente {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-bottom: 15px;
}

.btn-cliente:hover {
    background-color: #2980b9;
}

.status-indicator {
    font-size: 0.9rem;
    font-weight: bold;
}

.status-complete {
    color: #27ae60;
}

.status-pending {
    color: #e74c3c;
}

/* Tabla de datos */
.table-container {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.table-container h2,
.table-container h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.table-header {
    background-color: #3498db;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 1.3rem;
}

.data-table tr {
    border-bottom: 1px solid #eee;
}

.data-table td {
    padding: 15px;
    font-size: 1.1rem;
}

.label-cell {
    width: 50%;
    font-weight: bold;
    color: #2c3e50;
    background-color: #f8f9fa;
}

.input-cell input {
    width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    text-align: right;
}



.input-cell input:focus {
    border-color: #3498db;
    outline: none;
}

.auto-cell {
    color: #27ae60;
    font-weight: bold;
    background-color: #f8f9fa;
}

.total-row {
    background-color: #2c3e50;
    color: white;
    font-size: 1.2rem;
}

.payment-info {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.payment-info h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: left;
}

.payment-info p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* Botones de acción */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-save,
.btn-confirm,
.btn-copy {
    padding: 15px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-save {
    background-color: #3498db;
    color: white;
}

.btn-save:hover {
    background-color: #2980b9;
}

.btn-confirm {
    background-color: #27ae60;
    color: white;
    text-decoration: none;
}

.btn-confirm:hover {
    background-color: #219653;
}

.btn-copy {
    background-color: #9b59b6;
    color: white;
}

.btn-copy:hover {
    background-color: #8e44ad;
}

.clientes-tabs {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 10px;
}

.tab-cliente {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background-color: white;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    min-width: 150px;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tab-cliente:hover {
    background-color: #f0f7ff;
    border-color: #3498db;
    transform: translateY(-2px);
}

.tab-cliente.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.tab-cliente-indicators {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tab-pago {
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 3px 7px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    user-select: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.tab-pago-no {
    background: #fdecea;
    color: #c0392b;
    border-color: #f5c6cb;
}

.tab-pago-si {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.tab-cliente.active .tab-pago-no {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.tab-cliente.active .tab-pago-si {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
}

.tab-status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    font-size: 0.72rem;
    line-height: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Pendiente: X roja con “latido” suave (llama la atención sin cansar) */
.tab-status-pending {
    color: #fff;
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.45);
    animation: tab-pending-attention 2.2s ease-in-out infinite;
}

.tab-status-pending i {
    font-size: 0.78rem;
    font-weight: 700;
}

@keyframes tab-pending-attention {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.45);
    }
    40% {
        transform: scale(1.12);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.55);
    }
    55% {
        transform: scale(1.06) rotate(-6deg);
        box-shadow: 0 4px 14px rgba(231, 76, 60, 0.35);
    }
    70% {
        transform: scale(1.06) rotate(6deg);
        box-shadow: 0 4px 14px rgba(231, 76, 60, 0.35);
    }
}

/* Completado: check verde sólido, sin animación */
.tab-status-done {
    color: #fff;
    background: linear-gradient(145deg, #27ae60, #1e8449);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.35);
    animation: none;
}

.tab-status-done i {
    font-size: 0.82rem;
}

/* Pestaña activa (fondo azul): mantener contraste */
.tab-cliente.active .tab-status-pending {
    background: linear-gradient(145deg, #ff6b6b, #ee5a5a);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    animation-name: tab-pending-attention-active;
}

@keyframes tab-pending-attention-active {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    }
    45% {
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35);
    }
    60% {
        transform: scale(1.05) rotate(-5deg);
    }
    75% {
        transform: scale(1.05) rotate(5deg);
    }
}

.tab-cliente.active .tab-status-done {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

@media (prefers-reduced-motion: reduce) {
    .tab-status-pending {
        animation: none;
    }

    .tab-cliente.active .tab-status-pending {
        animation: none;
    }
}

.tabla-container {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reset-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
}

.btn-reset-global,
.btn-reset-cliente {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-reset-global {
    background-color: #e74c3c;
    color: white;
}

.btn-reset-global:hover {
    background-color: #c0392b;
}

.btn-reset-cliente {
    background-color: #3498db;
    color: white;
}

.btn-reset-cliente:hover {
    background-color: #2980b9;
}

.last-reset {
    color: #7f8c8d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Fechas globales (todos los clientes) */
.fechas-globales-panel {
    margin: 0 0 24px;
    padding: 16px 18px;
    background: #eef6fc;
    border: 1px solid #b8daff;
    border-radius: 10px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.fechas-globales-panel--disabled {
    background: #f4f4f5;
    border-color: #ddd;
    opacity: 0.95;
}

.fechas-globales-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.fechas-globales-head i {
    color: #3498db;
}

.fechas-globales-desc {
    margin: 0 0 8px;
    line-height: 1.7;
    color: #34495e;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.fechas-globales-date {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

.fechas-globales-mes {
    font-weight: 700;
    color: #2980b9;
}

.fechas-globales-hint {
    margin: 0 0 12px;
    color: #5d6d7e;
}

.fechas-globales-actions {
    margin: 0;
}

.btn-fechas-globales {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #16a085;
    color: #fff;
    transition: background 0.2s;
}

.btn-fechas-globales:hover {
    background: #138d75;
}

.fechas-globales-aviso {
    margin: 0;
    color: #555;
    line-height: 1.55;
    font-size: 0.95rem;
}

.fechas-globales-aviso i {
    color: #95a5a6;
    margin-right: 6px;
}

/* Instrucciones permanentes por cliente */
.instrucciones-cliente-panel {
    margin: 0 auto 24px;
    padding: 16px 20px;
    max-width: 900px;
    background: #fff;
    border: 1px solid #e8dcc8;
    border-left: 4px solid #e67e22;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-instrucciones-cliente {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(145deg, #e67e22, #d35400);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-instrucciones-cliente:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.35);
}

.instrucciones-cliente-vista {
    margin-top: 14px;
    padding: 14px 16px;
    background: #fffaf3;
    border: 1px solid #f0e0c8;
    border-radius: 6px;
}

.instrucciones-cliente-texto {
    color: #2c3e50;
    font-size: 0.95rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.instrucciones-cliente-editor {
    margin-top: 14px;
}

.instrucciones-cliente-textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}

.instrucciones-cliente-textarea:focus {
    outline: none;
    border-color: #e67e22;
}

.btn-guardar-instrucciones {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-guardar-instrucciones:hover {
    background: #219a52;
}

.btn-image {
    padding: 15px 25px;
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-image:hover {
    background-color: #8e44ad;
}

/* Secciones de formulario */
.form-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
}

.form-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-agregar,
.form-lista {
    margin-top: 20px;
}

.form-agregar .form-group,
.form-lista .form-group {
    margin-bottom: 20px;
}

.form-agregar .form-group label,
.form-lista .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

/* Inputs editables en tabla */
.input-editable {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.input-editable:focus {
    border-color: #3498db;
    outline: none;
}

.select-editable {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    background: white;
}

.select-editable:focus {
    border-color: #3498db;
    outline: none;
}

/* Tabla de gestión */
.data-table.gestion-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.data-table.gestion-table thead {
    background-color: #2c3e50;
    color: white;
}

.data-table.gestion-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 3px solid #3498db;
}

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

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

.data-table.gestion-table td {
    padding: 15px;
    vertical-align: middle;
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 2em;
    margin-bottom: 10px;
    display: block;
}

/* Información del sistema */
.system-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #3498db;
    margin-top: 30px;
}

.system-info h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.system-info li {
    margin: 10px 0;
    padding: 8px 0 8px 25px;
    position: relative;
    color: #555;
}

.system-info li:before {
    content: "•";
    color: #3498db;
    font-size: 1.5em;
    position: absolute;
    left: 0;
    top: 2px;
}

.system-info strong {
    color: #2c3e50;
}

/* Estados específicos */
.status-complete,
.status-pending {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-complete {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.status-pending {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Botón específico para eliminar */
.btn-reset-cliente {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.3s;
}

.btn-reset-cliente:hover {
    background-color: #c0392b;
}

/* Texto de ayuda */
.form-help {
    display: block;
    margin-top: 8px;
    color: #7f8c8d;
    font-size: 0.85em;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.form-help i {
    color: #3498db;
    margin-right: 5px;
}

/* Botón de gestión en las pestañas */
.tab-cliente.gestion-btn {
    background-color: #9b59b6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.tab-cliente.gestion-btn:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
}

.tab-cliente.gestion-btn i {
    font-size: 1.1rem;
}

/* ===================================== */
/* NUEVAS CLASES PARA EL SISTEMA v3.0   */
/* ===================================== */

/* Notificaciones flotantes */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-success {
    background-color: #27ae60;
}

.notification-error {
    background-color: #e74c3c;
}

.notification-info {
    background-color: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estado deshabilitado para inputs cuando está completado */
.input-disabled,
input:disabled,
select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Mejoras para campos calculados */
.auto-cell {
    font-weight: bold;
    color: #27ae60;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    text-align: right;
}

/* Tooltip para información */
.info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    margin-left: 5px;
    cursor: help;
}

/* ===================================== */
/* ESTILOS PARA LISTAS DINÁMICAS EN GRID */
/* ===================================== */

.grid-dinamico {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.input-group {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    background: #f9f9f9;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    width: auto;
    min-width: 130px;
}

.input-group input {
    width: 80px;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    text-align: right;
    font-size: 0.9rem;
}

.input-group .btn-small {
    padding: 4px 8px;
    font-size: 0.8rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.input-group .btn-small:hover {
    background: #c82333;
}

/* Responsive para tablas en móviles */
@media (max-width: 768px) {
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .input-cell input {
        width: 120px;
    }
}


/* Responsive */
@media (max-width: 768px) {
    .clientes-list {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-save,
    .btn-confirm,
    .btn-copy,
    .btn-image {
        width: 100%;
        justify-content: center;
    }

    .input-cell input {
        width: 100%;
    }

    .clientes-tabs {
        flex-direction: column;
    }

    .tab-cliente {
        min-width: 100%;
    }

    .data-table.gestion-table {
        display: block;
        overflow-x: auto;
    }

    .form-section {
        padding: 15px;
    }

    .input-editable,
    .select-editable {
        padding: 8px;
        font-size: 0.9rem;
    }

    .system-info {
        padding: 15px;
    }
}

/* ===================================== */
/* DEUDORES — pestaña plegable a la derecha */
/* ===================================== */
.deudores-drawer {
    position: fixed;
    top: 88px;
    right: 0;
    z-index: 40;
    display: flex;
    align-items: flex-start;
    transform: translateX(252px);
    transition: transform 0.25s ease;
    pointer-events: none;
}

.deudores-drawer.is-open {
    transform: translateX(0);
}

.deudores-tab {
    pointer-events: auto;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: #2c3e50;
    color: #ecf0f1;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 12px 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.18);
}

.deudores-tab:hover {
    background: #34495e;
}

.deudores-tab-count {
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #c0392b;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.deudores-tab-count.is-empty {
    display: none;
}

.deudores-sidebar {
    pointer-events: auto;
    width: 252px;
    max-height: calc(100vh - 100px);
}

.deudores-card {
    background: #fff;
    border: 1px solid #e6e8eb;
    border-right: none;
    border-radius: 10px 0 0 10px;
    box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.deudores-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: #f7f8fa;
    border-bottom: 1px solid #eceff2;
}

.deudores-card-head h2 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #5d6d7e;
}

.deudores-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.deudores-btn-add,
.deudores-btn-fold {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #dfe6e9;
    color: #2c3e50;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    padding: 0;
}

.deudores-btn-add:hover,
.deudores-btn-fold:hover {
    background: #bdc3c7;
}

.deudores-lista {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.deudores-vacio {
    padding: 14px 10px;
    font-size: 0.75rem;
    color: #95a5a6;
    text-align: center;
}

.deudor-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    cursor: pointer;
    border-bottom: 1px solid #f2f3f5;
}

.deudor-item:last-child {
    border-bottom: none;
}

.deudor-item:hover {
    background: #f4f6f8;
}

.deudor-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #d5d8dc;
    color: #2c3e50;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.deudor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deudor-nombre {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deudor-saldo {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    color: #c0392b;
    white-space: nowrap;
}

.deudor-modal[hidden] {
    display: none !important;
}

.deudor-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.deudor-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(44, 62, 80, 0.45);
}

.deudor-modal-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 12px;
    padding: 18px 16px 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.deudor-modal-box h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #2c3e50;
}

.deudor-foto-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.deudor-foto-preview {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #d5d8dc;
    color: #2c3e50;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.deudor-foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deudor-foto-btn {
    font-size: 0.8rem;
    color: #2c3e50;
    background: #ecf0f1;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.deudor-field {
    display: block;
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.deudor-field input,
.deudor-field select,
.deudor-field textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 9px;
    border: 1px solid #dcdfe3;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #2c3e50;
    font-family: inherit;
}

.deudor-field textarea {
    resize: vertical;
    min-height: 80px;
}

.deudor-saldo-row {
    display: flex;
    gap: 8px;
}

.deudor-field-saldo {
    flex: 1;
}

.deudor-field-moneda {
    flex: 0 0 110px;
}

.deudor-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.deudor-btn-guardar,
.deudor-btn-borrar,
.deudor-btn-cerrar {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
}

.deudor-btn-guardar {
    background: #27ae60;
    color: #fff;
}

.deudor-btn-borrar {
    background: #e74c3c;
    color: #fff;
}

.deudor-btn-cerrar {
    background: #ecf0f1;
    color: #2c3e50;
    margin-left: auto;
}