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

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: #333;
            font-size: 16px;
            line-height: 1.5;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 10px;
        }

        @media (min-width: 768px) {
            .container {
                padding: 20px;
            }
        }

        .card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            padding: 20px;
            margin-bottom: 15px;
            width: 100%;
        }

        @media (min-width: 768px) {
            .card {
                border-radius: 20px;
                padding: 40px;
                margin-bottom: 20px;
                box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            }
        }

        .header {
            text-align: center;
            margin-bottom: 25px;
        }

        @media (min-width: 768px) {
            .header {
                margin-bottom: 40px;
            }
        }

        .header h1 {
            color: #4a5568;
            font-size: 1.8em;
            margin-bottom: 8px;
            font-weight: 300;
        }

        @media (min-width: 768px) {
            .header h1 {
                font-size: 2.5em;
                margin-bottom: 10px;
            }
        }

        .header p {
            color: #718096;
            font-size: 1em;
        }

        @media (min-width: 768px) {
            .header p {
                font-size: 1.1em;
            }
        }

        .upload-section {
            text-align: center;
            padding: 20px;
        }

        @media (min-width: 768px) {
            .upload-section {
                padding: 40px;
            }
        }

        .upload-zone {
            border: 2px dashed #cbd5e0;
            border-radius: 12px;
            padding: 40px 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            background: linear-gradient(45deg, #f7fafc 0%, #edf2f7 100%);
            touch-action: manipulation;
        }

        @media (min-width: 768px) {
            .upload-zone {
                border: 3px dashed #cbd5e0;
                border-radius: 15px;
                padding: 60px 20px;
            }
        }

        .upload-zone:hover, .upload-zone:active {
            border-color: #667eea;
            background: linear-gradient(45deg, #edf2f7 0%, #e2e8f0 100%);
            transform: translateY(-2px);
        }

        .upload-zone.dragover {
            border-color: #667eea;
            background: rgba(102, 126, 234, 0.1);
        }

        .upload-icon {
            font-size: 3em;
            color: #a0aec0;
            margin-bottom: 15px;
        }

        @media (min-width: 768px) {
            .upload-icon {
                font-size: 4em;
                margin-bottom: 20px;
            }
        }

        .upload-text {
            font-size: 1.1em;
            color: #4a5568;
            margin-bottom: 8px;
        }

        @media (min-width: 768px) {
            .upload-text {
                font-size: 1.2em;
                margin-bottom: 10px;
            }
        }

        .upload-subtext {
            color: #718096;
            font-size: 0.85em;
        }

        @media (min-width: 768px) {
            .upload-subtext {
                font-size: 0.9em;
            }
        }

        #fileInput {
            display: none;
        }

        .btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 25px;
            cursor: pointer;
            font-size: 0.95em;
            font-weight: 500;
            transition: all 0.3s ease;
            margin: 8px 4px;
            touch-action: manipulation;
            min-height: 44px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        @media (min-width: 768px) {
            .btn {
                padding: 12px 30px;
                font-size: 1em;
                margin: 10px 5px;
            }
        }

        .btn:hover, .btn:active {
            transform: translateY(-2px);
            box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .btn-small {
            padding: 8px 12px;
            font-size: 0.85em;
            margin: 4px 2px;
            min-height: 36px;
        }

        @media (min-width: 768px) {
            .btn-small {
                padding: 8px 16px;
                font-size: 0.9em;
                margin: 5px;
            }
        }

        .btn-download {
            background: linear-gradient(135deg, #38b2ac 0%, #319795 100%);
            padding: 8px 16px;
            font-size: 0.9em;
            margin: 5px;
        }

        .btn-download:hover, .btn-download:active {
            box-shadow: 0 6px 12px rgba(56, 178, 172, 0.3);
        }

        .btn-success {
            background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
        }

        .btn-success:hover, .btn-success:active {
            box-shadow: 0 6px 12px rgba(56, 161, 105, 0.3);
        }

        .loading {
            display: none;
            text-align: center;
            padding: 20px;
        }

        .spinner {
            border: 3px solid #f3f3f3;
            border-top: 3px solid #667eea;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            animation: spin 1s linear infinite;
            margin: 0 auto 12px;
        }

        @media (min-width: 768px) {
            .spinner {
                border: 4px solid #f3f3f3;
                border-top: 4px solid #667eea;
                width: 40px;
                height: 40px;
                margin: 0 auto 15px;
            }
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .results-section {
            display: none;
        }

        .summary-cards {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
            margin-bottom: 25px;
        }

        @media (min-width: 480px) {
            .summary-cards {
                grid-template-columns: repeat(2, 1fr);
                gap: 18px;
            }
        }

        @media (min-width: 768px) {
            .summary-cards {
                grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
                gap: 20px;
                margin-bottom: 30px;
            }
        }

        @media (min-width: 1024px) {
            .summary-cards {
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            }
        }

        .summary-card {
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            padding: 18px;
            border-radius: 12px;
            text-align: center;
            box-shadow: 0 6px 15px rgba(66, 153, 225, 0.3);
        }

        @media (min-width: 768px) {
            .summary-card {
                padding: 25px;
                border-radius: 15px;
                box-shadow: 0 10px 20px rgba(66, 153, 225, 0.3);
            }
        }

        .summary-card h3 {
            font-size: 0.8em;
            opacity: 0.9;
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 1px;
            line-height: 1.2;
        }

        @media (min-width: 768px) {
            .summary-card h3 {
                font-size: 0.9em;
                margin-bottom: 10px;
            }
        }

        .summary-card .amount {
            font-size: 1.8em;
            font-weight: bold;
        }

        @media (min-width: 768px) {
            .summary-card .amount {
                font-size: 2.2em;
            }
        }

        .details-table {
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            margin-bottom: 15px;
        }

        @media (min-width: 768px) {
            .details-table {
                border-radius: 15px;
                box-shadow: 0 5px 15px rgba(0,0,0,0.08);
            }
        }

        .table-controls {
            padding: 12px;
            background: #f7fafc;
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        @media (min-width: 480px) {
            .table-controls {
                flex-direction: row;
                align-items: center;
                padding: 15px;
                gap: 10px;
            }
        }

        .table-controls label {
            font-weight: 500;
            color: #4a5568;
            font-size: 0.9em;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85em;
        }

        @media (min-width: 768px) {
            table {
                font-size: 1em;
            }
        }

        th {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 12px 8px;
            font-weight: bold;
            text-align: left;
            cursor: pointer;
            transition: background 0.3s ease;
            font-size: 0.8em;
        }

        @media (min-width: 768px) {
            th {
                padding: 15px;
                font-size: 1em;
            }
        }

        th:hover, th:active {
            background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
        }

        td {
            padding: 10px 8px;
            border-bottom: 1px solid #e2e8f0;
        }

        @media (min-width: 768px) {
            td {
                padding: 12px 15px;
            }
        }

        tbody tr:hover, tbody tr:active {
            background: #f7fafc;
        }

        .amount-cell {
            text-align: right;
            font-weight: 500;
        }

        .positive {
            color: #38a169;
        }

        .negative {
            color: #e53e3e;
        }

        .tabs {
            display: flex;
            margin-bottom: 15px;
            background: #edf2f7;
            border-radius: 8px;
            padding: 4px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        @media (min-width: 768px) {
            .tabs {
                margin-bottom: 20px;
                border-radius: 10px;
                padding: 5px;
            }
        }

        .tab {
            flex: 1;
            padding: 10px 8px;
            text-align: center;
            background: transparent;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s ease;
            white-space: nowrap;
            min-width: 0;
            font-size: 0.9em;
            touch-action: manipulation;
        }

        @media (min-width: 768px) {
            .tab {
                padding: 12px;
                border-radius: 8px;
                font-size: 1em;
            }
        }

        .tab.active {
            background: white;
            color: #667eea;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        @media (min-width: 768px) {
            .tab.active {
                box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            }
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .cotisation-form {
            background: white;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 15px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }

        @media (min-width: 768px) {
            .cotisation-form {
                border-radius: 15px;
                padding: 25px;
                margin-bottom: 20px;
                box-shadow: 0 5px 15px rgba(0,0,0,0.08);
            }
        }

        .year-section {
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
            background: #f7fafc;
        }

        @media (min-width: 768px) {
            .year-section {
                border-radius: 10px;
                padding: 20px;
                margin-bottom: 20px;
            }
        }

        .year-title {
            font-size: 1.2em;
            font-weight: bold;
            color: #4a5568;
            margin-bottom: 12px;
        }

        @media (min-width: 768px) {
            .year-title {
                font-size: 1.3em;
                margin-bottom: 15px;
            }
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
            margin-bottom: 12px;
        }

        @media (min-width: 480px) {
            .form-row {
                grid-template-columns: 1fr 1fr;
                gap: 18px;
            }
        }

        @media (min-width: 768px) {
            .form-row {
                gap: 20px;
                margin-bottom: 15px;
            }
        }

        .form-group {
            display: flex;
            flex-direction: column;
        }

        .form-group label {
            font-weight: 500;
            color: #4a5568;
            margin-bottom: 5px;
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .form-group label {
                font-size: 1em;
            }
        }

        .form-group input {
            padding: 10px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s ease;
            min-height: 44px;
        }

        @media (min-width: 768px) {
            .form-group input {
                font-size: 1em;
            }
        }

        .form-group input:focus {
            outline: none;
            border-color: #667eea;
        }

        .calculations {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 15px;
            border-radius: 8px;
            margin-top: 12px;
        }

        @media (min-width: 768px) {
            .calculations {
                padding: 20px;
                border-radius: 10px;
                margin-top: 15px;
            }
        }

        .calc-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 6px 0;
            border-bottom: 1px solid rgba(255,255,255,0.2);
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .calc-row {
                padding: 8px 0;
                font-size: 1em;
            }
        }

        .calc-row:last-child {
            border-bottom: none;
            font-weight: bold;
            font-size: 1em;
            margin-top: 8px;
            padding-top: 12px;
            border-top: 2px solid rgba(255,255,255,0.3);
        }

        @media (min-width: 768px) {
            .calc-row:last-child {
                font-size: 1.1em;
                margin-top: 10px;
                padding-top: 15px;
            }
        }

        .error-message {
            background: #fed7d7;
            color: #c53030;
            padding: 12px;
            border-radius: 8px;
            margin: 8px 0;
            border-left: 4px solid #e53e3e;
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .error-message {
                padding: 15px;
                border-radius: 10px;
                margin: 10px 0;
                font-size: 1em;
            }
        }

        .success-message {
            background: #c6f6d5;
            color: #2d5016;
            padding: 12px;
            border-radius: 8px;
            margin: 8px 0;
            border-left: 4px solid #48bb78;
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .success-message {
                padding: 15px;
                border-radius: 10px;
                margin: 10px 0;
                font-size: 1em;
            }
        }

        .privacy-notice {
            background: #e6fffa;
            color: #234e52;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 15px;
            border-left: 4px solid #38b2ac;
            font-size: 0.9em;
            line-height: 1.4;
        }

        @media (min-width: 768px) {
            .privacy-notice {
                padding: 15px;
                border-radius: 10px;
                margin-bottom: 20px;
                font-size: 1em;
            }
        }

        .privacy-notice strong {
            color: #1a202c;
        }

        .chart-container {
            background: white;
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 15px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            position: relative;
            height: 300px;
            min-width: 280px;
        }

        @media (min-width: 480px) {
            .chart-container {
                height: 350px;
            }
        }

        @media (min-width: 768px) {
            .chart-container {
                border-radius: 15px;
                padding: 30px;
                margin-bottom: 20px;
                box-shadow: 0 5px 15px rgba(0,0,0,0.08);
                height: 400px;
                min-width: 400px;
            }
        }

        @media (min-width: 1024px) {
            .chart-container {
                height: 500px;
                min-width: 500px;
            }
        }

        @media (min-width: 1200px) {
            .chart-container {
                height: 600px;
            }
        }

        .chart-header {
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: flex-start;
            margin-bottom: 12px;
        }

        @media (min-width: 480px) {
            .chart-header {
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
            }
        }

        @media (min-width: 768px) {
            .chart-header {
                margin-bottom: 15px;
                gap: 10px;
            }
        }

        .chart-container canvas {
            max-width: 100% !important;
            max-height: 100% !important;
        }

        .chart-title {
            font-size: 1em;
            font-weight: bold;
            color: #4a5568;
            margin: 0;
        }

        @media (min-width: 768px) {
            .chart-title {
                font-size: 1.2em;
            }
        }

        .chart-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
            margin-bottom: 15px;
        }

        @media (min-width: 1024px) {
            .chart-grid {
                grid-template-columns: 1fr 1fr;
                gap: 20px;
                margin-bottom: 20px;
            }
        }

        .year-selector select {
            width: 100%;
            padding: 10px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            background: white;
            cursor: pointer;
            transition: border-color 0.3s ease;
            min-height: 44px;
        }

        @media (min-width: 768px) {
            .year-selector select {
                font-size: 1em;
            }
        }

        .year-selector select:focus {
            outline: none;
            border-color: #667eea;
        }

        .download-status {
            background: #e6fffa;
            color: #234e52;
            padding: 8px 12px;
            border-radius: 8px;
            margin: 8px 0;
            border-left: 4px solid #38b2ac;
            display: none;
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .download-status {
                padding: 10px 15px;
                margin: 10px 0;
                font-size: 1em;
            }
        }

        /* Mobile-first optimizations */
        @media (max-width: 767px) {
            .container {
                padding: 15px;
            }
            
            .card {
                padding: 25px;
                margin-bottom: 15px;
                border-radius: 15px;
            }
            .summary-cards {
                grid-template-columns: 1fr;
                gap: 12px;
            }
            
            .summary-card {
                padding: 15px;
                margin: 0 5px;
            }
            
            .summary-card h3 {
                font-size: 0.75em;
                line-height: 1.1;
            }
            
            .summary-card .amount {
                font-size: 1.6em;
            }
            
            .tabs {
                padding: 3px;
                margin: 0 auto 15px;
                overflow-x: scroll;
                scrollbar-width: none;
                -ms-overflow-style: none;
                display: flex;
                justify-content: center;
                max-width: 350px;
            }
            
            .tabs::-webkit-scrollbar {
                display: none;
            }
            
            .tab {
                flex: none;
                min-width: 90px;
                max-width: 120px;
                padding: 12px 8px;
                font-size: 0.75em;
                margin: 0 1px;
                text-overflow: ellipsis;
                overflow: hidden;
            }
            
            .form-row {
                gap: 12px;
            }
            
            .form-group input, .year-selector select {
                font-size: 16px;
                padding: 12px;
                border-radius: 10px;
            }
            
            .privacy-notice {
                margin: 0 -5px 15px;
                padding: 15px;
                font-size: 0.85em;
                line-height: 1.5;
            }
            
            .btn {
                width: 100%;
                max-width: 280px;
                margin: 8px auto;
                display: block;
                padding: 14px 20px;
                font-size: 0.9em;
            }
            
            .btn-small {
                width: auto;
                max-width: none;
                display: inline-flex;
                margin: 4px 2px;
                min-width: 80px;
            }
            
            .table-controls {
                flex-wrap: wrap;
                justify-content: center;
            }
            
            .chart-container {
                margin: 0 -10px 15px;
                padding: 10px;
                height: 280px;
                border-radius: 10px;
            }
            
            .chart-title {
                font-size: 0.9em;
                text-align: center;
            }
            
            .upload-zone {
                margin: 0 -5px;
                padding: 30px 15px;
            }
            
            .upload-text {
                font-size: 1em;
            }
            
            .upload-subtext {
                font-size: 0.8em;
            }
            
            .header {
                padding: 0 10px;
            }
            
            .loading {
                padding: 30px 20px;
            }
        }

        /* Very small screens */
        @media (max-width: 400px) {
            .container {
                padding: 5px;
            }
            
            .card {
                padding: 15px;
                margin-bottom: 10px;
                border-radius: 12px;
            }
            
            .header h1 {
                font-size: 1.4em;
                margin-bottom: 5px;
            }
            
            .header p {
                font-size: 0.9em;
            }
            
            .summary-card {
                padding: 12px;
            }
            
            .summary-card h3 {
                font-size: 0.7em;
            }
            
            .summary-card .amount {
                font-size: 1.4em;
            }
            
            .tab {
                min-width: 90px;
                padding: 10px 12px;
                font-size: 0.8em;
            }
            
            .chart-container {
                height: 250px;
                padding: 8px;
            }
        }

        /* Footer responsive */
        footer {
            text-align: center;
            margin-top: 30px;
            padding: 15px;
            background: rgba(255,255,255,0.1);
            border-radius: 12px;
            backdrop-filter: blur(10px);
        }

        @media (min-width: 768px) {
            footer {
                margin-top: 40px;
                padding: 20px;
                border-radius: 15px;
            }
        }

        footer > div {
            color: rgba(255,255,255,0.9);
            font-size: 13px;
        }

        @media (min-width: 768px) {
            footer > div {
                font-size: 14px;
            }
        }

        footer a {
            color: rgba(255,255,255,0.9);
            text-decoration: none;
            margin: 5px;
            padding: 6px 10px;
            background: rgba(255,255,255,0.1);
            border-radius: 4px;
            transition: all 0.3s ease;
            display: inline-block;
            min-height: 32px;
            line-height: 20px;
        }

        @media (min-width: 768px) {
            footer a {
                margin: 0 10px;
                padding: 8px 12px;
                border-radius: 5px;
            }
        }

        footer a:hover, footer a:active {
            background: rgba(255,255,255,0.2);
        }

        footer span {
            color: rgba(255,255,255,0.5);
            display: none;
        }

        @media (min-width: 480px) {
            footer span {
                display: inline;
            }
        }.9em;
            margin: 5px;
        }

        .btn-download:hover, .btn-download:active {
            box-shadow: 0 6px 12px rgba(56, 178, 172, 0.3);
        }

        .btn-success {
            background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
        }

        .btn-success:hover, .btn-success:active {
            box-shadow: 0 6px 12px rgba(56, 161, 105, 0.3);
        }

        .loading {
            display: none;
            text-align: center;
            padding: 20px;
        }

        .spinner {
            border: 3px solid #f3f3f3;
            border-top: 3px solid #667eea;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            animation: spin 1s linear infinite;
            margin: 0 auto 12px;
        }

        @media (min-width: 768px) {
            .spinner {
                border: 4px solid #f3f3f3;
                border-top: 4px solid #667eea;
                width: 40px;
                height: 40px;
                margin: 0 auto 15px;
            }
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .results-section {
            display: none;
        }

        .summary-cards {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
            margin-bottom: 25px;
        }

        @media (min-width: 480px) {
            .summary-cards {
                grid-template-columns: repeat(2, 1fr);
                gap: 18px;
            }
        }

        @media (min-width: 768px) {
            .summary-cards {
                grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
                gap: 20px;
                margin-bottom: 30px;
            }
        }

        @media (min-width: 1024px) {
            .summary-cards {
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            }
        }

        .summary-card {
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            padding: 18px;
            border-radius: 12px;
            text-align: center;
            box-shadow: 0 6px 15px rgba(66, 153, 225, 0.3);
        }

        @media (min-width: 768px) {
            .summary-card {
                padding: 25px;
                border-radius: 15px;
                box-shadow: 0 10px 20px rgba(66, 153, 225, 0.3);
            }
        }

        .summary-card h3 {
            font-size: 0.8em;
            opacity: 0.9;
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 1px;
            line-height: 1.2;
        }

        @media (min-width: 768px) {
            .summary-card h3 {
                font-size: 0.9em;
                margin-bottom: 10px;
            }
        }

        .summary-card .amount {
            font-size: 1.8em;
            font-weight: bold;
        }

        @media (min-width: 768px) {
            .summary-card .amount {
                font-size: 2.2em;
            }
        }

        .details-table {
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            margin-bottom: 15px;
        }

        @media (min-width: 768px) {
            .details-table {
                border-radius: 15px;
                box-shadow: 0 5px 15px rgba(0,0,0,0.08);
            }
        }

        .table-controls {
            padding: 12px;
            background: #f7fafc;
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        @media (min-width: 480px) {
            .table-controls {
                flex-direction: row;
                align-items: center;
                padding: 15px;
                gap: 10px;
            }
        }

        .table-controls label {
            font-weight: 500;
            color: #4a5568;
            font-size: 0.9em;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85em;
        }

        @media (min-width: 768px) {
            table {
                font-size: 1em;
            }
        }

        th {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 12px 8px;
            font-weight: bold;
            text-align: left;
            cursor: pointer;
            transition: background 0.3s ease;
            font-size: 0.8em;
        }

        @media (min-width: 768px) {
            th {
                padding: 15px;
                font-size: 1em;
            }
        }

        th:hover, th:active {
            background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
        }

        td {
            padding: 10px 8px;
            border-bottom: 1px solid #e2e8f0;
        }

        @media (min-width: 768px) {
            td {
                padding: 12px 15px;
            }
        }

        tbody tr:hover, tbody tr:active {
            background: #f7fafc;
        }

        .amount-cell {
            text-align: right;
            font-weight: 500;
        }

        .positive {
            color: #38a169;
        }

        .negative {
            color: #e53e3e;
        }

        .tabs {
            display: flex;
            margin-bottom: 15px;
            background: #edf2f7;
            border-radius: 8px;
            padding: 4px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        @media (min-width: 768px) {
            .tabs {
                margin-bottom: 20px;
                border-radius: 10px;
                padding: 5px;
            }
        }

        .tab {
            flex: 1;
            padding: 10px 8px;
            text-align: center;
            background: transparent;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s ease;
            white-space: nowrap;
            min-width: 0;
            font-size: 0.9em;
            touch-action: manipulation;
        }

        @media (min-width: 768px) {
            .tab {
                padding: 12px;
                border-radius: 8px;
                font-size: 1em;
            }
        }

        .tab.active {
            background: white;
            color: #667eea;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        @media (min-width: 768px) {
            .tab.active {
                box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            }
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .cotisation-form {
            background: white;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 15px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }

        @media (min-width: 768px) {
            .cotisation-form {
                border-radius: 15px;
                padding: 25px;
                margin-bottom: 20px;
                box-shadow: 0 5px 15px rgba(0,0,0,0.08);
            }
        }

        .year-section {
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
            background: #f7fafc;
        }

        @media (min-width: 768px) {
            .year-section {
                border-radius: 10px;
                padding: 20px;
                margin-bottom: 20px;
            }
        }

        .year-title {
            font-size: 1.2em;
            font-weight: bold;
            color: #4a5568;
            margin-bottom: 12px;
        }

        @media (min-width: 768px) {
            .year-title {
                font-size: 1.3em;
                margin-bottom: 15px;
            }
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
            margin-bottom: 12px;
        }

        @media (min-width: 480px) {
            .form-row {
                grid-template-columns: 1fr 1fr;
                gap: 18px;
            }
        }

        @media (min-width: 768px) {
            .form-row {
                gap: 20px;
                margin-bottom: 15px;
            }
        }

        .form-group {
            display: flex;
            flex-direction: column;
        }

        .form-group label {
            font-weight: 500;
            color: #4a5568;
            margin-bottom: 5px;
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .form-group label {
                font-size: 1em;
            }
        }

        .form-group input {
            padding: 10px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s ease;
            min-height: 44px;
        }

        @media (min-width: 768px) {
            .form-group input {
                font-size: 1em;
            }
        }

        .form-group input:focus {
            outline: none;
            border-color: #667eea;
        }

        .calculations {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 15px;
            border-radius: 8px;
            margin-top: 12px;
        }

        @media (min-width: 768px) {
            .calculations {
                padding: 20px;
                border-radius: 10px;
                margin-top: 15px;
            }
        }

        .calc-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 6px 0;
            border-bottom: 1px solid rgba(255,255,255,0.2);
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .calc-row {
                padding: 8px 0;
                font-size: 1em;
            }
        }

        .calc-row:last-child {
            border-bottom: none;
            font-weight: bold;
            font-size: 1em;
            margin-top: 8px;
            padding-top: 12px;
            border-top: 2px solid rgba(255,255,255,0.3);
        }

        @media (min-width: 768px) {
            .calc-row:last-child {
                font-size: 1.1em;
                margin-top: 10px;
                padding-top: 15px;
            }
        }

        .error-message {
            background: #fed7d7;
            color: #c53030;
            padding: 12px;
            border-radius: 8px;
            margin: 8px 0;
            border-left: 4px solid #e53e3e;
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .error-message {
                padding: 15px;
                border-radius: 10px;
                margin: 10px 0;
                font-size: 1em;
            }
        }

        .success-message {
            background: #c6f6d5;
            color: #2d5016;
            padding: 12px;
            border-radius: 8px;
            margin: 8px 0;
            border-left: 4px solid #48bb78;
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .success-message {
                padding: 15px;
                border-radius: 10px;
                margin: 10px 0;
                font-size: 1em;
            }
        }

        .privacy-notice {
            background: #e6fffa;
            color: #234e52;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 15px;
            border-left: 4px solid #38b2ac;
            font-size: 0.9em;
            line-height: 1.4;
        }

        @media (min-width: 768px) {
            .privacy-notice {
                padding: 15px;
                border-radius: 10px;
                margin-bottom: 20px;
                font-size: 1em;
            }
        }

        .privacy-notice strong {
            color: #1a202c;
        }

        .chart-container {
            background: white;
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 15px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            position: relative;
            height: 300px;
            min-width: 280px;
        }

        @media (min-width: 480px) {
            .chart-container {
                height: 350px;
            }
        }

        @media (min-width: 768px) {
            .chart-container {
                border-radius: 15px;
                padding: 30px;
                margin-bottom: 20px;
                box-shadow: 0 5px 15px rgba(0,0,0,0.08);
                height: 400px;
                min-width: 400px;
            }
        }

        @media (min-width: 1024px) {
            .chart-container {
                height: 500px;
                min-width: 500px;
            }
        }

        @media (min-width: 1200px) {
            .chart-container {
                height: 600px;
            }
        }

        .chart-header {
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: flex-start;
            margin-bottom: 12px;
        }

        @media (min-width: 480px) {
            .chart-header {
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
            }
        }

        @media (min-width: 768px) {
            .chart-header {
                margin-bottom: 15px;
                gap: 10px;
            }
        }

        .chart-container canvas {
            max-width: 100% !important;
            max-height: 100% !important;
        }

        .chart-title {
            font-size: 1em;
            font-weight: bold;
            color: #4a5568;
            margin: 0;
        }

        @media (min-width: 768px) {
            .chart-title {
                font-size: 1.2em;
            }
        }

        .chart-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
            margin-bottom: 15px;
        }

        @media (min-width: 1024px) {
            .chart-grid {
                grid-template-columns: 1fr 1fr;
                gap: 20px;
                margin-bottom: 20px;
            }
        }

        .year-selector select {
            width: 100%;
            padding: 10px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            background: white;
            cursor: pointer;
            transition: border-color 0.3s ease;
            min-height: 44px;
        }

        @media (min-width: 768px) {
            .year-selector select {
                font-size: 1em;
            }
        }

        .year-selector select:focus {
            outline: none;
            border-color: #667eea;
        }

        .download-status {
            background: #e6fffa;
            color: #234e52;
            padding: 8px 12px;
            border-radius: 8px;
            margin: 8px 0;
            border-left: 4px solid #38b2ac;
            display: none;
            font-size: 0.9em;
        }

        @media (min-width: 768px) {
            .download-status {
                padding: 10px 15px;
                margin: 10px 0;
                font-size: 1em;
            }
        }

        /* Responsive table on mobile */
        @media (max-width: 767px) {
            .details-table {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            table {
                min-width: 500px;
            }
            
            th, td {
                white-space: nowrap;
            }
        }

        /* Improve touch targets */
        @media (max-width: 767px) {
            .btn, .tab, input, select {
                min-height: 44px;
                touch-action: manipulation;
            }
        }

        /* Footer responsive */
        footer {
            text-align: center;
            margin-top: 30px;
            padding: 15px;
            background: rgba(255,255,255,0.1);
            border-radius: 12px;
            backdrop-filter: blur(10px);
        }

        @media (min-width: 768px) {
            footer {
                margin-top: 40px;
                padding: 20px;
                border-radius: 15px;
            }
        }

        footer > div {
            color: rgba(255,255,255,0.9);
            font-size: 13px;
        }

        @media (min-width: 768px) {
            footer > div {
                font-size: 14px;
            }
        }

        footer a {
            color: rgba(255,255,255,0.9);
            text-decoration: none;
            margin: 5px;
            padding: 6px 10px;
            background: rgba(255,255,255,0.1);
            border-radius: 4px;
            transition: all 0.3s ease;
            display: inline-block;
            min-height: 32px;
            line-height: 20px;
        }

        @media (min-width: 768px) {
            footer a {
                margin: 0 10px;
                padding: 8px 12px;
                border-radius: 5px;
            }
        }

        footer a:hover, footer a:active {
            background: rgba(255,255,255,0.2);
        }

        footer span {
            color: rgba(255,255,255,0.5);
            display: none;
        }

        @media (min-width: 480px) {
            footer span {
                display: inline;
            }
        }.9em;
            margin: 5px;
        }

        .btn-download:hover {
            box-shadow: 0 8px 16px rgba(56, 178, 172, 0.3);
        }

        .btn-success {
            background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
        }

        .btn-success:hover {
            box-shadow: 0 8px 16px rgba(56, 161, 105, 0.3);
        }

        .loading {
            display: none;
            text-align: center;
            padding: 20px;
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto 15px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .results-section {
            display: none;
        }

        .summary-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .summary-card {
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            padding: 25px;
            border-radius: 15px;
            text-align: center;
            box-shadow: 0 10px 20px rgba(66, 153, 225, 0.3);
        }

        .summary-card h3 {
            font-size: 0.9em;
            opacity: 0.9;
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .summary-card .amount {
            font-size: 2.2em;
            font-weight: bold;
        }

        .details-table {
            background: white;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0,0,0,0.08);
        }

        .table-controls {
            padding: 15px;
            background: #f7fafc;
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .table-controls label {
            font-weight: 500;
            color: #4a5568;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 15px;
            font-weight: 500;
            text-align: left;
            cursor: pointer;
            transition: background 0.3s ease;
        }

        th:hover {
            background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
        }

        td {
            padding: 12px 15px;
            border-bottom: 1px solid #e2e8f0;
        }

        tbody tr:hover {
            background: #f7fafc;
        }

        .amount-cell {
            text-align: right;
            font-weight: 500;
        }

        .positive {
            color: #38a169;
        }

        .negative {
            color: #e53e3e;
        }

        .tabs {
            display: flex;
            margin-bottom: 20px;
            background: #edf2f7;
            border-radius: 10px;
            padding: 5px;
        }

        .tab {
            flex: 1;
            padding: 12px;
            text-align: center;
            background: transparent;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .tab.active {
            background: white;
            color: #667eea;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .cotisation-form {
            background: white;
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 20px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.08);
        }

        .year-section {
            border: 2px solid #e2e8f0;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            background: #f7fafc;
        }

        .year-title {
            font-size: 1.3em;
            font-weight: bold;
            color: #4a5568;
            margin-bottom: 15px;
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 15px;
        }

        .form-group {
            display: flex;
            flex-direction: column;
        }

        .form-group label {
            font-weight: 500;
            color: #4a5568;
            margin-bottom: 5px;
        }

        .form-group input {
            padding: 10px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 1em;
            transition: border-color 0.3s ease;
        }

        .form-group input:focus {
            outline: none;
            border-color: #667eea;
        }

        .calculations {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            border-radius: 10px;
            margin-top: 15px;
        }

        .calc-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid rgba(255,255,255,0.2);
        }

        .calc-row:last-child {
            border-bottom: none;
            font-weight: bold;
            font-size: 1.1em;
            margin-top: 10px;
            padding-top: 15px;
            border-top: 2px solid rgba(255,255,255,0.3);
        }

        .error-message {
            background: #fed7d7;
            color: #c53030;
            padding: 15px;
            border-radius: 10px;
            margin: 10px 0;
            border-left: 4px solid #e53e3e;
        }

        .success-message {
            background: #c6f6d5;
            color: #2d5016;
            padding: 15px;
            border-radius: 10px;
            margin: 10px 0;
            border-left: 4px solid #48bb78;
        }

        .privacy-notice {
            background: #e6fffa;
            color: #234e52;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
            border-left: 4px solid #38b2ac;
        }

        .privacy-notice strong {
            color: #1a202c;
        }

        .chart-container {
            background: white;
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 20px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.08);
            position: relative;
            height: 600px;
            min-width: 500px;
        }

        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .chart-container canvas {
            max-width: 100% !important;
            max-height: 100% !important;
        }

        .chart-title {
            font-size: 1.2em;
            font-weight: bold;
            color: #4a5568;
            margin: 0;
        }

        .chart-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        .supabase-section {
            background: #f0f8ff;
            color: #1e3a8a;
            padding: 20px;
            border-radius: 10px;
            margin-top: 20px;
            border-left: 4px solid #3b82f6;
        }

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

        .config-form input {
            width: 100%;
            padding: 10px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 1em;
            margin-bottom: 10px;
        }

        .debug-section {
            background: #f0f4f8;
            border: 1px solid #d1d5db;
            border-radius: 10px;
            padding: 15px;
            margin-top: 20px;
            font-family: monospace;
            font-size: 0.9em;
        }

        .debug-section h4 {
            color: #374151;
            margin-bottom: 10px;
        }

        .debug-content {
            background: white;
            padding: 10px;
            border-radius: 5px;
            max-height: 200px;
            overflow-y: auto;
            white-space: pre-wrap;
        }

        @media (max-width: 1200px) {
            .chart-grid {
                grid-template-columns: 1fr;
            }
            
            .chart-container {
                height: 500px;
                min-width: 300px;
            }
        }

        @media (max-width: 768px) {
            .chart-container {
                padding: 15px;
                height: 450px;
            }

            .form-row {
                grid-template-columns: 1fr;
            }
            
            .summary-cards {
                grid-template-columns: 1fr;
            }

            .chart-header {
                flex-direction: column;
                gap: 10px;
                align-items: flex-start;
            }
        }

        .analytics-summary {
            background: linear-gradient(135deg, #38b2ac 0%, #319795 100%);
            color: white;
            padding: 20px;
            border-radius: 15px;
            margin-bottom: 20px;
        }

        .analytics-summary h3 {
            margin-bottom: 15px;
            font-size: 1.3em;
        }

        .analytics-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid rgba(255,255,255,0.2);
        }

        .year-selector select {
            width: 100%;
            padding: 10px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 1em;
            background: white;
            cursor: pointer;
            transition: border-color 0.3s ease;
        }

        .year-selector select:focus {
            outline: none;
            border-color: #667eea;
        }

        .download-status {
            background: #e6fffa;
            color: #234e52;
            padding: 10px 15px;
            border-radius: 8px;
            margin: 10px 0;
            border-left: 4px solid #38b2ac;
            display: none;
        }