:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #a855f7;
    --bg-body: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --border: rgba(203, 213, 225, 0.6);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 16px;
    --glass: rgba(255, 255, 255, 0.75);
    --input-bg: #f8fafc;
    --modal-bg: rgba(255, 255, 255, 0.98);
}

.dark-mode {
    --bg-body: #0b0f19;
    --bg-card: rgba(18, 24, 38, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.09);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --glass: rgba(18, 24, 38, 0.82);
    --input-bg: rgba(30, 41, 59, 0.8);
    --modal-bg: rgba(18, 24, 38, 0.96);
}

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

#c {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -3; /* Shifted deeper */
    pointer-events: none;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    isolation: isolate; /* Ensures z-index -1 logic works correctly across all browsers */
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.4); /* 40% opacity white overlay */
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    opacity: 0.3; /* Increased for better visibility on all monitors */
    background-image: radial-gradient(var(--primary) 1.5px, transparent 1.5px);
    background-size: 32px 32px;
    animation: moveBg 60s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes moveBg {
    from { background-position: 0 0; }
    to { background-position: 100px 100px; }
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    animation: fadeIn 0.5s ease-out;
}

/* Auth Pages */
.auth-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.auth-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3.5rem;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: fadeIn 0.8s ease-out;
    z-index: 10;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, #6366f1, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    font-weight: 500;
}

.form-group-login {
    margin-bottom: 1.5rem;
}

.form-group-login label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon svg {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.input-with-icon input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3.25rem;
    border-radius: 16px;
    border: 1.5px solid var(--border);
    background: white;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.input-with-icon input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-with-icon input:focus + svg {
    color: var(--primary);
}

.error-text {
    color: var(--danger);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    margin-top: 1.25rem;
    background: rgba(239, 68, 68, 0.05);
    padding: 0.75rem;
    border-radius: 10px;
}

.badge-overdue {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.recurring-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.auth-footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.04em;
    margin-bottom: 0.25rem;
}

.header-search input {
    width: 100%;
    padding: 0.875rem 1.5rem 0.875rem 3rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--glass);
    backdrop-filter: blur(8px);
    outline: none;
    transition: all 0.3s;
}

.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.header-search svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

.sidebar-kpis {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 2rem;
}

.stat-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.25rem 1.5rem;
    border-radius: 18px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
}

.stat-card.paid::before { background: var(--success); }
.stat-card.pending::before { background: var(--warning); }
.stat-card.overdue::before { background: var(--danger); }

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.stat-card .icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}

/* Modern Card for List */

.card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2.5rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-main);
}

