﻿:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --success: #16a34a;
    --danger: #ef4444;
    --warning: #f59e0b;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 270px;
    --shadow: 0 10px 35px rgba(15, 23, 42, .07);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, .14);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #eef3f9;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    background: #eef3f9;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit !important;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 46px;
    border-color: var(--border);
    border-radius: 12px;
}

.form-control:focus,
.form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 .22rem rgba(37, 99, 235, .12);
}

.input-group > .form-control,
.input-group > .form-select {
    border-radius: 0 12px 12px 0 !important;
}

.input-group > .input-group-text {
    border-radius: 12px 0 0 12px !important;
    background: var(--surface-2);
}

.btn {
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-color: transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    border-color: transparent;
}

.text-bg-info {
    color: #075985 !important;
    background: #e0f2fe !important;
}

.app-layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 22px 18px;
    flex-direction: column;
    z-index: 1030;
    box-shadow: 10px 0 40px rgba(15, 23, 42, .04);
}

[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-left: none;
    border-right: 1px solid var(--border);
    box-shadow: -10px 0 40px rgba(15, 23, 42, .04);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 20px;
    border-bottom: 1px solid var(--border);
}

.brand img {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
}

.brand strong {
    display: block;
    font-size: 1.15rem;
    color: var(--text);
}

.brand small {
    color: var(--muted);
    font-size: .78rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 13px;
    color: #475569;
    transition: .2s ease;
}

.sidebar-nav a i {
    font-size: 1.1rem;
}

.sidebar-nav a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white;
    box-shadow: 0 10px 25px rgba(37, 99, 235, .22);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
}

.main-panel {
    min-height: 100vh;
    margin-right: var(--sidebar-width);
}

.topbar {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 28px;
    background: rgba(255,255,255,.93);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1010;
    backdrop-filter: blur(14px);
}

.topbar h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .84rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-wrap {
    padding: 26px;
    max-width: 1600px;
    margin: 0 auto;
}

.panel-card,
.summary-card,
.account-card,
.budget-card,
.debt-card,
.compare-card {
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel-card {
    padding: 20px;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading h2 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.panel-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .8rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.summary-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    position: relative;
}

.summary-card::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    left: -34px;
    bottom: -52px;
    opacity: .08;
    background: currentColor;
}

.summary-icon {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    flex: 0 0 auto;
}

.summary-card span {
    color: var(--muted);
    font-size: .82rem;
    display: block;
}

.summary-card strong {
    display: inline-block;
    font-size: 1.4rem;
    line-height: 1.4;
    margin-top: 3px;
}

.summary-card small {
    color: var(--muted);
    margin-right: 4px;
}

.balance-card .summary-icon { background: #eff6ff; color: #2563eb; }
.income-card .summary-icon { background: #ecfdf5; color: #16a34a; }
.expense-card .summary-icon { background: #fef2f2; color: #ef4444; }
.net-card .summary-icon { background: #f5f3ff; color: #7c3aed; }

.chart-container {
    position: relative;
    width: 100%;
}

.chart-large { height: 330px; }
.chart-medium { height: 280px; }
.chart-donut { height: 215px; }

.chart-legend-list,
.report-category-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.chart-legend-list > div,
.report-category-list > a,
.report-category-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .82rem;
}

.chart-legend-list strong,
.report-category-list strong,
.report-category-row strong {
    margin-right: auto;
    color: var(--text);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}


.account-list,
.transaction-list,
.reminder-mini-list,
.device-list {
    display: grid;
    gap: 8px;
}

.account-row,
.transaction-row,
.reminder-mini-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    transition: .2s ease;
}

.account-row:hover,
.transaction-row:hover,
.reminder-mini-row:hover {
    background: var(--surface-2);
}

.account-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--account-color) 12%, white);
    color: var(--account-color);
    flex: 0 0 auto;
}

.account-name,
.transaction-title {
    flex: 1;
    min-width: 0;
}

.account-name strong,
.transaction-title strong {
    display: block;
    font-size: .9rem;
}

