/* =========================================================
   BUDGETFLOW 2.0
   PERSONAL FINANCIAL MONITORING
   Premium Mobile-First UI
   ========================================================= */

/* =========================================================
   1. ROOT
   ========================================================= */

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: #e6f5f2;

    --accent: #d4a72c;
    --accent-soft: #fbf4dc;

    --bg: #f5f7f6;
    --surface: #ffffff;
    --surface-soft: #f8faf9;

    --text: #17201f;
    --text-secondary: #65716f;
    --text-muted: #96a09e;

    --border: #e8edeb;

    --income: #16845f;
    --income-soft: #e7f6ef;

    --expense: #d65353;
    --expense-soft: #fceaea;

    --warning: #b7791f;
    --warning-soft: #fff6df;

    --shadow-sm:
        0 2px 10px rgba(20, 38, 34, 0.04);

    --shadow-md:
        0 12px 35px rgba(20, 38, 34, 0.08);

    --shadow-lg:
        0 22px 60px rgba(20, 38, 34, 0.13);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 30px;

    --nav-height: 82px;
    --header-height: 72px;

    font-family: "DM Sans", sans-serif;
}

/* =========================================================
   2. RESET
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.18);
    outline-offset: 2px;
}

input,
select {
    color: var(--text);
}

svg {
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   3. APP SHELL
   ========================================================= */

.app {
    width: 100%;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 24px);
}

.main-content {
    width: min(100%, 680px);
    margin: 0 auto;
    padding: 18px 18px 40px;
}

/* =========================================================
   4. HEADER
   ========================================================= */

.app-header {
    width: 100%;
    height: var(--header-height);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;

    background: rgba(245, 247, 246, 0.92);
    border-bottom: 1px solid rgba(232, 237, 235, 0.85);

    position: sticky;
    top: 0;
    z-index: 50;

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            var(--primary),
            var(--primary-dark)
        );

    box-shadow:
        0 7px 18px rgba(15, 118, 110, 0.22);
}

.brand-mark span {
    display: block;
    width: 4px;
    border-radius: 999px;
    background: #ffffff;
}

.brand-mark span:nth-child(1) {
    height: 10px;
    opacity: 0.62;
}

.brand-mark span:nth-child(2) {
    height: 17px;
    opacity: 0.82;
}

.brand-mark span:nth-child(3) {
    height: 23px;
}

