        :root {
            --primary: #0f172a;
            --accent: #2563eb;
            --bg: #f8fafc;
            --text-main: #1e293b;
            --text-muted: #64748b;
            --border: #e2e8f0;
            --success: #10b981;
            --white: #ffffff;
            --warning: #f59e0b;
        }

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

        body {
            font-family: 'Inter', -apple-system, sans-serif;
            background-color: var(--bg);
            color: var(--text-main);
            min-height: 100vh;
        }

        .navbar {
            background: var(--white);
            border-bottom: 1px solid var(--border);
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .logo {
            font-weight: 800;
            font-size: 1.25rem;
            color: var(--primary);
            letter-spacing: -0.025em;
        }

        .logo span {
            color: var(--accent);
        }

        .container {
            max-width: 1000px;
            margin: 2rem auto;
            padding: 0 1rem;
        }

        /* Buscador */
        .search-container {
            margin-bottom: 1.5rem;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.2s;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        /* Tabla de Clientes */
        .data-card {
            background: var(--white);
            border-radius: 12px;
            border: 1px solid var(--border);
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .table-header {
            background: #f1f5f9;
            padding: 1rem;
            display: grid;
            grid-template-columns: 2fr 1fr 1.5fr auto;
            font-weight: 600;
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .customer-row {
            padding: 1.25rem 1rem;
            display: grid;
            grid-template-columns: 2fr 1fr 1.5fr auto;
            align-items: center;
            border-bottom: 1px solid var(--border);
            cursor: pointer;
            transition: background 0.2s;
        }

        .customer-row:hover {
            background: #f8fafc;
        }

        .customer-name {
            font-weight: 600;
            color: var(--primary);
            display: block;
        }

        .customer-code {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .badge {
            padding: 0.25rem 0.6rem;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
            background: #eff6ff;
            color: var(--accent);
        }

        /* Facturas con pagos parciales */
        .invoice-item {
            background: var(--white);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 0.75rem;
            transition: all 0.2s;
        }

        .invoice-item.selected {
            border-color: var(--accent);
            background: #eff6ff;
        }

        .invoice-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            cursor: pointer;
        }

        .invoice-details {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border);
        }

        .amount-input-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }

        .amount-input {
            flex: 1;
            padding: 0.5rem;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 0.9rem;
            font-weight: 600;
        }

        .amount-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .amount-input.error {
            border-color: #ef4444;
        }

        .quick-amount-btn {
            padding: 0.4rem 0.8rem;
            border: 1px solid var(--border);
            border-radius: 4px;
            background: white;
            font-size: 0.75rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .quick-amount-btn:hover {
            background: var(--bg);
            border-color: var(--accent);
        }

        .partial-badge {
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 600;
            background: #fef3c7;
            color: #92400e;
        }

        /* Botones */
        .btn {
            padding: 0.6rem 1.2rem;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            border: 1px solid transparent;
            transition: all 0.2s;
            font-size: 0.9rem;
        }

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

        .btn-primary:hover {
            background: #1d4ed8;
        }

        .btn-secondary {
            background: #64748b;
            color: white;
        }

        .btn-outline {
            background: white;
            border-color: var(--border);
            color: var(--text-main);
        }

        .btn-outline:hover {
            background: var(--bg);
        }

        /* Panel Flotante Total */
        .action-panel {
            position: fixed;
            bottom: 2rem;
            left: 50%;
            transform: translateX(-50%);
            background: var(--primary);
            color: white;
            padding: 1rem 1.5rem;
            border-radius: 12px;
            display: flex;
            align-items: center;
            gap: 2rem;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
            z-index: 1000;
        }

        .success-box {
            text-align: center;
            padding: 3rem;
            background: white;
            border-radius: 12px;
            border: 1px solid var(--border);
        }

        .payment-link-box {
            background: #f1f5f9;
            padding: 1rem;
            border-radius: 6px;
            margin: 1.5rem 0;
            font-family: monospace;
            word-break: break-all;
            border: 1px dashed var(--accent);
        }

        .loading-overlay {
            text-align: center;
            padding: 5rem;
            color: var(--accent);
            font-weight: 600;
        }

        .error-text {
            color: #ef4444;
            font-size: 0.75rem;
            margin-top: 0.25rem;
        }

        .info-box {
            background: #eff6ff;
            border: 1px solid #bfdbfe;
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
        }

        /* Estilos para Tablas */
        .table-container {
            overflow-x: auto;
            border-radius: 12px;
        }

        .table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
        }

        .table thead {
            background: #f1f5f9;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .table thead th {
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-bottom: 2px solid var(--border);
        }

        .table tbody tr {
            border-bottom: 1px solid var(--border);
            transition: background-color 0.2s;
        }

        .table tbody tr:hover {
            background-color: #f8fafc;
        }

        .table tbody tr:nth-child(even) {
            background-color: #f9fafb;
        }

        .table tbody tr:nth-child(even):hover {
            background-color: #f1f5f9;
        }

        .table tbody td {
            padding: 1rem;
            vertical-align: middle;
        }

        .table tbody td:first-child {
            font-weight: 600;
            color: var(--primary);
        }

        /* Responsive para tablas */
        @media (max-width: 768px) {
            .table-container {
                border-radius: 8px;
            }

            .table {
                font-size: 0.8rem;
            }

            .table thead th,
            .table tbody td {
                padding: 0.75rem 0.5rem;
            }

            .table thead th {
                font-size: 0.7rem;
            }

            /* Ocultar columnas menos importantes en móvil */
            .table .hide-mobile {
                display: none;
            }

            .btn {
                padding: 0.4rem 0.8rem;
                font-size: 0.75rem;
            }
        }

        /* Botones dentro de tablas */
        .table .btn-group {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        @media (max-width: 480px) {
            .table .btn-group {
                flex-direction: column;
            }

            .table .btn-group .btn {
                width: 100%;
                font-size: 0.7rem;
            }
        }