.account-name small,
.transaction-title small {
    color: var(--muted);
    font-size: .74rem;
    display: block;
    margin-top: 3px;
}

.account-balance {
    font-size: .9rem;
}

.transaction-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.transaction-icon.mini {
    width: 36px;
    height: 36px;
    border-radius: 11px;
}

.transaction-icon.income { background: #ecfdf5; color: #16a34a; }
.transaction-icon.expense { background: #fef2f2; color: #ef4444; }
.transaction-icon.transfer { background: #eff6ff; color: #2563eb; }

.transaction-amount {
    font-weight: 800;
    direction: ltr;
}

.reminder-mini-row {
    border-bottom: 1px dashed var(--border);
}

.reminder-mini-row:last-child {
    border-bottom: none;
}

.reminder-mini-row > span:nth-child(2) {
    flex: 1;
}

.reminder-mini-row strong,
.reminder-mini-row small {
    display: block;
}

.reminder-mini-row small {
    color: var(--muted);
    font-size: .75rem;
    margin-top: 3px;
}

.reminder-type {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #fff7ed;
    color: #f97316;
}

.budget-values,
.budget-card-values {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    font-size: .78rem;
}

.progress-thick {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-3);
}

.progress-thick .progress-bar {
    border-radius: 999px;
}

.page-actions,
.form-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.page-actions h2,
.form-page-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.page-actions p,
.form-page-header p {
    color: var(--muted);
    margin: 5px 0 0;
    font-size: .84rem;
}

.form-page {
    max-width: 920px;
    margin: 0 auto;
}

.form-card {
    padding: 26px;
}

.filter-card {
    padding: 16px;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

.finance-table {
    margin: 0;
}

.finance-table th {
    background: var(--surface-2);
    color: #475569;
    font-size: .78rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    white-space: nowrap;
}

.finance-table td {
    border-color: #eef2f7;
    padding: 13px 16px;
    font-size: .84rem;
}

.table-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-title strong,
.table-title small {
    display: block;
}

.table-title small {
    color: var(--muted);
    font-size: .72rem;
}

.account-card {
    min-height: 220px;
    padding: 22px;
    color: white;
    background:
        radial-gradient(circle at 15% 15%, rgba(255,255,255,.25), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--account-color) 92%, #111827), var(--account-color));
    position: relative;
    overflow: hidden;
    border: none;
}

.account-card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    border: 22px solid rgba(255,255,255,.08);
    border-radius: 50%;
    left: -50px;
    bottom: -90px;
}

.account-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-card-top > span {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,.17);
    font-size: 1.3rem;
}

.account-card h3 {
    font-size: 1.1rem;
    margin: 22px 0 4px;
}

.account-card p {
    opacity: .78;
    font-size: .78rem;
    min-height: 20px;
}

.account-card > strong {
    font-size: 1.55rem;
    direction: ltr;
    display: inline-block;
}

.account-card > strong small {
    font-size: .75rem;
    opacity: .76;
}

.card-last4 {
    margin-top: 16px;
    letter-spacing: 4px;
    direction: ltr;
    text-align: right;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: .2s ease;
}

.category-item:hover {
    border-color: #bfdbfe;
    background: var(--primary-soft);
}

.category-item > span {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: white;
    border-radius: 12px;
}

.category-item strong {
    font-size: .85rem;
}

.category-item small {
    margin-right: auto;
    color: var(--danger);
}

.transaction-type-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.type-tab input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.type-tab span {
    min-height: 54px;
    border: 1px solid var(--border);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: .2s;
}

.type-tab.income input:checked + span {
    color: #15803d;
    border-color: #86efac;
    background: #f0fdf4;
}

.type-tab.expense input:checked + span {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.type-tab.transfer input:checked + span {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.reminder-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-chip {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: white;
    color: #475569;
    font-size: .8rem;
}

.quick-chip:hover {
    border-color: #93c5fd;
    color: var(--primary);
}

.reminder-list {
    display: grid;
    gap: 14px;
}

.reminder-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: .2s ease;
}

.reminder-card:hover {
    transform: translateY(-2px);
}

.reminder-card.overdue {
    border-color: #fecaca;
    background: linear-gradient(90deg, white, #fff7f7);
}

.reminder-card.done {
    opacity: .65;
}

.reminder-card.focused {
    outline: 3px solid rgba(37, 99, 235, .18);
    border-color: #60a5fa;
}

.reminder-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.25rem;
    flex: 0 0 auto;
}

.reminder-card-icon.type-2 { background: #fef3c7; color: #b45309; }
.reminder-card-icon.type-3 { background: #fff7ed; color: #ea580c; }
.reminder-card-icon.type-4 { background: #ecfdf5; color: #059669; }
.reminder-card-icon.type-5 { background: #f5f3ff; color: #7c3aed; }
.reminder-card-icon.type-6 { background: #fef2f2; color: #dc2626; }

.reminder-card-content {
    flex: 1;
    min-width: 0;
}

.reminder-card h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.reminder-card p {
    color: var(--muted);
    font-size: .8rem;
    margin: 5px 0 0;
}

.reminder-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.reminder-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    color: #475569;
    font-size: .78rem;
    margin: 14px 0;
}

.reminder-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sync-box,
.settings-info,
.setup-note {
    padding: 14px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.sync-box small {
    display: block;
    color: var(--muted);
    margin-top: 6px;
}

.budget-card {
    padding: 18px;
}

.budget-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.budget-card-title > span {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: white;
}

.budget-card-title h3 {
    margin: 0;
    font-size: .95rem;
}

.budget-card-title small {
    color: var(--muted);
}

.budget-card-title form {
    margin-right: auto;
}

.debt-card {
    padding: 20px;
}

.debt-card.closed {
    opacity: .68;
}

.debt-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.debt-card-head h3 {
    margin: 0;
    font-size: 1rem;
}

.debt-card-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .78rem;
}

.debt-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: grid;
    place-items: center;
}

.debt-icon.payable { background: #fef2f2; color: #ef4444; }
.debt-icon.receivable { background: #ecfdf5; color: #16a34a; }

.debt-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.debt-values > div {
    background: var(--surface-2);
    border-radius: 12px;
    padding: 10px;
}

.debt-values span,
.debt-values strong {
    display: block;
}

.debt-values span {
    color: var(--muted);
    font-size: .72rem;
}

.debt-values strong {
    margin-top: 4px;
    font-size: .87rem;
}

.debt-due {
    margin-top: 14px;
    color: #475569;
    font-size: .8rem;
}

.debt-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.compare-card {
    padding: 20px;
}

.compare-card.difference {
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
}

.compare-card h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.compare-card > div {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
}

.settings-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.device-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.device-row strong,
.device-row small {
    display: block;
}

.device-row small {
    color: var(--muted);
    font-size: .7rem;
}

.device-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--primary);
}

.empty-state,
.empty-mini {
    text-align: center;
    color: var(--muted);
}

.empty-state {
    padding: 55px 20px;
}

.empty-state.compact {
    padding: 25px 10px;
}

.empty-state > i {
    display: block;
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 14px;
}

.empty-state h3 {
    color: var(--text);
    font-size: 1.05rem;
}

.empty-mini {
    padding: 30px 10px;
    font-size: .82rem;
}

.empty-mini i {
    display: block;
    font-size: 2rem;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.auth-page {
    min-height: 100vh;
    padding: 25px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 10% 10%, rgba(56,189,248,.24), transparent 28%),
        radial-gradient(circle at 90% 90%, rgba(139,92,246,.28), transparent 30%),
        linear-gradient(135deg, #0f172a, #1e3a8a);
}

.auth-card {
    width: min(100%, 460px);
    background: rgba(255,255,255,.97);
    padding: 30px;
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
}

.setup-card {
    width: min(100%, 720px);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.auth-brand img {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(37,99,235,.25);
}

.auth-brand h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.auth-brand p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.login-duration {
    padding: 13px;
    background: var(--surface-2);
    border-radius: 14px;
    color: var(--muted);
    font-size: .75rem;
}

.login-duration > div {
    display: flex;
    gap: 8px;
    padding: 4px;
}

.mobile-nav,
.floating-add {
    display: none;
}

.mobile-transaction-cards {
    padding: 10px;
}

.mobile-transaction-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
}

.mobile-transaction-card strong,
.mobile-transaction-card small {
    display: block;
}

.mobile-transaction-card small {
    color: var(--muted);
    font-size: .7rem;
    margin-top: 3px;
}

.alert {
    border-radius: 14px;
}

code {
    direction: ltr;
    display: inline-block;
}

@media (max-width: 1199.98px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .main-panel {
        margin-right: 0;
    }

    .topbar {
        min-height: 72px;
        padding: 12px 16px;
    }

    .topbar h1 {
        font-size: 1.05rem;
    }

    .topbar p {
        font-size: .72rem;
    }

    .content-wrap {
        padding: 16px 14px 28px;
    }

    .mobile-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        min-height: 66px;
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255,255,255,.97);
        border-top: 1px solid var(--border);
        box-shadow: 0 -10px 35px rgba(15,23,42,.1);
        backdrop-filter: blur(14px);
    }

    .mobile-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #64748b;
        font-size: .65rem;
    }

    .mobile-nav a i {
        font-size: 1.2rem;
    }

    .mobile-nav a.active {
        color: var(--primary);
    }

    .floating-add {
        display: grid;
        place-items: center;
        position: fixed;
        bottom: calc(36px + env(safe-area-inset-bottom));
        left: 50%;
        transform: translate(-50%, 50%);
        z-index: 1060;
        width: 58px;
        height: 58px;
        border-radius: 20px;
        background: linear-gradient(135deg, #2563eb, #4f46e5);
        color: white;
        font-size: 1.6rem;
        box-shadow: 0 12px 28px rgba(37,99,235,.38);
        border: 5px solid #fff;
    }

    .mobile-nav-spacer {
        display: block;
    }

    .chart-large {
        height: 280px;
    }
}

@media (max-width: 767.98px) {
    :root {
        --radius: 17px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .summary-card {
        padding: 14px 12px;
        gap: 10px;
        min-height: 110px;
        align-items: flex-start;
        flex-direction: column;
    }

    .summary-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .summary-card strong {
        font-size: 1.02rem;
    }

    .summary-card span {
        font-size: .7rem;
    }

    .summary-card small {
        display: block;
        margin: 0;
        font-size: .65rem;
    }

    .panel-card {
        padding: 15px;
    }

    .page-actions,
    .form-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-actions > div:last-child,
    .page-actions > a {
        width: 100%;
    }

    .page-actions > .d-flex {
        width: 100%;
    }

    .page-actions > .d-flex .btn {
        flex: 1;
    }

    .form-card {
        padding: 16px;
    }

    .transaction-type-tabs {
        gap: 6px;
    }

    .type-tab span {
        min-height: 48px;
        font-size: .75rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .reminder-card {
        padding: 14px;
    }

    .reminder-card-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .reminder-badges {
        display: none;
    }

    .reminder-meta {
        gap: 8px;
        flex-direction: column;
    }

    .debt-values {
        grid-template-columns: 1fr;
    }

    .debt-actions {
        flex-direction: column;
    }

    .compare-grid {
        grid-template-columns: 1fr;
    }

    .auth-page {
        padding: 14px;
    }

    .auth-card {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .auth-brand img {
        width: 60px;
        height: 60px;
    }

    .topbar-actions .btn {
        width: 42px;
        height: 42px;
        padding: 0;
        border-radius: 13px;
    }

    .topbar-actions .btn i {
        margin: 0;
    }

    .topbar-actions .btn {
        font-size: 0;
    }

    .topbar-actions .btn i {
        font-size: 1rem;
    }
}


/* =====================================================================
   TarazMan UI Refresh v6
   ===================================================================== */

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-soft: #eef2ff;
    --success: #059669;
    --danger: #e11d48;
    --warning: #f59e0b;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f7;
    --text: #111827;
    --muted: #64748b;
    --border: #e5e7eb;
    --shadow: 0 14px 42px rgba(15, 23, 42, .08);
    --shadow-lg: 0 26px 80px rgba(15, 23, 42, .16);
    --radius: 22px;
}

body.app-shell {
    background:
        radial-gradient(circle at 8% 8%, rgba(79, 70, 229, .09), transparent 28rem),
        radial-gradient(circle at 92% 18%, rgba(14, 165, 233, .08), transparent 30rem),
        linear-gradient(180deg, #f7f9fd 0%, #eef3f9 100%);
}

body.app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .38;
    background-image:
        linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .75), transparent 72%);
}

.sidebar {
    background:
        radial-gradient(circle at 20% 0%, rgba(99, 102, 241, .36), transparent 18rem),
        linear-gradient(180deg, #111827 0%, #172033 55%, #0f172a 100%);
    border: 0;
    box-shadow: -16px 0 48px rgba(15, 23, 42, .16);
}

[dir="rtl"] .sidebar {
    border-right: 0;
    box-shadow: -16px 0 48px rgba(15, 23, 42, .16);
}

.brand {
    border-bottom-color: rgba(255, 255, 255, .1);
}

.brand img {
    border: 2px solid rgba(255, 255, 255, .55);
    box-shadow: 0 14px 30px rgba(99, 102, 241, .35);
}

.brand strong {
    color: #ffffff;
}

.brand small {
    color: #a5b4fc;
}

.sidebar-nav {
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.sidebar-nav a {
    color: #cbd5e1;
    border: 1px solid transparent;
}

.sidebar-nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .08);
    transform: translateX(-2px);
}

.sidebar-nav a.active {
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1, #2563eb);
    border-color: rgba(255, 255, 255, .18);
    box-shadow: 0 16px 32px rgba(37, 99, 235, .28);
}

.sidebar-footer {
    color: #ffffff;
    border-top-color: rgba(255, 255, 255, .1);
}

.sidebar-footer .text-muted {
    color: #94a3b8 !important;
}

.sidebar-footer .avatar {
    color: #ffffff;
    background: rgba(99, 102, 241, .28);
    border: 1px solid rgba(165, 180, 252, .25);
}

.sidebar-footer .btn-light {
    color: #ffffff;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .1);
}

.topbar {
    background: rgba(255, 255, 255, .82);
    border-bottom-color: rgba(226, 232, 240, .8);
    box-shadow: 0 10px 34px rgba(15, 23, 42, .045);
    backdrop-filter: blur(22px) saturate(150%);
}

.topbar h1 {
    letter-spacing: -.03em;
}

.content-wrap {
    position: relative;
    z-index: 1;
}

.panel-card,
.summary-card,
.account-card,
.budget-card,
.debt-card,
.compare-card,
.reminder-card {
    border-color: rgba(255, 255, 255, .84);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 16px 46px rgba(15, 23, 42, .075);
}

.panel-card,
.summary-card,
.account-card,
.budget-card,
.debt-card,
.compare-card {
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.panel-card:hover,
.account-card:hover,
.budget-card:hover,
.debt-card:hover,
.compare-card:hover {
    border-color: rgba(129, 140, 248, .26);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .95) inset,
        0 22px 58px rgba(15, 23, 42, .105);
}

.summary-card {
    isolation: isolate;
    min-height: 126px;
}

.summary-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .9;
    background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .72));
}

.summary-card::after {
    width: 150px;
    height: 150px;
    left: -52px;
    bottom: -82px;
    opacity: .10;
}

.summary-card:hover {
    transform: translateY(-4px);
}

.summary-icon {
    box-shadow: 0 12px 28px rgba(15, 23, 42, .09);
}

.balance-card {
    background: linear-gradient(145deg, #ffffff, #eef2ff);
}

.income-card {
    background: linear-gradient(145deg, #ffffff, #ecfdf5);
}

.expense-card {
    background: linear-gradient(145deg, #ffffff, #fff1f2);
}

.net-card {
    background: linear-gradient(145deg, #ffffff, #f5f3ff);
}

.page-actions,
.form-page-header {
    margin-bottom: 24px;
}

.page-actions h2,
.form-page-header h2 {
    font-size: 1.25rem;
    letter-spacing: -.03em;
}

.page-actions p,
.form-page-header p {
    font-size: .84rem;
}

.form-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .92));
}

.form-card::before {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    left: -120px;
    top: -135px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(99, 102, 241, .13), transparent 66%);
}

.form-label {
    color: #334155;
    font-weight: 700;
    font-size: .83rem;
    margin-bottom: .5rem;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 49px;
    border-color: #dbe2ea;
    background-color: rgba(255, 255, 255, .92);
}

.form-control:hover,
.form-select:hover {
    border-color: #c7d2fe;
}

.form-control:focus,
.form-select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 .25rem rgba(99, 102, 241, .12);
}

