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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:where(img, video, canvas, svg) {
    max-width: 100%;
    height: auto;
}

:where(pre, code) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

:where(input, select, textarea, button) {
    max-width: 100%;
}

:root {
    /* Colors */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --accent-color: #7c3aed;
    --accent-dark: #6d28d9;
    --accent-light: #8b5cf6;
    --success-color: #16a34a;
    --success-light: #22c55e;
    --success-dark: #15803d;
    --success-surface: #dcfce7;
    --danger-color: #dc2626;
    --danger-light: #ef4444;
    --danger-lighter: #f87171;
    --danger-dark: #b91c1c;
    --warning-color: #f59e0b;
    --warning-surface: #fef3c7;
    --warning-dark: #d97706;
    --warning-hover: #fbbf24;
    
    /* Alert */
    --alert-title: #92400e;
    --alert-text: #78350f;
    
    /* Secondary / Neutral */
    --secondary-color: #475569;
    --secondary-dark: #334155;
    --archived-bg: #f3f4f6;
    --archived-border: #9ca3af;
    --archived-bg-hover: #e5e7eb;
    --archived-border-hover: #6b7280;
    --archived-badge: #6b7280;
    
    /* Backgrounds */
    --background: #f1f5f9;
    --card-bg: #ffffff;
    --modal-overlay: rgba(0, 0, 0, 0.5);
    
    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Shadows */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Transitions */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.loading {
    overflow: hidden;
}

body.loaded {
    overflow: auto;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    touch-action: none;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f766e;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
    animation: fadeInUp 0.6s ease-out;
}

.loading-logo {
    font-size: 72px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.loading-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 30px;
    font-weight: 400;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    will-change: transform;
}

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

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-content p {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    opacity: 0.95;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--primary-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    font-size: 2.25rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: pulse 3s ease-in-out infinite;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid rgba(255,255,255,0.4);
    text-transform: uppercase;
}

.user-email {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
    transition: background-color var(--transition-fast);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.25);
}

.btn-menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.btn-menu-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.app-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    z-index: 2100;
}

.app-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 340px);
    height: 100vh;
    height: 100dvh;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 2200;
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.app-menu.open {
    transform: translateX(0);
}

.app-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.7rem;
}

.app-menu-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.btn-menu-close {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    cursor: pointer;
}

