/* ============================================================
   گروه تربیتی شهید جعفری — استایل کامل سامانه
   فایل: style.css
   ============================================================ */

/* ---------- متغیرها (تم روشن) ---------- */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;

    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;

    /* رنگ ۹ دسته‌بندی */
    --cat-study:  #4f46e5;
    --cat-class:  #0ea5e9;
    --cat-skill:  #8b5cf6;
    --cat-book:   #ec4899;
    --cat-sport:  #10b981;
    --cat-sleep:  #6366f1;
    --cat-family: #f59e0b;
    --cat-media:  #ef4444;
    --cat-other:  #64748b;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, .08);
    --radius: 14px;
    --radius-sm: 9px;
}

/* ---------- تم تیره ---------- */
[data-theme="dark"] {
    --primary-light: #312e81;
    --success-light: #064e3b;
    --danger-light: #7f1d1d;
    --warning-light: #78350f;

    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --text-main: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
}

/* ---------- پایه ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { font-size: 15px; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    transition: background-color .3s ease, color .3s ease;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button { cursor: pointer; border: none; background: none; }

.hidden { display: none !important; }

/* کانتینر اصلی — موبایل‌محور */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 14px 110px;
}

/* ---------- صفحات ---------- */
.page { display: none; animation: fadeIn .35s ease; }
.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- لودینگ اولیه ---------- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    z-index: 9999;
}

.loading-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: .95rem;
}

/* ============================================================
   صفحه ورود
   ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
    padding: 38px 26px 30px;
    text-align: center;
}

.login-logo {
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .35);
}

.login-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-bottom: 26px;
}

/* ---------- فرم‌ها ---------- */
.form-group {
    margin-bottom: 16px;
    text-align: right;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    transition: border-color .2s ease, box-shadow .2s ease;
    outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.8;
}

/* چک‌باکس «مرا به خاطر بسپار» */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: .88rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.form-check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

/* ---------- دکمه‌ها ---------- */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: background .2s ease, transform .1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(.98); }

.btn-secondary {
    padding: 10px 18px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: filter .2s ease;
}

.btn-secondary:hover { filter: brightness(.95); }

.btn-danger {
    padding: 8px 14px;
    background: var(--danger-light);
    color: var(--danger);
    font-weight: 600;
    font-size: .85rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sm { padding: 7px 12px; font-size: .83rem; }

/* دکمه آیکونی (تم، خروج، تنظیمات) */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    flex-shrink: 0;
}

.icon-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ============================================================
   هدر داشبورد و ادمین
   ============================================================ */
.dashboard-header, .admin-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-info { flex: 1; min-width: 0; }

.header-info .user-fullname {
    font-weight: 800;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-info .header-date {
    font-size: .8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-actions { display: flex; gap: 8px; }

/* ============================================================
   تب‌های ۷ روز هفته
   ============================================================ */
.history-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    margin-bottom: 6px;
    scrollbar-width: thin;
}

.history-day-tab {
    flex: 1;
    min-width: 62px;
    padding: 10px 6px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    transition: all .2s ease;
    flex-shrink: 0;
}

.history-day-tab .tab-day-name {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.history-day-tab .tab-day-date {
    display: block;
    font-size: .7rem;
    color: var(--text-secondary);
}

.history-day-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.history-day-tab.active .tab-day-date { color: rgba(255, 255, 255, .8); }

/* ---------- بنر فقط‌خواندنی (روزهای گذشته) ---------- */
.readonly-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--warning-light);
    color: var(--warning);
    font-size: .85rem;
    font-weight: 600;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    border: 1px solid var(--warning);
}

/* ============================================================
   کارت‌های ۹ فعالیت
   ============================================================ */
.activities-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.activity-item-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    border-right: 4px solid var(--border-color);
}

.activity-item-card[data-category="study"]  { border-right-color: var(--cat-study); }
.activity-item-card[data-category="class"]  { border-right-color: var(--cat-class); }
.activity-item-card[data-category="skill"]  { border-right-color: var(--cat-skill); }
.activity-item-card[data-category="book"]   { border-right-color: var(--cat-book); }
.activity-item-card[data-category="sport"]  { border-right-color: var(--cat-sport); }
.activity-item-card[data-category="sleep"]  { border-right-color: var(--cat-sleep); }
.activity-item-card[data-category="family"] { border-right-color: var(--cat-family); }
.activity-item-card[data-category="media"]  { border-right-color: var(--cat-media); }
.activity-item-card[data-category="other"]  { border-right-color: var(--cat-other); }