.brand-name {
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-caption {
    margin-top: 1px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.icon-button {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    position: relative;

    color: var(--text-secondary);

    border: 1px solid var(--border);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.82);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.icon-button:hover {
    background: var(--surface);
    color: var(--primary);
}

.icon-button:active {
    transform: scale(0.94);
}

.icon-button svg {
    width: 19px;
    height: 19px;
}

.icon-button.small {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.notification-dot {
    position: absolute;
    top: 9px;
    right: 9px;

    width: 6px;
    height: 6px;

    border-radius: 50%;
    background: var(--expense);

    box-shadow: 0 0 0 3px #fff;
}

/* =========================================================
   5. PAGE SYSTEM
   ========================================================= */

.page {
    display: none;
    animation: pageIn 0.28s ease both;
}

.page.active {
    display: block;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   6. TYPOGRAPHY
   ========================================================= */

.eyebrow {
    display: block;

    color: var(--text-muted);

    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.greeting {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 18px;
}

.greeting h1 {
    margin-top: 7px;

    font-family: "Manrope", sans-serif;
    font-size: clamp(25px, 7vw, 34px);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.greeting p {
    margin-top: 7px;

    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.5;
}

.date-badge {
    flex: 0 0 auto;

    padding: 9px 11px;

    color: var(--text-secondary);

    border: 1px solid var(--border);
    border-radius: 11px;

    background: rgba(255, 255, 255, 0.75);

    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 16px;

    margin: 4px 0 22px;
}

.page-heading h1 {
    margin-top: 7px;

    font-family: "Manrope", sans-serif;
    font-size: 31px;
    line-height: 1;
    letter-spacing: -0.045em;
}

.page-heading p {
    max-width: 440px;

    margin-top: 8px;

    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.55;
}

.section-block {
    margin-top: 28px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 13px;
}

.section-heading h2 {
    margin-top: 5px;

    font-family: "Manrope", sans-serif;
    font-size: 17px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

/* =========================================================
   7. BUTTONS
   ========================================================= */

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: var(--primary);

    font-size: 12px;
    font-weight: 700;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.text-button:hover {
    opacity: 0.75;
}

.text-button:active {
    transform: scale(0.97);
}

.text-button svg {
    width: 14px;
    height: 14px;
}

.primary-button {
    width: 100%;
    min-height: 54px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    box-shadow:
        0 12px 25px rgba(15, 118, 110, 0.19);

    font-size: 14px;
    font-weight: 800;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.primary-button:hover {
    box-shadow:
        0 16px 30px rgba(15, 118, 110, 0.24);
}

.primary-button:active {
    transform: scale(0.98);
}

/* =========================================================
   8. BALANCE CARD
   ========================================================= */

.balance-card {
    padding: 21px;

    border-radius: var(--radius-lg);

    background:
        radial-gradient(
            circle at 85% 15%,
            rgba(255,255,255,0.12),
            transparent 30%
        ),
        linear-gradient(
            145deg,
            #173d39,
            #0e615a
        );

    color: #fff;

    box-shadow:
        0 20px 42px rgba(17, 94, 89, 0.18);

    overflow: hidden;

    position: relative;
}

.balance-card::after {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: -95px;
    bottom: -105px;

    border-radius: 50%;

    border: 1px solid rgba(255,255,255,0.10);
}

.balance-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;
}

.balance-label {
    display: block;

    color: rgba(255,255,255,0.62);

    font-size: 12px;
    font-weight: 600;
}

.balance-value-row {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 7px;
}

.balance-value-row h2 {
    font-family: "Manrope", sans-serif;
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1;
    letter-spacing: -0.055em;

    word-break: break-word;
}

.balance-toggle {
    width: 30px;
    height: 30px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: rgba(255,255,255,0.7);

    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;

    background: rgba(255,255,255,0.06);
}

.balance-toggle svg {
    width: 15px;
    height: 15px;
}

.balance-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 7px 9px;

    border-radius: 999px;

    background: rgba(255,255,255,0.08);

    color: rgba(255,255,255,0.72);

    font-size: 11px;
    font-weight: 700;
}

.status-indicator {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #74e0b6;

    box-shadow: 0 0 0 3px rgba(116,224,182,0.10);
}

.balance-divider {
    height: 1px;

    margin: 21px 0 17px;

    background: rgba(255,255,255,0.10);
}

.balance-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 16px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 9px;
}

.summary-icon {
    width: 31px;
    height: 31px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
}

.summary-icon.income {
    color: #8ce2bd;
    background: rgba(140,226,189,0.10);
}

.summary-icon.expense {
    color: #ffb0b0;
    background: rgba(255,176,176,0.10);
}

.summary-icon svg {
    width: 15px;
    height: 15px;
}

.summary-item span {
    display: block;

    color: rgba(255,255,255,0.48);

    font-size: 11px;
    font-weight: 600;
}

.summary-item strong {
    display: block;

    margin-top: 3px;

    font-size: 13px;
    font-weight: 800;
}

/* =========================================================
   9. CHART
   ========================================================= */

.chart-card {
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);

    box-shadow: var(--shadow-sm);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-label {
    display: block;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
}

.chart-header strong {
    display: block;

    margin-top: 4px;

    font-family: "Manrope", sans-serif;
    font-size: 22px;
    letter-spacing: -0.04em;
}

.change-badge {
    padding: 7px 9px;

    border-radius: 999px;

    color: var(--primary);

    background: var(--primary-soft);

    font-size: 11px;
    font-weight: 800;
}

.change-badge.negative {
    color: var(--expense);
    background: var(--expense-soft);
}

.chart-wrapper {
    margin-top: 17px;
}

.spending-chart {
    width: 100%;
    height: 150px;

    overflow: visible;
}

#chartGradient stop {
    stop-color: var(--primary);
}

#chartArea {
    fill: url(#chartGradient);
}

#chartLine {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-labels {
    display: flex;
    justify-content: space-between;

    margin-top: 3px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
}

/* =========================================================
   10. CATEGORY LIST
   ========================================================= */

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item {
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);

    box-shadow: var(--shadow-sm);
}

.category-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.category-name {
    display: flex;
    align-items: center;
    gap: 9px;
}

.category-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: var(--surface-soft);

    color: var(--primary);
}

.category-icon svg {
    width: 16px;
    height: 16px;
}

.category-name span {
    font-size: 13px;
    font-weight: 700;
}

.category-value {
    font-size: 13px;
    font-weight: 800;
}

.category-progress {
    height: 5px;

    margin-top: 11px;

    overflow: hidden;

    border-radius: 999px;

    background: #edf1ef;
}

.category-progress-value {
    height: 100%;

    border-radius: inherit;

    background: var(--primary);

    transition: width 0.5s ease;
}

/* =========================================================
   11. INSIGHT CARD
   ========================================================= */

.insight-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;

    padding: 17px;

    border: 1px solid rgba(15,118,110,0.12);
    border-radius: var(--radius-md);

    background:
        linear-gradient(
            145deg,
            #f0faf8,
            #ffffff
        );
}

