﻿:root {
    color-scheme: light;
    --white: #ffffff;
    --bg: #faf9ff;
    --purple-50: #f5f3ff;
    --purple-100: #ede9fe;
    --purple-200: #ddd6fe;
    --purple-400: #a78bfa;
    --purple-500: #8b5cf6;
    --purple-600: #7c3aed;
    --purple-700: #6d28d9;
    --purple-900: #4c1d95;
    --text: #1e1b4b;
    --text-muted: #6b7280;
    --glass: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(139, 92, 246, 0.15);
    --shadow: 0 8px 32px rgba(109, 40, 217, 0.08);
    --shadow-lg: 0 20px 60px rgba(109, 40, 217, 0.12);
    --radius: 20px;
    --sidebar-w: 280px;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --surface-3: #f5f3ff;
    --input-bg: rgba(255, 255, 255, 0.7);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
}

/* ── Ambient background ── */
.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 12s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #ddd6fe 0%, transparent 70%);
    bottom: 10%;
    left: 20%;
    animation-delay: -4s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #ede9fe 0%, transparent 70%);
    top: 40%;
    left: -5%;
    animation-delay: -8s;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ── Layout ── */
.app {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--glass-border);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--purple-600), var(--purple-400));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.brand-icon svg {
    width: 22px;
    height: 22px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 800;
    font-size: 1.05rem;
    background: linear-gradient(135deg, var(--purple-700), var(--purple-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 6px 6px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.4);
}

.nav-group[data-group="home"] {
    padding: 0;
    background: transparent;
    border-color: transparent;
}

.nav-group.tone-violet { background: rgba(124, 58, 237, 0.05); border-color: rgba(124, 58, 237, 0.08); }
.nav-group.tone-teal { background: rgba(13, 148, 136, 0.05); border-color: rgba(13, 148, 136, 0.1); }
.nav-group.tone-emerald { background: rgba(16, 185, 129, 0.06); border-color: rgba(16, 185, 129, 0.1); }
.nav-group.tone-amber { background: rgba(245, 158, 11, 0.07); border-color: rgba(217, 119, 6, 0.12); }
.nav-group.tone-sky { background: rgba(14, 165, 233, 0.06); border-color: rgba(14, 165, 233, 0.1); }
.nav-group.tone-rose { background: rgba(244, 63, 94, 0.05); border-color: rgba(244, 63, 94, 0.1); }
.nav-group.tone-slate { background: rgba(71, 85, 105, 0.06); border-color: rgba(71, 85, 105, 0.1); }
.nav-group.tone-indigo { background: rgba(79, 70, 229, 0.05); border-color: rgba(79, 70, 229, 0.08); }

.nav-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px 5px;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--purple-700);
}

.nav-group.tone-teal .nav-group-label { color: #0f766e; }
.nav-group.tone-emerald .nav-group-label { color: #047857; }
.nav-group.tone-amber .nav-group-label { color: #b45309; }
.nav-group.tone-sky .nav-group-label { color: #0369a1; }
.nav-group.tone-rose .nav-group-label { color: #be123c; }
.nav-group.tone-slate .nav-group-label { color: #334155; }

.nav-group-icon { font-size: 0.78rem; line-height: 1; }

.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.84rem;
    transition: all 0.25s ease;
    position: relative;
}

.nav-item:hover:not(.disabled) {
    background: var(--purple-50);
    color: var(--purple-700);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
    color: white;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.nav-icon {
    font-size: 0.92rem;
    opacity: 0.8;
}

.nav-badge {
    margin-right: auto;
    font-size: 0.62rem;
    background: rgba(255, 255, 255, 0.25);
    padding: 1px 8px;
    border-radius: 20px;
}

.nav-soon {
    margin-right: auto;
    font-size: 0.6rem;
    background: var(--purple-100);
    color: var(--purple-600);
    padding: 1px 7px;
    border-radius: 20px;
}

.nav-item.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    margin-top: 8px;
    flex-shrink: 0;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--purple-500);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ── Main content (desktop; mobile overrides in panel-base + below) ── */
.main {
    flex: 1;
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
}

@media (min-width: 769px) {
    .main {
        padding: 32px 40px;
        max-width: calc(100vw - var(--sidebar-w));
    }
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    animation: fadeUp 0.6s ease;
}

.topbar h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.topbar p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--purple-100);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--purple-700);
    box-shadow: var(--shadow);
}

.status-chip.compact {
    padding: 6px 12px;
    font-size: 0.72rem;
    box-shadow: none;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* ── Top widgets: clock + sleep ── */
.dash-top-widgets {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 14px;
    margin-bottom: 20px;
    animation: fadeUp 0.5s ease both;
}

.dash-clock-card {
    position: relative;
    background: linear-gradient(145deg, #1e1b4b 0%, #4c1d95 45%, #7c3aed 100%);
    border-radius: 22px;
    padding: 20px 22px;
    color: white;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(76, 29, 149, 0.35);
    min-height: 120px;
}

.dash-clock-glow {
    position: absolute;
    top: -40%;
    right: -20%;
    width: 70%;
    height: 140%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
    pointer-events: none;
}

.dash-clock-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
}

.dash-clock-weekday {
    font-size: 0.82rem;
    font-weight: 700;
    opacity: 0.9;
    letter-spacing: 0.02em;
}

.dash-clock-time {
    font-size: clamp(1.6rem, 5vw, 2.1rem);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.dash-clock-date {
    font-size: 0.78rem;
    opacity: 0.85;
    font-weight: 600;
}

.dash-sleep-card {
    background: var(--white);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.3s;
}

.dash-sleep-card.empty {
    opacity: 0.75;
}

.dash-sleep-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.dash-sleep-head span {
    font-size: 1.4rem;
    line-height: 1;
}

.dash-sleep-head h3 {
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.dash-sleep-head p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.dash-sleep-bar-track {
    height: 12px;
    background: linear-gradient(90deg, #e0e7ff, #ede9fe);
    border-radius: 99px;
    overflow: hidden;
}

.dash-sleep-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6366f1, #a855f7, #c084fc);
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
}

.dash-sleep-pct {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--purple-700);
    align-self: flex-end;
}

/* ── Study / Event hero pair ── */
.dash-activity-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.dash-activity-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    text-decoration: none;
    color: inherit;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    background:
        linear-gradient(135deg, rgba(240, 253, 250, 0.95), rgba(255, 255, 255, 0.98)),
        #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dash-activity-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    border-color: rgba(13, 148, 136, 0.28);
}

.dash-activity-bar.is-live {
    border-color: rgba(220, 38, 38, 0.18);
    background:
        linear-gradient(135deg, rgba(254, 242, 242, 0.9), rgba(255, 255, 255, 0.98)),
        #fff;
}

.dash-activity-bar.is-live[data-kind="study"] {
    border-color: rgba(79, 70, 229, 0.2);
    background:
        linear-gradient(135deg, rgba(238, 242, 255, 0.95), rgba(255, 255, 255, 0.98)),
        #fff;
}

.dash-activity-bar.is-idle {
    border-color: rgba(100, 116, 139, 0.16);
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98)),
        #fff;
}

.dash-activity-bar-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.dash-activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    background: rgba(15, 118, 110, 0.08);
    flex-shrink: 0;
}

