/* =====================================================
   RESET
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800;900&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    direction: rtl;
}

body {
    font-family:
        "Vazirmatn",
        Tahoma,
        Arial,
        sans-serif;

    background: #f4f6f8;

    color: #202124;

    min-height: 100vh;
}


/* =====================================================
   APP
===================================================== */

.app-shell {

    width: 100%;

    max-width: 520px;

    min-height: 100vh;

    margin: 0 auto;

    background: #f4f6f8;

    padding-bottom: 90px;
}


/* =====================================================
   HEADER
===================================================== */

.top-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 22px 18px 8px;
}

.welcome-text {

    font-size: 13px;

    color: #777;

    margin-bottom: 5px;
}

.app-title {

    font-size: 23px;

    font-weight: 800;
}

.header-icon-button {

    width: 44px;

    height: 44px;

    border: none;

    border-radius: 14px;

    background: white;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.07);

    font-size: 20px;

    cursor: pointer;
}


/* =====================================================
   DATE
===================================================== */

.today-date {

    padding: 0 18px 18px;

    color: #777;

    font-size: 13px;
}


/* =====================================================
   HERO
===================================================== */

.hero-card {

    margin: 0 16px 16px;

    padding: 24px;

    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            #263238,
            #455a64
        );

    color: white;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.12);
}

.hero-title {

    font-size: 14px;

    opacity: 0.8;

    margin-bottom: 12px;
}

.hero-amount {

    font-size: 30px;

    font-weight: 900;

    margin-bottom: 7px;
}

.hero-subtitle {

    font-size: 12px;

    opacity: 0.7;
}


/* =====================================================
   CARDS
===================================================== */

.quick-input-card,
.dashboard-section {

    margin: 0 16px 16px;

    background: white;

    border-radius: 20px;

    padding: 18px;

    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.05);
}

.section-title {

    font-size: 16px;

    font-weight: 800;

    margin-bottom: 5px;
}

.section-subtitle {

    font-size: 12px;

    color: #888;
}

.section-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 16px;
}


/* =====================================================
   INPUT
===================================================== */

.quick-input-wrapper {

    display: flex;

    gap: 8px;

    margin-top: 14px;

    margin-bottom: 12px;
}

.quick-input {

    flex: 1;

    min-width: 0;

    height: 50px;

    border: 1px solid #e2e5e8;

    border-radius: 14px;

    padding: 0 15px;

    font-family: inherit;

    font-size: 14px;

    outline: none;

    background: #fafafa;
}

.quick-input:focus {

    border-color: #607d8b;

    background: white;
}

.voice-button {

    width: 50px;

    height: 50px;

    border: none;

    border-radius: 14px;

    background: #eceff1;

    font-size: 21px;

    cursor: pointer;
}

.voice-button:disabled {

    cursor: not-allowed;

    opacity: 0.5;
}

.voice-button.recording {

    transform: scale(1.08);

    animation:
        voicePulse 1s infinite;
}

@keyframes voicePulse {

    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }

    100% {
        opacity: 1;
    }
}


/* =====================================================
   BUTTONS
===================================================== */

.primary-button {

    border: none;

    border-radius: 13px;

    min-height: 46px;

    padding: 0 18px;

    background: #263238;

    color: white;

    font-family: inherit;

    font-size: 14px;

    font-weight: bold;

    cursor: pointer;
}

.primary-button:hover {

    opacity: 0.92;
}

.primary-button:disabled {

    opacity: 0.55;

    cursor: not-allowed;
}

.full-width {

    width: 100%;
}

.secondary-button {

    border: 1px solid #e1e4e6;

    border-radius: 13px;

    min-height: 46px;

    padding: 0 18px;

    background: white;

    color: #444;

    font-family: inherit;

    font-size: 14px;

    cursor: pointer;
}

.secondary-button:hover {

    background: #f7f7f7;
}

.small-action-button {

    width: 38px;

    height: 38px;

    border: none;

    border-radius: 11px;

    background: #f2f4f5;

    font-size: 20px;

    cursor: pointer;
}


/* =====================================================
   SUMMARY
===================================================== */

.summary-grid {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;
}

.summary-card {

    background: #f7f8f9;

    border-radius: 16px;

    padding: 15px;

    min-width: 0;
}

.summary-icon {

    font-size: 22px;

    margin-bottom: 10px;
}

.summary-label {

    font-size: 11px;

    color: #888;

    margin-bottom: 7px;
}

.summary-value {

    font-size: 15px;

    font-weight: 800;

    line-height: 1.6;

    word-break: break-word;
}


/* =====================================================
   MONTHLY COMPARISON
===================================================== */