.insight-icon {
    width: 38px;
    height: 38px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--primary);

    border-radius: 12px;

    background: rgba(15,118,110,0.09);
}

.insight-icon svg {
    width: 18px;
    height: 18px;
}

.insight-content h3 {
    margin-top: 6px;

    font-family: "Manrope", sans-serif;
    font-size: 14px;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.insight-content p {
    margin-top: 5px;

    color: var(--text-secondary);

    font-size: 12px;
    line-height: 1.55;
}

/* =========================================================
   12. ISLAMIC PREVIEW
   ========================================================= */

.islamic-preview {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 17px;

    border: 1px solid rgba(212,167,44,0.16);
    border-radius: var(--radius-md);

    background:
        linear-gradient(
            145deg,
            #fffaf0,
            #ffffff
        );

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.islamic-preview:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.islamic-symbol {
    width: 39px;
    height: 39px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #a87b17;

    border-radius: 13px;

    background: var(--accent-soft);
}

.islamic-symbol svg {
    width: 18px;
    height: 18px;
}

.islamic-preview-content {
    min-width: 0;
    flex: 1;
}

.islamic-preview-title {
    margin-top: 5px;

    font-family: "Manrope", sans-serif;
    font-size: 14px;
    letter-spacing: -0.025em;
}

.islamic-preview-text {
    margin-top: 4px;

    color: var(--text-secondary);

    font-size: 11px;
    line-height: 1.5;
}

.preview-arrow {
    flex: 0 0 auto;

    width: 16px;
    height: 16px;

    color: var(--text-muted);
}

/* =========================================================
   13. TRANSACTIONS
   ========================================================= */

.filter-scroll {
    display: flex;
    gap: 8px;

    overflow-x: auto;

    padding-bottom: 4px;

    scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex: 0 0 auto;

    padding: 9px 13px;

    color: var(--text-secondary);

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface);

    font-size: 12px;
    font-weight: 700;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.filter-chip.active {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-list.full {
    margin-top: 18px;
}

.transaction-group {
    margin-top: 19px;
}

.transaction-group:first-child {
    margin-top: 0;
}

.transaction-group-title {
    display: flex;
    justify-content: space-between;

    margin-bottom: 8px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.transaction-item {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.transaction-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.transaction-icon {
    width: 38px;
    height: 38px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;
}

.transaction-icon.income {
    color: var(--income);
    background: var(--income-soft);
}

.transaction-icon.expense {
    color: var(--expense);
    background: var(--expense-soft);
}

.transaction-icon svg {
    width: 17px;
    height: 17px;
}

.transaction-info {
    min-width: 0;
    flex: 1;
}

.transaction-title {
    display: block;

    overflow: hidden;

    color: var(--text);

    font-size: 13px;
    font-weight: 800;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-meta {
    display: block;

    margin-top: 3px;

    overflow: hidden;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-amount {
    flex: 0 0 auto;

    text-align: right;

    font-size: 13px;
    font-weight: 800;
}

.transaction-amount.income {
    color: var(--income);
}

.transaction-amount.expense {
    color: var(--expense);
}

.transaction-delete {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-muted);

    border-radius: 9px;

    transition:
        color 0.2s ease,
        background 0.2s ease;
}

.transaction-delete:hover {
    color: var(--expense);
    background: var(--expense-soft);
}

.transaction-delete svg {
    width: 14px;
    height: 14px;
}

/* =========================================================
   14. EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 38px 20px;

    text-align: center;

    border: 1px dashed var(--border);
    border-radius: var(--radius-md);

    background: rgba(255,255,255,0.65);
}

.empty-state-icon {
    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 12px;

    color: var(--primary);

    border-radius: 14px;

    background: var(--primary-soft);
}

.empty-state-icon svg {
    width: 20px;
    height: 20px;
}

.empty-state h3 {
    font-family: "Manrope", sans-serif;
    font-size: 14px;
}

.empty-state p {
    max-width: 270px;

    margin: 6px auto 0;

    color: var(--text-muted);

    font-size: 12px;
    line-height: 1.55;
}

/* =========================================================
   15. ANALYSIS
   ========================================================= */

.period-selector {
    display: flex;
    gap: 7px;

    margin-bottom: 18px;

    padding: 4px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--surface);
}

.period-button {
    flex: 1;

    min-height: 36px;

    border-radius: 9px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 800;

    transition:
        color 0.2s ease,
        background 0.2s ease;
}

.period-button.active {
    color: var(--text);
    background: var(--surface-soft);
    box-shadow: var(--shadow-sm);
}

.analysis-summary-card {
    padding: 19px;

    border-radius: var(--radius-lg);

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f4faf8
        );

    border: 1px solid var(--border);

    box-shadow: var(--shadow-sm);
}

.analysis-summary-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 14px;
}

.analysis-summary-header h2 {
    margin-top: 7px;

    font-family: "Manrope", sans-serif;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.net-status {
    padding: 7px 10px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
}

.net-status.positive {
    color: var(--income);
    background: var(--income-soft);
}

.net-status.negative {
    color: var(--expense);
    background: var(--expense-soft);
}

.analysis-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-top: 22px;
}

.analysis-metric {
    padding: 12px;

    border-radius: 13px;

    background: rgba(255,255,255,0.8);
}

.analysis-metric span {
    display: block;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
}

.analysis-metric strong {
    display: block;

    margin-top: 4px;

    font-size: 13px;
    font-weight: 800;
}

.analysis-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;

    gap: 20px;

    padding: 19px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.donut-chart {
    width: 138px;
    height: 138px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto;

    border-radius: 50%;

    background:
        conic-gradient(
            var(--primary) 0deg,
            var(--primary) 120deg,
            #7ebdb5 120deg,
            #7ebdb5 220deg,
            #d8b758 220deg,
            #d8b758 290deg,
            #dce5e2 290deg,
            #dce5e2 360deg
        );

    position: relative;
}

.donut-chart::after {
    content: "";

    position: absolute;

    width: 94px;
    height: 94px;

    border-radius: 50%;

    background: var(--surface);
}

.donut-center {
    position: relative;
    z-index: 2;

    text-align: center;
}

.donut-center strong {
    display: block;

    font-family: "Manrope", sans-serif;
    font-size: 14px;
    letter-spacing: -0.03em;
}

.donut-center span {
    display: block;

    margin-top: 3px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.legend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.legend-name {
    display: flex;
    align-items: center;
    gap: 7px;

    min-width: 0;
}

.legend-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 auto;

    border-radius: 50%;

    background: var(--primary);
}

.legend-name span {
    overflow: hidden;

    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-value {
    flex: 0 0 auto;

    font-size: 11px;
    font-weight: 800;
}

.comparison-card {
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);

    box-shadow: var(--shadow-sm);
}

.comparison-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    gap: 10px;
}

.comparison-row > div:not(.comparison-arrow) {
    padding: 12px;

    border-radius: 13px;

    background: var(--surface-soft);
}

.comparison-row span {
    display: block;

    color: var(--text-muted);

    font-size: 11px;
}

.comparison-row strong {
    display: block;

    margin-top: 4px;

    font-size: 13px;
    font-weight: 800;
}

.comparison-arrow {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-muted);
}

.comparison-arrow svg {
    width: 15px;
}

.comparison-result {
    margin-top: 12px;

    padding: 11px 12px;

    border-radius: 11px;

    color: var(--text-secondary);

    background: var(--surface-soft);

    font-size: 11px;
    line-height: 1.5;
}

.saving-card {
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);

    box-shadow: var(--shadow-sm);
}

