/* ══════════════════════════════════════════ */
/* ═══════ نوار تاریخ فشرده ═══════ */
/* ══════════════════════════════════════════ */

.date-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: #ffffff; border-radius: 16px; padding: 12px 16px;
    margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
}
.date-nav-btn {
    background: #f5f5f7; border: none; width: 38px; height: 38px;
    border-radius: 10px; cursor: pointer; font-size: 14px; color: #0071e3;
    transition: all 0.15s; font-family: inherit;
}
.date-nav-btn:hover { background: #e8f0fe; }
.date-nav-btn:active { transform: scale(0.95); }
.date-center { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.date-prefix { font-size: 10px; color: #86868b; font-weight: 700; }
.date-full { font-size: 14px; font-weight: 800; color: #1d1d1f; }

/* ══════════════════════════════════════════ */
/* ═══════ کارت خلاصه و بودجه ═══════ */
/* ══════════════════════════════════════════ */

.summary-card {
    background: linear-gradient(135deg, #ffffff, #fafbff);
    border-radius: 18px; padding: 16px 18px; margin-bottom: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,113,227,0.08);
}
.summary-row { display: flex; align-items: center; gap: 15px; margin-bottom: 12px; }
.summary-item { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.summary-label { font-size: 11px; color: #86868b; font-weight: 600; }
.summary-value { font-size: 16px; font-weight: 800; }
.summary-value.green { color: #34c759; }
.summary-value.blue { color: #0071e3; }
.summary-divider { width: 1px; height: 30px; background: rgba(0,0,0,0.08); }

.edit-budget-btn {
    background: #f5f5f7; border: none; width: 32px; height: 32px;
    border-radius: 8px; cursor: pointer; font-size: 14px; color: #0071e3; transition: all 0.15s;
}
.edit-budget-btn:hover { background: #e8f0fe; }
.budget-bar-bg { background: #e5e5ea; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.budget-bar-fill { height: 100%; background: #34c759; border-radius: 4px; width: 0%; transition: width 0.4s, background-color 0.4s; }
.budget-bar-fill.warning { background: #ff9500; }
.budget-bar-fill.danger  { background: #ff3b30; }
.budget-status { font-size: 11px; text-align: center; color: #888; font-weight: 600; }

/* ══════════════════════════════════════════ */
/* ═══════ دکمه‌های اصلی ═══════ */
/* ══════════════════════════════════════════ */

.add-expense-btn {
    width: 100%; background: linear-gradient(135deg, #34c759, #2fb14e);
    color: white; border: none; padding: 16px; border-radius: 14px;
    font-family: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 15px; box-shadow: 0 6px 18px rgba(52, 199, 89, 0.3); transition: all 0.2s;
}
.add-expense-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(52, 199, 89, 0.4); }

/* ══════════════════════════════════════════ */
/* ═══════ دکمه‌های ردیفی و کوچیک ═══════ */
/* ══════════════════════════════════════════ */

.button-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.open-modal-btn-small {
    background: #ffffff; color: #1d1d1f; border: 1px solid #e5e5ea;
    padding: 12px 5px; border-radius: 12px; font-family: inherit;
    font-size: 12px; font-weight: 800; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02); transition: all 0.2s;
}
.open-modal-btn-small:hover {
    border-color: #0071e3; background: #f8f9fc;
    transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0, 113, 227, 0.1);
}

/* ══════════════════════════════════════════ */
/* ═══════ لیست هزینه‌ها ═══════ */
/* ══════════════════════════════════════════ */

.list-card { padding: 20px !important; margin-bottom: 20px !important; }
.expense-list { list-style: none; padding: 0; margin: 0; }
.expense-list li {
    display: flex !important; align-items: center !important; justify-content: space-between !important;
    padding: 12px 14px !important; background: #f8f9fc !important;
    border: 1px solid #e5e5ea !important; border-radius: 12px !important;
    margin-bottom: 8px !important; transition: all 0.15s;
}
.expense-list li:hover { background: #ffffff !important; border-color: #34c759 !important; }
.expense-del { background: transparent; border: none; color: #ff3b30; cursor: pointer; font-size: 16px; padding: 0 8px; }

/* ══════════════════════════════════════════ */
/* ═══════ فیلترها (چیپ‌های داخل مودال) ═══════ */
/* ══════════════════════════════════════════ */

.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
    background: #f5f5f7; border: 1px solid #e5e5ea; padding: 8px 16px;
    border-radius: 20px; font-family: inherit; font-size: 12px; font-weight: 700;
    color: #555; cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.filter-chip:hover { background: #e8f0fe; border-color: #0071e3; }
.filter-chip.active { background: #0071e3; color: white; border-color: #0071e3; }

/* ══════════════════════════════════════════ */
/* ═══════ نتایج زنده در مودال فیلتر ═══════ */
/* ══════════════════════════════════════════ */

#filterResultList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fc;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 12px;
}
#filterResultList li .res-desc { font-weight: 700; color: #1d1d1f; }
#filterResultList li .res-amount { font-weight: 800; color: #34c759; font-family: monospace; font-size: 13px; }
#filterResultList li.res-empty { text-align: center; color: #aaa; padding: 20px; justify-content: center; background: none; }

/* ══════════════════════════════════════════ */
/* ═══════ آمار و نمودارها ═══════ */
/* ══════════════════════════════════════════ */

.stats-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; margin-top: 10px; }
.stats-mini-box { background: #f8f9fc; padding: 12px 8px; border-radius: 12px; text-align: center; }
.stats-mini-icon { font-size: 20px; margin-bottom: 5px; }
.stats-mini-value { font-size: 13px; font-weight: 800; color: #1d1d1f; margin-bottom: 3px; }
.stats-mini-label { font-size: 10px; color: #86868b; font-weight: 600; }
.chart-title { font-size: 13px; font-weight: 800; color: #1d1d1f; margin: 20px 0 10px 0; }
.chart-container { position: relative; height: 220px; }

/* ══════════════════════════════════════════ */
/* ═══════ مقایسه ═══════ */
/* ══════════════════════════════════════════ */

.stat-row { display: flex; justify-content: space-between; font-size: 14px; color: #555; }
.stat-row strong { font-weight: 800; }
.stat-row strong.green { color: #34c759; }
.compare-badge { text-align: center; padding: 12px; background: #f5f5f7; border-radius: 10px; font-weight: 700; font-size: 13px; margin-top: 5px; }
.compare-badge.increase { background:#ffe5e0; color:#e74c3c; }
.compare-badge.decrease { background:#e8f8ed; color:#34c759; }
.compare-badge.same     { background:#f5f5f7; color:#86868b; }

/* ══════════════════════════════════════════ */
/* ═══════ مودال و دسته‌بندی‌ها ═══════ */
/* ══════════════════════════════════════════ */

.modal-close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: #86868b; width: 32px; height: 32px; border-radius: 8px; transition: all 0.15s; }
.modal-close-btn:hover { background: #f5f5f7; color: #ff3b30; }

#categoryList li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; background: #f8f9fc; border-radius: 10px;
    margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #1d1d1f;
}

/* ══════════════════════════════════════════ */
/* ═══════ تقویم شمسی اختصاصی ═══════ */
/* ══════════════════════════════════════════ */

.shamsi-date-btn {
    width: 100%; padding: 14px 16px; background: #f5f5f7; border: 1px solid #e5e5ea;
    border-radius: 12px; font-family: inherit; font-size: 14px; font-weight: 700;
    color: #1d1d1f; cursor: pointer; display: flex; justify-content: space-between;
    align-items: center; transition: all 0.2s;
}
.shamsi-date-btn:hover { border-color: #0071e3; }
.shamsi-calendar { margin-top: 10px; background: #ffffff; border: 1px solid #e5e5ea; border-radius: 16px; padding: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.shamsi-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.shamsi-header button { background: #f5f5f7; border: none; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: #0071e3; font-family: inherit; font-size: 14px; }
.shamsi-header button:hover { background: #e8f0fe; }
.shamsi-month-year { font-weight: 800; font-size: 14px; color: #1d1d1f; }
.shamsi-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; text-align: center; font-size: 11px; font-weight: 700; color: #86868b; }
.shamsi-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.shamsi-day { aspect-ratio: 1; border: none; background: #f8f9fc; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 700; color: #1d1d1f; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.shamsi-day:hover { background: #e8f0fe; color: #0071e3; }
.shamsi-day.selected { background: #0071e3; color: white; }
.shamsi-day.empty { background: transparent; cursor: default; }

/* ══════════════════════════════════════════ */
/* ═══════ حالت تاریک ═══════ */
/* ══════════════════════════════════════════ */

body.dark .date-bar { background: #1e293b; border-color: #334155; }
body.dark .date-nav-btn { background: #334155; color: #60a5fa; }
body.dark .date-full { color: #f8fafc; }

body.dark .summary-card { background: #1e293b; border-color: #334155; }
body.dark .summary-label { color: #94a3b8; }
body.dark .budget-bar-bg { background: #334155; }
body.dark .expense-list li { background: #0f172a !important; border-color: #334155 !important; }
body.dark .filter-chip { background: #1e293b; border-color: #334155; color: #cbd5e1; }
body.dark .filter-chip.active { background: #3b82f6; color: white; }
body.dark .open-modal-btn-small { background: #1e293b; border-color: #334155; color: #f8fafc; }
body.dark .open-modal-btn-small:hover { background: #0f172a; border-color: #3b82f6; }
body.dark .stats-mini-box { background: #0f172a; }
body.dark .stats-mini-value { color: #f8fafc; }
body.dark .chart-title { color: #f8fafc; }
body.dark .stat-row { color: #cbd5e1; }
body.dark .compare-badge { background: #0f172a; color: #cbd5e1; }

body.dark #filterResultList li { background: #0f172a; }
body.dark #filterResultList li .res-desc { color: #f8fafc; }
body.dark #filterResultList li .res-amount { color: #4ade80; }
body.dark #filterResultList li.res-empty { background: none; }

body.dark .shamsi-date-btn { background: #1e293b; border-color: #334155; color: #f8fafc; }
body.dark .shamsi-calendar { background: #1e293b; border-color: #334155; }
body.dark .shamsi-header button { background: #334155; color: #60a5fa; }
body.dark .shamsi-month-year { color: #f8fafc; }
body.dark .shamsi-day { background: #0f172a; color: #e2e8f0; }
body.dark .shamsi-day:hover { background: #334155; color: #60a5fa; }
body.dark .shamsi-day.selected { background: #3b82f6; color: white; }

body.dark #categoryList li { background: #0f172a; color: #f8fafc; }

/* ══════════════════════════════════════════ */
/* ═══════ رفع مشکل باکس جستجو در دارک ═══════ */
/* ══════════════════════════════════════════ */

#filterModal .modal-body > .form-group:first-child {
    background: #ffffff;
}

body.dark #filterModal .modal-body > .form-group:first-child {
    background: #1e293b !important;
}

#searchExpense {
    background: #f5f5f7;
    border: 1px solid #e5e5ea;
}

body.dark #searchExpense {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* ══════════════════════════════════════════ */
/* ═══════ موبایل ═══════ */
/* ══════════════════════════════════════════ */

@media (max-width: 500px) {
    .summary-value { font-size: 14px; }
    .add-expense-btn { padding: 14px; font-size: 14px; }
    .stats-mini-grid { gap: 8px; }
    .stats-mini-value { font-size: 12px; }
    .stats-mini-label { font-size: 9px; }
    .open-modal-btn-small { font-size: 11px; padding: 10px 2px; }
}