.app-menu-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.app-menu-link {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    font-weight: 600;
    background: var(--card-bg);
    transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.app-menu-link:hover {
    border-color: #8fd5cd;
    background: #f8fbff;
    transform: translateX(2px);
}

.app-menu-link-button {
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.15rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.version-badge {
    display: inline-block;
    background: rgba(139, 92, 246, 0.3);
    color: white;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid rgba(139, 92, 246, 0.5);
    vertical-align: middle;
}

.login-version {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.beta-badge {
    display: inline-block;
    background: #f59e0b;
    color: white;
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    font-weight: 400;
}

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.clients-card {
    border: none;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.total-debt {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Cards de Totais */
.totals-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.total-card {
    background: var(--card-bg);
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.total-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.total-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.total-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.total-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.debt-card {
    border-left: none;
    background: #fff5f5;
}

.debt-card::before {
    background: var(--danger-light);
}

.total-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.debt-card .total-value {
    color: #dc2626;
}

.activity-card {
    box-shadow: var(--shadow-md);
}

.activity-header {
    align-items: flex-start;
}

.activity-summary {
    font-size: 0.84rem;
    color: var(--text-secondary);
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.activity-main {
    min-width: 0;
    flex: 1;
}

.activity-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.18rem;
}

.activity-type {
    font-weight: 700;
    color: var(--text-primary);
}

.activity-amount {
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
}

.activity-amount.in {
    color: var(--success-dark);
}

.activity-amount.out {
    color: var(--danger-color);
}

.activity-client {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.activity-description {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.45;
    word-break: break-word;
}

.activity-date {
    color: var(--text-secondary);
    font-size: 0.78rem;
    white-space: nowrap;
}

.history-page .container {
    max-width: 860px;
}

.history-page .history-toolbar {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.history-page .history-toolbar .btn {
    min-height: 42px;
}

.history-controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.history-limit-label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.history-limit {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    background: var(--card-bg);
    color: var(--text-primary);
    min-width: 180px;
}

.history-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Alert Banner */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
    animation: slideIn 0.3s ease-out;
}

.clickable-alert {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.clickable-alert:hover {
    background: #fde68a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.clickable-alert .alert-content {
    pointer-events: none;
}

.clickable-alert .alert-icon {
    pointer-events: none;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
    color: var(--text-primary);
}

.alert-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--alert-title);
}

.alert-content span {
    font-size: 0.95rem;
    color: var(--alert-text);
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--alert-title);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color var(--transition-fast);
    flex-shrink: 0;
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.checkbox-label:hover {
    background: #e2e8f0;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-wrapper input {
    width: 100%;
}

.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
}

.suggestions-dropdown.show {
    display: block;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

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

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--background);
}

.suggestion-item.new-client {
    color: var(--success-color);
    font-weight: 600;
}

.suggestion-item.new-client:hover {
    background: var(--success-surface);
}

.client-debt-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.client-debt-preview.has-debt {
    color: var(--danger-color);
}

input, select, textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px; /* 16px evita zoom automático no iOS */
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--card-bg);
    color: var(--text-primary);
}

/* Manter aparência nativa dos checkboxes */
input[type="checkbox"] {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    padding: 0;
    border: none;
    border-radius: 0;
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.filter-search-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filter-checkbox-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    user-select: none;
    position: relative;
}

.filter-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.filter-checkbox-label span {
    font-weight: 500;
}

.filter-checkbox-label:hover span {
    color: var(--primary-color);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), opacity var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
    font-family: inherit;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

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

.btn-primary:hover {
    background: var(--primary-light);
}

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

.btn-success:hover {
    background: var(--success-light);
}

.btn-payment-action {
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.28);
}

.btn-sale-action {
    background: #f59e0b;
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-sale-action:hover {
    background: #fbbf24;
}

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

.btn-danger:hover {
    background: var(--danger-light);
}

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

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

.clients-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 2rem;
    font-style: italic;
}

.empty-message::before {
    content: '💭';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    font-style: normal;
    opacity: 0.4;
    animation: pulse 3s ease-in-out infinite;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.client-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.client-item:hover {
    border-color: var(--primary-light);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.client-item:hover::before {
    opacity: 1;
}

.client-item.has-notes {
    background: #fef3c7;
    border-color: #f59e0b;
    border-left-width: 4px;
}

.client-item.has-notes:hover {
    border-color: #d97706;
    background: #fde68a;
}

.overdue-indicator {
    display: inline-block;
    font-size: 0.8rem;
    cursor: help;
    color: var(--warning-dark, #d97706);
}

.client-overdue-msg {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--warning-dark, #d97706);
    font-weight: 500;
}

.client-item.archived {
    opacity: 0.6;
    background: var(--archived-bg);
    border-color: var(--archived-border);
}

.client-item.archived:hover {
    opacity: 0.8;
    background: var(--archived-bg-hover);
    border-color: var(--archived-border-hover);
}

.archived-badge {
    display: inline-block;
    background: var(--archived-badge);
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.note-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 1rem;
    cursor: help;
}

.client-info {
    flex: 1;
}

.client-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.client-sales {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.client-debt {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--danger-color);
}

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

.client-debt.credit {
    color: var(--success-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-bg);
    margin: 3% auto;
    padding: 0;
    border-radius: 16px;
    max-width: 600px;
    max-height: 94vh;
    max-height: 94dvh;
    box-shadow: var(--shadow-xl);
    animation: slideDown var(--transition-normal);
    -webkit-overflow-scrolling: touch;
    will-change: transform, opacity;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: var(--primary-color);
    padding: 1.5rem 2rem;
    position: relative;
    flex-shrink: 0;
    z-index: 2;
    overflow: hidden;
}

.modal-fixed-section {
    flex-shrink: 0;
    padding: 1rem 2rem;
    background: var(--card-bg);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid var(--border-color);
    z-index: 1;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.client-modal-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.client-modal-tab {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.6rem 0.8rem;
    background: var(--background);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.client-modal-tab:hover {
    color: var(--text-primary);
    border-color: var(--primary-light);
}

.client-modal-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.client-modal-screen {
    display: none;
}

.client-modal-screen.active {
    display: block;
}

.modal-header .close {
    color: rgba(255,255,255,0.8);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-header .close:hover {
    color: white;
}

.modal-header .client-name-section {
    margin-bottom: 0;
    margin-right: 2.5rem;
}

.modal-header .editable-name {
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.modal-header .btn-edit-name {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.8);
}

.modal-header .btn-edit-name:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.6);
    color: white;
}

.modal-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-section-payment {
    border-left: 4px solid var(--success-color);
    background: linear-gradient(90deg, rgba(22, 163, 74, 0.1), rgba(22, 163, 74, 0));
}

.modal-section-sale {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0));
}

.modal-section:last-of-type {
    border-bottom: none;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--text-secondary);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
    z-index: 2;
}

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

.modal-content h2 {
    margin-top: 0;
    color: var(--primary-color);
}

/* Seção de nome do cliente com botão de edição */
.client-name-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    margin-right: 2.5rem;
}

.editable-name {
    margin: 0;
    flex: 1;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.btn-edit-name {
    background: transparent;
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
    flex-shrink: 0;
}

.btn-edit-name:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.btn-edit-name svg {
    display: block;
}

/* Formulário de edição inline */
.edit-name-form {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.edit-name-form input {
    margin-bottom: 0.75rem;
}

.edit-name-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

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

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.modal-debt {
    background: var(--danger-color);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    text-align: center;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
    word-break: break-word;
}

.modal-debt.has-credit {
    background: #16a34a;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.modal-debt.is-paid {
    background: #64748b;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.25);
}

.sales-history {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    margin: 0 2rem 0;
    background: var(--background);
}

.sale-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--card-bg);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: transform var(--transition-fast);
}

.sale-item:hover {
    transform: translateX(2px);
}

.sale-info {
    flex: 1;
}

.payment-item {
    border-left-color: var(--success-color);
}

.note-item {
    border-left-color: #f59e0b;
    background: #fef3c7;
}

.note-badge {
    display: inline-block;
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.sale-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.edited-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.sale-amount {
    font-weight: 600;
    font-size: 1.1rem;
    word-break: break-word;
}

.sale-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.sale-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-edit-sale:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.btn-delete-sale:hover {
    color: var(--danger-color);
    background: rgba(220, 38, 38, 0.1);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.modal-actions {
    margin-top: 0;
    padding: 1.5rem 2rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--background);
    border-radius: 0 0 16px 16px;
    flex-shrink: 0;
}

.modal-actions .btn {
    flex: 1 1 auto;
    min-width: 100px;
}

.settings-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.client-display-name-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.client-display-name-form label {
    font-weight: 600;
    color: var(--text-primary);
}

.client-display-name-form .btn {
    width: 100%;
}

#clientScreenSettings .modal-actions {
    border-top: none;
    border-radius: 0;
}

#clientScreenSettings .btn-settings-danger {
    flex: 1 1 100%;
}