.saving-header {
    display: flex;
    justify-content: space-between;
}

.saving-header span {
    display: block;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
}

.saving-header strong {
    display: block;

    margin-top: 4px;

    font-family: "Manrope", sans-serif;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.progress-track {
    width: 100%;
    height: 7px;

    margin-top: 16px;

    overflow: hidden;

    border-radius: 999px;

    background: #e9efed;
}

.progress-value {
    width: 0;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            #3b9b91
        );

    transition: width 0.6s ease;
}

.saving-card p {
    margin-top: 10px;

    color: var(--text-secondary);

    font-size: 11px;
    line-height: 1.5;
}

.smart-analysis {
    display: flex;
    align-items: flex-start;
    gap: 13px;

    padding: 18px;

    border-radius: var(--radius-md);

    color: #fff;

    background:
        linear-gradient(
            145deg,
            #193c38,
            #0f766e
        );

    box-shadow:
        0 15px 30px rgba(15,118,110,0.14);
}

.smart-analysis-icon {
    width: 38px;
    height: 38px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: rgba(255,255,255,0.10);
}

.smart-analysis-icon svg {
    width: 18px;
}

.smart-analysis .eyebrow {
    color: rgba(255,255,255,0.52);
}

.smart-analysis h3 {
    margin-top: 6px;

    font-family: "Manrope", sans-serif;
    font-size: 14px;
    line-height: 1.35;
}