.amount-input {
    direction: ltr !important;
    text-align: left !important;
    font-weight: 800;
    letter-spacing: .035em;
    font-variant-numeric: tabular-nums;
    color: #1e293b;
}

.amount-input.money-ready {
    background-image: linear-gradient(90deg, rgba(79, 70, 229, .025), transparent);
}

.transaction-type-tabs {
    padding: 6px;
    border-radius: 18px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.type-tab span {
    border-color: transparent;
    background: transparent;
}

.type-tab.income input:checked + span,
.type-tab.expense input:checked + span,
.type-tab.transfer input:checked + span {
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.account-card {
    overflow: hidden;
}

.account-card::before {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    left: -70px;
    bottom: -100px;
    border-radius: 50%;
    opacity: .13;
    background: var(--account-color);
}

.account-card:hover {
    transform: translateY(-5px);
}

.finance-table thead th {
    color: #64748b;
    font-size: .76rem;
    letter-spacing: -.01em;
    border-bottom-color: #e2e8f0;
}

.finance-table tbody tr {
    transition: background .18s ease, transform .18s ease;
}

.finance-table tbody tr:hover {
    background: #f8faff;
}

.mobile-dashboard-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 13px;
}

.mobile-dashboard-actions a {
    min-width: 0;
    padding: 12px 6px;
    border-radius: 17px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .065);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    color: #334155;
}