.monthly-comparison {

    margin-top: 12px;

    padding: 14px 15px;

    border-radius: 15px;

    background: #f7f8f9;

    border: 1px solid #edf0f2;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    min-width: 0;
}

.comparison-label {

    font-size: 11px;

    color: #777;

    white-space: nowrap;
}

.comparison-value {

    font-size: 12px;

    font-weight: 800;

    line-height: 1.7;

    text-align: left;

    direction: rtl;

    min-width: 0;
}

.comparison-value.positive {

    color: #c62828;
}

.comparison-value.negative {

    color: #2e7d32;
}

.comparison-value.increase {

    color: #c62828;
}

.comparison-value.decrease {

    color: #2e7d32;
}

.comparison-value.neutral {

    color: #777;
}


/* =====================================================
   CATEGORIES
===================================================== */

.category-list {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 9px;

    width: 100%;

    max-width: 100%;
}

.category-item {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    min-height: 82px;

    min-width: 0;

    border-radius: 15px;

    background: #f7f8f9;

    padding: 8px;

    overflow: hidden;
}

.category-icon {

    font-size: 24px;

    margin-bottom: 7px;
}

.category-name {

    width: 100%;

    font-size: 11px;

    text-align: center;

    color: #555;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =====================================================
   CATEGORY SUMMARY
   3 COLUMNS
===================================================== */

#categoryList {

    display: grid !important;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 9px;

    width: 100%;

    max-width: 100%;

    box-sizing: border-box;
}

#categoryList .category-summary-item {

    display: block;

    width: 100%;

    max-width: 100%;

    min-width: 0;

    margin: 0;

    padding: 10px 7px;

    border-radius: 15px;

    background: #ffffff;

    border: 1px solid #eeeeee;

    box-sizing: border-box;

    overflow: hidden;
}

#categoryList .category-summary-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 5px;

    width: 100%;

    min-width: 0;

    box-sizing: border-box;
}

#categoryList .category-summary-title {

    display: flex;

    align-items: center;

    gap: 5px;

    min-width: 0;

    flex: 1;

    overflow: hidden;
}

#categoryList .category-summary-icon {

    width: 31px;

    height: 31px;

    flex-shrink: 0;

    border-radius: 10px;

    background: #f5f7fa;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 17px;
}

#categoryList .category-summary-name {

    min-width: 0;

    max-width: 100%;

    font-size: 8px;

    font-weight: 700;

    color: #222;

    line-height: 1.5;

    white-space: normal;

    overflow-wrap: break-word;

    word-break: normal;

    text-align: right;
}

#categoryList .category-summary-count {

    margin-top: 2px;

    font-size: 7px;

    color: #999;

    white-space: nowrap;
}

#categoryList .category-summary-amount {

    min-width: 0;

    max-width: 100%;

    flex-shrink: 1;

    font-size: 8px;

    font-weight: 700;

    color: #333;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

#categoryList .category-progress {

    width: 100%;

    max-width: 100%;

    height: 6px;

    background: #eeeeee;

    border-radius: 10px;

    overflow: hidden;

    margin-top: 8px;

    box-sizing: border-box;
}

#categoryList .category-progress-bar {

    height: 100%;

    min-width: 0;

    border-radius: 10px;

    background:
        linear-gradient(
            90deg,
            #667eea,
            #764ba2
        );

    transition:
        width 0.5s ease;
}

#categoryList .category-summary-footer {

    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 100%;

    margin-top: 5px;

    box-sizing: border-box;

    font-size: 7px;

    color: #999;
}

#categoryList
.category-summary-footer
span:first-child {

    font-weight: 700;

    color: #667eea;
}


/* =====================================================
   CATEGORY CHART
===================================================== */

.category-chart-wrapper {

    margin-top: 16px;

    padding: 16px;

    background: #ffffff;

    border-radius: 18px;

    border: 1px solid #eeeeee;
}

.category-chart-title {

    font-size: 14px;

    font-weight: 700;

    margin-bottom: 12px;

    text-align: right;
}

.category-chart-container {

    position: relative;

    width: 100%;

    height: 280px;
}


/* =====================================================
   EXPENSE LIST
===================================================== */

.expense-list {

    display: flex;

    flex-direction: column;

    gap: 10px;
}

.expense-item {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding: 13px;

    border-radius: 16px;

    background: #f8f9fa;

    min-width: 0;
}

.expense-main {

    display: flex;

    align-items: center;

    min-width: 0;

    flex: 1;
}

.expense-icon {

    width: 43px;

    height: 43px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 13px;

    background: white;

    font-size: 20px;

    margin-left: 10px;
}

.expense-info {

    min-width: 0;

    flex: 1;
}

