/* ═══════════════════════════════════════════════════════
   Dashboard «روزِ من» — daily action page (client role)
   IranFit · theme-safe (lime / orange / blue tokens only)
   ═══════════════════════════════════════════════════════ */

/* ── Base widget card ─────────────────────────────── */
.dsh-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.dsh-link {
    color: var(--lime);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}
.dsh-sub { font-size: 11px; color: var(--muted); }

/* ── Hero personalization ─────────────────────────── */
.hero-copy { position: relative; z-index: 1; min-width: 0; }
.hero-status {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
    font-size: 12px;
    font-weight: 700;
    color: var(--on-accent);
}
.hero-avatar {
    position: relative;
    z-index: 1;
    order: -1;
    width: 68px;
    height: 68px;
    min-width: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.6);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb),0.55), 0 8px 24px rgba(var(--accent-rgb),0.3);
    background: var(--card2);
}
/* placeholder avatar (initial letter) — theme-driven, shown when no photo */
.hero-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: var(--on-accent);
    background: linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0.1));
}
/* neutral hero states: avatar ring follows accent, fill follows card */
.hero-rest .hero-avatar,
.hero-off .hero-avatar {
    border-color: var(--card);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb),0.5), var(--shadow);
}
.hero-rest .hero-avatar-fallback,
.hero-off .hero-avatar-fallback {
    background: rgba(var(--accent-rgb),0.16);
    color: var(--lime);
}
/* tonal variants driven by today's state */
.hero-train { box-shadow: 0 12px 40px rgba(var(--accent-rgb),0.3); }
.hero-done  { filter: saturate(0.92); }
.hero-rest  { background: linear-gradient(135deg, var(--card2) 0%, var(--card3) 100%); color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.hero-rest .hero-status { background: rgba(var(--accent-rgb),0.14); color: var(--text2); }
.hero-rest p { color: var(--muted); }
.hero-off   { background: linear-gradient(135deg, var(--card2) 0%, var(--card3) 100%); color: var(--text); border: 1px dashed var(--line-strong); box-shadow: none; }
.hero-off p { color: var(--muted); }
.hero-off .eyebrow { color: var(--lime); }
.hero-off .hero-status { background: rgba(var(--accent-rgb),0.12); color: var(--text2); }

/* ── ۱. Today card ────────────────────────────────── */
.dsh-today {
    position: relative;
    overflow: hidden;
    border-width: 1.5px;
}
.dsh-today::before {
    content: '';
    position: absolute;
    top: -46px; left: -46px;
    width: 150px; height: 150px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb),0.07);
    pointer-events: none;
}
.dsh-today.is-train { border-color: rgba(var(--accent-rgb),0.55); background: linear-gradient(150deg, var(--card) 0%, var(--card2) 100%); }
.dsh-today.is-done  { border-color: rgba(var(--accent-rgb),0.35); }
.dsh-today.is-rest  { border-style: dashed; }
.dsh-today.is-off   { border-style: dashed; }

.dsh-today-head {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    position: relative;
    z-index: 1;
}
.dsh-today-emoji {
    font-size: 30px;
    line-height: 1;
    width: 56px; height: 56px;
    min-width: 56px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(var(--accent-rgb),0.12);
    border: 1px solid rgba(var(--accent-rgb),0.3);
    border-radius: 17px;
}
.dsh-today-photo {
    width: 68px;
    height: 68px;
    min-width: 68px;
    object-fit: cover;
    border: 1px solid rgba(var(--accent-rgb),0.42);
    border-radius: 17px;
    box-shadow: 0 6px 20px rgba(0,0,0,.22), 0 0 0 3px rgba(var(--accent-rgb),.08);
    background: var(--card2);
}
.dsh-today-label { font-size: 11px; color: var(--muted); letter-spacing: 0.4px; }
.dsh-today-title { font-size: 19px; font-weight: 800; margin-top: 2px; line-height: 1.35; }
.dsh-today-focus { font-size: 13px; color: var(--text2); margin-top: 3px; }