/* Modal de edição pequeno */
.modal-content-small {
    max-width: 450px;
    padding: 2rem;
    display: block;
    overflow-y: auto;
}

.modal-content-small .close {
    position: absolute;
    top: 0.85rem;
    right: 1.15rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
}

.modal-content-small h2 {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    color: var(--text-primary);
    padding-right: 2rem;
}

.modal-content-small form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    overflow-x: hidden;
}

.modal-content-small input,
.modal-content-small textarea {
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
}

.modal-content-small form label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: -0.5rem;
}

#editSaleDescriptionWrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#editSaleDescription {
    min-height: 170px;
    line-height: 1.5;
    resize: vertical;
}

.modal-content-small .modal-actions {
    margin-top: 0.5rem;
    padding: 0;
    border-top: none;
    background: transparent;
    border-radius: 0;
}

@media (max-width: 600px) {
    .modal-content-small {
        margin: 0;
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom));
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .modal-content-small h2 {
        margin-bottom: 1rem;
        font-size: 1.25rem;
        padding-right: 2.6rem;
    }

    .modal-content-small .close {
        top: 0.65rem;
        right: 0.65rem;
    }

    .modal-content-small form {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: 0.25rem;
    }

    .modal-content-small form label {
        font-size: 0.95rem;
    }

    #editSaleDescription {
        min-height: 240px;
        max-height: 52vh;
    }

    .modal-content-small .modal-actions {
        position: sticky;
        bottom: 0;
        margin-top: auto;
        padding-top: 0.75rem;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        border-top: 1px solid var(--border-color);
        background: linear-gradient(180deg, rgba(255, 253, 249, 0.85) 0%, rgba(255, 253, 249, 0.98) 40%);
        backdrop-filter: blur(4px);
    }

    .modal-content-small .modal-actions .btn {
        min-height: 48px;
        font-size: 1rem;
    }
}