.expense-description {

    font-size: 13px;

    font-weight: bold;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.expense-meta {

    display: flex;

    gap: 8px;

    margin-top: 5px;

    color: #888;

    font-size: 10px;
}

.expense-right {

    display: flex;

    flex-direction: column;

    align-items: flex-end;

    gap: 7px;

    flex-shrink: 0;
}

.expense-amount {

    font-size: 13px;

    font-weight: 800;

    white-space: nowrap;
}

.expense-actions {

    display: flex;

    align-items: center;

    gap: 4px;
}

.expense-edit-button,
.expense-delete-button {

    width: 31px;

    height: 31px;

    border: none;

    border-radius: 9px;

    background: white;

    cursor: pointer;

    font-size: 15px;

    display: flex;

    align-items: center;

    justify-content: center;
}

.expense-edit-button:hover {

    background: #eaf3f7;
}

.expense-delete-button:hover {

    background: #ffe9e9;
}


/* =====================================================
   EMPTY / LOADING
===================================================== */

.loading {

    text-align: center;

    color: #888;

    font-size: 13px;

    padding: 25px 10px;
}

.empty-state {

    text-align: center;

    color: #888;

    font-size: 13px;

    padding: 25px 10px;
}

.empty-icon {

    font-size: 35px;

    margin-bottom: 10px;
}


/* =====================================================
   BOTTOM NAV
===================================================== */

.bottom-nav {

    position: fixed;

    left: 50%;

    bottom: 0;

    transform: translateX(-50%);

    width: min(520px, 100%);

    height: 72px;

    background:
        rgba(
            255,
            255,
            255,
            0.96
        );

    border-top:
        1px solid #e8eaec;

    display: flex;

    align-items: center;

    justify-content: space-around;

    z-index: 100;
}

.bottom-nav-item {

    border: none;

    background: transparent;

    min-width: 58px;

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 4px;

    color: #999;

    font-family: inherit;

    cursor: pointer;
}

.bottom-nav-item span {

    font-size: 19px;
}

.bottom-nav-item small {

    font-size: 10px;
}

.bottom-nav-item.active {

    color: #263238;

    font-weight: bold;
}

.bottom-nav-add {

    width: 54px;

    height: 54px;

    border-radius: 18px;

    border: none;

    background: #263238;

    color: white;

    font-size: 30px;

    line-height: 1;

    cursor: pointer;

    box-shadow:
        0 7px 20px
        rgba(0, 0, 0, 0.18);
}


/* =====================================================
   MODAL
===================================================== */

.modal-overlay {

    position: fixed;

    inset: 0;

    background:
        rgba(0, 0, 0, 0.45);

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    z-index: 1000;
}

.modal-overlay.hidden {

    display: none;
}

.modal-card {

    width: 100%;

    max-width: 430px;

    max-height: 90vh;

    overflow-y: auto;

    background: white;

    border-radius: 24px;

    padding: 20px;

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.25);
}

.modal-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}

.modal-header h2 {

    font-size: 18px;
}

.modal-close {

    width: 35px;

    height: 35px;

    border: none;

    border-radius: 10px;

    background: #f1f2f3;

    font-size: 24px;

    line-height: 1;

    cursor: pointer;
}

.modal-actions {

    display: flex;

    gap: 10px;

    margin-top: 20px;
}

.modal-actions button {

    flex: 1;
}


/* =====================================================
   CONFIRMATION
===================================================== */

.confirmation-content {

    text-align: center;

    padding: 5px 0 10px;
}

.confirmation-icon {

    font-size: 45px;

    margin-bottom: 12px;
}

.confirmation-description {

    font-size: 17px;

    font-weight: bold;

    margin-bottom: 10px;
}

.confirmation-amount {

    font-size: 23px;

    font-weight: 900;

    margin-bottom: 12px;
}

.confirmation-category,
.confirmation-date {

    color: #777;

    font-size: 12px;

    margin-top: 5px;
}


/* =====================================================
   EDIT FORM
===================================================== */

.edit-form {

    display: flex;

    flex-direction: column;

    gap: 8px;
}

.edit-form label {

    font-size: 12px;

    color: #666;

    margin-top: 5px;
}

.edit-form input,
.edit-form select {

    width: 100%;

    height: 46px;

    border: 1px solid #ddd;

    border-radius: 12px;

    padding: 0 12px;

    font-family: inherit;

    font-size: 14px;

    outline: none;

    background: white;
}

.edit-form input:focus,
.edit-form select:focus {

    border-color: #607d8b;
}


/* =====================================================
   DELETE MODAL
===================================================== */

.delete-modal-card {

    text-align: center;
}

.delete-expense-content {

    padding: 5px 0 5px;
}