/* Common Cards */
.card {
    background: var(--glass);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-navigator {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.4rem 0.75rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.nav-btn {
    background: white;
    border: 1px solid var(--border);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

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

.month-label {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    min-width: 130px;
    text-align: center;
    text-transform: capitalize;
    letter-spacing: -0.01em;
}

/* Tables */
th {
    background: rgba(248, 250, 252, 0.5);
    padding: 1.25rem 2rem;
}

td {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.3);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(to right, #6366f1, #a855f7);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
}

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

.btn-outline:hover {
    background: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Status Badges */
.status-badge {
    padding: 0.375rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.025em;
}

.badge-pending { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-paid { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-overdue { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 28px;
    width: 95%;
    max-width: 580px;
    position: relative;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.modal h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.form-group {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    font-size: 0.935rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0;
}

.form-group textarea {
    grid-column: 2;
}

.form-group:has(textarea) {
    align-items: start;
}

.form-group:has(textarea) label {
    padding-top: 0.75rem;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

/* Utilities */
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.actions {
    display: flex;
    gap: 0.75rem;
}

.btn-icon {
    padding: 0.625rem;
    border-radius: 12px;
    cursor: pointer;
    background: white;
    color: var(--text-muted);
    border: 1px solid #e2e8f0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-icon.btn-notify:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

th, td {
    text-align: left;
    padding: 1.25rem 1rem;
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
}

td {
    font-size: 0.935rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

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

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 2.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0; width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #f1f5f9;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #e2e8f0;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.form-control {
    border: 1px solid #94a3b8;
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s;
}

.form-control:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

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

@keyframes pulse-update {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.kpi-card-animate {
    animation: pulse-update 0.4s ease-out;
}

[style*="animation"] {
    will-change: transform, opacity;
}
/* Modern Modal Form */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-form .form-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-form label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    padding-left: 0.25rem;
}

.modal-form .form-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 1.25rem;
}

@media (max-width: 480px) {
    .modal-form .form-grid {
        grid-template-columns: 1fr;
    }
}

.currency-amount-group {
    display: flex;
    gap: 0.5rem;
}

.currency-select {
    width: 80px;
    flex-shrink: 0;
    cursor: pointer;
    background-color: #fff;
}

/* Redesigned Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    transition: all 0.2s;
}

.checkbox-wrapper:hover {
    background: rgba(99, 102, 241, 0.08);
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.checkbox-title {
    font-size: 0.935rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
}

.checkbox-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.checkbox-wrapper .checkmark {
    position: relative;
    display: inline-block;
    top: 3px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.checkbox-wrapper input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-wrapper .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper input:checked ~ .checkmark:after {
    display: block;
}

/* ==========================================================================
   MODO OSCURO (DARK MODE)
   ========================================================================== */

body.dark-mode {
    background-color: var(--bg-body);
    color: var(--text-main);
}

body.dark-mode::before {
    background: rgba(11, 15, 25, 0.72);
}

body.dark-mode::after {
    opacity: 0.18;
    background-image: radial-gradient(rgba(129, 140, 248, 0.45) 1.5px, transparent 1.5px);
}

/* Header & Welcome */
.dark-mode header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-mode header h1 {
    color: #f8fafc;
}

.dark-mode #welcomeMsg {
    color: #94a3b8 !important;
}

/* Header Search */
.dark-mode .header-search input {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

.dark-mode .header-search input:focus {
    background: rgba(30, 41, 59, 0.95);
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

.dark-mode .header-search svg {
    color: #94a3b8;
}

/* KPI Cards */
.dark-mode .stat-card {
    background: rgba(18, 24, 38, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.dark-mode .stat-card .label {
    color: #94a3b8;
}

.dark-mode .stat-card .value {
    color: #f8fafc;
}

/* Payment List Card */
.dark-mode .card {
    background: rgba(18, 24, 38, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

.dark-mode .card-header {
    background: rgba(30, 41, 59, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-mode .card-header h2 {
    color: #f8fafc;
}

.dark-mode .month-navigator {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
}

.dark-mode .nav-btn {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

.dark-mode .nav-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.dark-mode .month-label {
    color: #f8fafc;
}

/* Table */
.dark-mode th {
    background: rgba(15, 23, 42, 0.7);
    color: #94a3b8;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.dark-mode td {
    color: #f1f5f9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-mode tr:hover td {
    background: rgba(255, 255, 255, 0.035);
}

/* Buttons */
.dark-mode .btn-outline {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

.dark-mode .btn-outline:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: #818cf8;
    color: #818cf8;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.dark-mode .btn-icon {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.dark-mode .btn-icon:hover {
    background: rgba(51, 65, 85, 1);
    border-color: #818cf8;
    color: #818cf8;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Badges */
.dark-mode .badge-pending {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.dark-mode .badge-paid {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.dark-mode .badge-overdue {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.dark-mode .recurring-badge {
    background: rgba(99, 102, 241, 0.22);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

/* Modals */
.dark-mode .modal-overlay {
    background: rgba(3, 7, 18, 0.75);
}

.dark-mode .modal {
    background: rgba(18, 24, 38, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.85);
}

.dark-mode .modal h2,
.dark-mode .modal h3 {
    color: #f8fafc;
}

.dark-mode .modal-form label {
    color: #cbd5e1;
}

.dark-mode .modal-close {
    color: #94a3b8;
}

.dark-mode .modal-close:hover {
    color: #f8fafc;
}

.dark-mode .form-control {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fafc;
}

.dark-mode .form-control:focus {
    background: rgba(30, 41, 59, 1);
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

.dark-mode .currency-select {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.14);
}

.dark-mode .currency-select option {
    background-color: #1e293b;
    color: #f8fafc;
}

.dark-mode .checkbox-wrapper {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .checkbox-wrapper:hover {
    background: rgba(99, 102, 241, 0.16);
}

.dark-mode .checkbox-wrapper .checkmark {
    background-color: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.22);
}

.dark-mode .checkbox-title {
    color: #f8fafc !important;
}

.dark-mode #usersModal .modal-form {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Auth Login Page */
.dark-mode .auth-card {
    background: rgba(18, 24, 38, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.dark-mode .form-group-login label {
    color: #cbd5e1;
}

.dark-mode .input-with-icon input {
    background: rgba(30, 41, 59, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

.dark-mode .input-with-icon input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

.dark-mode .input-with-icon input::placeholder {
    color: #64748b;
}

.dark-mode .auth-header p {
    color: #94a3b8;
}

.dark-mode .auth-footer {
    color: #64748b;
}

/* Scrollbars */
.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   THEME TOGGLE BUTTON & AUTH TOP ACTIONS
   ========================================================================== */

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    transform: rotate(15deg) scale(1.06);
}

.theme-icon-sun {
    color: #f59e0b;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
}

.theme-icon-moon {
    color: #6366f1;
}

.dark-mode .theme-icon-moon {
    color: #818cf8;
}

.auth-top-actions {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 20;
}

/* ==========================================================================
   EXCEL EXPORT COMPONENT STYLES
   ========================================================================== */

.btn-excel {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.btn-excel:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    transform: translateY(-2px);
    color: white !important;
}

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

.btn-excel-quick {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.825rem;
    font-weight: 700;
    border-radius: 10px;
    color: #059669;
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.08);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-excel-quick:hover {
    background: #10b981;
    color: white;
    border-color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.dark-mode .btn-excel-quick {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
}

.dark-mode .btn-excel-quick:hover {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.export-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 540px) {
    .export-cards-grid {
        grid-template-columns: 1fr;
    }
}

.export-card-option {
    background: rgba(248, 250, 252, 0.9);
    border: 1.5px solid rgba(203, 213, 225, 0.8);
    border-radius: 18px;
    padding: 1.5rem 1.25rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    position: relative;
}

.export-card-option:hover {
    border-color: #10b981;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgba(16, 185, 129, 0.22);
    background: rgba(240, 253, 244, 0.7);
}

.dark-mode .export-card-option {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.12);
}

.dark-mode .export-card-option:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    box-shadow: 0 12px 24px -6px rgba(16, 185, 129, 0.3);
}

.export-card-option .option-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(16, 185, 129, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
}

.export-card-option h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.export-card-option p {
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.export-card-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.dark-mode .export-card-badge {
    color: #34d399;
}