[data-theme="dark"] .modal-content-small .close {
    background: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .modal-content-small .modal-actions {
    background: linear-gradient(180deg, rgba(17, 28, 46, 0.84) 0%, rgba(17, 28, 46, 0.98) 40%);
}

/* Modal de Confirmação */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn var(--transition-fast);
}

.confirm-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.confirm-modal-content {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    animation: slideDown var(--transition-normal);
    text-align: center;
    border: 1px solid var(--border-color);
}

.confirm-modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.confirm-modal-content h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.4rem;
}

.confirm-modal-content p {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-modal-actions .btn {
    min-width: 120px;
}

/* Loader */
.loader-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loader-overlay.active {
    display: flex;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    will-change: transform;
}

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

.loader-text {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Toast de Sucesso */
.toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #16a34a;
    color: white;
    padding: 1rem 2rem;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.1) inset;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    transition: all var(--transition-normal) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 600;
    font-size: 1rem;
    opacity: 0;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
    justify-content: center;
}

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

.toast.toast-error {
    background: var(--danger-color);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsividade Mobile */
@media (max-width: 600px) {
    body {
        padding: 0.75rem;
    }

    header {
        border-radius: 12px;
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .header-brand {
        justify-content: center;
        width: 100%;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .header-logo {
        font-size: 1.75rem;
    }

    .user-info {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .user-avatar {
        display: none;
    }

    .user-email {
        max-width: 120px;
        font-size: 0.75rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .total-debt {
        width: 100%;
        text-align: center;
    }

    .total-value {
        font-size: 1.5rem;
    }

    .client-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .client-debt {
        align-self: flex-end;
    }

    .modal-content {
        margin: 0;
        padding: 0;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        width: 100%;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
        border-radius: 0;
    }

    .modal-fixed-section {
        padding: 0.75rem 1.5rem;
    }

    .modal-section {
        padding: 1.25rem 1.5rem;
    }

    .client-modal-tabs {
        padding: 0.65rem 1.5rem;
    }

    .client-modal-tab {
        font-size: 0.78rem;
        padding: 0.55rem 0.5rem;
    }

    .modal-actions {
        padding: 1.25rem 1.5rem;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
        border-radius: 0;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .modal-actions .btn {
        min-width: unset;
        flex: 1 1 auto;
    }

    .sales-history {
        margin: 0 1.5rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .btn-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-group .btn {
        width: 100%;
    }

    .login-container {
        padding: 2rem;
    }

    .login-logo {
        font-size: 3rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    /* Histórico de vendas em mobile */
    .sale-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .sale-actions {
        align-self: flex-end;
        width: 100%;
        justify-content: flex-end;
    }

    /* Alert banner mobile */
    .alert-banner {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }

    /* Confirm modal mobile */
    .confirm-modal-content {
        padding: 2rem 1.5rem;
        width: 92%;
    }

    .confirm-modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .confirm-modal-actions .btn {
        min-width: unset;
        width: 100%;
    }

    /* Filters mobile */
    .filter-checkbox-container {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .filter-fieldset {
        padding: 0.5rem 0.75rem 0.75rem;
    }

    /* Toast mobile */
    .toast {
        max-width: 92%;
        font-size: 0.9rem;
        padding: 0.875rem 1.25rem;
    }

    /* Collapsible form */
    .collapsible-summary h2 {
        font-size: 1.1rem;
    }

    /* Back to top */
    .back-to-top {
        bottom: max(1.25rem, env(safe-area-inset-bottom));
        right: 1.25rem;
    }

    /* Share button full width */
    .btn-share {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    body {
        padding: 0.5rem;
        font-size: 0.95rem;
    }

    header {
        padding: 0.875rem;
        border-radius: 10px;
    }

    header h1 {
        font-size: 1.1rem;
    }

    .header-logo {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .user-email {
        max-width: 100px;
        font-size: 0.7rem;
    }

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

    .card {
        padding: 1rem;
    }

    .card h2 {
        font-size: 1.1rem;
    }

    .total-value {
        font-size: 1.35rem;
    }

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

    .modal-content {
        margin: 0;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-fixed-section {
        padding: 0.75rem 1.25rem;
    }

    .modal-section {
        padding: 1rem 1.25rem;
    }

    .client-modal-tabs {
        padding: 0.6rem 1.25rem;
        gap: 0.4rem;
    }

    .client-modal-tab {
        font-size: 0.72rem;
        padding: 0.5rem 0.4rem;
    }

    .modal-actions {
        padding: 1rem 1.25rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .sales-history {
        margin: 0 1.25rem;
    }

    .client-name {
        font-size: 1rem;
    }

    .client-debt {
        font-size: 1.05rem;
    }

    .login-container {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .login-logo {
        font-size: 2.5rem;
    }

    /* Alert compact */
    .alert-banner {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .alert-content strong {
        font-size: 0.9rem;
    }

    .alert-content span {
        font-size: 0.85rem;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        margin: 2vh auto;
        max-height: 95vh;
        max-height: 95dvh;
        overflow-y: auto;
    }

    .login-screen {
        min-height: auto;
        padding: 1rem;
    }

    .login-container {
        padding: 1.5rem;
        max-width: 600px;
    }

    .login-logo {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    .login-header {
        margin-bottom: 1rem;
    }

    header {
        padding: 0.75rem 1rem;
    }

    .card {
        padding: 1rem;
    }
}

/* Tablets e telas médias */
@media (min-width: 601px) and (max-width: 900px) {
    .container {
        max-width: 700px;
    }

    .card {
        padding: 1.5rem;
    }

    .modal-content {
        max-width: 500px;
        margin: 5% auto;
    }
}

/* Telas extra pequenas */
@media (max-width: 360px) {
    body {
        font-size: 0.9rem;
        padding: 0.375rem;
    }

    .card {
        padding: 0.875rem;
        border-radius: 10px;
    }

    header {
        padding: 0.75rem;
        border-radius: 8px;
    }

    header h1 {
        font-size: 1rem;
    }

    .version-badge {
        font-size: 0.5rem;
        padding: 0.15rem 0.35rem;
    }

    .user-email {
        display: none;
    }

    .modal-content {
        padding: 0;
        margin: 0;
    }

    .modal-header {
        padding: 0.875rem 1rem;
    }

    .modal-section {
        padding: 0.875rem 1rem;
    }

    .client-modal-tabs {
        padding: 0.5rem 1rem;
        gap: 0.35rem;
    }

    .client-modal-tab {
        font-size: 0.68rem;
        padding: 0.45rem 0.35rem;
    }

    .modal-fixed-section {
        padding: 0.5rem 1rem;
    }

    .modal-actions {
        padding: 0.875rem 1rem;
        padding-bottom: max(0.875rem, env(safe-area-inset-bottom));
        gap: 0.5rem;
    }

    .sales-history {
        margin: 0 1rem;
        padding: 0.5rem;
    }

    .sale-item {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .total-value {
        font-size: 1.2rem;
    }

    .total-card {
        padding: 1rem;
    }

    .confirm-modal-content {
        padding: 1.5rem 1rem;
        width: 95%;
    }

    .confirm-modal-content h3 {
        font-size: 1.2rem;
    }

    .login-container {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .login-logo {
        font-size: 2rem;
    }

    .login-header h1 {
        font-size: 1.3rem;
    }
}

/* Ajuste para telas muito altas (scrolling facilitado) */
@media (min-height: 800px) {
    .modal-content {
        margin: 10% auto;
    }
}

/* Login Screen */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--primary-color);
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.login-container {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.2);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255,255,255,0.3);
}

.login-logo {
    font-size: 4.5rem;
    text-align: center;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    animation: pulse 3s ease-in-out infinite;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-weight: 800;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Password toggle */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 3rem;
}

.btn-toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    line-height: 1;
    border-radius: 6px;
}

.btn-toggle-password:hover {
    opacity: 1;
}

/* Clients counter */
.clients-count {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Offline banner */
.offline-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ef4444;
    color: white;
    text-align: center;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.offline-icon {
    font-size: 1.1rem;
}

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

.login-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

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

.login-toggle {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-toggle a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.login-toggle a:hover {
    text-decoration: underline;
}

.btn-google {
    width: 100%;
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 600;
}

.btn-google:hover {
    background: var(--background);
    border-color: var(--text-secondary);
}

/* Collapsible Form */
.collapsible-form {
    border: none;
}

.collapsible-form > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapsible-form > summary::-webkit-details-marker {
    display: none;
}

.collapsible-form > summary::before {
    content: '▶';
    display: inline-block;
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
    color: var(--text-secondary);
}

.collapsible-form[open] > summary::before {
    transform: rotate(90deg);
}

.collapsible-form > summary h2 {
    margin: 0;
    display: inline;
}

.collapsible-form > form {
    margin-top: 1rem;
}

/* Fieldset for filters */
.filter-fieldset {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem 0.75rem;
    margin: 0;
}

.filter-legend {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: max(2rem, env(safe-area-inset-bottom));
    right: max(2rem, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast), transform var(--transition-fast);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
}

/* Histórico Header & Botão de Cobrança */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
    background: #22c55e;
}

.btn-share svg {
    flex-shrink: 0;
}

/* Search Input */
.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--background);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* Theme Toggle Button */
.btn-theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: all var(--transition-fast);
    padding: 0;
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.btn-theme-toggle:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

.theme-icon-light,
.theme-icon-dark {
    position: absolute;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

/* Light mode: show moon (to switch to dark) */
.theme-icon-light {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}
.theme-icon-dark {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Dark mode: show sun (to switch to light) */
[data-theme="dark"] .theme-icon-light {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
[data-theme="dark"] .theme-icon-dark {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --accent-color: #8b5cf6;
    --accent-dark: #7c3aed;
    --accent-light: #a78bfa;
    --success-color: #22c55e;
    --success-light: #4ade80;
    --success-dark: #16a34a;
    --success-surface: #14532d;
    --danger-color: #ef4444;
    --danger-light: #f87171;
    --danger-lighter: #fca5a5;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --warning-surface: #451a03;
    --warning-dark: #fbbf24;
    --warning-hover: #fde68a;
    --alert-title: #fbbf24;
    --alert-text: #fde68a;
    --secondary-color: #64748b;
    --secondary-dark: #475569;
    --archived-bg: #1e293b;
    --archived-border: #475569;
    --archived-bg-hover: #334155;
    --archived-border-hover: #64748b;
    --archived-badge: #64748b;
    --background: #0f172a;
    --card-bg: #1e293b;
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

[data-theme="dark"] header {
    background: #1e3a5f;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .modal-header {
    background: #1e3a5f;
}

[data-theme="dark"] .modal-fixed-section {
    background: var(--card-bg);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
    border-bottom-color: #334155;
}

[data-theme="dark"] .client-modal-tabs {
    background: var(--card-bg);
    border-bottom-color: #334155;
}

[data-theme="dark"] .client-modal-tab {
    background: #0f172a;
    border-color: #334155;
    color: var(--text-secondary);
}

[data-theme="dark"] .client-modal-tab:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
}

[data-theme="dark"] .client-modal-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .loading-screen {
    background: #134e4a;
}

[data-theme="dark"] .login-screen {
    background: #1e3a5f;
}

[data-theme="dark"] .login-container {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .debt-card {
    background: #451a1a;
}

[data-theme="dark"] .alert-banner {
    background: var(--warning-surface);
    border-left-color: var(--warning-color);
}

[data-theme="dark"] .alert-content strong {
    color: var(--alert-title);
}

[data-theme="dark"] .alert-content span {
    color: var(--alert-text);
}

[data-theme="dark"] .alert-close {
    color: var(--alert-title);
}

[data-theme="dark"] .clickable-alert:hover {
    background: #78350f;
}

[data-theme="dark"] .client-item {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .client-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-theme="dark"] .client-item.has-notes {
    background: var(--warning-surface);
    border-color: var(--warning-color);
}

[data-theme="dark"] .client-item.has-notes:hover {
    border-color: var(--warning-hover);
    background: #78350f;
}

[data-theme="dark"] .overdue-indicator,
[data-theme="dark"] .client-overdue-msg {
    color: #fbbf24;
}

[data-theme="dark"] .client-item.archived {
    opacity: 0.5;
    background: var(--archived-bg);
    border-color: var(--archived-border);
}

[data-theme="dark"] .checkbox-label:hover {
    background: #334155;
}

[data-theme="dark"] .suggestion-item:hover,
[data-theme="dark"] .suggestion-item.active {
    background: #334155;
}

[data-theme="dark"] .suggestion-item.new-client:hover {
    background: var(--success-surface);
}

[data-theme="dark"] .note-item {
    background: var(--warning-surface);
}

[data-theme="dark"] .btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-edit-sale:hover {
    background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .btn-delete-sale:hover {
    background: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .btn-google {
    background: #1e293b;
    color: var(--text-primary);
    border-color: #475569;
}

[data-theme="dark"] .btn-google:hover {
    background: #334155;
    border-color: #64748b;
}

[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .confirm-modal {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .modal-actions {
    background: #0f172a;
}

[data-theme="dark"] .sales-history {
    background: #0f172a;
}

[data-theme="dark"] .modal-section-payment {
    background: linear-gradient(90deg, rgba(22, 163, 74, 0.16), rgba(22, 163, 74, 0));
}

[data-theme="dark"] .modal-section-sale {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0));
}

[data-theme="dark"] .sale-item {
    background: var(--card-bg);
}

[data-theme="dark"] .search-input {
    background: var(--card-bg);
}

[data-theme="dark"] .btn-share {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .user-avatar {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

/* =========================================================
   UX Refresh v2.1 - usability-first visual redesign
   ========================================================= */

:root {
    --primary-color: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #14b8a6;
    --accent-color: #ea580c;
    --accent-dark: #c2410c;
    --success-color: #15803d;
    --danger-color: #b91c1c;
    --warning-color: #d97706;
    --background: #f6f3ee;
    --card-bg: #fffdf9;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: #e7dfd3;
    --shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
    --shadow-md: 0 18px 40px rgba(17, 24, 39, 0.12);
    --shadow-lg: 0 30px 60px rgba(17, 24, 39, 0.16);
}

body {
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(80rem 40rem at -10% -20%, rgba(20, 184, 166, 0.12), transparent 70%),
        radial-gradient(72rem 32rem at 120% -10%, rgba(234, 88, 12, 0.1), transparent 72%),
        linear-gradient(180deg, #f9f7f3 0%, #f4efe7 100%);
    min-height: 100vh;
}

header {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.96) 0%, rgba(17, 94, 89, 0.95) 55%, rgba(12, 74, 70, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header h1,
.login-header h1 {
    font-family: 'Sora', sans-serif;
    letter-spacing: -0.03em;
}

.subtitle {
    opacity: 0.92;
}

.container {
    max-width: 980px;
}

main {
    display: grid;
    gap: 1rem;
}

.card {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.card h2,
.modal-content h2,
.modal-content h3 {
    letter-spacing: -0.02em;
}

.collapsible-summary {
    padding: 0.25rem 0;
}

.collapsible-form > summary::before {
    color: var(--primary-color);
}

form {
    gap: 0.9rem;
}

input,
select,
textarea {
    border-width: 1.5px;
    border-radius: 12px;
    background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15);
}

.btn {
    border-radius: 12px;
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.btn-sale-action {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

.search-input {
    background: #ffffff;
    border-width: 1.5px;
}

.filter-fieldset {
    border-style: dashed;
    border-width: 1.5px;
    background: rgba(255, 255, 255, 0.7);
}

.filter-checkbox-container {
    gap: 0.6rem;
}

.filter-checkbox-label span {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.32rem 0.72rem;
    transition: all var(--transition-fast);
}

.filter-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-checkbox-label input[type="checkbox"]:checked + span {
    border-color: var(--primary-color);
    color: #ffffff;
    background: var(--primary-color);
}

.totals-container {
    margin-top: 0.25rem;
}

.debt-card {
    background: linear-gradient(140deg, #fff6f6 0%, #fffaf0 100%);
    border: 1px solid #f8d7d7;
}

.total-value {
    font-family: 'Sora', sans-serif;
}

.clients-list {
    gap: 0.85rem;
}

.client-item {
    border-radius: 14px;
    padding: 1rem 1.1rem;
    border: 1.5px solid var(--border-color);
    background: linear-gradient(180deg, #ffffff 0%, #fffcf8 100%);
}

.client-item::after {
    content: '›';
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-left: 0.75rem;
    align-self: center;
}

.client-item:hover {
    border-color: #8fd5cd;
    transform: translateX(2px) translateY(-1px);
}

.client-name {
    font-size: 1.04rem;
    font-weight: 800;
}

.client-debt {
    font-family: 'Sora', sans-serif;
    font-size: 1.08rem;
}

.client-overdue-msg {
    margin-top: 0.35rem;
}

.overdue-indicator {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

.client-item.has-notes {
    border-left-width: 5px;
}

.alert-banner {
    border-radius: 12px;
    border-left-width: 5px;
}

.modal {
    background-color: rgba(15, 23, 42, 0.52);
}

.modal-content {
    border: 1px solid var(--border-color);
}

.modal-header {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.98), rgba(17, 94, 89, 0.98));
}

.modal-debt {
    font-family: 'Sora', sans-serif;
    border-radius: 12px;
}

.sales-history {
    border-radius: 14px;
    border-width: 1.5px;
}

.sale-item {
    border-radius: 12px;
}

.modal-actions {
    background: linear-gradient(180deg, #fbfaf8 0%, #f6f1e8 100%);
}

.back-to-top {
    width: 50px;
    height: 50px;
    font-size: 1.35rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-screen {
    background:
        radial-gradient(80rem 40rem at -10% -20%, rgba(20, 184, 166, 0.3), transparent 70%),
        radial-gradient(72rem 32rem at 120% -10%, rgba(234, 88, 12, 0.28), transparent 72%),
        linear-gradient(135deg, #155e75 0%, #0f766e 60%, #115e59 100%);
}

.login-container {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-theme-toggle {
    border-width: 1.5px;
}

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

    .filter-checkbox-container {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
        padding-bottom: 0.2rem;
    }

    .client-item {
        padding: 0.95rem;
    }

    .client-item::after {
        display: none;
    }

    .client-debt {
        align-self: flex-start;
        margin-top: 0.2rem;
    }

    .btn,
    .btn-share,
    .client-modal-tab,
    .btn-theme-toggle,
    .btn-menu-toggle,
    .back-to-top {
        min-height: 44px;
    }
}

@media (max-width: 500px) {
    body {
        background:
            radial-gradient(60rem 28rem at -20% -20%, rgba(20, 184, 166, 0.12), transparent 70%),
            linear-gradient(180deg, #f9f6f0 0%, #f4efe7 100%);
    }

    .card {
        padding: 1rem;
    }

    .filter-checkbox-label span {
        font-size: 0.86rem;
    }

    .total-value {
        font-size: 1.35rem;
    }

    .activity-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .activity-date {
        align-self: flex-start;
    }

    .activity-summary {
        width: 100%;
        border-radius: 10px;
    }

    .history-controls {
        align-items: stretch;
    }

    .history-limit {
        width: 100%;
        min-width: 0;
    }
}

[data-theme="dark"] {
    --primary-color: #2dd4bf;
    --primary-dark: #14b8a6;
    --primary-light: #5eead4;
    --accent-color: #fb923c;
    --success-color: #4ade80;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --background: #0b1220;
    --card-bg: #111c2e;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border-color: #243246;
}

[data-theme="dark"] .activity-summary {
    background: #0f1a2d;
    border-color: #2a3c55;
}

[data-theme="dark"] .activity-item {
    background: linear-gradient(180deg, #111f34 0%, #0f1a2d 100%);
    border-color: #2a3c55;
}

[data-theme="dark"] .activity-amount.out {
    color: #fca5a5;
}

[data-theme="dark"] .btn-menu-toggle {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.28);
}

[data-theme="dark"] .app-menu {
    background: #0f1a2d;
    border-right-color: #2a3c55;
}

[data-theme="dark"] .app-menu-link {
    background: #111f34;
    border-color: #2a3c55;
}

[data-theme="dark"] .app-menu-link:hover {
    background: #14253d;
    border-color: #3c5a7e;
}

[data-theme="dark"] .history-limit {
    background: #0f1a2d;
    border-color: #2a3c55;
}

[data-theme="dark"] body {
    background:
        radial-gradient(80rem 40rem at -10% -20%, rgba(45, 212, 191, 0.16), transparent 70%),
        radial-gradient(72rem 32rem at 120% -10%, rgba(251, 146, 60, 0.14), transparent 72%),
        linear-gradient(180deg, #0a1322 0%, #0b1220 100%);
}

[data-theme="dark"] .debt-card {
    background: linear-gradient(140deg, #3b1111 0%, #3a1e11 100%);
    border-color: #5f2a2a;
}

[data-theme="dark"] .filter-fieldset,
[data-theme="dark"] .filter-checkbox-label span,
[data-theme="dark"] .search-input,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #0e1728;
}

[data-theme="dark"] .modal-actions {
    background: linear-gradient(180deg, #0e1728 0%, #0b1220 100%);
}

[data-theme="dark"] .overdue-indicator {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.4);
}