.mobile-dashboard-actions a span {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.mobile-dashboard-actions a strong {
    font-size: .69rem;
    white-space: nowrap;
}

.mobile-dashboard-actions .expense span {
    color: #e11d48;
    background: #fff1f2;
}

.mobile-dashboard-actions .income span {
    color: #059669;
    background: #ecfdf5;
}

.mobile-dashboard-actions .accounts span {
    color: #4f46e5;
    background: #eef2ff;
}

.mobile-dashboard-actions .settings span {
    color: #0f766e;
    background: #f0fdfa;
}

.mobile-action-sheet,
.mobile-more-sheet {
    --bs-offcanvas-height: auto;
    max-height: 86vh;
    border: 0;
    border-radius: 28px 28px 0 0;
    background:
        radial-gradient(circle at 12% 0%, rgba(99, 102, 241, .11), transparent 15rem),
        #ffffff;
    box-shadow: 0 -26px 70px rgba(15, 23, 42, .2);
}

.mobile-action-sheet .offcanvas-header,
.mobile-more-sheet .offcanvas-header {
    padding: 20px 20px 8px;
    align-items: flex-start;
}

.mobile-action-sheet .offcanvas-title,
.mobile-more-sheet .offcanvas-title {
    font-size: 1.05rem;
    font-weight: 900;
}

.mobile-action-sheet .offcanvas-header p,
.mobile-more-sheet .offcanvas-header p {
    color: var(--muted);
    font-size: .75rem;
    margin: 4px 0 0;
}

.mobile-action-sheet .offcanvas-body,
.mobile-more-sheet .offcanvas-body {
    padding: 14px 18px calc(24px + env(safe-area-inset-bottom));
}

.mobile-action-grid {
    display: grid;
    gap: 11px;
}

.mobile-action-card {
    min-height: 82px;
    display: grid;
    grid-template-columns: 54px 1fr;
    grid-template-rows: auto auto;
    column-gap: 13px;
    align-items: center;
    padding: 13px;
    border-radius: 19px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .92);
}