.delete-warning {

    font-size: 48px;

    margin-bottom: 12px;
}

.delete-question {

    font-size: 14px;

    font-weight: bold;

    margin-bottom: 16px;
}

.delete-expense-info {

    background: #f7f8f9;

    border-radius: 15px;

    padding: 15px;
}

.delete-description {

    font-size: 14px;

    font-weight: bold;

    margin-bottom: 8px;
}

.delete-amount {

    font-size: 18px;

    font-weight: 900;
}

.delete-confirm-button {

    border: none;

    border-radius: 13px;

    min-height: 46px;

    padding: 0 18px;

    background: #c62828;

    color: white;

    font-family: inherit;

    font-size: 14px;

    font-weight: bold;

    cursor: pointer;
}

.delete-confirm-button:hover {

    background: #b71c1c;
}

.delete-confirm-button:disabled {

    opacity: 0.55;

    cursor: not-allowed;
}


/* =====================================================
   TOAST
===================================================== */

.toast {

    position: fixed;

    left: 50%;

    bottom: 88px;

    transform:
        translateX(-50%)
        translateY(20px);

    width: calc(100% - 32px);

    max-width: 480px;

    background: #263238;

    color: white;

    padding: 13px 16px;

    border-radius: 13px;

    text-align: center;

    font-size: 13px;

    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;

    z-index: 2000;
}

.toast.show {

    opacity: 1;

    transform:
        translateX(-50%)
        translateY(0);
}


/* =====================================================
   NUMERIC FONT
===================================================== */

.hero-amount,
.summary-value,
.expense-amount,
.category-summary-amount,
.category-summary-footer,
.confirmation-amount,
.delete-amount,
.comparison-value,
.subscription-plan-price {

    font-family:
        "Vazirmatn",
        Tahoma,
        Arial,
        sans-serif;

    font-variant-numeric:
        tabular-nums;

    direction: rtl;
}

.hero-amount {

    font-weight: 800;

    letter-spacing: 0;
}

.summary-value {

    font-weight: 800;
}

.expense-amount {

    font-weight: 700;

    font-size: 13px;
}

.category-summary-amount {

    font-weight: 700;
}

.category-summary-footer span:first-child {

    font-family:
        "Vazirmatn",
        Tahoma,
        Arial,
        sans-serif;

    font-weight: 700;
}

.confirmation-amount {

    font-size: 23px;

    font-weight: 900;
}

.delete-amount {

    font-size: 18px;

    font-weight: 900;
}


/* =====================================================
   SUBSCRIPTION ICON
===================================================== */

.subscription-icon-button {

    width: 38px;

    height: 38px;

    border: none;

    background: transparent;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.subscription-icon-button:hover {

    background:
        rgba(0, 0, 0, 0.04);
}

.subscription-icon-button:active {

    transform:
        scale(0.9);
}

.subscription-icon {

    font-size: 19px;

    line-height: 1;
}


/* =====================================================
   SUBSCRIPTION STATUS
===================================================== */

.subscription-icon-button.trial .subscription-icon {

    opacity: 0.65;
}

.subscription-icon-button.warning .subscription-icon {

    opacity: 0.9;

    filter:
        saturate(1.4);
}

.subscription-icon-button.expired .subscription-icon {

    opacity: 1;

    filter:
        grayscale(1)
        sepia(1)
        saturate(6)
        hue-rotate(315deg);
}

.subscription-icon-button.active .subscription-icon {

    opacity: 1;
}


/* =====================================================
   SUBSCRIPTION PAYWALL
===================================================== */

.subscription-paywall {

    position: fixed;

    inset: 0;

    z-index: 5000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 16px;

    background:
        rgba(20, 24, 28, 0.48);

    backdrop-filter:
        blur(5px);

    -webkit-backdrop-filter:
        blur(5px);

    direction: rtl;
}

.subscription-paywall.hidden {

    display: none;
}


/* =====================================================
   PAYWALL CARD
===================================================== */

.subscription-paywall-card {

    position: relative;

    width: 100%;

    max-width: 350px;

    max-height:
        calc(100vh - 32px);

    overflow-y: auto;

    padding:
        30px
        22px
        20px;

    background: #ffffff;

    border-radius: 24px;

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.22);

    text-align: center;

    direction: rtl;
}


/* =====================================================
   PAYWALL CLOSE
===================================================== */

.subscription-paywall-close {

    position: absolute;

    top: 11px;

    left: 11px;

    width: 32px;

    height: 32px;

    padding: 0;

    border: none;

    border-radius: 50%;

    background: #f3f4f5;

    color: #555;

    font-family: inherit;

    font-size: 22px;

    line-height: 32px;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    z-index: 3;
}