.smart-analysis p {
    margin-top: 5px;

    color: rgba(255,255,255,0.65);

    font-size: 11px;
    line-height: 1.55;
}

/* =========================================================
   16. ISLAMIC PAGE
   ========================================================= */

.islamic-hero {
    padding: 24px;

    border-radius: var(--radius-lg);

    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(212,167,44,0.14),
            transparent 34%
        ),
        linear-gradient(
            145deg,
            #263d39,
            #17302c
        );

    color: #fff;

    box-shadow:
        0 18px 40px rgba(23,48,44,0.15);
}

.islamic-hero-icon {
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 20px;

    color: #e8ca72;

    border-radius: 14px;

    background: rgba(212,167,44,0.10);
}

.islamic-hero-icon svg {
    width: 21px;
}

.islamic-hero .eyebrow {
    color: rgba(255,255,255,0.50);
}

.islamic-hero h2 {
    max-width: 450px;

    margin-top: 8px;

    font-family: "Manrope", sans-serif;
    font-size: 25px;
    line-height: 1.18;
    letter-spacing: -0.045em;
}

.islamic-hero p {
    max-width: 500px;

    margin-top: 11px;

    color: rgba(255,255,255,0.68);

    font-size: 12px;
    line-height: 1.65;
}

.principle-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.principle-card {
    display: grid;
    grid-template-columns: 35px 1fr;

    gap: 11px;

    padding: 16px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);

    box-shadow: var(--shadow-sm);
}

.principle-number {
    width: 35px;
    height: 35px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    color: #a37a18;

    background: var(--accent-soft);

    font-size: 11px;
    font-weight: 800;
}

.principle-card h3 {
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    letter-spacing: -0.02em;
}

.principle-card p {
    margin-top: 4px;

    color: var(--text-secondary);

    font-size: 11px;
    line-height: 1.55;
}

.allocation-card {
    padding: 20px;

    border: 1px solid rgba(212,167,44,0.16);
    border-radius: var(--radius-lg);

    background:
        linear-gradient(
            145deg,
            #fffaf0,
            #ffffff
        );
}

.allocation-card h2 {
    margin-top: 7px;

    font-family: "Manrope", sans-serif;
    font-size: 19px;
    letter-spacing: -0.03em;
}

.allocation-card > p {
    margin-top: 6px;

    color: var(--text-secondary);

    font-size: 11px;
    line-height: 1.55;
}

.allocation-list {
    margin-top: 17px;

    border-top: 1px solid rgba(212,167,44,0.14);
}

