.btn-primary:focus,
.btn-payment:focus,
.btn-copy:focus,
.btn-pay-all:focus,
.form-input:focus {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a237e;
    text-align: center;
}

.hero-desc {
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.08rem;
}

.icon-primary {
    color: var(--primary-color) !important;
}

:root {
    --primary-color: #2c5282;
    --secondary-color: #4a90a4;
    --accent-color: #68d391;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --bg-primary: #f7fafc;
    --bg-secondary: #edf2f7;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --success-color: #38a169;
    --warning-color: #d69e2e;
    --error-color: #e53e3e;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

.header {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

#logo-img {
    width: 130px;
    height: auto;
    border-radius: 8px;
    top: 10px;
    left: 20px;
    position: relative;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.search-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.search-form {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 280px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.btn-primary {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.btn-primary:hover {
    background: #2a4f7a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
}

.card-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.info-icon {
    font-size: 1rem;
    color: var(--text-muted);
    min-width: 20px;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.debt-summary {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.debt-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
    flex-wrap: wrap;
    gap: 15px;
}

.debt-summary-title-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.debt-summary-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.debt-summary-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-pay-all {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--success-color) 0%, #2f855a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pay-all:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-pay-all:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.debt-year-section {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.debt-year-section.paid {
    background: #f0fff4;
    border-color: var(--success-color);
    opacity: 0.8;
}

.debt-year-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.debt-year-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.debt-year-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.debt-year-title.paid {
    color: var(--success-color);
}

.debt-year-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.debt-year-total.paid {
    color: var(--success-color);
}

.debt-year-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success-color);
}

.debt-year-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-pay-year {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--success-color) 0%, #2f855a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pay-year:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-pay-year:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.btn-select-year {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-select-year:hover {
    background: #2a4f7a;
    transform: translateY(-1px);
}

.btn-select-year:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.debt-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.debt-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.debt-item.paid {
    background: #f9fffe;
    border-color: var(--success-color);
    opacity: 0.8;
}

.debt-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.debt-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.debt-item-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.debt-item-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.debt-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.debt-item-title.paid {
    color: var(--success-color);
}

.debt-item-details {
    margin-left: 26px;
}

.debt-item-status {
    font-size: 0.8rem;
    color: var(--warning-color);
    margin-bottom: 5px;
}

.debt-item-status.paid {
    color: var(--success-color);
}

.debt-item-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.debt-item-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.debt-item-value.paid {
    color: var(--success-color);
}

.debt-table-container {
    overflow-x: auto;
    margin: 25px 0;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.debt-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

.debt-table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.debt-table td {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    font-weight: 500;
    position: relative;
}

.debt-table tr:hover {
    background: var(--bg-primary);
}

.debt-table tr:last-child td {
    border-bottom: none;
}

.debt-table tr.selected {
    background-color: #fff2d062;
}

.debt-table tr.paid {
    background: #f0fff4;
    opacity: 0.8;
}

.debt-amount {
    font-weight: 600;
    color: var(--primary-color);
}

.debt-amount.paid {
    color: var(--success-color);
}

.debt-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background: #fff3c4;
    color: #b7791f;
    border: 1px solid #ecc94b;
}

.status-paid {
    background: #f0fff4;
    color: var(--success-color);
    border: 1px solid #9ae6b4;
}

.debt-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
    transform: scale(1.2);
}

.debt-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.individual-payment {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.btn-success:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

.btn-success:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.payment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.selection-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-label {
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.total-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    margin-top: 20px;
}

.total-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.total-amount {
    font-family: 'Roboto', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.total-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-payment {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--success-color) 0%, #2f855a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-payment:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-payment:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    animation: fadeIn 0.3s ease;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 1000;
    display: none;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    z-index: 1001;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-right: 50px;
}

.modal-subtitle {
    color: var(--success-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 20px;
    padding-bottom: 40px;
}

.instructions {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-color);
}

.instructions h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 600;
}