.subscription-paywall-close:hover {

    background: #e9ebed;
}


/* =====================================================
   PAYWALL ICON
===================================================== */

.subscription-paywall-icon {

    width: 62px;

    height: 62px;

    margin:
        0 auto
        13px;

    border-radius: 18px;

    background: #f7f8f9;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 34px;

    line-height: 1;
}


/* =====================================================
   PAYWALL TITLE
===================================================== */

.subscription-paywall-title {

    width: 100%;

    margin-bottom: 8px;

    font-size: 17px;

    font-weight: 800;

    line-height: 1.8;

    color: #222;

    text-align: center;
}


/* =====================================================
   PAYWALL DESCRIPTION
===================================================== */

.subscription-paywall-description {

    width: 100%;

    max-width: 285px;

    margin:
        0 auto
        16px;

    font-size: 11px;

    line-height: 2;

    color: #777;

    text-align: center;
}


/* =====================================================
   PLAN
===================================================== */

.subscription-plan {

    width: 100%;

    margin:
        0 auto
        16px;

    padding:
        14px
        12px;

    border-radius: 17px;

    background: #f7f8f9;

    border:
        1px solid #edf0f2;

    text-align: center;
}

.subscription-plan-label {

    font-size: 10px;

    color: #888;

    margin-bottom: 4px;

    text-align: center;
}

.subscription-plan-price {

    font-size: 22px;

    font-weight: 900;

    line-height: 1.7;

    color: #263238;

    white-space: nowrap;

    text-align: center;
}

.subscription-plan-period {

    font-size: 9px;

    color: #999;

    margin-top: 1px;

    text-align: center;
}


/* =====================================================
   FEATURES
===================================================== */

.subscription-feature-list {

    width: 100%;

    margin:
        0 auto
        17px;

    padding: 0;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 4px;

    direction: rtl;

    text-align: center;
}

.subscription-feature-list div {

    width: 100%;

    max-width: 270px;

    padding:
        4px
        8px;

    border-radius: 8px;

    color: #555;

    font-size: 10px;

    line-height: 1.8;

    text-align: center;

    background: #fafafa;
}


/* =====================================================
   PAYWALL BUTTONS
===================================================== */

.subscription-paywall-card
.primary-button,
.subscription-paywall-card
.secondary-button {

    display: block;

    width: 100%;

    min-width: 0;

    margin-left: auto;

    margin-right: auto;

    text-align: center;

    box-sizing: border-box;
}

.subscription-paywall-card
.primary-button {

    margin-bottom: 9px;
}


/* =====================================================
   BODY LOCK
===================================================== */

body.subscription-modal-open {

    overflow: hidden;
}


/* =====================================================
   SETTINGS
===================================================== */

.settings-modal {

    position: fixed;

    inset: 0;

    z-index: 3000;

    background:
        rgba(0, 0, 0, 0.45);

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 16px;

    direction: rtl;
}

.settings-modal.hidden {

    display: none;
}

.settings-card {

    width: 100%;

    max-width: 520px;

    max-height:
        calc(100vh - 32px);

    overflow-y: auto;

    background: #ffffff;

    border-radius: 24px;

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.18);
}


/* =====================================================
   SETTINGS HEADER
   قرارداد ثابت:
   عنوان سمت راست
   دکمه بستن سمت چپ
===================================================== */

.settings-header {

    position: sticky;

    top: 0;

    z-index: 2;

    background: #ffffff;

    padding: 20px;

    border-bottom:
        1px solid #eeeeee;

    display: flex;

    flex-direction: row;

    align-items: center;

    justify-content: space-between;

    direction: rtl;

    min-height: 84px;
}

.settings-header-title {

    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;

    flex: 1;

    order: 1;

    text-align: right;
}

.settings-header-icon {

    width: 44px;

    height: 44px;

    flex:
        0 0
        44px;

    border-radius: 14px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #f5f5f5;

    font-size: 22px;
}

.settings-title {

    font-size: 19px;

    font-weight: 800;

    color: #222222;

    line-height: 1.6;

    text-align: right;
}

.settings-subtitle {

    margin-top: 4px;

    font-size: 12px;

    color: #888888;

    line-height: 1.6;

    text-align: right;
}

.settings-close {

    width: 38px;

    height: 38px;

    flex:
        0 0
        38px;

    border: none;

    border-radius: 12px;

    background: #f5f5f5;

    color: #555555;

    font-size: 18px;

    line-height: 1;

    cursor: pointer;

    order: 2;

    display: flex;

    align-items: center;

    justify-content: center;

    margin-right: 12px;

    margin-left: 0;
}

.settings-close:hover {

    background: #eceeef;

}

