* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #f5f5f5;
            padding-bottom: 70px;
            overflow-x: hidden;
        }

        /* Header fijo */
        .header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: white;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            z-index: 100;
            padding: 12px 16px;
        }

        .header-title {
            font-size: 18px;
            font-weight: 600;
            color: #1a1a1a;
        }

        .header-subtitle {
            font-size: 13px;
            color: #666;
            margin-top: 2px;
        }

        /* Área de contenido con padding para header */
        .content {
            padding-top: 70px;
        }

        /* Tarjetas optimizadas para móvil */
        .card {
            background: white;
            margin: 12px;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            overflow: hidden;
        }

        .card-header {
            padding: 16px;
            border-bottom: 1px solid #f0f0f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .card-title {
            font-size: 16px;
            font-weight: 600;
            color: #1a1a1a;
        }

        /* Stats móvil - más compacto */
        .stats-mobile {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            padding: 12px;
        }

        .stat-mobile {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 16px;
            border-radius: 12px;
            color: white;
        }

        .stat-mobile.red {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        }

        .stat-mobile.green {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
        }

        .stat-mobile.blue {
            background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
        }

        .stat-label {
            font-size: 12px;
            opacity: 0.9;
            margin-bottom: 6px;
        }

        .stat-value {
            font-size: 22px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .stat-value.hidden-value {
            font-size: 28px;
            letter-spacing: 2px;
        }

        .eye-icon {
            width: 20px;
            height: 20px;
            cursor: pointer;
            opacity: 0.9;
            flex-shrink: 0;
        }

        .stat-count {
            font-size: 11px;
            opacity: 0.85;
            margin-top: 4px;
        }

        /* Lista de clientes/comprobantes optimizada */
        .list-item {
            padding: 16px;
            border-bottom: 1px solid #f0f0f0;
            background: white;
            transition: background 0.2s;
        }

        .list-item:active {
            background: #f9f9f9;
        }

        .list-item:last-child {
            border-bottom: none;
        }

        .list-item.paid {
            background: #f0fdf4;
        }

        .list-item.overdue {
            background: #fef2f2;
        }

        .item-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 8px;
        }

        .item-name {
            font-size: 15px;
            font-weight: 600;
            color: #1a1a1a;
            flex: 1;
            line-height: 1.3;
        }

        .item-name.paid {
            text-decoration: line-through;
            color: #666;
        }

        .item-amount {
            font-size: 18px;
            font-weight: 700;
            white-space: nowrap;
            margin-left: 12px;
        }

        .item-amount.paid {
            color: #16a34a;
            text-decoration: line-through;
        }

        .item-amount.overdue {
            color: #dc2626;
        }

        .item-info {
            display: flex;
            gap: 12px;
            font-size: 13px;
            color: #666;
            margin-bottom: 10px;
        }

        .badge-mobile {
            display: inline-flex;
            align-items: center;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }

        .badge-red {
            background: #fee2e2;
            color: #991b1b;
        }

        .badge-green {
            background: #dcfce7;
            color: #166534;
        }

        .badge-blue {
            background: #dbeafe;
            color: #1e40af;
        }

        /* Botones de acción más grandes */
        .item-checkbox {
            position: absolute;
            top: 16px;
            left: 16px;
            width: 24px;
            height: 24px;
            cursor: pointer;
        }

        .cliente-item {
            cursor: pointer;
            transition: background 0.2s;
        }

        .cliente-item:active {
            background: #f9f9f9;
        }

        .cliente-expanded {
            background: #f9fafb;
        }

        .comprobantes-desplegados {
            padding: 12px 16px;
            background: white;
            border-top: 1px solid #e5e5e5;
        }

        .comprobante-mini {
            padding: 12px;
            margin-bottom: 8px;
            background: #f9fafb;
            border-radius: 8px;
            border-left: 3px solid #3b82f6;
        }

        .comprobante-mini:last-child {
            margin-bottom: 0;
        }

        .comprobante-mini.overdue {
            border-left-color: #dc2626;
            background: #fef2f2;
        }

        .comprobante-mini.paid {
            border-left-color: #16a34a;
            background: #f0fdf4;
        }

        .comprobante-mini-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
        }

        .comprobante-mini-title {
            font-size: 14px;
            font-weight: 600;
            color: #1a1a1a;
        }

        .comprobante-mini-amount {
            font-size: 15px;
            font-weight: 700;
            color: #1a1a1a;
        }

        .comprobante-mini-amount.overdue {
            color: #dc2626;
        }

        .comprobante-mini-amount.paid {
            color: #16a34a;
            text-decoration: line-through;
        }

        .comprobante-mini-info {
            font-size: 12px;
            color: #666;
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }

        .list-item {
            padding: 16px 16px 16px 52px;
            border-bottom: 1px solid #f0f0f0;
            background: white;
            transition: background 0.2s;
            position: relative;
        }

        .list-item.selected {
            background: #eff6ff;
            border-left: 4px solid #3b82f6;
            padding-left: 48px;
        }

        .item-actions {
            display: flex;
            gap: 8px;
            margin-top: 10px;
        }

        /* Botón flotante para seleccionados */
        .floating-selection {
            position: fixed;
            bottom: 70px;
            left: 0;
            right: 0;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
            z-index: 90;
            transform: translateY(200px);
            transition: transform 0.3s ease;
        }

        .floating-selection.show {
            transform: translateY(0);
        }

        .selection-info {
            flex: 1;
        }

        .selection-count {
            font-size: 14px;
            opacity: 0.9;
        }

        .selection-total {
            font-size: 20px;
            font-weight: 700;
            margin-top: 4px;
        }

        .btn-clear-selection {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }

        .btn-share-selection {
            background: #25D366;
            border: none;
            color: white;
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .floating-actions {
            display: flex;
            gap: 8px;
        }

        /* Notas */
        .notes-section {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid rgba(255,255,255,0.2);
        }

        .note-display {
            font-size: 13px;
            opacity: 0.95;
            font-style: italic;
            margin-top: 4px;
            padding: 8px;
            background: rgba(0,0,0,0.1);
            border-radius: 6px;
        }

        .btn-note {
            background: #8b5cf6;
            color: white;
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .note-badge {
            background: #8b5cf6;
            color: white;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .btn-action {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: transform 0.1s;
        }

        .btn-action:active {
            transform: scale(0.97);
        }

        .btn-pay {
            background: #16a34a;
            color: white;
        }

        .btn-partial {
            background: #3b82f6;
            color: white;
        }

        .btn-undo {
            background: #f59e0b;
            color: white;
        }

        .btn-delete {
            background: #ef4444;
            color: white;
        }

        /* Búsqueda sticky */
        .search-sticky {
            position: sticky;
            top: 70px;
            background: white;
            padding: 12px;
            border-bottom: 1px solid #e5e5e5;
            z-index: 50;
        }

        .search-input {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid #e5e5e5;
            border-radius: 12px;
            font-size: 15px;
            background: #f9f9f9;
        }

        .search-input:focus {
            outline: none;
            border-color: #3b82f6;
            background: white;
        }

        /* Bottom navigation */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            border-top: 1px solid #e5e5e5;
            display: flex;
            justify-content: space-around;
            padding: 8px 0;
            z-index: 100;
        }

        .nav-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            padding: 8px;
            border: none;
            background: none;
            cursor: pointer;
            color: #666;
            font-size: 11px;
            font-weight: 500;
        }

        .nav-item.active {
            color: #3b82f6;
        }

        .nav-icon {
            width: 24px;
            height: 24px;
        }

        /* Modal móvil */
        .modal {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.6);
            display: flex;
            align-items: flex-end;
            justify-content: center;
            z-index: 200;
        }

        .modal-content {
            background: white;
            border-radius: 20px 20px 0 0;
            padding: 24px;
            width: 100%;
            max-height: 80vh;
            overflow-y: auto;
            animation: slideUp 0.3s ease-out;
        }

        @keyframes slideUp {
            from {
                transform: translateY(100%);
            }
            to {
                transform: translateY(0);
            }
        }

        .modal-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 16px;
            text-align: center;
        }

        .modal-body {
            margin-bottom: 20px;
        }

        .modal-label {
            font-size: 14px;
            font-weight: 600;
            color: #1a1a1a;
            margin-bottom: 8px;
            display: block;
        }

        .modal-input {
            width: 100%;
            padding: 14px;
            border: 2px solid #e5e5e5;
            border-radius: 12px;
            font-size: 16px;
            margin-bottom: 16px;
        }

        .modal-input:focus {
            outline: none;
            border-color: #3b82f6;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
        }

        .btn-modal {
            flex: 1;
            padding: 16px;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
        }

        .btn-cancel {
            background: #f5f5f5;
            color: #666;
        }

        .btn-confirm {
            background: #3b82f6;
            color: white;
        }

        .btn-danger-modal {
            background: #ef4444;
            color: white;
        }

        /* Upload área */
        .upload-area {
            padding: 24px;
        }

        .upload-box {
            border: 2px dashed #d1d5db;
            border-radius: 16px;
            padding: 40px 20px;
            text-align: center;
            background: #f9fafb;
        }

        .upload-icon {
            width: 64px;
            height: 64px;
            margin: 0 auto 16px;
            opacity: 0.5;
        }

        .upload-text {
            font-size: 15px;
            color: #666;
            margin-bottom: 20px;
        }

        .btn-upload {
            background: #3b82f6;
            color: white;
            border: none;
            padding: 14px 28px;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .hidden {
            display: none !important;
        }

        .empty-state {
            padding: 60px 20px;
            text-align: center;
            color: #999;
        }

        .empty-icon {
            width: 80px;
            height: 80px;
            margin: 0 auto 16px;
            opacity: 0.3;
        }

        /* Loading */
        .loading {
            text-align: center;
            padding: 40px;
            color: #666;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #3b82f6;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 12px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Filtros rápidos */
        .quick-filters {
            display: flex;
            gap: 8px;
            padding: 12px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .filter-chip {
            padding: 8px 16px;
            border-radius: 20px;
            border: 2px solid #e5e5e5;
            background: white;
            font-size: 13px;
            font-weight: 600;
            white-space: nowrap;
            cursor: pointer;
            color: #666;
        }

        .filter-chip.active {
            background: #3b82f6;
            border-color: #3b82f6;
            color: white;
        }