/* ============ هدر (مطابق الگوی اسکرین‌شات) ============ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--bg);
    max-width: 520px;
    margin: 0 auto;
}
.header-left, .header-right { display: flex; align-items: center; gap: 10px; }
.header-center { text-align: center; }
.header-center strong { font-size: 16px; font-weight: 700; display: block; }
.header-center small { font-size: 11px; color: var(--text-muted); }

.icon-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: var(--text);
    position: relative;
}
.avatar-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.avatar-btn.brand-icon {
    background: var(--primary);
    color: var(--primary-contrast);
    font-size: 18px;
}
.notif-dot {
    position: absolute; top: 6px; left: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger);
    border: 1.5px solid var(--bg);
}
.notif-badge {
    position: absolute; top: -4px; left: -6px;
    background: var(--danger); color: #fff;
    border-radius: 50%; font-size: 10px;
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
}

/* ============ اسلایدر اخبار ============ */
.news-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    margin-bottom: 16px;
}
.news-slide {
    flex: 0 0 90%;
    scroll-snap-align: start;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #7a1f1f 0%, #c9722f 100%);
    color: #fff;
    padding: 20px;
    min-height: 110px;
    position: relative;
    overflow: hidden;
}
.news-slide::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 90% 20%, rgba(255,255,255,.12), transparent 60%);
}
.news-slide .slide-title { font-size: 15px; font-weight: 700; position: relative; }
.news-slide .slide-body { font-size: 12.5px; margin-top: 8px; opacity: .9; position: relative; }
.slider-dots { display: flex; gap: 5px; justify-content: center; margin: 4px 0 16px; }
.slider-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.slider-dots span.active { width: 18px; border-radius: 4px; background: var(--primary); }

/* ============ گرید ویجت‌ها (کارت دوستونه مثل اسکرین‌شات) ============ */
.widget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 6px;
}
.widget-grid .widget-full { grid-column: 1 / -1; }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
    display: flex;
    flex-direction: column;
    min-height: 190px;
}
.stat-card:active { transform: scale(0.98); }
.stat-card:hover { border-color: var(--primary); }

.stat-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}
.stat-card-title { font-size: 14px; font-weight: 700; line-height: 1.4; }
.stat-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.stat-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.stat-icon.gold { background: var(--primary-soft); color: var(--primary); }
.stat-icon.orange { background: rgba(230,126,34,.15); color: #e67e22; }
.stat-icon.green { background: rgba(46,158,91,.15); color: var(--success); }
.stat-icon.blue { background: rgba(66,133,244,.15); color: #4285f4; }
.stat-icon.red { background: rgba(214,69,69,.15); color: var(--danger); }

.stat-value {
    font-size: 22px;
    font-weight: 800;
    margin: 6px 0 2px;
}
.stat-value small { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.stat-spark {
    margin-top: auto;
    padding-top: 10px;
    height: 34px;
}
.stat-spark svg { width: 100%; height: 100%; display: block; }

.stat-card-footer {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 12px;
    padding: 8px;
}

/* لیست خلاصه (مثل قوانین/اخبار داخل کارت) قبل از باز شدن مودال */
.summary-list { font-size: 13px; line-height: 1.8; margin: 0; padding-inline-start: 0; list-style: none; flex: 1; }
.summary-list li {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 0;
    color: var(--text);
}
.summary-list li::before { content: '•'; color: var(--primary); font-weight: 900; }
.summary-more { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============ مونوی پایین چسبان (مطابق الگو) ============ */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 520px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    color: var(--text-muted);
    min-width: 48px;
}
.nav-item .nav-icon { font-size: 19px; }
.nav-item.active { color: var(--primary); font-weight: 700; }
.nav-item-fab {
    width: 54px; height: 54px;
    margin-top: -30px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-contrast);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 16px rgba(212,175,55,.35);
}

/* ============ کارت‌های احراز هویت ============ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 24px;
}
.auth-title { margin: 0 0 20px; font-size: 20px; text-align: center; font-weight: 700; }
.auth-footer-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-footer-link a { color: var(--primary); font-weight: 700; }

/* ============ ویجت‌های عمومی (صفحات داخلی غیر داشبورد) ============ */
.widget-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}
.widget-card h3 { margin: 0 0 10px; font-size: 15px; }

/* ============ مودال جزئیات ویجت ============ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-sheet {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    transform: translateY(24px);
    transition: transform .25s ease;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
    width: 42px; height: 4px; border-radius: 3px;
    background: var(--border);
    margin: 0 auto 14px;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.modal-header h2 { font-size: 17px; margin: 0; font-weight: 700; }
.modal-close {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 50%; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--text-muted); cursor: pointer;
}
.modal-body { font-size: 14px; line-height: 1.9; }
.modal-body .full-list li { padding: 8px 0; border-bottom: 1px solid var(--border); list-style: none; }
.modal-body .full-list { margin: 0; padding: 0; }