.settings-close:active {

    transform:
        scale(0.94);
}


/* =====================================================
   SETTINGS CONTENT
===================================================== */

.settings-content {

    padding:
        10px
        16px
        20px;
}


/* =====================================================
   SETTINGS ITEM
===================================================== */

.settings-item {

    width: 100%;

    border: none;

    background: transparent;

    padding:
        15px
        4px;

    display: flex;

    align-items: center;

    gap: 13px;

    text-align: right;

    direction: rtl;

    cursor: pointer;

    border-bottom:
        1px solid #f0f0f0;

    font-family: inherit;
}

.settings-item:last-child {

    border-bottom: none;
}

.settings-item:hover {

    background:
        rgba(
            0,
            0,
            0,
            0.015
        );
}

.settings-item:active {

    opacity: 0.7;
}

.settings-item-icon {

    width: 42px;

    height: 42px;

    flex:
        0 0
        42px;

    border-radius: 13px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #f7f7f7;

    font-size: 20px;
}

.settings-item-text {

    flex: 1;

    min-width: 0;

    text-align: right;
}

.settings-item-title {

    font-size: 14px;

    font-weight: 700;

    color: #222222;

    line-height: 1.6;

    text-align: right;
}

.settings-item-description {

    margin-top: 4px;

    font-size: 11px;

    color: #8a8a8a;

    line-height: 1.6;

    text-align: right;
}

.settings-item-arrow {

    width: 20px;

    flex:
        0 0
        20px;

    font-size: 25px;

    color: #aaaaaa;

    line-height: 1;

    display: flex;

    align-items: center;

    justify-content: center;
}

body.settings-modal-open {

    overflow: hidden;
}


/* =====================================================
   SETTINGS DETAIL MODAL
===================================================== */

#settingsDetailModal {

    z-index: 4000;
}

#settingsDetailModal .settings-card {

    max-width: 520px;
}

#settingsDetailModal .settings-content {

    padding:
        18px
        20px
        22px;
}

#settingsDetailModal .edit-form {

    width: 100%;
}

#settingsDetailModal .settings-item {

    width: 100%;

    border:
        1px solid #eeeeee;

    border-radius: 16px;

    background: #f9fafb;

    margin: 0;

    padding: 14px;

    cursor: default;
}

#settingsDetailModal .settings-item:hover {

    background: #f9fafb;
}


/* =====================================================
   SETTINGS DETAIL BUTTONS
===================================================== */

#settingsDetailModal
.primary-button {

    margin-top: 8px;
}


/* =====================================================
   CATEGORY MANAGEMENT
===================================================== */

.category-management-card {

    max-width: 560px;
}

.category-management-list {

    padding:
        8px
        16px;
}

.category-management-item {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding:
        14px
        4px;

    border-bottom:
        1px solid #eeeeee;

    direction: rtl;
}

.category-management-item:last-child {

    border-bottom: none;
}

.category-management-main {

    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;

    flex: 1;
}

.category-management-icon {

    width: 44px;

    height: 44px;

    flex:
        0 0
        44px;

    border-radius: 14px;

    background: #f7f7f7;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 21px;
}

.category-management-info {

    min-width: 0;

    flex: 1;

    text-align: right;
}

.category-management-name {

    font-size: 14px;

    font-weight: 700;

    color: #222;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    text-align: right;
}

.category-management-status {

    margin-top: 4px;

    font-size: 11px;

    text-align: right;
}

.category-management-status.active {

    color: #2e8b57;
}

.category-management-status.inactive {

    color: #c62828;
}

.category-management-actions {

    display: flex;

    align-items: center;

    gap: 6px;

    direction: ltr;

    flex-shrink: 0;
}

.category-action-button {

    width: 36px;

    height: 36px;

    border: none;

    border-radius: 11px;

    background: #f5f5f5;

    cursor: pointer;

    font-size: 16px;

    display: flex;

    align-items: center;

    justify-content: center;
}

.category-action-button:hover {

    background: #eceff1;
}

.category-action-button:active {

    opacity: 0.65;

    transform:
        scale(0.95);
}

.category-management-footer {

    padding:
        14px
        16px
        20px;
}

.category-management-footer
.primary-button {

    width: 100%;
}

.category-management-loading,
.category-management-empty,
.category-management-error {

    text-align: center;

    padding:
        30px
        15px;

    font-size: 13px;

    color: #888;
}

.category-management-error {

    color: #c62828;
}


/* ============================================================
   MOBILE
=========================================================== */