.dash-activity-bar.is-live .dash-activity-icon {
    background: rgba(239, 68, 68, 0.1);
}

.dash-activity-bar.is-live[data-kind="study"] .dash-activity-icon {
    background: rgba(79, 70, 229, 0.1);
}

.dash-activity-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-activity-text strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
}

.dash-activity-text span {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-activity-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.04);
}

.dash-activity-timer strong {
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--text);
}

.dash-activity-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);
    animation: dash-live-pulse 1.4s infinite;
}

.dash-activity-live-dot[hidden] { display: none !important; }

.dash-hero-pair {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 0;
    align-items: stretch;
}

.dash-study-hero-wrap,
.dash-test-hero-wrap,
.dash-event-hero-wrap {
    margin-bottom: 0;
    animation: fadeUp 0.5s ease 0.04s both;
    min-width: 0;
    display: flex;
}

.dash-study-hero-card,
.dash-test-hero-card,
.dash-event-hero-card {
    display: flex;
    flex-direction: column;
    position: relative;
    text-decoration: none;
    color: white;
    border-radius: 28px;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 168px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dash-study-hero-card {
    background: linear-gradient(135deg, #312e81 0%, #5b21b6 35%, #7c3aed 65%, #db2777 100%);
    box-shadow:
        0 24px 60px rgba(91, 33, 182, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dash-study-hero-card:hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow:
        0 32px 70px rgba(91, 33, 182, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.dash-study-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.dash-study-hero-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.12);
    animation: study-ring-spin 18s linear infinite;
}

.dash-study-hero-ring-1 {
    width: 280px;
    height: 280px;
    top: -120px;
    right: -80px;
}

.dash-study-hero-ring-2 {
    width: 180px;
    height: 180px;
    bottom: -60px;
    left: -40px;
    animation-direction: reverse;
    animation-duration: 14s;
    border-color: rgba(255, 255, 255, 0.08);
}

.dash-study-hero-spark {
    position: absolute;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.2rem;
    animation: study-spark-float 4s ease-in-out infinite;
}

.dash-study-hero-spark-1 { top: 18%; left: 12%; animation-delay: 0s; }
.dash-study-hero-spark-2 { top: 55%; right: 28%; animation-delay: -1.5s; font-size: 0.9rem; }
.dash-study-hero-spark-3 { bottom: 20%; left: 35%; animation-delay: -2.8s; font-size: 1.5rem; opacity: 0.5; }

@keyframes study-ring-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes study-spark-float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
    50% { transform: translateY(-8px) scale(1.15); opacity: 0.85; }
}

.dash-study-hero-inner,
.dash-test-hero-inner,
.dash-event-hero-inner {
    position: relative;
    z-index: 1;
    padding: 18px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    min-height: 100%;
    box-sizing: border-box;
}

.dash-study-hero-badge,
.dash-test-hero-badge,
.dash-event-hero-badge {
    display: inline-flex;
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dash-study-hero-main,
.dash-test-hero-main,
.dash-event-hero-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.dash-study-hero-icon-wrap,
.dash-test-hero-icon-wrap,
.dash-event-hero-icon-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.dash-study-hero-icon,
.dash-test-hero-icon,
.dash-event-hero-icon {
    font-size: 1.7rem;
    position: relative;
    z-index: 1;
}

.dash-study-hero-pulse,
.dash-test-hero-pulse,
.dash-event-hero-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    animation: study-play-pulse 2.4s ease-in-out infinite;
}

.dash-study-hero-label,
.dash-test-hero-label,
.dash-event-hero-label {
    display: block;
    font-size: 0.72rem;
    opacity: 0.85;
    margin-bottom: 4px;
}

.dash-study-hero-text h2,
.dash-test-hero-text h2,
.dash-event-hero-text h2 {
    margin: 0 0 6px;
    font-size: 1.28rem;
    font-weight: 800;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.dash-study-hero-elapsed,
.dash-test-hero-elapsed,
.dash-event-hero-elapsed {
    font-size: 0.78rem;
    opacity: 0.9;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dash-study-hero-action,
.dash-test-hero-action,
.dash-event-hero-action {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 108px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    align-self: flex-start;
}

.dash-study-action-label,
.dash-test-action-label,
.dash-event-action-label {
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.dash-study-play,
.dash-test-play,
.dash-event-play {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--surface, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    animation: study-play-pulse 2s ease-in-out infinite;
}

.dash-study-play { color: #6d28d9; }
.dash-test-play { color: #b45309; }
.dash-event-play { color: #0f766e; }

.dash-study-play-icon,
.dash-test-play-icon,
.dash-event-play-icon {
    font-size: 1.05rem;
    margin-right: -2px;
}

@keyframes study-play-pulse {
    0%, 100% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(255, 255, 255, 0.4); }
    50% { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 0 10px rgba(255, 255, 255, 0); }
}

/* Test hero visuals */
.dash-test-hero-card {
    background: linear-gradient(135deg, #78350f 0%, #b45309 38%, #d97706 68%, #fbbf24 100%);
    box-shadow:
        0 24px 60px rgba(180, 83, 9, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dash-test-hero-card:hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow:
        0 32px 70px rgba(180, 83, 9, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.dash-test-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.dash-test-hero-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.dash-test-hero-ring-1 {
    width: 150px;
    height: 150px;
    top: -36px;
    right: -28px;
    animation: study-ring-spin 16s linear infinite;
}

.dash-test-hero-ring-2 {
    width: 90px;
    height: 90px;
    bottom: -18px;
    left: 18%;
    animation: study-ring-spin 12s linear infinite reverse;
}

.dash-test-hero-mark {
    position: absolute;
    top: 18%;
    left: 14%;
    font-size: 1.4rem;
    opacity: 0.45;
    animation: study-spark 3.2s ease-in-out infinite;
}

/* Event hero visuals */
.dash-event-hero-card {
    background: linear-gradient(135deg, #134e4a 0%, #0f766e 40%, #0d9488 70%, #2dd4bf 100%);
    box-shadow:
        0 24px 60px rgba(15, 118, 110, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dash-event-hero-card:hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow:
        0 32px 70px rgba(15, 118, 110, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.dash-event-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.dash-event-hero-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.dash-event-hero-ring-1 {
    width: 160px;
    height: 160px;
    top: -40px;
    left: -30px;
    animation: study-ring-spin 18s linear infinite;
}

.dash-event-hero-ring-2 {
    width: 220px;
    height: 220px;
    bottom: -80px;
    right: -50px;
    animation: study-ring-spin 24s linear infinite reverse;
}

.dash-event-hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.08));
    animation: event-wave 5s ease-in-out infinite;
}

@keyframes event-wave {
    0%, 100% { opacity: 0.5; transform: translateY(4px); }
    50% { opacity: 1; transform: translateY(0); }
}

/* Live timer chips in header */
.topbar-left {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.mobile-topbar {
    justify-content: space-between;
    gap: 10px;
}

.mobile-topbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
    direction: ltr;
}

.mobile-topbar-live {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
    max-width: min(42vw, 160px);
}

.mobile-topbar-live:not(:has(.dash-live-timer-chip:not(.hidden))) {
    display: none;
}

.mobile-topbar-end .panel-topbar-actions {
    flex-shrink: 0;
}

.dash-live-timer-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #4c1d95;
    background: linear-gradient(135deg, #ede9fe, #fce7f3);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.15);
    animation: dash-live-chip-in 0.35s ease;
}

.dash-live-timer-chip.event {
    color: #115e59;
    background: linear-gradient(135deg, #ccfbf1, #d1fae5);
    border-color: rgba(13, 148, 136, 0.3);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.15);
}

.dash-live-timer-chip.hidden { display: none !important; }

.dash-live-timer-chip.compact {
    padding: 5px 10px;
    gap: 6px;
}

.dash-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);
    animation: dash-live-pulse 1.4s infinite;
    flex-shrink: 0;
}

.dash-live-text { white-space: nowrap; }
.dash-live-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: 0.02em;
}

@keyframes dash-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
    70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes dash-live-chip-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

.dash-study-hero-card.is-live,
.dash-test-hero-card.is-live,
.dash-event-hero-card.is-live {
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: 2px;
}

@media (max-width: 980px) {
    .dash-hero-pair {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .dash-hero-pair {
        grid-template-columns: 1fr;
    }

    .dash-activity-bar {
        padding: 12px 14px;
        border-radius: 16px;
    }

    .dash-activity-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 1.1rem;
    }

    .dash-activity-timer strong {
        font-size: 0.95rem;
    }

    .dash-activity-text span {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

@media (min-width: 900px) {
    .dash-study-hero-inner,
    .dash-test-hero-inner,
    .dash-event-hero-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 20px 20px;
    }

    .dash-study-hero-main,
    .dash-test-hero-main,
    .dash-event-hero-main {
        flex: 1;
    }

    .dash-study-hero-action,
    .dash-test-hero-action,
    .dash-event-hero-action {
        align-self: center;
        flex-direction: column;
        min-width: 112px;
        padding: 14px 16px;
    }
}

/* ── Section blocks ── */
.dash-section-head {
    margin-bottom: 12px;
}

.dash-section-head h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 2px;
}

.dash-section-head p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dash-services-section {
    margin-bottom: 20px;
    animation: fadeUp 0.55s ease 0.06s both;
}

.dash-services-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dash-svc-group {
    position: relative;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(124, 58, 237, 0.08);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(248, 247, 255, 0.72));
    box-shadow: 0 10px 28px rgba(76, 29, 149, 0.06);
    overflow: hidden;
}

.dash-svc-group::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--purple-500), var(--purple-300));
}

.dash-svc-group.tone-violet::before { background: linear-gradient(180deg, #7c3aed, #c084fc); }
.dash-svc-group.tone-teal::before { background: linear-gradient(180deg, #0d9488, #5eead4); }
.dash-svc-group.tone-emerald::before { background: linear-gradient(180deg, #059669, #6ee7b7); }
.dash-svc-group.tone-amber::before { background: linear-gradient(180deg, #d97706, #fbbf24); }
.dash-svc-group.tone-sky::before { background: linear-gradient(180deg, #0284c7, #7dd3fc); }
.dash-svc-group.tone-rose::before { background: linear-gradient(180deg, #e11d48, #fb7185); }
.dash-svc-group.tone-slate::before { background: linear-gradient(180deg, #475569, #94a3b8); }
.dash-svc-group.tone-indigo::before { background: linear-gradient(180deg, #4f46e5, #a5b4fc); }

.dash-svc-group.tone-violet { background: linear-gradient(160deg, rgba(245, 243, 255, 0.9), rgba(255, 255, 255, 0.75)); }
.dash-svc-group.tone-teal { background: linear-gradient(160deg, rgba(240, 253, 250, 0.92), rgba(255, 255, 255, 0.75)); }
.dash-svc-group.tone-emerald { background: linear-gradient(160deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.75)); }
.dash-svc-group.tone-amber { background: linear-gradient(160deg, rgba(255, 251, 235, 0.94), rgba(255, 255, 255, 0.75)); }
.dash-svc-group.tone-sky { background: linear-gradient(160deg, rgba(240, 249, 255, 0.94), rgba(255, 255, 255, 0.75)); }
.dash-svc-group.tone-rose { background: linear-gradient(160deg, rgba(255, 241, 242, 0.94), rgba(255, 255, 255, 0.75)); }
.dash-svc-group.tone-slate { background: linear-gradient(160deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.78)); }

.dash-svc-group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-inline-start: 8px;
}

.dash-svc-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    font-size: 1rem;
}

.dash-svc-group-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
}

.dash-svc-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 640px) {
    .dash-svc-group-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.dash-account-section {
    margin-top: 8px;
    margin-bottom: 28px;
    animation: fadeUp 0.6s ease 0.12s both;
}

/* ── Tools row ── */
.dash-tools-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.dash-tools-edu {
    grid-template-columns: repeat(2, 1fr);
}

.dash-tools-account {
    grid-template-columns: repeat(2, 1fr);
    max-width: 480px;
}

@media (min-width: 640px) {
    .dash-tools-edu {
        grid-template-columns: repeat(5, 1fr);
    }
}

.dash-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    padding: 16px 10px;
    border-radius: 18px;
    text-decoration: none;
    color: white;
    min-height: 96px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    background: linear-gradient(145deg, #6366f1, #8b5cf6);
}

.dash-tool-card:hover {
    transform: translateY(-2px);
}

.dash-tool-card strong {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.3;
}

.dash-tool-card small {
    font-size: 0.65rem;
    opacity: 0.9;
}

.dash-tool-icon {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.dash-tool-card.planner-tool {
    background: linear-gradient(145deg, #4f46e5, #7c3aed);
}

.dash-tool-card.reports-tool {
    background: linear-gradient(145deg, #0d9488, #06b6d4);
}

.dash-tool-card.progress-tool {
    background: linear-gradient(145deg, #7c3aed, #a78bfa);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.28);
}

.dash-tool-card.calendar-tool {
    background: linear-gradient(145deg, #0f766e, #14b8a6);
}

.dash-tool-card.answer-sheet-tool {
    background: linear-gradient(145deg, #d97706, #f59e0b);
}

.dash-tool-card.personalization-tool {
    background: linear-gradient(145deg, #4f46e5, #7c3aed);
}

.dash-tool-card.groups-tool {
    background: linear-gradient(145deg, #b45309, #f59e0b);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.28);
}

.dash-tool-card.consultant-tool,
.dash-tool-card.my-consultant-tool {
    background: linear-gradient(145deg, #0369a1, #0ea5e9);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.28);
}

.dash-tool-card.start-study-tool {
    background: linear-gradient(145deg, #7c3aed, #a855f7);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.28);
}

.dash-tool-card.start-test-tool {
    background: linear-gradient(145deg, #b45309, #f59e0b);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.32);
}

.dash-tool-card.start-event-tool {
    background: linear-gradient(145deg, #0284c7, #38bdf8);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.28);
}

.dash-tool-card.mood-tool {
    background: linear-gradient(145deg, #be123c, #fb7185);
    box-shadow: 0 8px 24px rgba(244, 63, 94, 0.32);
}

/* Fallback tones — اگر کلاس اختصاصی نبود */
.dash-tool-card.tone-violet { background: linear-gradient(145deg, #7c3aed, #a855f7); box-shadow: 0 8px 24px rgba(124, 58, 237, 0.28); }
.dash-tool-card.tone-indigo { background: linear-gradient(145deg, #4f46e5, #7c3aed); box-shadow: 0 8px 24px rgba(79, 70, 229, 0.28); }
.dash-tool-card.tone-teal { background: linear-gradient(145deg, #0d9488, #14b8a6); box-shadow: 0 8px 24px rgba(13, 148, 136, 0.28); }
.dash-tool-card.tone-emerald { background: linear-gradient(145deg, #047857, #10b981); box-shadow: 0 8px 24px rgba(16, 185, 129, 0.28); }
.dash-tool-card.tone-amber { background: linear-gradient(145deg, #b45309, #f59e0b); box-shadow: 0 8px 24px rgba(217, 119, 6, 0.32); }
.dash-tool-card.tone-sky { background: linear-gradient(145deg, #0369a1, #38bdf8); box-shadow: 0 8px 24px rgba(14, 165, 233, 0.28); }
.dash-tool-card.tone-rose { background: linear-gradient(145deg, #be123c, #fb7185); box-shadow: 0 8px 24px rgba(244, 63, 94, 0.32); }
.dash-tool-card.tone-pink { background: linear-gradient(145deg, #be185d, #ec4899); box-shadow: 0 8px 24px rgba(236, 72, 153, 0.28); }
.dash-tool-card.tone-slate { background: linear-gradient(145deg, #334155, #64748b); box-shadow: 0 8px 24px rgba(51, 65, 85, 0.28); }

.dash-tool-card.chat-tool {
    background: linear-gradient(145deg, #4f46e5, #7c3aed);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.dash-tool-card.hammasir-tool {
    background: linear-gradient(145deg, #0f766e, #14b8a6);
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.28);
}

.dash-tool-card.chatbox-tool {
    background: linear-gradient(145deg, #0f172a, #0e7490);
    box-shadow: 0 8px 24px rgba(14, 116, 144, 0.32);
}

.dash-tool-card.resources-tool {
    background: linear-gradient(145deg, #047857, #10b981);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.28);
}

.dash-tool-card.notebook-tool {
    background: linear-gradient(145deg, #be185d, #ec4899);
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.28);
}

.dash-tool-card.analyzer-tool {
    background: linear-gradient(145deg, #6d28d9, #a855f7);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.32);
}

.dash-tool-card.orbit-tool {
    background: linear-gradient(145deg, #0f766e, #34d399);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.32);
}

.dash-tool-card.water-tool {
    background: linear-gradient(145deg, #0369a1, #38bdf8);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.32);
}

.dash-tool-card.film-therapy-tool {
    background: linear-gradient(145deg, #be123c, #fb7185);
    box-shadow: 0 8px 24px rgba(251, 113, 133, 0.32);
}

.dash-tool-card.leveling-tool {
    background: linear-gradient(145deg, #b45309, #f59e0b);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.32);
}

/* Dashboard water tracker */
.dash-water-section {
    margin-bottom: 14px;
}
.dash-water-card {
    border-radius: 16px;
    border: 1px solid rgba(14, 165, 233, 0.25);
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.9), rgba(255, 255, 255, 0.85));
    padding: 12px 14px;
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.08);
}
.dash-water-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.dash-water-head h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: #0c4a6e;
}
.dash-water-link {
    font-size: 0.72rem;
    font-weight: 700;
    color: #0284c7;
    text-decoration: none;
}
.dash-water-body {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}
.dash-water-count {
    display: flex;
    align-items: baseline;
    gap: 2px;
    min-width: 52px;
}
.dash-water-count strong {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0369a1;
    line-height: 1;
}
.dash-water-count span {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}
.dash-water-meta p {
    margin: 0 0 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
}
.dash-water-track {
    height: 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.dash-water-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0369a1, #38bdf8);
    transition: width 0.6s ease;
}
.dash-water-add {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 0;
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
    flex-shrink: 0;
}
.dash-water-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}
.dash-water-add:active:not(:disabled) {
    transform: scale(0.96);
}

@media (max-width: 640px) {
    .dash-water-body {
        gap: 8px;
    }
    .dash-water-count strong {
        font-size: 1.35rem;
    }
}

.dash-tool-card.time-period-tool {
    background: linear-gradient(145deg, #be4d6a, #e891a8);
    box-shadow: 0 8px 24px rgba(190, 77, 106, 0.32);
}

.dash-tool-card.about-apatite-tool {
    background: linear-gradient(145deg, #0369a1, #38bdf8);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.32);
}

.dash-tool-card.account-tool {
    background: linear-gradient(145deg, #4338ca, #6366f1);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.32);
}

.dash-tool-card.audit-tool {
    background: linear-gradient(145deg, #0f766e, #059669);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.32);
}

.dash-chat-banner {
    display: flex;
    width: 100%;
    margin-bottom: 20px;
    animation: fadeUp 0.55s ease 0.08s both;
}

.calendar-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(135deg, #0f766e, #14b8a6 55%, #2dd4bf);
    border-radius: 24px;
    padding: 22px 24px;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15, 118, 110, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.calendar-cta-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(15, 118, 110, 0.45);
}

.calendar-cta-glow {
    position: absolute;
    top: -50%;
    right: -15%;
    width: 65%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(-12deg);
    pointer-events: none;
}

.calendar-cta-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
}

/* ── Target exams card ── */
.dash-exams-card {
    background: var(--white);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 20px 22px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease 0.08s both;
}

.dash-exams-head h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.dash-exams-head p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.dash-exams-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-exam-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--purple-50);
    border-radius: 14px;
    border: 1px solid var(--purple-100);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dash-exam-item:hover {
    transform: translateX(-2px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
}

.dash-exam-info {
    flex: 1;
    min-width: 0;
}

.dash-exam-info strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 2px;
    line-height: 1.35;
}

.dash-exam-info small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dash-exam-badge {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--purple-600), #a855f7);
    color: white;
    white-space: nowrap;
}

.dash-exam-badge.urgent {
    background: linear-gradient(135deg, #dc2626, #f97316);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.dash-exam-badge.soon {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.dash-exam-badge.calm {
    background: linear-gradient(135deg, #059669, #10b981);
}

.dash-exams-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 16px;
    background: var(--purple-50);
    border-radius: 12px;
}

/* ── Dashboard CTA grid ── */
.dashboard-cta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

@media (min-width: 1100px) {
    .dashboard-cta-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.cta-tile {
    margin-bottom: 0;
}

.cta-tile .study-cta-content {
    flex: 1;
    min-width: 0;
}

.cta-tile .study-cta-content h2 {
    font-size: 1.1rem;
    line-height: 1.35;
}

.cta-tile .study-cta-content p {
    font-size: 0.78rem;
    line-height: 1.45;
}

.cta-tile .study-cta-arrow {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* ── Planner CTA ── */
.planner-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 24px;
    padding: 24px 28px;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(79, 70, 229, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeUp 0.5s ease 0.05s both;
}

.planner-cta-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(79, 70, 229, 0.45);
}

.planner-cta-glow {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255, 255, 255, 0.08);
    transform: rotate(15deg);
    pointer-events: none;
}

.planner-cta-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
}

/* ── Reports CTA ── */
.reports-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(135deg, #0d9488, #06b6d4);
    border-radius: 24px;
    padding: 22px 24px;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(13, 148, 136, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeUp 0.5s ease 0.1s both;
}

.reports-cta-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(13, 148, 136, 0.45);
}

.reports-cta-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255, 255, 255, 0.08);
    transform: rotate(-12deg);
    pointer-events: none;
}

.reports-cta-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
}

/* ── Chatbox CTA — مسنجر داخلی ── */
.chatbox-cta-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 18px 20px;
    border-radius: 22px;
    text-decoration: none;
    color: #fff;
    position: relative;
    overflow: hidden;
    background: linear-gradient(125deg, #0b1220 0%, #134e4a 42%, #0e7490 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 34px rgba(14, 116, 144, 0.28);
    transition: transform .25s ease, box-shadow .25s ease;
}

.chatbox-cta-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(14, 116, 144, 0.36);
}

.chatbox-cta-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 90% 15%, rgba(255, 255, 255, 0.18), transparent 40%),
        radial-gradient(circle at 8% 85%, rgba(45, 212, 191, 0.2), transparent 42%);
    pointer-events: none;
}

.chatbox-cta-icon {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
}

.chatbox-cta-body {
    position: relative;
    flex: 1;
    min-width: 0;
}

.chatbox-cta-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    margin-bottom: 4px;
}

.chatbox-cta-body h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.chatbox-cta-body p {
    margin: 3px 0 0;
    font-size: .82rem;
    opacity: .88;
}

.chatbox-cta-arrow {
    position: relative;
    font-size: 1.2rem;
    opacity: .85;
    flex-shrink: 0;
}

/* ── AI Chat CTA — برجسته و متمایز ── */
.chat-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(125deg, #7f1d1d 0%, #dc2626 28%, #ef4444 52%, #f97316 100%);
    border-radius: 24px;
    padding: 22px 24px;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 14px 44px rgba(220, 38, 38, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeUp 0.5s ease 0.15s both, chat-pulse-ring 3s ease-in-out infinite;
}

.chat-cta-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow:
        0 20px 52px rgba(220, 38, 38, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.chat-cta-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.28), transparent 42%),
        radial-gradient(circle at 10% 80%, rgba(251, 191, 36, 0.22), transparent 38%);
    pointer-events: none;
    animation: chat-glow-shift 5s ease-in-out infinite;
}

.chat-cta-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    animation: chat-shimmer 4.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes chat-glow-shift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.04); }
}

@keyframes chat-shimmer {
    0% { left: -120%; }
    55%, 100% { left: 140%; }
}

@keyframes chat-pulse-ring {
    0%, 100% { box-shadow: 0 14px 44px rgba(220, 38, 38, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 16px 48px rgba(239, 68, 68, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
}

.chat-cta-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 1.5rem;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.chat-cta-body {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.chat-cta-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.18);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.chat-cta-card .study-cta-content {
    position: relative;
    z-index: 1;
}

.chat-cta-card .study-cta-content h2 {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.chat-cta-card .study-cta-arrow {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.4rem;
}

/* ── Study CTA ── */
.study-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
    border-radius: 24px;
    padding: 28px 36px;
    margin-bottom: 24px;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeUp 0.5s ease both;
}

.study-cta-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(124, 58, 237, 0.45);
}

.study-cta-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(-15deg);
    pointer-events: none;
}

.study-cta-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.study-cta-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.study-cta-content p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.study-cta-arrow {
    font-size: 2rem;
    font-weight: 300;
    opacity: 0.8;
    flex-shrink: 0;
}

/* ── Today dashboard panel ── */
.today-panel {
    margin-bottom: 28px;
    animation: fadeUp 0.6s ease both;
}

.today-section-head {
    margin-bottom: 14px;
}

.today-section-head .today-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--purple-600);
    letter-spacing: 0.04em;
}

.today-section-head h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: 2px;
    color: var(--text);
}

.today-combined-inner {
    display: flex;
    align-items: stretch;
    gap: 14px;
    height: 100%;
    min-height: 72px;
}

.today-combined-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.today-combined-sep {
    width: 1px;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    margin: 4px 0;
}

.today-combined-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 6px;
}

.today-combined-value {
    display: block;
    font-size: clamp(1.25rem, 3.5vw, 1.65rem);
    font-weight: 900;
    line-height: 1.15;
}

.today-combined-subvalue {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
}

.today-combined-hint {
    display: block;
    font-size: 0.68rem;
    opacity: 0.85;
    margin-top: 4px;
}

.today-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: stretch;
}

.widget-card {
    background: var(--white);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.widget-card.today-combined-widget {
    background: linear-gradient(135deg, var(--purple-700), #9333ea 55%, #c026d3);
    border: none;
    color: #fff;
    box-shadow: 0 12px 36px rgba(109, 40, 217, 0.28);
    padding: 16px 18px;
}

.widget-card.today-combined-widget .today-combined-label,
.widget-card.today-combined-widget .today-combined-value,
.widget-card.today-combined-widget .today-combined-subvalue,
.widget-card.today-combined-widget .today-combined-hint {
    color: #fff;
}

.widget-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.widget-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--purple-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.widget-head h3 {
    font-size: 0.92rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.widget-head p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.widget-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--purple-700);
}

.goal-bar-track {
    height: 10px;
    background: var(--purple-100);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}

.goal-bar-track.slim { height: 8px; margin-top: 10px; }

.goal-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--purple-600), #e879f9);
    border-radius: 99px;
    transition: width 0.6s ease;
}

.goal-bar-fill.planner-fill {
    background: linear-gradient(90deg, #059669, #34d399);
}

.goal-bar-pct {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--purple-700);
}

.planner-squares {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.planner-sq {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: var(--purple-100);
    border: 1px solid var(--purple-200);
}

.planner-sq.done {
    background: #059669;
    border-color: #059669;
}

.planner-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Dashboard analytics */
.dash-analytics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.dash-chart-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.dash-chart-head h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.dash-chart-head p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.dash-chart-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dash-chart-head-row p {
    margin-bottom: 0;
}

.dash-chart-head-row p strong {
    color: var(--purple-700);
    font-weight: 800;
}

.dash-chart-toggle {
    flex-shrink: 0;
    border: 1px solid var(--purple-200);
    background: var(--purple-50);
    color: var(--purple-700);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.dash-chart-toggle:hover {
    background: var(--purple-100);
    transform: scale(1.03);
}

.dash-chart-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--purple-200);
    background: var(--purple-50);
    color: inherit;
    text-decoration: none;
    font-size: 1.15rem;
    border-radius: 12px;
    transition: background 0.2s, transform 0.15s;
}

.dash-chart-link:hover {
    background: var(--purple-100);
    transform: scale(1.05);
}

.dash-chart-body {
    width: 100%;
}

.dash-svg-chart {
    width: 100%;
    height: auto;
    display: block;
}

.dash-goals-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-goal-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-goal-ring {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.dash-goal-ring svg {
    width: 100%;
    height: 100%;
}

.dash-goal-ring span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--purple-700);
}

.dash-goal-info {
    flex: 1;
    min-width: 0;
}

.dash-goal-info strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.dash-goal-info small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dash-goal-bar {
    height: 6px;
    background: var(--purple-100);
    border-radius: 99px;
    margin-top: 8px;
    overflow: hidden;
}

.dash-goal-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--purple-600), #e879f9);
    border-radius: 99px;
    transition: width 0.6s ease;
}

.dash-sp-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.dash-sp-tree { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow: auto; padding-left: 2px; }
.dash-sp-acc {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--purple-50, #f5f3ff);
    overflow: hidden;
}
.dash-sp-grade { background: #fff; }
.dash-sp-lesson { background: #f8fafc; }
.dash-sp-toggle {
    width: 100%; border: none; background: transparent; text-align: right;
    padding: 8px 10px; cursor: pointer; font-family: inherit;
    display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.dash-sp-toggle-main { display: flex; gap: 6px; align-items: flex-start; flex: 1; min-width: 0; }
.dash-sp-toggle-main strong { display: block; font-size: .8rem; font-weight: 800; color: var(--text, #0f172a); }
.dash-sp-toggle-main small { display: block; color: var(--text-muted); font-size: .68rem; margin-top: 1px; }
.dash-sp-caret { color: #94a3b8; transition: transform .2s; display: inline-block; margin-top: 2px; }
.dash-sp-acc.open > .dash-sp-toggle .dash-sp-caret { transform: rotate(90deg); }
.dash-sp-body { display: none; padding: 0 8px 8px; }
.dash-sp-acc.open > .dash-sp-body { display: flex; flex-direction: column; gap: 6px; }
.dash-sp-bar { min-width: 72px; }
.dash-sp-bar-meta {
    display: flex; justify-content: space-between; font-size: .64rem; font-weight: 800; color: #64748b;
}
.dash-sp-track {
    height: 5px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin-top: 3px;
}
.dash-sp-track > i {
    display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #10b981);
}
.dash-sp-track > i.done { background: #059669; }
.dash-sp-leaf {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 10px; background: #fff; border: 1px solid #e2e8f0;
}
.dash-sp-leaf-title { font-size: .75rem; font-weight: 700; color: #334155; }

.dash-goals-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 20px;
    background: var(--purple-50);
    border-radius: 14px;
}

@media (max-width: 768px) {
    .dash-analytics {
        grid-template-columns: 1fr;
    }
}

/* legacy hero (unused) */
.hero-card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 48px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 28px;
    animation: fadeUp 0.7s ease 0.1s both;
}

.hero-glow {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 200%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), transparent);
    transform: rotate(-15deg);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--purple-100), var(--purple-50));
    color: var(--purple-700);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--purple-200);
}

.hero-content h2 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--purple-900), var(--purple-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 14px;
    line-height: 1.4;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 520px;
    margin-bottom: 28px;
}

.progress-track {
    height: 6px;
    background: var(--purple-100);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    max-width: 400px;
}

.progress-fill {
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg, var(--purple-600), var(--purple-400));
    border-radius: 10px;
    animation: progressPulse 3s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { width: 35%; opacity: 1; }
    50% { width: 42%; opacity: 0.85; }
}

.progress-label {
    font-size: 0.78rem;
    color: var(--purple-500);
    font-weight: 600;
}

/* ── Hero visual ── */
.hero-visual {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-ring {
    position: absolute;
    border: 1.5px solid var(--purple-200);
    border-radius: 50%;
    animation: spin 20s linear infinite;
}

.ring-1 { width: 180px; height: 180px; }
.ring-2 { width: 140px; height: 140px; animation-duration: 15s; animation-direction: reverse; border-color: var(--purple-100); }
.ring-3 { width: 100px; height: 100px; animation-duration: 10s; border-color: rgba(139, 92, 246, 0.2); }

.orbit-core {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--purple-50), var(--white));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.2);
    animation: coreGlow 4s ease-in-out infinite;
}

.orbit-core svg {
    width: 56px;
    height: 56px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes coreGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.2); }
    50% { box-shadow: 0 0 60px rgba(139, 92, 246, 0.35); }
}

/* ── Stats grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 32px;
    animation: fadeUp 0.8s ease 0.2s both;
}

.stat-card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.purple { background: linear-gradient(135deg, #ede9fe, #f5f3ff); }
.stat-icon.violet { background: linear-gradient(135deg, #ddd6fe, #ede9fe); }
.stat-icon.lilac { background: linear-gradient(135deg, #e9d5ff, #f3e8ff); }
.stat-icon.grape { background: linear-gradient(135deg, #d8b4fe, #e9d5ff); }

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--purple-200);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(139, 92, 246, 0.04) 50%, transparent 60%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── Features preview ── */
.features-preview {
    animation: fadeUp 0.9s ease 0.3s both;
}

.features-preview h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 18px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.feature-tile {
    background: var(--white);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-tile::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--purple-600), var(--purple-400));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.feature-tile:hover {
    border-color: var(--purple-200);
    box-shadow: var(--shadow);
}

.feature-tile:hover::before {
    transform: scaleX(1);
}

.feature-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--purple-100);
    line-height: 1;
    margin-bottom: 12px;
}

.feature-tile h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.feature-tile p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .dashboard-cta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .topbar {
        display: none !important;
    }

    .dash-top-widgets {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 16px;
    }

    .dash-clock-card {
        padding: 16px 18px;
        min-height: 100px;
        border-radius: 18px;
    }

    .dash-sleep-card {
        border-radius: 18px;
        padding: 16px 18px;
    }

    .dash-exams-card {
        border-radius: 18px;
        padding: 16px 18px;
        margin-bottom: 20px;
    }

    .dash-study-hero-card,
    .dash-test-hero-card,
    .dash-event-hero-card {
        border-radius: 22px;
        min-height: 156px;
    }

    .dash-study-hero-inner,
    .dash-test-hero-inner,
    .dash-event-hero-inner {
        padding: 16px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .dash-study-hero-main,
    .dash-test-hero-main,
    .dash-event-hero-main {
        flex-direction: row;
        text-align: start;
        flex: 1;
    }

    .dash-study-hero-elapsed,
    .dash-test-hero-elapsed,
    .dash-event-hero-elapsed {
        max-width: none;
    }

    .dash-study-hero-action,
    .dash-test-hero-action,
    .dash-event-hero-action {
        flex-direction: column;
        justify-content: center;
        align-self: center;
        min-width: 100px;
        padding: 10px 12px;
    }

    .dash-tools-edu {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-tools-account {
        max-width: none;
    }

    .dash-tool-card {
        min-height: 88px;
        padding: 12px 8px;
        border-radius: 16px;
    }

    .dash-tool-card strong {
        font-size: 0.75rem;
    }

    .dash-chat-banner {
        border-radius: 18px;
        padding: 16px 18px;
        margin-bottom: 16px;
    }

    .chat-cta-icon-wrap {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        border-radius: 14px;
    }

    .chat-cta-card .study-cta-content h2 {
        font-size: 1rem;
    }

    .chat-cta-badge {
        font-size: 0.62rem;
        padding: 3px 8px;
    }

    .study-cta-card,
    .planner-cta-card,
    .reports-cta-card,
    .chat-cta-card {
        flex-direction: row;
        align-items: center;
        text-align: right;
        padding: 16px 18px;
        gap: 12px;
        border-radius: 18px;
    }

    .cta-tile .study-cta-content h2 {
        font-size: 0.95rem;
        margin-bottom: 2px;
    }

    .cta-tile .study-cta-content p {
        font-size: 0.72rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .study-cta-badge,
    .planner-cta-badge,
    .reports-cta-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
        margin-bottom: 4px;
    }

    .study-cta-arrow {
        display: flex;
        font-size: 1.25rem;
        opacity: 0.75;
    }

    .hero-card {
        grid-template-columns: 1fr;
        padding: 22px 18px;
        text-align: center;
        margin-bottom: 20px;
        border-radius: 20px;
    }

    .today-widgets {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .today-combined-inner {
        flex-direction: column;
        gap: 12px;
    }

    .today-combined-sep {
        width: 100%;
        height: 1px;
        margin: 0;
    }

    .widget-card {
        padding: 16px 16px;
        border-radius: 16px;
    }

    .hero-content h2 {
        font-size: 1.35rem;
        line-height: 1.4;
    }

    .hero-content p {
        max-width: 100%;
        font-size: 0.88rem;
        margin-bottom: 20px;
    }

    .progress-track {
        margin: 0 auto 8px;
        max-width: 100%;
    }

    .hero-visual {
        margin: 0 auto;
        width: 140px;
        height: 140px;
    }

    .orbit-ring.ring-1 { width: 130px; height: 130px; }
    .orbit-ring.ring-2 { width: 100px; height: 100px; }
    .orbit-ring.ring-3 { width: 72px; height: 72px; }
    .orbit-core { width: 56px; height: 56px; }
    .orbit-core svg { width: 44px; height: 44px; }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 24px;
    }

    .stat-card {
        padding: 14px 12px;
        gap: 10px;
        border-radius: 16px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
        border-radius: 12px;
    }

    .stat-value { font-size: 1.15rem; }
    .stat-label { font-size: 0.72rem; }

    .features-preview h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .feature-tile {
        padding: 20px 18px;
        border-radius: 16px;
    }

    .feature-num {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
}

/* Subscription status — compact single-row bar */
.dash-sub-card {
    margin-bottom: 16px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--white);
    box-shadow: var(--shadow);
    color: var(--text);
}
.dash-sub-card.is-urgent {
    border-color: rgba(248, 113, 113, .35);
    background: linear-gradient(90deg, #fff 0%, #fef2f2 100%);
}
.dash-sub-card.is-pending {
    border-color: rgba(139, 92, 246, .28);
    background: linear-gradient(90deg, #fff 0%, var(--purple-50) 100%);
}
.dash-sub-card.is-trial {
    border-color: rgba(245, 158, 11, .28);
    background: linear-gradient(90deg, #fff 0%, #fffbeb 100%);
}
.dash-sub-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    min-height: 56px;
}
.dash-sub-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 0;
}
.dash-sub-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--purple-100);
    color: var(--purple-700);
    border: 1px solid var(--purple-200);
}
.dash-sub-card.is-free .dash-sub-badge {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}
.dash-sub-card.is-urgent .dash-sub-badge {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}
.dash-sub-card.is-trial .dash-sub-badge {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}
.dash-sub-title {
    margin: 0;
    font-size: .92rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 11rem;
}
.dash-sub-stats {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.dash-sub-stat {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--purple-50);
    border: 1px solid var(--purple-100);
}
.dash-sub-stat span {
    display: block;
    font-size: .65rem;
    color: var(--text-muted);
    line-height: 1.2;
    margin-bottom: 2px;
}
.dash-sub-stat strong {
    display: block;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-sub-days { color: var(--purple-700); }
.dash-sub-card.is-urgent .dash-sub-days { color: #b91c1c; }
.dash-sub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 700;
    background: var(--purple-600);
    color: #fff;
    border: none;
    transition: background .12s, transform .12s;
}
.dash-sub-btn:hover {
    background: var(--purple-700);
    transform: translateY(-1px);
}
.dash-sub-card.is-free .dash-sub-btn {
    background: var(--purple-500);
}
.dash-sub-card.is-urgent .dash-sub-btn {
    background: #dc2626;
}
.dash-sub-card.is-urgent .dash-sub-btn:hover {
    background: #b91c1c;
}
@media (max-width: 640px) {
    .dash-sub-main {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }
    .dash-sub-identity { width: 100%; }
    .dash-sub-title { max-width: none; flex: 1; }
    .dash-sub-stats { width: calc(100% - 72px); }
    .dash-sub-btn { margin-right: auto; }
}

@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ── Dark mode dashboard surfaces ── */
html[data-theme="dark"] .dash-sub-card {
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.35), rgba(26, 22, 37, 0.95));
    border-color: var(--glass-border);
}
html[data-theme="dark"] .dash-clock-card,
html[data-theme="dark"] .dash-sleep-card,
html[data-theme="dark"] .dash-svc-link,
html[data-theme="dark"] .feature-widget,
html[data-theme="dark"] .mood-note-card {
    background: var(--surface);
    border-color: var(--glass-border);
    color: var(--text);
}
html[data-theme="dark"] .dash-svc-link {
    background: rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .dash-svc-link:hover {
    background: rgba(139, 92, 246, 0.14);
}
html[data-theme="dark"] .nav-group.tone-teal .nav-group-label { color: #5eead4; }
html[data-theme="dark"] .dash-sub-card.is-urgent {
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.35), rgba(26, 22, 37, 0.95));
}
html[data-theme="dark"] .dash-sub-card.is-urgent .dash-sub-days { color: #fca5a5; }
html[data-theme="dark"] .dash-sub-days { color: #c4b5fd; }

/* نوار معلق مطالعه/فعالیت */
html[data-theme="dark"] .dash-activity-bar,
html[data-theme="dark"] .dash-activity-bar.is-idle {
    background: linear-gradient(135deg, #1a2332, #14182a) !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    color: #f1f5ff;
}
html[data-theme="dark"] .dash-activity-bar.is-live {
    background: linear-gradient(135deg, #2a1518, #1a1620) !important;
    border-color: rgba(248, 113, 113, 0.35) !important;
}
html[data-theme="dark"] .dash-activity-bar.is-live[data-kind="study"] {
    background: linear-gradient(135deg, #1a1a3a, #16182a) !important;
    border-color: rgba(129, 140, 248, 0.35) !important;
}
html[data-theme="dark"] .dash-activity-text strong,
html[data-theme="dark"] .dash-activity-timer strong {
    color: #f1f5ff !important;
}
html[data-theme="dark"] .dash-activity-text span {
    color: #9aa3c2 !important;
}
html[data-theme="dark"] .dash-activity-icon {
    background: rgba(45, 212, 191, 0.16) !important;
}
html[data-theme="dark"] .dash-activity-bar.is-live .dash-activity-icon {
    background: rgba(248, 113, 113, 0.18) !important;
}
html[data-theme="dark"] .dash-activity-bar.is-live[data-kind="study"] .dash-activity-icon {
    background: rgba(129, 140, 248, 0.2) !important;
}
html[data-theme="dark"] .dash-activity-timer {
    background: rgba(255, 255, 255, 0.08) !important;
}