.activity-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.activity-icon.study  { background: var(--cat-study); }
.activity-icon.class  { background: var(--cat-class); }
.activity-icon.skill  { background: var(--cat-skill); }
.activity-icon.book   { background: var(--cat-book); }
.activity-icon.sport  { background: var(--cat-sport); }
.activity-icon.sleep  { background: var(--cat-sleep); }
.activity-icon.family { background: var(--cat-family); }
.activity-icon.media  { background: var(--cat-media); }
.activity-icon.other  { background: var(--cat-other); }

.activity-name { font-weight: 700; font-size: .98rem; flex: 1; }

.activity-duration-badge {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
}

.activity-inputs-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.activity-time-select {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    outline: none;
}

.activity-time-select:focus { border-color: var(--primary); }

.activity-note-input {
    flex: 2;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    outline: none;
    font-size: .85rem;
}

.activity-note-input:focus { border-color: var(--primary); }

.activity-inputs-row input:disabled,
.activity-inputs-row select:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ---------- یادداشت روزانه ---------- */
.daily-note-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.section-title i { color: var(--primary); }

/* ============================================================
   بخش آمار و نمودار زنده
   ============================================================ */
.stats-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.chart-wrap {
    position: relative;
    height: 230px;
    margin-bottom: 14px;
}

.chart-wrap-tall { height: 300px; }

.stats-totals {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin-bottom: 14px;
    text-align: center;
}

.stat-total-box { flex: 1; }