@media (max-width: 520px) {

    .app-title {

        font-size: 21px;
    }

    .hero-card {

        margin:
            0 14px 14px;

        padding: 20px;
    }

    .quick-input-card,
    .dashboard-section {

        margin:
            0 14px 14px;

        padding: 15px;
    }


    /* -----------------------------------------------
       MONTH COMPARISON
    ----------------------------------------------- */

    .monthly-comparison {

        padding: 12px;

        gap: 8px;
    }

    .comparison-label {

        font-size: 10px;
    }

    .comparison-value {

        font-size: 10px;

        text-align: left;
    }


    /* -----------------------------------------------
       CATEGORY SUMMARY
    ----------------------------------------------- */

    #categoryList {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 7px;
    }

    #categoryList
    .category-summary-item {

        padding:
            9px 5px;

        border-radius: 13px;
    }

    #categoryList
    .category-summary-header {

        gap: 3px;
    }

    #categoryList
    .category-summary-title {

        gap: 4px;
    }

    #categoryList
    .category-summary-icon {

        width: 28px;

        height: 28px;

        font-size: 15px;

        border-radius: 9px;
    }

    #categoryList
    .category-summary-name {

        font-size: 7px;

        line-height: 1.4;
    }

    #categoryList
    .category-summary-count {

        font-size: 6px;
    }

    #categoryList
    .category-summary-amount {

        font-size: 7px;
    }

    #categoryList
    .category-progress {

        height: 5px;

        margin-top: 7px;
    }

    #categoryList
    .category-summary-footer {

        margin-top: 4px;

        font-size: 6px;
    }

    .expense-amount {

        font-size: 11px;
    }


    /* -----------------------------------------------
       CHART
    ----------------------------------------------- */

    .category-chart-wrapper {

        padding: 13px;

        margin-top: 14px;
    }

    .category-chart-title {

        font-size: 13px;
    }

    .category-chart-container {

        height: 250px;
    }


    /* -----------------------------------------------
       SUBSCRIPTION
    ----------------------------------------------- */

    .subscription-paywall {

        padding: 12px;
    }

    .subscription-paywall-card {

        max-width: 340px;

        padding:
            27px
            17px
            17px;

        border-radius: 22px;
    }

    .subscription-paywall-icon {

        width: 58px;

        height: 58px;

        font-size: 31px;

        margin-bottom: 10px;
    }

    .subscription-paywall-title {

        font-size: 16px;
    }

    .subscription-paywall-description {

        font-size: 10px;

        max-width: 275px;
    }

    .subscription-plan {

        padding:
            13px
            10px;
    }

    .subscription-plan-price {

        font-size: 20px;
    }

    .subscription-feature-list {

        margin-bottom: 15px;
    }

    .subscription-feature-list div {

        max-width: 250px;

        font-size: 9px;
    }


    /* -----------------------------------------------
       SETTINGS
    ----------------------------------------------- */

    .settings-modal {

        align-items: flex-end;

        padding: 0;
    }

    .settings-card {

        max-width: none;

        max-height: 90vh;

        border-radius:
            24px
            24px
            0
            0;
    }

    .settings-header {

        padding: 17px;

        min-height: 78px;
    }

    .settings-header-title {

        gap: 9px;
    }

    .settings-header-icon {

        width: 40px;

        height: 40px;

        flex-basis: 40px;

        border-radius: 12px;

        font-size: 20px;
    }

    .settings-title {

        font-size: 17px;
    }

    .settings-subtitle {

        font-size: 10px;
    }

    .settings-close {

        width: 36px;

        height: 36px;

        flex-basis: 36px;

        margin-right: 9px;

        border-radius: 11px;
    }

    .settings-content {

        padding:
            8px
            14px
            18px;
    }

    .settings-item {

        padding:
            14px
            2px;
    }

    .settings-item-icon {

        width: 39px;

        height: 39px;

        flex-basis: 39px;

        border-radius: 12px;

        font-size: 19px;
    }

    .settings-item-title {

        font-size: 13px;
    }

    .settings-item-description {

        font-size: 10px;

        margin-top: 3px;
    }

    .settings-item-arrow {

        font-size: 23px;
    }


    /* -----------------------------------------------
       SETTINGS DETAIL
    ----------------------------------------------- */

    #settingsDetailModal .settings-content {

        padding:
            15px
            16px
            20px;
    }

    #settingsDetailModal .settings-item {

        padding: 13px;
    }


    /* -----------------------------------------------
       CATEGORY MANAGEMENT
    ----------------------------------------------- */

    .category-management-card {

        max-height: 90vh;

        border-radius:
            24px
            24px
            0
            0;
    }

    .category-management-list {

        padding:
            6px
            14px;
    }

    .category-management-item {

        padding:
            13px
            2px;

        gap: 8px;
    }

    .category-management-main {

        gap: 9px;
    }

    .category-management-icon {

        width: 40px;

        height: 40px;

        flex-basis: 40px;

        border-radius: 12px;

        font-size: 19px;
    }

    .category-management-name {

        font-size: 13px;
    }

    .category-management-status {

        font-size: 10px;

        margin-top: 3px;
    }

    .category-management-actions {

        gap: 4px;
    }

    .category-action-button {

        width: 33px;

        height: 33px;

        border-radius: 10px;

        font-size: 14px;
    }

    .category-management-footer {

        padding:
            12px
            14px
            18px;
    }
}


