[x-cloak] { display: none !important; }

* { -webkit-font-smoothing: antialiased; }

/* Instant tap feedback — visible the moment you touch a link/button, before any
   navigation or action happens. Matters most on full-page navigations, where the
   browser takes over immediately after and there's no time for anything fancier. */
.nav-link, .btn, button {
    -webkit-tap-highlight-color: transparent;
}
.nav-link:active, .btn:active:not(:disabled) {
    transform: scale(0.97);
    filter: brightness(0.95);
}
.nav-link, .btn {
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease, filter 0.1s ease, box-shadow 0.15s ease;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4b5563;
}
.nav-link svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.dark .nav-link { color: #d1d5db; }
.nav-link:hover { background-color: #f3f4f6; }
.dark .nav-link:hover { background-color: #2a3142; }
.nav-link-active {
    background-color: #f4f2fe;
    color: #4a3dd9;
}
.dark .nav-link-active {
    background-color: rgba(89, 79, 242, 0.18);
    color: #b0a2f7;
}

.card {
    background-color: #fff;
    border-radius: 1rem;
    border: 1px solid #eceef2;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.dark .card { background-color: #1a2030; border-color: #2a3142; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.55rem 1.1rem;
    border-radius: 0.65rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary {
    background: linear-gradient(135deg, #7052ed, #594ff2);
    color: #fff;
    box-shadow: 0 2px 8px rgba(89, 79, 242, 0.35);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(89, 79, 242, 0.45); filter: brightness(1.04); }
.btn-secondary { background-color: #f3f4f6; color: #111827; }
.btn-secondary:hover { background-color: #e5e7eb; }
.dark .btn-secondary { background-color: #2a3142; color: #f9fafb; }
.dark .btn-secondary:hover { background-color: #384056; }
.btn-danger { background-color: #dc2626; color: #fff; box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3); }
.btn-danger:hover { background-color: #b91c1c; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.input {
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.8rem;
    border-radius: 0.65rem;
    border: 1px solid #d9dce3;
    background-color: #fff;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dark .input { background-color: #131826; border-color: #384056; color: #f9fafb; }
.input:focus {
    outline: none;
    border-color: #7052ed;
    box-shadow: 0 0 0 3px rgba(89, 79, 242, 0.15);
}

.label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; color: #374151; }
.dark .label { color: #d1d5db; }

.table-wrap { overflow-x: auto; border-radius: 1rem; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.data-table th {
    text-align: left; padding: 0.75rem 1.1rem; font-weight: 600; font-size: 0.72rem;
    letter-spacing: 0.04em; text-transform: uppercase; color: #6b7280;
    border-bottom: 1px solid #eceef2; white-space: nowrap;
    position: sticky; top: 0; z-index: 1; background-color: #fff;
}
/* table.data-table th's own text-align beats Tailwind's .text-right utility on
   specificity alone (0,1,2 vs 0,1,0), silently breaking right-aligned numeric
   header columns app-wide. This rule re-establishes the override intentionally. */
table.data-table th.text-right { text-align: right; }
.dark table.data-table th { color: #9ca3af; border-color: #2a3142; background-color: #1a2030; }
table.data-table td { padding: 0.85rem 1.1rem; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.dark table.data-table td { border-color: #232a3a; }
table.data-table tbody tr:nth-child(even) td { background-color: #fafafc; }
.dark table.data-table tbody tr:nth-child(even) td { background-color: #171c29; }
table.data-table tr:hover td { background-color: #f4f3fe; }
.dark table.data-table tr:hover td { background-color: #1e2536; }
table.data-table tbody tr:last-child td { border-bottom: none; }

.chip {
    display: inline-flex; align-items: center; padding: 0.25rem 0.65rem; border-radius: 0.5rem;
    font-size: 0.78rem; font-weight: 600; background-color: #f3f4f6; color: #374151;
}
.dark .chip { background-color: #232a3a; color: #d1d5db; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: 0.55rem; color: #6b7280;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn svg { width: 1.05rem; height: 1.05rem; }
.icon-btn:hover { background-color: #eceef2; color: #374151; }
.dark .icon-btn { color: #9ca3af; }
.dark .icon-btn:hover { background-color: #2a3142; color: #f3f4f6; }
.icon-btn-danger:hover { background-color: #fee2e2; color: #b91c1c; }
.dark .icon-btn-danger:hover { background-color: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.badge {
    display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 9999px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.01em;
}
.badge-income { background-color: #dcfce7; color: #166534; }
.dark .badge-income { background-color: rgba(34, 197, 94, 0.15); color: #86efac; }
.badge-expense { background-color: #fee2e2; color: #991b1b; }
.dark .badge-expense { background-color: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.badge-transfer { background-color: #f4f2fe; color: #4a3dd9; }
.dark .badge-transfer { background-color: rgba(89, 79, 242, 0.18); color: #c7bdfb; }

.modal-backdrop {
    position: fixed; inset: 0; background-color: rgba(15, 17, 26, 0.55); backdrop-filter: blur(2px);
    z-index: 40; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-panel {
    background-color: #fff; border-radius: 1.1rem; width: 100%; max-width: 32rem;
    max-height: 90vh; overflow-y: auto; z-index: 50; box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
}
.dark .modal-panel { background-color: #1a2030; }