.allocation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 12px 0;

    border-bottom: 1px solid rgba(212,167,44,0.12);
}

.allocation-row span {
    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 600;
}

.allocation-row strong {
    color: var(--text);

    font-size: 11px;
    font-weight: 800;
}

.allocation-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;

    margin-top: 13px;

    color: var(--text-muted);

    font-size: 11px;
    line-height: 1.5;
}

.allocation-note svg {
    width: 13px;
    height: 13px;

    flex: 0 0 auto;

    margin-top: 1px;
}

/* =========================================================
   17. FLOATING ADD
   ========================================================= */

/* =========================================================
   18. BOTTOM NAVIGATION
   ========================================================= */

.bottom-nav {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    height: calc(var(--nav-height) + env(safe-area-inset-bottom));

    display: grid;
    grid-template-columns: repeat(5, 1fr);

    padding:
        8px
        8px
        calc(8px + env(safe-area-inset-bottom));

    z-index: 60;

    border-top: 1px solid rgba(232,237,235,0.95);

    background:
        rgba(255,255,255,0.93);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    box-shadow:
        0 -10px 35px rgba(20,38,34,0.06);
}

.nav-item {
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;

    color: var(--text-muted);

    border-radius: 15px;

    font-size: 11px;
    font-weight: 700;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.nav-item svg {
    width: 19px;
    height: 19px;

    stroke-width: 1.8;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:not(.nav-add):active {
    transform: scale(0.94);
}

.nav-add {
    position: relative;

    justify-content: flex-start;

    padding-top: 2px;
}

.nav-add-circle {
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: -21px;

    color: #fff;

    border: 5px solid var(--bg);
    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            var(--primary),
            var(--primary-dark)
        );

    box-shadow:
        0 9px 20px rgba(15,118,110,0.24);
}

.nav-add-circle svg {
    width: 18px;
    height: 18px;
}

.nav-add > span:last-child {
    margin-top: 1px;
}

/* =========================================================
   19. BOTTOM SHEET
   ========================================================= */

.sheet-overlay {
    position: fixed;

    inset: 0;

    z-index: 100;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    padding: 0;

    background: rgba(14, 30, 27, 0.40);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sheet-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bottom-sheet {
    width: min(100%, 680px);

    max-height: 92vh;

    overflow-y: auto;

    padding:
        10px
        20px
        calc(22px + env(safe-area-inset-bottom));

    border-radius: 28px 28px 0 0;

    background: var(--surface);

    box-shadow:
        0 -25px 80px rgba(0,0,0,0.16);

    transform: translateY(100%);

    transition:
        transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 4px;

    margin: 1px auto 18px;

    border-radius: 999px;

    background: #dfe5e3;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 18px;
}

.sheet-header h2 {
    margin-top: 6px;

    font-family: "Manrope", sans-serif;
    font-size: 20px;
    letter-spacing: -0.035em;
}

.transaction-type {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin-bottom: 18px;
}

.type-option {
    min-height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    color: var(--text-secondary);

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-soft);

    font-size: 12px;
    font-weight: 800;

    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.type-option svg {
    width: 15px;
    height: 15px;
}

.type-option.active[data-type="expense"] {
    color: var(--expense);

    border-color: rgba(214,83,83,0.22);

    background: var(--expense-soft);
}

.type-option.active[data-type="income"] {
    color: var(--income);

    border-color: rgba(22,132,95,0.22);

    background: var(--income-soft);
}

.amount-field {
    display: flex;
    align-items: baseline;
    gap: 9px;

    padding: 6px 0 15px;

    border-bottom: 1px solid var(--border);
}

.amount-field > span {
    color: var(--text-muted);

    font-family: "Manrope", sans-serif;
    font-size: 18px;
    font-weight: 800;
}

.amount-field input {
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;

    font-family: "Manrope", sans-serif;
    font-size: 35px;
    font-weight: 800;
    letter-spacing: -0.055em;
}

.amount-field input::placeholder {
    color: #d2d9d7;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-top: 16px;
}

.form-field {
    display: block;

    margin-top: 12px;
}

.form-grid .form-field {
    margin-top: 0;
}

.form-field > span {
    display: block;

    margin-bottom: 7px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.form-field input,
.form-field select {
    width: 100%;
    min-height: 45px;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 13px;

    outline: 0;

    background: var(--surface-soft);

    font-size: 12px;
    font-weight: 600;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.form-field input:focus,
.form-field select:focus {
    border-color: rgba(15,118,110,0.35);
    background: #fff;
}

.form-field select {
    appearance: none;

    cursor: pointer;

    background-image:
        linear-gradient(45deg, transparent 50%, #8e9996 50%),
        linear-gradient(135deg, #8e9996 50%, transparent 50%);

    background-position:
        calc(100% - 16px) 19px,
        calc(100% - 12px) 19px;

    background-size: 4px 4px;
    background-repeat: no-repeat;
}

.bottom-sheet .primary-button {
    margin-top: 20px;
}

/* =========================================================
   PREMIUM TOAST NOTIFICATION
   ========================================================= */

.toast {
    position: fixed;
    left: 50%;
    bottom: 92px;
    z-index: 9999;

    width: min(390px, calc(100vw - 32px));
    min-height: 72px;

    display: flex;
    align-items: center;
    gap: 13px;

    padding: 13px 14px;

    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 18px;

    box-shadow:
        0 18px 50px rgba(15, 23, 42, 0.16),
        0 4px 14px rgba(15, 23, 42, 0.08);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 20px) scale(.96);

    transition:
        opacity .28s ease,
        transform .32s cubic-bezier(.2,.8,.2,1),
        visibility .28s ease;

    overflow: hidden;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) scale(1);
}

.toast-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: #ecfdf5;
    color: #059669;
}

.toast-icon svg {
    width: 19px;
    height: 19px;
    stroke-width: 2.4;
}

.toast-content {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 3px;
}

.toast-content strong {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.toast-content span {
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;

    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-close {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 9px;

    background: transparent;
    color: #94a3b8;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease;
}

.toast-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* Progress indicator */

.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;

    width: 100%;
    height: 3px;

    background: #2563eb;

    transform-origin: left;
}

.toast.show .toast-progress {
    animation: toastProgress 3.8s linear forwards;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Success */

.toast.success .toast-icon {
    background: #ecfdf5;
    color: #059669;
}

.toast.success .toast-progress {
    background: #10b981;
}

/* Error */

.toast.error .toast-icon {
    background: #fef2f2;
    color: #dc2626;
}

.toast.error .toast-progress {
    background: #ef4444;
}

/* Warning */

.toast.warning .toast-icon {
    background: #fffbeb;
    color: #d97706;
}

.toast.warning .toast-progress {
    background: #f59e0b;
}

/* Info */

.toast.info .toast-icon {
    background: #eff6ff;
    color: #2563eb;
}

.toast.info .toast-progress {
    background: #3b82f6;
}

/* Mobile */

@media (max-width: 600px) {
    .toast {
        bottom: 84px;
        width: calc(100vw - 24px);
        border-radius: 17px;
    }
}

/* =========================================================
   21. DESKTOP
   ========================================================= */

@media (min-width: 700px) {

    :root {
        --nav-height: 76px;
    }

    body {
        background:
            radial-gradient(
                circle at 50% -10%,
                rgba(15,118,110,0.05),
                transparent 35%
            ),
            var(--bg);
    }

    .app {
        max-width: 760px;
        margin: 0 auto;

        background: var(--bg);

        box-shadow:
            0 0 80px rgba(20,38,34,0.05);
    }

    .app-header {
        max-width: 760px;
        margin: 0 auto;
    }

    .main-content {
        padding-left: 24px;
        padding-right: 24px;
    }

    .bottom-nav {
        left: 50%;
        right: auto;

        width: min(100%, 760px);

        transform: translateX(-50%);
    }

    .sheet-overlay {
        align-items: center;
        padding: 20px;
    }

    .bottom-sheet {
        border-radius: 28px;

        box-shadow: var(--shadow-lg);

        transform: translateY(25px) scale(0.98);
    }

    .sheet-overlay.active .bottom-sheet {
        transform: translateY(0) scale(1);
    }
}

/* =========================================================
   22. SMALL MOBILE
   ========================================================= */

@media (max-width: 370px) {

    .main-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .app-header {
        padding-left: 14px;
        padding-right: 14px;
    }

    .greeting {
        gap: 8px;
    }

    .date-badge {
        padding: 8px;
    }

    .balance-card {
        padding: 18px;
    }

    .balance-summary {
        gap: 8px;
    }

    .summary-item {
        gap: 6px;
    }

    .summary-item strong {
        font-size: 12px;
    }

    .analysis-card {
        grid-template-columns: 1fr;
    }

    .donut-chart {
        width: 145px;
        height: 145px;
    }

    .legend-list {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .form-field {
        margin-top: 12px;
    }

    .bottom-sheet {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* =========================================================
   23. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* =========================================================
   24. ADDITIONS
   ========================================================= */

[hidden] {
    display: none !important;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.islamic-preview {
    width: 100%;
    text-align: left;
    color: inherit;
}

.islamic-preview-content,
.islamic-preview-title,
.islamic-preview-text {
    display: block;
}

.saving-card .saving-note {
    color: var(--text-muted);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 12px;
    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--surface);
}

.search-bar svg {
    width: 16px;
    height: 16px;

    flex: 0 0 auto;

    color: var(--text-muted);
}

.search-bar input {
    flex: 1;
    min-width: 0;
    min-height: 44px;

    border: 0;
    outline: 0;

    background: transparent;

    font-size: 16px;
}

.secondary-button {
    width: 100%;
    min-height: 54px;

    color: var(--text-secondary);

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface-soft);

    font-size: 14px;
    font-weight: 700;
}

.sheet-overlay.dialog {
    z-index: 120;

    align-items: center;

    padding: 20px;
}

.sheet-overlay.dialog .bottom-sheet {
    width: min(100%, 380px);

    padding: 24px;

    border-radius: 24px;

    transform: translateY(20px) scale(0.98);
}

.sheet-overlay.dialog.active .bottom-sheet {
    transform: none;
}

.dialog h2 {
    font-family: "Manrope", sans-serif;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.dialog p {
    margin-top: 8px;

    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.55;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;

    margin-top: 22px;
}

.confirm-actions .primary-button,
.confirm-actions .secondary-button {
    min-height: 48px;

    font-size: 14px;
}

.bottom-sheet .confirm-actions .primary-button {
    margin-top: 0;
}

.primary-button.danger {
    background: linear-gradient(135deg, #e06464, var(--expense));

    box-shadow: 0 12px 25px rgba(214, 83, 83, 0.2);
}

.transaction-main {
    flex: 1;
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 11px;

    color: inherit;
    text-align: left;

    border-radius: 12px;
}

.transaction-main:focus-visible {
    outline-offset: 4px;
}

/* =========================================================
   25. ZAKAT CALCULATOR
   ========================================================= */

.zakat-card {
    padding: 20px;

    border: 1px solid rgba(212,167,44,0.16);
    border-radius: var(--radius-lg);

    background:
        linear-gradient(
            145deg,
            #fffaf0,
            #ffffff
        );
}

.zakat-intro {
    margin-bottom: 4px;

    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.55;
}

.zakat-card .text-button {
    margin-top: 14px;
}

.zakat-result {
    margin-top: 16px;
    padding: 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);
}

.zakat-status {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 10px;
}

.zakat-label {
    display: block;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
}

.zakat-status strong {
    display: block;

    margin-top: 4px;

    font-family: "Manrope", sans-serif;
    font-size: 24px;
    letter-spacing: -0.04em;
}

.net-status.neutral {
    color: var(--text-secondary);
    background: var(--surface-soft);
}

.zakat-lines {
    margin-top: 14px;
}

.zakat-line {
    display: flex;
    justify-content: space-between;

    gap: 12px;

    padding: 9px 0;

    border-top: 1px solid var(--border);

    color: var(--text-secondary);

    font-size: 12px;
}

.zakat-line strong {
    color: var(--text);

    font-weight: 700;
    text-align: right;
}

.zakat-hint {
    margin-top: 12px;

    color: var(--text-secondary);

    font-size: 12px;
    line-height: 1.55;
}

.zakat-note {
    margin-top: 12px;

    color: var(--text-muted);

    font-size: 11px;
    line-height: 1.5;
}