.mobile-action-card > span {
    grid-row: 1 / span 2;
    width: 54px;
    height: 54px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
}

.mobile-action-card strong {
    align-self: end;
    font-size: .92rem;
}

.mobile-action-card small {
    align-self: start;
    color: var(--muted);
    font-size: .72rem;
}

.mobile-action-card.expense {
    border-color: #fecdd3;
    background: linear-gradient(135deg, #ffffff, #fff1f2);
}

.mobile-action-card.expense > span {
    color: #e11d48;
    background: #ffe4e6;
}

.mobile-action-card.income {
    border-color: #a7f3d0;
    background: linear-gradient(135deg, #ffffff, #ecfdf5);
}

.mobile-action-card.income > span {
    color: #059669;
    background: #d1fae5;
}

.mobile-action-card.transfer {
    border-color: #c7d2fe;
    background: linear-gradient(135deg, #ffffff, #eef2ff);
}

.mobile-action-card.transfer > span {
    color: #4f46e5;
    background: #e0e7ff;
}

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mobile-menu-grid > a {
    min-height: 96px;
    padding: 12px 7px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: #475569;
}

.mobile-menu-grid > a span {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #4f46e5;
    background: #eef2ff;
    font-size: 1.15rem;
}

.mobile-menu-grid > a strong {
    font-size: .72rem;
}

.mobile-menu-grid > a.active {
    color: #3730a3;
    border-color: #a5b4fc;
    background: #eef2ff;
}

.mobile-profile-card {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.mobile-profile-card small {
    color: var(--muted);
    font-size: .72rem;
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(82px + env(safe-area-inset-bottom));
    }

    .mobile-nav {
        min-height: 72px;
        padding: 5px 5px env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .92);
        border-top-color: rgba(226, 232, 240, .85);
        box-shadow: 0 -16px 44px rgba(15, 23, 42, .12);
        backdrop-filter: blur(22px) saturate(150%);
    }

    .mobile-nav a,
    .mobile-nav button {
        min-width: 0;
        border: 0;
        outline: 0;
        background: transparent;
        padding: 5px 2px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #64748b;
        font-family: inherit;
        font-size: .62rem;
    }

    .mobile-nav a i,
    .mobile-nav button > i {
        font-size: 1.18rem;
    }

    .mobile-nav a.active,
    .mobile-nav button.active {
        color: #4f46e5;
    }

    .mobile-add-trigger {
        transform: translateY(-15px);
    }

    .mobile-add-trigger .mobile-add-icon {
        width: 54px;
        height: 54px;
        display: grid;
        place-items: center;
        border-radius: 19px;
        color: #ffffff;
        font-size: 1.45rem;
        background: linear-gradient(135deg, #6366f1, #2563eb);
        border: 5px solid #ffffff;
        box-shadow: 0 14px 30px rgba(79, 70, 229, .34);
    }

    .mobile-add-trigger > span:last-child {
        margin-top: -2px;
        color: #4f46e5;
        font-weight: 800;
    }

    .topbar {
        border-radius: 0 0 18px 18px;
    }

    .content-wrap {
        padding-top: 18px;
    }
}

@media (max-width: 767.98px) {
    body.app-shell::before {
        opacity: .22;
    }

    .topbar {
        padding-inline: 14px;
    }

    .topbar-actions {
        gap: 5px;
    }

    .dashboard-grid {
        gap: 11px;
    }

    .summary-card {
        min-height: 116px;
        border-radius: 19px;
    }

    .panel-card {
        border-radius: 19px;
    }

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

    .page-actions .btn,
    .form-page-header .btn {
        min-height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .panel-card,
    .summary-card,
    .account-card,
    .budget-card,
    .debt-card,
    .compare-card,
    .sidebar-nav a {
        transition: none !important;
    }
}