/* ============================================================
   VERY SMALL MOBILE
=========================================================== */

@media (max-width: 380px) {

    .app-title {

        font-size: 19px;
    }

    .hero-amount {

        font-size: 26px;
    }


    /* -----------------------------------------------
       MONTH COMPARISON
    ----------------------------------------------- */

    .monthly-comparison {

        display: flex;

        flex-direction: column;

        align-items: flex-start;

        gap: 3px;
    }

    .comparison-label {

        font-size: 9px;
    }

    .comparison-value {

        font-size: 10px;

        width: 100%;

        text-align: right;
    }


    /* -----------------------------------------------
       CATEGORY
    ----------------------------------------------- */

    #categoryList {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 5px;
    }

    #categoryList
    .category-summary-item {

        padding:
            7px 4px;
    }

    #categoryList
    .category-summary-icon {

        width: 25px;

        height: 25px;

        font-size: 13px;
    }

    #categoryList
    .category-summary-name {

        font-size: 6px;

        line-height: 1.4;
    }

    #categoryList
    .category-summary-amount {

        font-size: 6px;
    }

    #categoryList
    .category-summary-footer {

        font-size: 5px;
    }


    /* -----------------------------------------------
       EXPENSE ACTIONS
    ----------------------------------------------- */

    .expense-edit-button,
    .expense-delete-button {

        width: 28px;

        height: 28px;

        font-size: 13px;
    }


    /* -----------------------------------------------
       CHART
    ----------------------------------------------- */

    .category-chart-container {

        height: 220px;
    }


    /* -----------------------------------------------
       SUBSCRIPTION
    ----------------------------------------------- */

    .subscription-paywall {

        padding: 8px;
    }

    .subscription-paywall-card {

        max-height:
            calc(100vh - 16px);

        padding:
            23px
            14px
            14px;

        border-radius: 20px;
    }

    .subscription-paywall-icon {

        width: 54px;

        height: 54px;

        font-size: 29px;
    }

    .subscription-paywall-title {

        font-size: 15px;

        line-height: 1.7;
    }

    .subscription-paywall-description {

        font-size: 9px;

        max-width: 250px;

        line-height: 1.9;
    }

    .subscription-plan {

        padding:
            11px
            8px;

        margin-bottom: 13px;
    }

    .subscription-plan-label {

        font-size: 9px;
    }

    .subscription-plan-price {

        font-size: 18px;
    }

    .subscription-plan-period {

        font-size: 8px;
    }

    .subscription-feature-list {

        gap: 3px;

        margin-bottom: 13px;
    }

    .subscription-feature-list div {

        max-width: 230px;

        padding:
            3px
            6px;

        font-size: 8px;

        line-height: 1.7;
    }


    /* -----------------------------------------------
       SETTINGS
    ----------------------------------------------- */

    .settings-header {

        padding:
            15px
            14px;
    }

    .settings-header-icon {

        width: 36px;

        height: 36px;

        flex-basis: 36px;

        font-size: 18px;
    }

    .settings-title {

        font-size: 15px;
    }

    .settings-subtitle {

        font-size: 9px;
    }

    .settings-close {

        width: 34px;

        height: 34px;

        flex-basis: 34px;

        margin-right: 7px;

        font-size: 17px;
    }

    .settings-item-icon {

        width: 36px;

        height: 36px;

        flex-basis: 36px;

        font-size: 17px;
    }

    .settings-item-title {

        font-size: 12px;
    }

    .settings-item-description {

        font-size: 9px;
    }

    .settings-item-arrow {

        font-size: 21px;
    }


    /* -----------------------------------------------
       CATEGORY MANAGEMENT
    ----------------------------------------------- */

    .category-management-icon {

        width: 36px;

        height: 36px;

        flex-basis: 36px;

        font-size: 17px;
    }

    .category-management-name {

        font-size: 12px;
    }

    .category-management-status {

        font-size: 9px;
    }

    .category-action-button {

        width: 30px;

        height: 30px;

        font-size: 13px;
    }

    .category-management-footer
    .primary-button {

        min-height: 44px;

        font-size: 13px;
    }
}