.dsh-today-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0 10px;
    position: relative;
    z-index: 1;
}
.dsh-metric {
    background: var(--card2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 6px;
    text-align: center;
}
.dsh-metric strong { display: block; font-size: 17px; font-weight: 800; color: var(--lime); }
.dsh-metric span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.dsh-progressbar {
    height: 9px;
    background: var(--card3);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
.dsh-progressbar > span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--lime-dim), var(--lime));
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.dsh-progressbar.diet { height: 7px; }

.dsh-today-done-note {
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: rgba(var(--accent-rgb),0.1);
    border: 1px solid rgba(var(--accent-rgb),0.28);
    color: var(--text2);
    font-size: 12.5px;
    font-weight: 600;
}

.dsh-today-cta-row {
    display: flex;
    gap: 9px;
    margin-top: 15px;
    position: relative;
    z-index: 1;
}
.dsh-cta {
    flex: 1;
    text-align: center;
    background: linear-gradient(135deg, var(--lime) 0%, var(--lime-dim) 100%);
    color: var(--on-accent);
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    padding: 13px 16px;
    border-radius: 15px;
    box-shadow: 0 8px 22px rgba(var(--accent-rgb),0.28);
    transition: transform 0.15s, box-shadow 0.15s;
}
.dsh-cta:active { transform: scale(0.97); }
.dsh-cta-ghost {
    text-align: center;
    background: transparent;
    color: var(--text2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 13px 16px;
    border-radius: 15px;
    border: 1px solid var(--line-strong);
    transition: background 0.15s;
}
.dsh-cta-ghost:active { background: var(--card3); }

.dsh-rest-tips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 15px;
    position: relative;
    z-index: 1;
}
.dsh-rest-tips span {
    background: var(--card2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 10px;
    font-size: 12px;
    color: var(--text2);
}
.dsh-tomorrow {
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--muted);
    position: relative;
    z-index: 1;
}