.instructions ol {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-code {
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    max-width: 100%;
    height: auto;
}

.btn-copy {
    background: var(--text-primary);
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
}

.btn-copy:hover {
    background: var(--text-secondary);
    transform: translateY(-1px);
}

.payment-total {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
}

.payment-total h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.payment-total .amount {
    font-family: 'Roboto', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.payment-items {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-error {
    background: #fed7d7;
    color: var(--error-color);
    border: 1px solid #feb2b2;
}

.alert-success {
    background: #c6f6d5;
    color: var(--success-color);
    border: 1px solid #9ae6b4;
}

.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

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

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 8px;
        max-width: 100%;
    }

    /* Melhorar tabela de débitos no mobile */
    .debt-table-container {
        margin: 15px -12px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .debt-table {
        min-width: 700px;
        font-size: 0.85rem;
    }

    .debt-table th {
        padding: 12px 8px;
        font-size: 0.8rem;
        white-space: nowrap;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .debt-table td {
        padding: 12px 8px;
        white-space: nowrap;
        min-width: 120px;
    }

    .debt-table td:first-child {
        min-width: 200px;
        white-space: normal;
        word-wrap: break-word;
    }

    .debt-table td:last-child {
        min-width: 140px;
    }

    /* Indicador de scroll horizontal */
    .debt-table-container::after {
        content: "← Deslize para ver mais →";
        display: block;
        text-align: center;
        padding: 8px;
        background: var(--bg-primary);
        color: var(--text-muted);
        font-size: 0.8rem;
        border-top: 1px solid var(--border-color);
    }

    .header {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .header-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .logo-section {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    #logo-img {
        width: 100px;
        position: static;
    }

    .header-actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .header-btn {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }

    .hero-section {
        padding: 15px 8px;
    }

    .search-section {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .search-form {
        flex-direction: column;
        gap: 12px;
    }

    .form-group {
        width: 100%;
    }

    .form-label {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }

    .form-input {
        padding: 14px 12px;
        font-size: 16px;
        /* Evita zoom no iOS */
        border-radius: 6px;
    }

    .page-title {
        font-size: 1.3rem;
        line-height: 1.3;
    }

    .page-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .vehicle-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .info-card {
        padding: 8px 12px;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    .info-icon {
        font-size: 0.9rem;
        min-width: 16px;
    }

    .info-label {
        font-size: 0.85rem;
    }

    .info-value {
        font-size: 0.9rem;
        word-break: break-word;
    }

    .debt-items-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .debt-item {
        padding: 12px;
        border-radius: 6px;
    }

    .debt-item-title {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .debt-item-details {
        margin-left: 22px;
    }

    .debt-item-status,
    .debt-item-date {
        font-size: 0.75rem;
    }

    .debt-item-value {
        font-size: 0.95rem;
    }

    .debt-year-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .debt-year-title {
        font-size: 1rem;
    }

    .debt-year-total {
        font-size: 1.1rem;
    }

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

    .debt-summary-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .debt-summary-subtitle {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .debt-summary-actions {
        width: 100%;
        justify-content: stretch;
    }

    .btn-pay-all {
        flex: 1;
        justify-content: center;
    }

    .debt-summary-footer {
        padding-top: 12px;
        gap: 8px;
    }

    .debt-year-actions {
        flex-direction: column;
        width: 100%;
        gap: 6px;
    }

    .btn-pay-year,
    .btn-select-year {
        width: 100%;
        justify-content: center;
    }

    .select-all-wrapper {
        font-size: 0.9rem;
        gap: 6px;
    }

    .total-and-button {
        flex-direction: column;
        gap: 10px;
    }

    .selection-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    .control-group {
        justify-content: center;
    }

    .btn-small {
        flex: 1;
        padding: 10px;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    .btn-primary {
        font-size: 1rem;
    }

    .total-section {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .total-amount {
        font-size: 1.3rem;
    }

    .total-count {
        font-size: 0.85rem;
        text-align: center;
    }

    .btn-payment {
        width: 100%;
        justify-content: center;
        padding: 16px;
        font-size: 1.1rem;
        border-radius: 8px;
    }

    .debt-table-container {
        font-size: 0.8rem;
        border-radius: 6px;
        margin: 15px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 10px -8px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .debt-table th,
    .debt-table td {
        padding: 10px 6px;
        font-size: 0.8rem;
    }

    .debt-table th {
        font-size: 0.8rem;
        padding: 12px 6px;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .debt-table {
        min-width: 650px;
    }

    .debt-table td:first-child {
        min-width: 180px;
        white-space: normal;
    }

    .debt-table td:nth-child(2) {
        min-width: 100px;
    }

    .debt-table td:nth-child(3) {
        min-width: 80px;
    }

    .debt-table td:last-child {
        min-width: 120px;
    }

    .card {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .card-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .card-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
        gap: 8px;
    }

    .modal {
        border-radius: 0;
        padding: 0;
    }

    .modal-header {
        padding: 12px 15px;
        position: sticky;
        top: 0;
        z-index: 1001;
    }

    .modal-title {
        font-size: 1.1rem;
        line-height: 1.3;
        padding-right: 40px;
    }

    .modal-subtitle {
        font-size: 0.9rem;
    }

    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }

    .modal-body {
        padding: 12px 15px;
        padding-bottom: 30px;
    }

    .instructions {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 6px;
    }

    .instructions h4 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .instructions li {
        font-size: 0.85rem;
        margin-bottom: 6px;
        line-height: 1.4;
    }

    .instructions ol {
        padding-left: 16px;
    }

    .qr-code {
        width: 160px;
        height: 160px;
        margin-bottom: 15px;
    }

    .btn-copy {
        padding: 12px 20px;
        font-size: 0.95rem;
        max-width: 280px;
        border-radius: 6px;
    }

    .payment-total .amount {
        font-size: 1.6rem;
    }

    .payment-total {
        padding: 15px;
        margin-top: 15px;
        border-radius: 6px;
    }

    .payment-total h3 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .payment-items {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .security-info {
        font-size: 0.8rem;
        margin-top: 15px;
    }

    .alert {
        padding: 12px 15px;
        margin: 15px 0;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    .resumo-debitos-tabela {
        font-size: 0.8rem;
        margin: 15px 0;
    }

    .resumo-debitos-tabela th,
    .resumo-debitos-tabela td {
        padding: 6px 4px;
        min-width: 60px;
    }

    .resumo-debitos-tabela {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        border-radius: 6px;
    }

    .resumo-debitos-tabela table {
        min-width: 400px;
        width: 100%;
    }

    .debt-summary {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .debt-year-section {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 6px;
    }

    #btn-nova-busca {
        font-size: 0.9rem;
        padding: 10px 16px;
        margin-top: 8px;
        width: 100%;
        justify-content: center;
    }

    .hero-title {
        font-size: 1.4rem;
        padding: 0 8px;
        line-height: 1.3;
    }

    .hero-desc {
        font-size: 0.95rem;
        padding: 0 8px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 4px;
    }

    .debt-table-container {
        margin: 8px -4px;
        font-size: 0.75rem;
    }

    .header {
        padding: 8px;
        margin-bottom: 10px;
    }

    .search-section {
        padding: 8px;
        margin-bottom: 10px;
    }

    .card {
        padding: 8px;
        margin-bottom: 10px;
    }

    .page-title {
        font-size: 1.2rem;
        line-height: 1.2;
    }

    .page-subtitle {
        font-size: 0.85rem;
    }

    .logo {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    #logo-img {
        width: 80px;
    }

    .form-input {
        padding: 12px 10px;
        font-size: 16px;
    }

    .btn-primary {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .hero-title {
        font-size: 1.2rem;
        padding: 0 4px;
    }

    .hero-desc {
        font-size: 0.9rem;
        padding: 0 4px;
    }

    .vehicle-grid {
        gap: 6px;
    }

    .info-card {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .debt-items-grid {
        gap: 8px;
    }

    .debt-item {
        padding: 8px;
    }

    .debt-item-title {
        font-size: 0.8rem;
    }

    .debt-item-details {
        margin-left: 18px;
    }

    .debt-item-status,
    .debt-item-date {
        font-size: 0.7rem;
    }

    .debt-item-value {
        font-size: 0.85rem;
    }

    .debt-table th,
    .debt-table td {
        padding: 8px 4px;
        font-size: 0.75rem;
    }

    .debt-table th {
        font-size: 0.75rem;
        padding: 10px 4px;
    }

    .debt-table {
        min-width: 600px;
    }

    .debt-table td:first-child {
        min-width: 160px;
    }

    .debt-table td:nth-child(2) {
        min-width: 90px;
    }

    .debt-table td:nth-child(3) {
        min-width: 70px;
    }

    .debt-table td:last-child {
        min-width: 110px;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
        gap: 6px;
    }

    .modal-header {
        padding: 8px 12px;
    }

    .modal-body {
        padding: 8px 12px;
        padding-bottom: 20px;
    }

    .modal-title {
        font-size: 1rem;
        padding-right: 35px;
    }

    .modal-close {
        top: 6px;
        right: 12px;
        font-size: 20px;
    }

    .qr-code {
        width: 140px;
        height: 140px;
        margin-bottom: 12px;
    }

    .btn-copy {
        padding: 10px 16px;
        font-size: 0.9rem;
        max-width: 250px;
    }

    .payment-total {
        padding: 12px;
        margin-top: 12px;
    }

    .payment-total .amount {
        font-size: 1.4rem;
    }

    .payment-total h3 {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }

    .payment-items {
        font-size: 0.75rem;
    }

    .instructions {
        padding: 8px;
        margin-bottom: 12px;
    }

    .instructions h4 {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .instructions li {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .instructions ol {
        padding-left: 14px;
    }

    .security-info {
        font-size: 0.75rem;
        margin-top: 12px;
    }

    .alert {
        padding: 8px 12px;
        margin: 10px 0;
        font-size: 0.85rem;
    }

    .debt-summary {
        padding: 8px;
        margin-bottom: 10px;
    }

    .debt-summary-title {
        font-size: 1rem;
    }

    .debt-summary-subtitle {
        font-size: 0.8rem;
    }

    .debt-year-section {
        padding: 8px;
        margin-bottom: 10px;
    }

    .debt-year-title {
        font-size: 0.9rem;
    }

    .debt-year-total {
        font-size: 1rem;
    }

    .resumo-debitos-tabela {
        font-size: 0.7rem;
        margin: 10px 0;
    }

    .resumo-debitos-tabela th,
    .resumo-debitos-tabela td {
        padding: 4px 2px;
        min-width: 50px;
    }

    .resumo-debitos-tabela table {
        min-width: 350px;
    }

    .select-all-wrapper {
        font-size: 0.8rem;
    }

    .total-label {
        font-size: 1rem;
    }

    .total-count {
        font-size: 0.8rem;
    }

    .btn-pay-all,
    .btn-payment {
        font-size: 1rem;
        padding: 14px;
    }

    #btn-nova-busca {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .total-and-button {
        gap: 8px;
    }

    .debt-summary-footer {
        padding-top: 8px;
        gap: 6px;
    }
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.debt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.debt-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.debt-card:hover {
    transform: translateY(-3px);
}

.debt-card.paid {
    background: #f0fff4;
    opacity: 0.8;
}

.debt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.debt-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.debt-card-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.debt-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 10px;
}

.debt-card-status {
    font-weight: 600;
    margin-top: 8px;
    color: var(--warning-color);
}

.debt-card-status.paid {
    color: var(--success-color);
}

.debt-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.resumo-debitos-tabela {
    background-color: var(--bg-secondary);
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.resumo-debitos-tabela th,
.resumo-debitos-tabela td {
    padding: 10px;
    text-align: center;
}

.resumo-debitos-tabela th {
    background-color: white;
    font-weight: bold;
}

.icon-and-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.debt-summary-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0;
}

.debt-summary-footer {
    margin-top: 1rem;
    border-top: 1px solid #ddd;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.select-all-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #444;
}

.total-and-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.total-label {
    font-size: 1rem;
    font-weight: 600;
}

#btn-gerar-pagamento {
    background-color: #0069d9;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.select-all-wrapper,
.total-label,
#btn-gerar-pagamento,
#btn-pay-all-summary {
    font-size: 1.05rem;
}

.debt-table tr.pending {
    background-color: #fff9e6;
}

/* AJUSTES EXTRAS PARA MELHORAR MOBILE */

@media (max-width: 768px) {
    .debt-table-container {
        overflow-x: auto;
        width: 100%;
    }

    .debt-table {
        min-width: 640px;
        /* força scroll horizontal */
    }

    .search-form {
        flex-direction: column;
        gap: 10px;
    }

    .form-group {
        width: 100%;
    }

    .btn-primary {
        width: 100%;
        font-size: 1.05rem;
        padding: 14px;
    }

    .hero-title {
        font-size: 1.4rem;
        padding: 0 10px;
    }

    .hero-desc {
        font-size: 1rem;
        padding: 0 10px;
    }

    .vehicle-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card,
    .search-section,
    .header {
        padding: 16px;
    }

    .resumo-debitos-tabela {
        display: block;
        overflow-x: auto;
        width: 100%;
    }

    .resumo-debitos-tabela table {
        min-width: 600px;
    }

    .btn-pay-all,
    .btn-payment,
    .btn-copy {
        width: 100%;
        justify-content: center;
    }

    .modal {
        padding: 0 !important;
    }

    .modal-body {
        padding: 16px !important;
    }

    .qr-code {
        width: 160px;
        height: auto;
    }

    .total-and-button {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #btn-pay-all-summary {
        font-size: 1rem;
    }

    .total-label {
        font-size: 1.1rem;
        text-align: center;
    }

    .total-count {
        text-align: center;
    }
}