/* ═══ تقویم شمسی — استایل ساده (مشترک در کل سایت) ═══ */

.jalali-calendar {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem;
    background: #f8fafc;
    min-height: 14rem;
    direction: rtl;
    font-family: inherit;
}

.jalali-calendar-loading {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    padding: 2rem 0.5rem;
}

.jalali-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.jalali-calendar-header button {
    border: none;
    background: #e2e8f0;
    border-radius: 0.5rem;
    width: 1.75rem;
    height: 1.75rem;
    cursor: pointer;
    font-weight: 700;
    color: #475569;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.jalali-calendar-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
}

.jalali-calendar-weekdays,
.jalali-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.2rem;
}

.jalali-calendar-weekdays span {
    font-size: 0.6rem;
    color: #94a3b8;
    text-align: center;
    font-weight: 600;
}

.jalali-day-btn {
    aspect-ratio: 1;
    border: none;
    border-radius: 0.45rem;
    background: #fff;
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
    color: #334155;
}

.jalali-day-btn:hover:not(:disabled):not(.is-empty) {
    background: #eff6ff;
}

.jalali-day-btn.is-today {
    border: 1px solid #93c5fd;
}

.jalali-day-btn.is-selected {
    background: #3b82f6;
    color: #fff;
}

.jalali-day-btn.is-empty {
    visibility: hidden;
    pointer-events: none;
}

.jalali-day-btn.is-past {
    opacity: 0.38;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* بازه انتخاب (اهداف) */
.jalali-day-btn.is-in-range {
    background: #dbeafe;
    color: #1e40af;
}

.jalali-day-btn.is-range-start,
.jalali-day-btn.is-range-end {
    background: #3b82f6;
    color: #fff;
}

.jalali-day-btn.is-range-start.is-range-end {
    border-radius: 0.45rem;
}

/* آمار تیم — بازطراحی تقویم */
.team-cal-calendar-header {
    margin-bottom: 0.65rem;
    padding: 0.35rem 0.15rem;
    border-bottom: 1px solid #e2e8f0;
}

.team-cal-calendar-header button {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.65rem;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 1.15rem;
    border: 1px solid #bae6fd;
}

.team-cal-calendar-header button:hover {
    background: #bae6fd;
}

.team-cal-calendar-title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 0;
}

.team-cal-calendar .jalali-calendar-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.team-cal-calendar-title-hint {
    font-size: 0.58rem;
    font-weight: 700;
    color: #64748b;
}

.team-cal-calendar-weekdays {
    margin-bottom: 0.35rem;
    padding: 0.35rem 0.15rem;
    border-radius: 0.55rem;
    background: #f1f5f9;
}

.team-cal-calendar-weekdays span {
    font-size: 0.68rem;
    font-weight: 800;
    color: #475569;
}

.team-cal-days {
    gap: 0.35rem;
}

.team-cal-days .jalali-day-btn {
    position: relative;
    min-height: 2.65rem;
    aspect-ratio: auto;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.6rem;
    background: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    padding: 0.2rem 0.1rem 0.35rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.team-cal-days .jalali-day-btn:hover:not(:disabled):not(.is-empty) {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.12);
}

.team-cal-days .jalali-day-btn.is-today {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #93c5fd;
}

.team-cal-days .jalali-day-btn.is-selected {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-color: #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}

.team-cal-days .jalali-day-btn.has-team-data {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #4ade80;
    color: #166534;
}

.team-cal-days .jalali-day-btn.has-team-data.is-today {
    background: linear-gradient(180deg, #ecfdf5 0%, #dbeafe 100%);
    border-color: #16a34a;
    box-shadow: inset 0 0 0 1px #86efac, 0 0 0 1px #93c5fd;
}

.team-cal-days .jalali-day-btn.has-team-data.is-selected {
    background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
    border-color: #166534;
    color: #fff;
}

.team-cal-dot {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #16a34a;
}

.team-cal-day-badge {
    display: block;
    font-size: 0.56rem;
    font-weight: 800;
    line-height: 1;
    color: #15803d;
    margin-top: 2px;
}

.team-cal-days .jalali-day-btn.is-selected .team-cal-dot,
.team-cal-days .jalali-day-btn.is-selected .team-cal-day-badge {
    color: #fff;
    background: transparent;
}

.team-cal-days .jalali-day-btn.is-selected .team-cal-dot {
    background: #fff;
}

@media (max-width: 380px) {
    .team-cal-days .jalali-day-btn {
        min-height: 2.35rem;
        font-size: 0.76rem;
    }
    .team-cal-day-badge { font-size: 0.5rem; }
}

html.dark .team-cal-calendar-header { border-bottom-color: #334155; }
html.dark .team-cal-calendar-header button {
    background: #1e3a5f;
    border-color: #334155;
    color: #bae6fd;
}
html.dark .team-cal-calendar-header button:hover { background: #334155; }
html.dark .team-cal-calendar .jalali-calendar-title { color: #f1f5f9; }
html.dark .team-cal-calendar-title-hint { color: #94a3b8; }
html.dark .team-cal-calendar-weekdays { background: #1e293b; }
html.dark .team-cal-calendar-weekdays span { color: #cbd5e1; }
html.dark .team-cal-days .jalali-day-btn {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
html.dark .team-cal-days .jalali-day-btn:hover:not(:disabled):not(.is-empty) {
    background: #1e3a5f;
    border-color: #60a5fa;
}
html.dark .team-cal-days .jalali-day-btn.is-today {
    background: rgba(30, 58, 138, 0.45);
    border-color: #60a5fa;
}
html.dark .team-cal-days .jalali-day-btn.has-team-data {
    background: rgba(22, 163, 74, 0.18);
    border-color: #16a34a;
    color: #86efac;
}
html.dark .team-cal-day-badge { color: #86efac; }

html.dark .jalali-calendar {
    background: #0f172a;
    border-color: #475569;
}

html.dark .jalali-calendar-title {
    color: #f1f5f9;
}

html.dark .jalali-calendar-header button {
    background: #334155;
    color: #e2e8f0;
}

html.dark .jalali-day-btn {
    background: #1e293b;
    color: #e2e8f0;
}

html.dark .jalali-day-btn:hover:not(:disabled):not(.is-empty) {
    background: #334155;
}

html.dark .jalali-day-btn.is-in-range {
    background: rgba(30, 58, 138, 0.45);
    color: #bfdbfe;
}