/* ── ۲. Daily summary strip ───────────────────────── */
.dsh-summary {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 13px 8px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}
.dsh-sum-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 0;
    text-align: right;
}
.dsh-sum-ico { font-size: 19px; flex-shrink: 0; }
.dsh-sum-item strong { display: block; font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-sum-item small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.dsh-sum-sep { width: 1px; height: 30px; background: var(--line); flex-shrink: 0; }

/* ── ۲ب. Diet card ────────────────────────────────── */
.dsh-diet-bars { display: grid; gap: 12px; }
.dsh-diet-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 6px;
}
.dsh-diet-label span:last-child { color: var(--muted); }
.dsh-next-meal {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 14px;
    padding: 11px 12px;
    background: var(--card2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.dsh-next-meal.done {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--lime);
}
.dsh-next-meal-time {
    background: rgba(var(--accent-rgb),0.13);
    color: var(--lime);
    border-radius: 9px;
    padding: 6px 9px;
    font-size: 12.5px;
    font-weight: 800;
    direction: ltr;
    flex-shrink: 0;
}
.dsh-next-meal-info { flex: 1; min-width: 0; }
.dsh-next-meal-info strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-next-meal-info small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.dsh-meal-btn { flex: 0 0 auto; padding: 9px 13px; font-size: 12.5px; border-radius: 11px; box-shadow: none; }

/* ── ۳. Four primary actions ──────────────────────── */
.dsh-actions4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.dsh-action {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--card2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px 8px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.dsh-action:active { transform: scale(0.97); }
.dsh-action:hover { border-color: rgba(var(--accent-rgb),.7); background: rgba(var(--accent-rgb),.08); }
.dsh-action strong { font-size: 13px; font-weight: 700; }
.dsh-action-ico {
    width: 46px; height: 46px;
    border-radius: 14px;
    background: rgba(var(--accent-rgb),.12);
    border: 1px solid rgba(var(--accent-rgb),.25);
    display: flex; align-items: center; justify-content: center;
}
.dsh-action-ico img { width: 26px; height: 26px; object-fit: contain; }
.dsh-badge {
    position: absolute;
    top: 9px; left: 9px;
    min-width: 20px; height: 20px;
    padding: 0 6px;
    border-radius: 99px;
    background: var(--lime);
    color: var(--on-accent);
    font-size: 11px;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

/* ── ۴. Weekly progress ───────────────────────────── */
.dsh-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.dsh-chip {
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 99px;
    padding: 5px 11px;
    border: 1px solid var(--line);
    background: var(--card2);
    color: var(--text2);
}
.chip-fire { border-color: rgba(245,158,11,0.45); color: #f59e0b; }
.chip-gold { border-color: rgba(var(--accent-rgb),0.5); color: var(--lime); background: rgba(var(--accent-rgb),0.1); }
.chip-pr   { border-color: rgba(var(--accent-rgb),0.5); color: var(--lime); }
.chip-soft { color: var(--muted); }

.dsh-nudge {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    background: rgba(var(--accent-rgb),0.09);
    border: 1px dashed rgba(var(--accent-rgb),0.4);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    margin-bottom: 13px;
}
.dsh-nudge.nudge-done { border-style: solid; }

.dsh-stats3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.dsh-stat3 {
    background: var(--card2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 8px;
    text-align: center;
    min-width: 0;
}
.dsh-stat3 strong { display: block; font-size: 16px; font-weight: 800; color: var(--lime); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-stat3 span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; min-height: 26px; line-height: 1.3; }
.dsh-stat3 small { display: block; font-size: 10px; margin-top: 4px; }
.delta-up { color: #f59e0b; }
.delta-down { color: var(--lime); }
.delta-flat { color: var(--muted); }

.dsh-goalbar {
    height: 6px;
    background: var(--card3);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 7px;
}
.dsh-goalbar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--lime-dim), var(--lime));
    border-radius: 99px;
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.dsh-mini-chart {
    background: var(--card2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
}
.dsh-mini-chart-title { font-size: 12.5px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }

.dsh-totals {
    display: flex;
    justify-content: space-around;
    gap: 6px;
    border-top: 1px dashed var(--line);
    padding-top: 11px;
    font-size: 11.5px;
    color: var(--muted);
}
.dsh-totals strong { color: var(--text); font-weight: 800; }

/* ── ۵. Coach card ────────────────────────────────── */
.dsh-coach { display: flex; gap: 13px; align-items: flex-start; }
.dsh-coach-photo {
    width: 62px; height: 62px;
    min-width: 62px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    background: var(--card2);
}
.dsh-coach-info { flex: 1; min-width: 0; }
.dsh-coach-info > strong { display: block; font-size: 15px; font-weight: 800; }
.dsh-coach-info > small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.dsh-coach-last {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    padding: 8px 10px;
    background: var(--card2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text2);
    min-width: 0;
}
.dsh-coach-last.is-unread { border-color: rgba(var(--accent-rgb),0.5); background: rgba(var(--accent-rgb),0.08); }
.dsh-coach-last-ico { flex-shrink: 0; }
.dsh-coach-last-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-coach-last-time { flex-shrink: 0; font-size: 10.5px; color: var(--muted); direction: ltr; }
.dsh-coach-btns { display: flex; gap: 9px; margin-top: 13px; }
.dsh-btn-primary {
    flex: 1;
    text-align: center;
    background: linear-gradient(135deg, var(--lime) 0%, var(--lime-dim) 100%);
    color: var(--on-accent);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 800;
    padding: 11px 12px;
    border-radius: 13px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s;
}
.dsh-btn-primary:active { transform: scale(0.97); }
.dsh-btn-ghost {
    flex: 1;
    text-align: center;
    background: rgba(var(--accent-rgb),.08);
    color: var(--lime);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 11px 12px;
    border-radius: 13px;
    border: 1px solid rgba(var(--accent-rgb),.32);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.dsh-btn-ghost:hover { background: rgba(var(--accent-rgb),.16); border-color: rgba(var(--accent-rgb),.6); }
.dsh-btn-ghost:active { background: rgba(var(--accent-rgb),.22); transform: scale(.98); }
.dsh-btn-ghost:focus-visible { outline: 2px solid rgba(var(--accent-rgb),.85); outline-offset: 2px; }
.dsh-empty-mini { font-size: 13px; color: var(--muted); text-align: center; padding: 8px 0; }

/* ── ۶. Mini music player ─────────────────────────── */
.dsh-music { padding: 12px 14px; }
.dsh-music-mini {
    display: flex;
    align-items: center;
    gap: 11px;
}
.dsh-music-mini .music-disc { width: 44px; height: 44px; font-size: 21px; cursor: pointer; }
.dsh-music-meta { flex: 1; min-width: 0; cursor: pointer; }
.dsh-music-meta strong { display: block; font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-music-meta small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-music-expand {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card2);
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.dsh-music .music-controls { margin-top: 13px; }
.dsh-music .music-progress-bar { margin-top: 4px; }

/* ── Gym strip (compact, low) ─────────────────────── */
.dsh-gym-strip {
    display: flex;
    align-items: center;
    gap: 11px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 15px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}
.dsh-gym-ico {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--card2);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.dsh-gym-info { flex: 1; min-width: 0; }
.dsh-gym-info strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-gym-info small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.dsh-gym-fee { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }

/* ── ۸. All services (collapsible) ────────────────── */
.dsh-services { padding: 12px 14px; }
.dsh-services-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    color: var(--text);
    font: inherit;
    font-size: 14.5px;
    font-weight: 800;
    padding: 4px 2px;
    cursor: pointer;
}
.dsh-services-count {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--on-accent);
    background: var(--lime);
    border-radius: 99px;
    padding: 4px 11px;
}
.dsh-services-grid { margin-top: 13px; }
.dsh-services-grid .admin-menu-item { padding: 13px 8px; }

/* ── Widget skeleton / error / retry (نکته ۱۰) ───── */
.sk-block { display: grid; gap: 10px; padding: 4px 0; }
.sk-line {
    height: 12px;
    border-radius: 7px;
    background: linear-gradient(90deg, var(--card2) 25%, var(--card3) 50%, var(--card2) 75%);
    background-size: 200% 100%;
    animation: dsh-shimmer 1.4s ease infinite;
}
.sk-line.big { height: 22px; width: 70%; }
.sk-line.w40 { width: 40%; }
.sk-line.w50 { width: 50%; }
.sk-line.w60 { width: 60%; }
.sk-line.w70 { width: 70%; }
.sk-line.w80 { width: 80%; }
.sk-line.w90 { width: 90%; }
.sk-bar {
    height: 9px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--card2) 25%, var(--card3) 50%, var(--card2) 75%);
    background-size: 200% 100%;
    animation: dsh-shimmer 1.4s ease infinite;
}
@keyframes dsh-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.dsh-widget-err, .dsh-err-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dsh-widget-err { justify-content: space-between; }
.dsh-err-icon { font-size: 24px; }
.dsh-err-text { flex: 1; min-width: 0; }
.dsh-err-text strong { display: block; font-size: 13.5px; font-weight: 700; }
.dsh-err-text small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.dsh-retry {
    flex-shrink: 0;
    background: var(--card2);
    color: var(--lime);
    border: 1px solid rgba(var(--accent-rgb),0.45);
    border-radius: 11px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.dsh-retry:active { background: var(--card3); }

/* ── Entrance animation (نکته ۹) ──────────────────── */
.anim-in {
    animation: dsh-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.06s;
}
@keyframes dsh-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .anim-in { animation: none; }
    .sk-line, .sk-bar { animation: none; }
    .dsh-progressbar > span, .dsh-goalbar > span { transition: none; }
}

/* ── Day-card anchor target (from today card) ────── */
.day-card { scroll-margin-top: 14px; }

/* ── Small screens ────────────────────────────────── */
@media (max-width: 380px) {
    .dsh-stat3 strong { font-size: 14px; }
    .dsh-sum-item strong { font-size: 12.5px; }
    .dsh-today-emoji { width: 48px; height: 48px; min-width: 48px; font-size: 25px; }
    .dsh-today-photo { width: 58px; height: 58px; min-width: 58px; border-radius: 15px; }
}

/* Main action colors follow the active lime, orange, or blue theme token. */
.dsh-action:focus-visible { outline: 2px solid rgba(var(--accent-rgb),.8); outline-offset: 2px; }