.stat-total-box .stat-total-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-total-box .stat-total-label {
    font-size: .75rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.legend-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    font-weight: 600;
    padding: 5px 11px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---------- استریک (روزهای متوالی) ---------- */
.streak-section {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 18px;
    margin-bottom: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
}

.streak-icon {
    font-size: 2.1rem;
    flex-shrink: 0;
}

.streak-count {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
}

.streak-message {
    font-size: .85rem;
    opacity: .92;
    margin-top: 3px;
}

/* ---------- بنر مقایسه با دیروز ---------- */
.comparison-banner {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.comparison-banner.positive {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.comparison-banner.negative {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

.comparison-banner.neutral {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* ============================================================
   نوار ذخیره چسبان پایین صفحه
   ============================================================ */
.sticky-save-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 12px 14px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
    z-index: 100;
}

.btn-save-all {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: background .2s ease, transform .1s ease;
}

.btn-save-all:hover { background: var(--primary-hover); }
.btn-save-all:active { transform: scale(.98); }

/* وقتی مجموع بیش از ۲۴ ساعت شد */
.btn-save-all.over-limit {
    background: var(--danger);
    cursor: not-allowed;
}

/* ============================================================
   پنل ادمین — تب‌های اصلی
   ============================================================ */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-tab-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .92rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all .2s ease;
}

.admin-tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.admin-view { display: none; }
.admin-view.active { display: block; animation: fadeIn .3s ease; }

/* ---------- دکمه‌های فیلتر بازه ---------- */
.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.admin-filter-btn {
    padding: 8px 15px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all .2s ease;
}

.admin-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.admin-filter-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-filter-inputs .form-group { flex: 1; min-width: 130px; margin-bottom: 0; }

/* ---------- زیرتب گروهی / فردی ---------- */
.admin-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px;
}

.admin-subtab-btn {
    flex: 1;
    padding: 9px;
    border-radius: 7px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all .2s ease;
}

.admin-subtab-btn.active {
    background: var(--primary);
    color: #fff;
}

.admin-subview { display: none; }
.admin-subview.active { display: block; animation: fadeIn .3s ease; }

/* ---------- برچسب بازه گزارش ---------- */
.period-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .82rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

/* ---------- کارت‌های آمار ادمین ---------- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.admin-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px 10px;
    text-align: center;
}

.admin-stat-card .stat-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 9px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.admin-stat-card .stat-value {
    font-size: 1.1rem;
    font-weight: 800;
}

.admin-stat-card .stat-label {
    font-size: .72rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

/* ---------- کارت نمودار ---------- */
.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.chart-card .section-title { font-size: .93rem; }

/* ============================================================
   گزارش فردی
   ============================================================ */
.individual-select-wrap { margin-bottom: 16px; }

.individual-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
}

.individual-empty i {
    font-size: 2.6rem;
    margin-bottom: 14px;
    opacity: .4;
    display: block;
}

.individual-header {
    display: flex;
    align-items: center;
    gap: 13px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.individual-header .member-name { font-weight: 800; font-size: 1.05rem; }
.individual-header .member-username { font-size: .8rem; color: var(--text-secondary); margin-top: 2px; }

/* ---------- لیست یادداشت‌ها ---------- */
.notes-list { display: flex; flex-direction: column; gap: 10px; }

.note-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.note-item .note-date {
    font-size: .75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.note-item .note-text {
    font-size: .88rem;
    line-height: 1.8;
    color: var(--text-main);
}

/* ============================================================
   بخش هوش مصنوعی
   ============================================================ */
.ai-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.ai-quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.ai-prompt-chip {
    padding: 8px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    transition: filter .2s ease;
}

.ai-prompt-chip:hover { filter: brightness(.93); }

.ai-input-row {
    display: flex;
    gap: 9px;
}

.ai-input-row .form-input { flex: 1; }

.ai-send-btn {
    width: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s ease;
}

.ai-send-btn:hover { background: var(--primary-hover); }

.ai-answer-box {
    margin-top: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: .9rem;
    line-height: 2;
    white-space: pre-wrap;
    display: none;
}

.ai-answer-box.visible { display: block; animation: fadeIn .3s ease; }

/* ============================================================
   مدیریت کاربران
   ============================================================ */
.users-form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.users-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.users-form-grid .form-group { margin-bottom: 0; }
.users-form-grid .full-width { grid-column: 1 / -1; }

.users-list { display: flex; flex-direction: column; gap: 10px; }

.admin-user-item {
    display: flex;
    align-items: center;
    gap: 11px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 13px 15px;
}

.admin-user-item .avatar-circle {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
}

.user-item-info { flex: 1; min-width: 0; }

.user-item-info .user-item-name {
    font-weight: 700;
    font-size: .93rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-item-info .user-item-username {
    font-size: .76rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.role-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

.role-badge.admin {
    background: var(--warning-light);
    color: var(--warning);
}

.role-badge.member {
    background: var(--primary-light);
    color: var(--primary);
}

.user-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.user-item-actions .icon-btn {
    width: 34px;
    height: 34px;
    font-size: .82rem;
    border-radius: 9px;
}

.user-item-actions .icon-btn.delete-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* ============================================================
   مودال تغییر نام کاربری / رمز
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .6);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-overlay.visible { display: flex; animation: fadeIn .25s ease; }

.modal-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    padding: 26px 22px;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.modal-title i { color: var(--primary); }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.modal-actions .btn-primary { flex: 2; }
.modal-actions .btn-secondary { flex: 1; justify-content: center; }

/* ============================================================
   ریسپانسیو — موبایل کوچک
   ============================================================ */
@media (max-width: 480px) {
    html { font-size: 14px; }
    .app-container { padding: 12px 10px 105px; }
    .admin-stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .activity-inputs-row { flex-direction: column; align-items: stretch; }
    .activity-note-input, .activity-time-select { width: 100%; flex: none; }
    .users-form-grid { grid-template-columns: 1fr; }
    .header-info .user-fullname { font-size: .95rem; }
    .chart-wrap { height: 200px; }
    .chart-wrap-tall { height: 260px; }
}

/* ============================================================
   چاپ گزارش
   ============================================================ */
@media print {
    body { background: #fff !important; color: #000 !important; }

    .dashboard-header .header-actions,
    .admin-header .header-actions,
    .admin-tabs, .admin-filters, .admin-filter-inputs,
    .admin-subtabs, .ai-section, .sticky-save-bar,
    .login-container, .icon-btn, .btn-primary,
    .btn-secondary, .btn-danger, .ai-input-row,
    .ai-quick-prompts, .users-form-card,
    .user-item-actions, .individual-select-wrap {
        display: none !important;
    }

    .page { display: none !important; }
    .page.active { display: block !important; }

    .admin-view, .admin-subview { display: block !important; }

    .chart-card, .admin-stat-card, .stats-section,
    .individual-header, .note-item {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    .app-container { max-width: 100%; padding: 0; }
    .chart-wrap, .chart-wrap-tall { height: 280px; }

    /* تاریخ تولید گزارش فقط موقع چاپ نمایش داده میشه */
    #admin-print-generated-at {
        display: block !important;
        font-size: .8rem;
        color: #555;
        margin-bottom: 14px;
    }
}