/* ═══════════════════════════════════════════════════════════════
   Psyno (سای‌نو) — Glassmorphism + Cyber-Arabesque Theme
   ═══════════════════════════════════════════════════════════════ */

/* فونت وزیرمتن روی همین سرور (بدون وابستگی به Google Fonts؛ سریع‌تر و پایدار در ایران).
   مجوز: SIL OFL 1.1 — assets/fonts/Vazirmatn-OFL.txt */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2-variations'),
         url('../fonts/Vazirmatn-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-primary:    #060a14;
    --bg-secondary:  #0d1324;
    --glass-bg:      rgba(255, 255, 255, 0.035);
    --glass-bg-hover:rgba(255, 255, 255, 0.06);
    --glass-border:  rgba(255, 255, 255, 0.09);
    --glass-shadow:  0 8px 32px rgba(0, 0, 0, 0.45);
    --accent:        #7c3aed;
    --accent-glow:   rgba(124, 58, 237, 0.45);
    --accent-light:  #a78bfa;
    --cyan:          #06b6d4;
    --cyan-glow:     rgba(6, 182, 212, 0.35);
    --success:       #10b981;
    --danger:        #f43f5e;
    --warning:       #f59e0b;
    --text-primary:  #f8fafc;
    --text-muted:    #8b9cb8;
    --radius:        16px;
    --radius-sm:     10px;
    --sidebar-w:     280px;
    --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    font-feature-settings: 'ss01' on;
}

/* ─── Arabesque Background Pattern ─────────────────────────── */
.arabesque-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 15% 40%, rgba(124,58,237,0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(6,182,212,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(167,139,250,0.06) 0%, transparent 55%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.arabesque-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23a78bfa' stroke-width='0.5'%3E%3Cpath d='M40 0 L50 20 L70 30 L50 40 L40 60 L30 40 L10 30 L30 20 Z'/%3E%3Cpath d='M40 10 L45 22 L58 28 L45 34 L40 46 L35 34 L22 28 L35 22 Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 80px 80px;
    animation: arabesque-drift 60s linear infinite;
}

.arabesque-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(124,58,237,0.02) 2px,
        rgba(124,58,237,0.02) 4px
    );
    pointer-events: none;
}

@keyframes arabesque-drift {
    from { background-position: 0 0; }
    to { background-position: 80px 80px; }
}

/* ─── Glass Panels ─────────────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow), 0 1px 0 rgba(255,255,255,0.04) inset;
}

.glow-border {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: var(--glass-shadow), 0 0 40px rgba(124, 58, 237, 0.08);
}

.glow-hover {
    transition: var(--transition);
}

.glow-hover:hover {
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: var(--glass-shadow), 0 0 30px rgba(124, 58, 237, 0.12);
    transform: translateY(-2px);
}

.glass-panel-sm {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

/* ─── Layout ───────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    z-index: 100;
    border-left: 1px solid var(--glass-border);
    background:
        linear-gradient(165deg, rgba(124, 58, 237, 0.14) 0%, rgba(6, 182, 212, 0.06) 38%, rgba(255,255,255,0.02) 100%),
        var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    box-shadow: -4px 0 40px rgba(0, 0, 0, 0.25), inset 1px 0 0 rgba(255,255,255,0.06);
}

.sidebar-glow {
    position: absolute;
    top: -40%;
    right: -30%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.35) 0%, transparent 70%);
    pointer-events: none;
    animation: sidebar-glow-pulse 6s ease-in-out infinite;
}

@keyframes sidebar-glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.08); }
}

.pulse-soft {
    animation: pulse-soft 3s ease-in-out infinite;
}

@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
    50% { box-shadow: 0 0 32px var(--accent-glow), 0 0 48px rgba(6, 182, 212, 0.2); }
}

.main-content {
    flex: 1;
    margin-right: var(--sidebar-w);
    padding: 2rem;
    max-width: 1200px;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ─── Brand ────────────────────────────────────────────────── */
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.brand-text {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.brand-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.brand-icon.lg {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    margin: 0 auto 1rem;
    border-radius: 16px;
}

/* ─── Navigation ───────────────────────────────────────────── */
.nav-links {
    list-style: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-left: 2px;
    margin-bottom: 0.5rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.nav-icon-wrap {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    transition: var(--transition);
}

.nav-icon-wrap svg {
    width: 1.05rem;
    height: 1.05rem;
    opacity: 0.85;
}

.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-icon {
    font-size: 0.85rem;
    opacity: 0.7;
    width: 1.2rem;
    text-align: center;
}

.nav-links a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, var(--accent-light), var(--cyan));
    border-radius: 4px;
    transition: transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(6, 182, 212, 0.08));
    border-color: rgba(124, 58, 237, 0.18);
    transform: translateX(-2px);
}

.nav-links a:hover .nav-icon-wrap,
.nav-links a.active .nav-icon-wrap {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(6, 182, 212, 0.2));
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}

.nav-links a.active::before {
    transform: translateY(-50%) scaleY(1);
}

.nav-links a.active {
    border-right: none;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

/* ─── دکمهٔ چشم‌نواز پشتیبانی در زیرمنوی کاربری ─── */
.support-cta {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--accent, #7c3aed), var(--cyan, #06b6d4));
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: support-cta-pulse 2.8s ease-in-out infinite;
}
.support-cta:hover,
.support-cta.active {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(6, 182, 212, 0.45);
    border-color: rgba(255, 255, 255, 0.35);
}
@keyframes support-cta-pulse {
    0%, 100% { box-shadow: 0 8px 22px rgba(124, 58, 237, 0.35); }
    50% { box-shadow: 0 10px 30px rgba(6, 182, 212, 0.5); }
}
.support-cta-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(120px 60px at 80% 0%, rgba(255, 255, 255, 0.35), transparent 70%);
    opacity: 0.6;
    pointer-events: none;
    animation: support-cta-shine 3.5s linear infinite;
}
@keyframes support-cta-shine {
    0% { transform: translateX(-30%); opacity: 0.25; }
    50% { opacity: 0.6; }
    100% { transform: translateX(30%); opacity: 0.25; }
}
.support-cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
}
.support-cta-icon svg { width: 20px; height: 20px; }
.support-cta-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.support-cta-text strong { font-size: 0.9rem; font-weight: 700; }
.support-cta-text small { font-size: 0.68rem; opacity: 0.85; }
.support-cta-badge {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    direction: ltr;
}

.sidebar-footer .user-badge {
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.sidebar-footer .user-badge:hover {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.15);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-name {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Typography ───────────────────────────────────────────── */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }

.text-muted { color: var(--text-muted); font-size: 0.9rem; }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.btn-ghost:hover { color: var(--text-primary); border-color: var(--accent); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #e11d48);
    color: #fff;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}
.btn-block { width: 100%; }

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

/* ─── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

input, select, textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-secondary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b9cb8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    padding-left: 2.25rem;
    cursor: pointer;
}

select option,
select optgroup {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

select option:checked,
select option:hover {
    background-color: rgba(124, 58, 237, 0.35);
    color: var(--text-primary);
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    color-scheme: inherit;
}

[data-theme="light"] select {
    background-color: rgba(255, 255, 255, 0.9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="light"] select option,
[data-theme="light"] select optgroup {
    background-color: #f0f4f8;
    color: #0f172a;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.search-input {
    max-width: 300px;
}

/* ─── Stats Grid ───────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-grid-6 {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* ─── System Alerts (Dashboard) ───────────────────────────── */
.system-alerts {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
}

.system-alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.system-alerts-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.system-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.system-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
}

.system-alert:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(124, 58, 237, 0.2);
}

.system-alert-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.95rem;
}

.system-alert-warning .system-alert-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.system-alert-info .system-alert-icon {
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
}

.system-alert-error .system-alert-icon {
    background: rgba(244, 63, 94, 0.15);
    color: var(--danger);
}

.system-alert-body p {
    margin: 0 0 0.35rem;
    line-height: 1.55;
}

.system-alert-link {
    font-size: 0.85rem;
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
}

.system-alert-link:hover {
    color: var(--cyan);
}

.stat-card {
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--cyan), transparent);
    opacity: 0.6;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.stat-money {
    font-size: 1.5rem !important;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-light), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ─── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; padding: 0; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--glass-border);
}

.data-table th {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:hover td {
    background: rgba(99, 102, 241, 0.04);
}

.data-table a {
    color: var(--accent-light);
    text-decoration: none;
}

.data-table a:hover { text-decoration: underline; }

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(99,102,241,0.15);
    color: var(--accent-light);
}

.badge-scheduled { background: rgba(6,182,212,0.15); color: var(--cyan); }
.badge-confirmed { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-cancelled { background: rgba(244,63,94,0.15); color: var(--danger); }
.badge-completed { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-issued { background: rgba(124,58,237,0.15); color: var(--accent-light); }
.badge-paid { background: rgba(16,185,129,0.2); color: var(--success); }
.badge-draft { background: rgba(139,156,184,0.15); color: var(--text-muted); }
.badge-busy { background: rgba(244,63,94,0.15); color: var(--danger); }
.badge-free { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-default { background: rgba(124,58,237,0.2); color: var(--accent-light); margin-right: 0.25rem; }

/* ─── Login Page ───────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
}

.login-card h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.login-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.login-tagline {
    font-size: 0.78rem;
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

.login-card form { text-align: right; }

.theme-toggle-login {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.theme-toggle-login:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ═══ Auth Page (ورود / ثبت‌نام) ═══════════════════════════════ */
.auth-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    overflow: hidden;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
    animation: auth-orb-float 16s ease-in-out infinite;
}
.auth-orb-1 { width: 420px; height: 420px; top: -120px; inset-inline-end: -80px; background: radial-gradient(circle, rgba(124,58,237,0.55), transparent 70%); }
.auth-orb-2 { width: 380px; height: 380px; bottom: -140px; inset-inline-start: -100px; background: radial-gradient(circle, rgba(6,182,212,0.4), transparent 70%); animation-delay: -5s; }
.auth-orb-3 { width: 300px; height: 300px; top: 40%; inset-inline-start: 45%; background: radial-gradient(circle, rgba(167,139,250,0.3), transparent 70%); animation-delay: -9s; }

@keyframes auth-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(0, -34px) scale(1.08); }
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1080px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.5rem;
    align-items: stretch;
    animation: login-float 0.7s ease;
}

/* ─── Showcase / marketing ─── */
.auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.75rem;
    padding: 2.25rem;
    border-radius: 24px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(6,182,212,0.35), transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(167,139,250,0.28), transparent 45%),
        linear-gradient(150deg, #4c1d95 0%, #5b21b6 35%, #1e293b 100%);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 24px 70px rgba(76,29,149,0.45);
}

.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='0.6'%3E%3Cpath d='M40 0 L50 20 L70 30 L50 40 L40 60 L30 40 L10 30 L30 20 Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 70px 70px;
    animation: arabesque-drift 60s linear infinite;
    pointer-events: none;
}

.auth-hero-top,
.auth-hero-body,
.auth-hero-foot { position: relative; z-index: 1; }

.auth-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-brand { display: flex; align-items: center; gap: 0.75rem; }
.auth-brand-name { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.auth-brand-sub { display: block; font-size: 0.72rem; opacity: 0.7; letter-spacing: 0.14em; text-transform: uppercase; }

.auth-trial-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    font-size: 0.74rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}
.auth-trial-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
    animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.7); } }

.auth-hero-title {
    font-size: 2rem;
    line-height: 1.35;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.auth-grad {
    background: linear-gradient(90deg, #a78bfa, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-hero-lead {
    font-size: 0.95rem;
    line-height: 1.9;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    max-width: 46ch;
}

.auth-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    transition: var(--transition);
}
.auth-feature:hover {
    background: rgba(255,255,255,0.13);
    transform: translateY(-2px);
}
.auth-feature-icon { font-size: 1.25rem; line-height: 1.4; flex-shrink: 0; }
.auth-feature strong { display: block; font-size: 0.86rem; font-weight: 600; }
.auth-feature span { font-size: 0.74rem; opacity: 0.78; }

.auth-hero-foot {
    display: flex;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.14);
}
.auth-stat { flex: 1; }
.auth-stat strong { display: block; font-size: 1.4rem; font-weight: 700; color: #fff; }
.auth-stat span { font-size: 0.72rem; opacity: 0.75; }

/* ─── Auth card ─── */
.auth-panel {
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-panel-head { text-align: center; margin-bottom: 1.25rem; }
.auth-panel-logo {
    width: 56px; height: 56px;
    font-size: 1.6rem;
    margin: 0 auto 0.75rem;
    display: flex; align-items: center; justify-content: center;
}
.auth-panel-head h2 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.auth-panel-head p { font-size: 0.85rem; }

.auth-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--success);
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.25);
}
.auth-security-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 1.8s ease-in-out infinite;
}

.auth-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.35rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}
.auth-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.5rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    box-shadow: 0 6px 18px var(--accent-glow);
}
.auth-tab-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.auth-tab:not(.active) .auth-tab-badge {
    background: rgba(16,185,129,0.18);
    color: var(--success);
}

.auth-form { display: none; text-align: right; }
.auth-form.active { display: block; animation: auth-form-in 0.3s ease; }
@keyframes auth-form-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.btn-lg { padding: 0.9rem 1.25rem; font-size: 1rem; }

.auth-switch { text-align: center; margin-top: 1rem; font-size: 0.82rem; }
.auth-trust { text-align: center; margin-top: 0.6rem; font-size: 0.74rem; opacity: 0.8; }
.auth-link {
    background: none;
    border: none;
    color: var(--accent-light);
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.auth-link:hover { color: var(--cyan); }

.password-step .password-input-group {
    text-align: right;
    margin-bottom: 1.25rem;
}
.password-step .password-input-group input {
    width: 100%;
}

/* ─── Set-password step (اولین ورود) ─── */
.set-password-step { text-align: center; }
.set-password-step form { text-align: right; }
.set-password-step .password-input-group { text-align: right; margin-bottom: 0.9rem; }
.set-password-step .password-input-group input { width: 100%; }
.set-password-step .otp-visual {
    position: relative;
    margin: 0 auto 1.25rem;
    width: 96px;
    height: 96px;
}
.set-password-step .otp-shield-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(6,182,212,0.2));
    border: 2px solid rgba(124,58,237,0.45);
    box-shadow: 0 0 40px rgba(124,58,237,0.35), inset 0 0 20px rgba(255,255,255,0.05);
    animation: otp-ring-pulse 2.5s ease-in-out infinite;
}
.set-password-step .otp-shield-icon {
    font-size: 2.3rem;
    line-height: 1;
    animation: otp-icon-bounce 2s ease-in-out infinite;
}

/* لیست شرایط رمز عبور */
.password-checklist {
    list-style: none;
    margin: 0.35rem 0 1.1rem;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 0.3rem;
}
.password-checklist li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    transition: color 0.2s ease;
}
.password-checklist li .pw-check-icon {
    display: inline-flex;
    width: 1.15rem;
    justify-content: center;
    font-weight: 700;
}
.password-checklist li.pw-rule-ok {
    color: var(--success, #22c55e);
}
.password-checklist li.pw-rule-ok .pw-check-icon {
    color: var(--success, #22c55e);
}

/* ─── OTP Step (تأیید دو مرحله‌ای) ─── */
.otp-step {
    text-align: center;
    animation: otp-step-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: visible;
}
@keyframes otp-step-in {
    from { opacity: 0; transform: translateY(20px) scale(0.96); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* Password step keeps classic shield visual */
.password-step .otp-visual {
    position: relative;
    margin: 0 auto 1.5rem;
    width: 100px;
    height: 100px;
}
.password-step .otp-shield-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(6,182,212,0.2));
    border: 2px solid rgba(124,58,237,0.45);
    box-shadow: 0 0 40px rgba(124,58,237,0.35), inset 0 0 20px rgba(255,255,255,0.05);
    animation: otp-ring-pulse 2.5s ease-in-out infinite;
}
@keyframes otp-ring-pulse {
    0%, 100% { box-shadow: 0 0 40px rgba(124,58,237,0.35), inset 0 0 20px rgba(255,255,255,0.05); transform: scale(1); }
    50% { box-shadow: 0 0 60px rgba(6,182,212,0.45), inset 0 0 30px rgba(255,255,255,0.08); transform: scale(1.04); }
}
.password-step .otp-shield-icon {
    font-size: 2.5rem;
    line-height: 1;
    animation: otp-icon-bounce 2s ease-in-out infinite;
}
@keyframes otp-icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.password-step .otp-pulse-line {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--accent-light), var(--cyan), transparent);
    animation: otp-line-scan 1.8s ease-in-out infinite;
}
@keyframes otp-line-scan {
    0%, 100% { opacity: 0.4; width: 40px; }
    50% { opacity: 1; width: 80px; }
}

/* ─── Premium OTP verify flow ─── */
#otp-step.otp-verify-flow {
    padding-top: 0.25rem;
}

/* Floating particles */
#otp-step .otp-particles {
    position: absolute;
    inset: -20px -10px auto;
    height: 140px;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
#otp-step .otp-particle {
    position: absolute;
    width: calc(3px + (var(--p) % 3) * 1px);
    height: calc(3px + (var(--p) % 3) * 1px);
    border-radius: 50%;
    background: var(--accent-light);
    opacity: 0;
    left: calc(5% + (var(--p) * 6.5%) % 90%);
    top: calc(10% + (var(--p) * 11%) % 80%);
    animation: otp-particle-float calc(4s + (var(--p) % 5) * 0.6s) ease-in-out infinite;
    animation-delay: calc(var(--p) * -0.35s);
    box-shadow: 0 0 8px var(--accent-glow);
}
#otp-step .otp-particle:nth-child(3n) { background: var(--cyan); box-shadow: 0 0 8px var(--cyan-glow); }
#otp-step .otp-particle:nth-child(3n+1) { background: #c4b5fd; }
@keyframes otp-particle-float {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.6); }
    15% { opacity: 0.7; }
    50% { opacity: 0.35; transform: translateY(-28px) scale(1); }
    85% { opacity: 0.5; }
}

/* Animated phone scene */
#otp-step .otp-phone-scene {
    position: relative;
    margin: 0 auto 1.25rem;
    width: 130px;
    height: 130px;
    z-index: 1;
}
#otp-step .otp-phone-aura {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124,58,237,0.22) 0%, transparent 68%);
    animation: glow-pulse 3s ease-in-out infinite;
}
@keyframes glow-pulse {
    0%, 100% { transform: scale(0.92); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
}
#otp-step .otp-orbit-ring {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 1px dashed rgba(167,139,250,0.35);
    animation: gradient-border-rotate 12s linear infinite;
}
@keyframes gradient-border-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
#otp-step .otp-phone-device {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 88px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
    border: 2px solid rgba(167,139,250,0.45);
    box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 0 24px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
    animation: otp-phone-float 3.5s ease-in-out infinite;
    overflow: hidden;
}
@keyframes otp-phone-float {
    0%, 100% { transform: translate(-50%, -50%) rotate(-3deg); }
    50% { transform: translate(-50%, calc(-50% - 6px)) rotate(3deg); }
}
#otp-step .otp-phone-notch {
    width: 22px;
    height: 4px;
    margin: 6px auto 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
}
#otp-step .otp-phone-screen {
    margin: 8px 7px;
    padding: 6px;
    border-radius: 8px;
    background: rgba(6,10,20,0.55);
    min-height: 52px;
}
[data-theme="light"] #otp-step .otp-phone-screen {
    background: rgba(124,58,237,0.08);
}
#otp-step .otp-phone-bar {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-light), var(--cyan));
    margin-bottom: 5px;
    opacity: 0.55;
    animation: otp-screen-pulse 2s ease-in-out infinite;
}
#otp-step .otp-phone-bar.short { width: 55%; opacity: 0.35; animation-delay: 0.4s; }
@keyframes otp-screen-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.85; }
}
#otp-step .otp-msg-bubble {
    position: absolute;
    right: -4px;
    top: 28px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 8px 11px;
    border-radius: 14px 14px 4px 14px;
    background: linear-gradient(135deg, rgba(124,58,237,0.85), rgba(6,182,212,0.75));
    box-shadow: 0 6px 20px var(--accent-glow);
    animation: otp-bubble-pop 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both, otp-bubble-float 3s ease-in-out 0.9s infinite;
}
@keyframes otp-bubble-pop {
    from { opacity: 0; transform: scale(0.4) translateX(10px); }
    to { opacity: 1; transform: scale(1) translateX(0); }
}
@keyframes otp-bubble-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
#otp-step .otp-msg-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    animation: message-dots 1.4s ease-in-out infinite;
}
#otp-step .otp-msg-dot:nth-child(2) { animation-delay: 0.2s; }
#otp-step .otp-msg-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes message-dots {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-4px); opacity: 1; }
}
#otp-step .otp-sms-icon {
    position: absolute;
    left: 0;
    bottom: 18px;
    font-size: 1.1rem;
    opacity: 0.65;
    animation: otp-sms-pulse 2.5s ease-in-out infinite;
}
@keyframes otp-sms-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

#otp-step .otp-secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--success);
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.28);
    position: relative;
    z-index: 1;
}
#otp-step .otp-secure-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse-dot 1.8s ease-in-out infinite;
}

.otp-lead {
    font-size: 0.92rem;
    line-height: 1.85;
    margin-bottom: 1.35rem;
    color: var(--text-secondary, var(--text-muted));
    position: relative;
    z-index: 1;
}
.otp-lead strong {
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--accent-light);
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 1.05rem;
    text-shadow: 0 0 20px var(--accent-glow);
}

/* Digit inputs — gradient border wrapper */
#otp-step .otp-inputs-wrap {
    position: relative;
    margin: 0 auto 1.35rem;
    padding: 3px;
    border-radius: 20px;
    max-width: 340px;
    z-index: 1;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
#otp-step .otp-inputs-border {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent), var(--cyan), var(--accent-light), var(--accent));
    background-size: 300% 300%;
    animation: gradient-border-rotate-colors 4s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.55;
    transition: opacity 0.3s ease;
}
@keyframes gradient-border-rotate-colors {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
#otp-step .otp-inputs-wrap.otp-complete .otp-inputs-border {
    opacity: 1;
    animation-duration: 2s;
}
#otp-step .otp-inputs-wrap.otp-complete {
    transform: scale(1.02);
}
#otp-step .otp-inputs-wrap.otp-verifying .otp-inputs-border {
    animation: gradient-border-rotate-colors 1s ease infinite, glow-pulse 1.5s ease infinite;
}

#otp-step .otp-inputs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    direction: ltr;
    padding: 0.85rem 0.65rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(8px);
}
[data-theme="light"] #otp-step .otp-inputs {
    background: rgba(255,255,255,0.65);
}

#otp-step .otp-digit-cell {
    position: relative;
    width: 48px;
    height: 58px;
}
#otp-step .otp-digit {
    width: 100%;
    height: 100%;
    text-align: center;
    font-size: 1.65rem;
    font-weight: 700;
    font-family: 'Vazirmatn', monospace;
    border-radius: 14px;
    border: 2px solid var(--glass-border);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    caret-color: var(--accent-light);
    position: relative;
    z-index: 1;
}
#otp-step .otp-digit-glow {
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: radial-gradient(circle at center, var(--accent-glow), transparent 70%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 0;
}
#otp-step .otp-digit-cell.otp-digit-focus .otp-digit {
    outline: none;
    border-color: var(--accent);
    background: rgba(124,58,237,0.14);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 10px 28px rgba(124,58,237,0.3);
    transform: translateY(-3px) scale(1.04);
}
#otp-step .otp-digit-cell.otp-digit-focus .otp-digit-glow {
    opacity: 0.6;
    animation: glow-pulse 1.5s ease-in-out infinite;
}
#otp-step .otp-digit-cell.otp-digit-filled .otp-digit {
    border-color: var(--accent-light);
    background: rgba(124,58,237,0.18);
    animation: digit-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes digit-pop {
    0% { transform: scale(0.85); }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
#otp-step .otp-digit.otp-shake {
    animation: otp-shake 0.45s ease;
    border-color: var(--danger) !important;
}
@keyframes otp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Complete checkmark ring */
#otp-step .otp-complete-ring {
    position: absolute;
    right: -14px;
    top: -14px;
    width: 36px;
    height: 36px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 2;
}
#otp-step .otp-inputs-wrap.otp-complete .otp-complete-ring {
    opacity: 1;
    transform: scale(1);
}
#otp-step .otp-complete-circle {
    fill: none;
    stroke: var(--success);
    stroke-width: 2;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: otp-check-circle 0.5s ease forwards 0.1s;
}
#otp-step .otp-complete-check {
    fill: none;
    stroke: var(--success);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: otp-check-stroke 0.35s ease forwards 0.45s;
}
@keyframes otp-check-circle {
    to { stroke-dashoffset: 0; }
}
@keyframes otp-check-stroke {
    to { stroke-dashoffset: 0; }
}

/* Sparkle burst on complete */
#otp-step .otp-sparkle-burst {
    position: relative;
    height: 0;
    pointer-events: none;
    z-index: 2;
}
#otp-step .otp-sparkle {
    position: absolute;
    left: 50%;
    top: -20px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-light);
    opacity: 0;
    transform: translate(-50%, 0) scale(0);
}
#otp-step .otp-sparkle-burst.otp-sparkle-active .otp-sparkle {
    animation: otp-sparkle-burst 0.9s ease-out forwards;
    animation-delay: calc(var(--s) * 0.04s);
}
#otp-step .otp-sparkle:nth-child(odd) { background: var(--cyan); }
@keyframes otp-sparkle-burst {
    0% { opacity: 1; transform: translate(-50%, 0) scale(0); }
    40% { opacity: 1; }
    100% {
        opacity: 0;
        transform: translate(
            calc(-50% + cos(calc(var(--s) * 45deg)) * 60px),
            calc(sin(calc(var(--s) * 45deg)) * -50px)
        ) scale(1.2);
    }
}
/* Fallback sparkle directions (CSS can't use cos/sin everywhere) */
#otp-step .otp-sparkle-burst.otp-sparkle-active .otp-sparkle:nth-child(1) { animation-name: otp-sparkle-1; }
#otp-step .otp-sparkle-burst.otp-sparkle-active .otp-sparkle:nth-child(2) { animation-name: otp-sparkle-2; }
#otp-step .otp-sparkle-burst.otp-sparkle-active .otp-sparkle:nth-child(3) { animation-name: otp-sparkle-3; }
#otp-step .otp-sparkle-burst.otp-sparkle-active .otp-sparkle:nth-child(4) { animation-name: otp-sparkle-4; }
#otp-step .otp-sparkle-burst.otp-sparkle-active .otp-sparkle:nth-child(5) { animation-name: otp-sparkle-5; }
#otp-step .otp-sparkle-burst.otp-sparkle-active .otp-sparkle:nth-child(6) { animation-name: otp-sparkle-6; }
#otp-step .otp-sparkle-burst.otp-sparkle-active .otp-sparkle:nth-child(7) { animation-name: otp-sparkle-7; }
#otp-step .otp-sparkle-burst.otp-sparkle-active .otp-sparkle:nth-child(8) { animation-name: otp-sparkle-8; }
@keyframes otp-sparkle-1 { 0% { opacity:1; transform:translate(-50%,0) scale(0); } 100% { opacity:0; transform:translate(calc(-50% - 50px), -40px) scale(1); } }
@keyframes otp-sparkle-2 { 0% { opacity:1; transform:translate(-50%,0) scale(0); } 100% { opacity:0; transform:translate(calc(-50% - 20px), -55px) scale(1); } }
@keyframes otp-sparkle-3 { 0% { opacity:1; transform:translate(-50%,0) scale(0); } 100% { opacity:0; transform:translate(calc(-50% + 20px), -55px) scale(1); } }
@keyframes otp-sparkle-4 { 0% { opacity:1; transform:translate(-50%,0) scale(0); } 100% { opacity:0; transform:translate(calc(-50% + 50px), -40px) scale(1); } }
@keyframes otp-sparkle-5 { 0% { opacity:1; transform:translate(-50%,0) scale(0); } 100% { opacity:0; transform:translate(calc(-50% + 55px), -10px) scale(1); } }
@keyframes otp-sparkle-6 { 0% { opacity:1; transform:translate(-50%,0) scale(0); } 100% { opacity:0; transform:translate(calc(-50% + 40px), 20px) scale(1); } }
@keyframes otp-sparkle-7 { 0% { opacity:1; transform:translate(-50%,0) scale(0); } 100% { opacity:0; transform:translate(calc(-50% - 40px), 20px) scale(1); } }
@keyframes otp-sparkle-8 { 0% { opacity:1; transform:translate(-50%,0) scale(0); } 100% { opacity:0; transform:translate(calc(-50% - 55px), -10px) scale(1); } }

/* Circular countdown timer */
#otp-step .otp-timer-circular {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 1.25rem;
    z-index: 1;
}
#otp-step .otp-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 8px var(--cyan-glow));
}
#otp-step .otp-timer-track {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 4;
}
[data-theme="light"] #otp-step .otp-timer-track {
    stroke: rgba(124,58,237,0.12);
}
#otp-step .otp-timer-progress {
    fill: none;
    stroke: url(#otp-timer-grad);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 238.76;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}
#otp-step .otp-timer-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}
#otp-step .otp-timer-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 500;
}
#otp-step .otp-timer {
    font-weight: 700;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    color: var(--cyan);
    transition: color 0.3s ease, transform 0.3s ease;
}
#otp-step .otp-timer.otp-timer-urgent {
    color: var(--warning);
    animation: otp-timer-pulse 1s ease-in-out infinite;
}
#otp-step .otp-timer.otp-timer-expired {
    color: var(--danger);
}
@keyframes otp-timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* Verify button — loading & success */
#otp-step .otp-verify-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
#otp-step .otp-verify-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
#otp-step .otp-verify-btn:hover:not(:disabled)::before {
    transform: translateX(100%);
}
#otp-step .otp-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}
#otp-step .otp-verify-btn.is-loading .otp-btn-spinner { display: inline-block; }
#otp-step .otp-verify-btn.is-loading .otp-btn-success-icon { display: none; }
#otp-step .otp-btn-success-icon {
    display: none;
    margin-right: 0.35rem;
    font-weight: 700;
}
#otp-step .otp-verify-btn.is-success {
    background: linear-gradient(135deg, var(--success), #059669) !important;
    box-shadow: 0 6px 24px rgba(16,185,129,0.45) !important;
}
#otp-step .otp-verify-btn.is-success .otp-btn-success-icon { display: inline; }
#otp-step .otp-verify-btn.is-success .otp-btn-spinner { display: none; }
@keyframes spin {
    to { transform: rotate(360deg); }
}

.otp-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
#otp-step .otp-resend-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s ease;
}
#otp-step .otp-resend-icon {
    display: inline-block;
    transition: transform 0.35s ease;
}
#otp-step .otp-resend-btn:not(:disabled):hover .otp-resend-icon {
    transform: rotate(-180deg);
}
.otp-resend-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.otp-resend-countdown {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.otp-back-btn {
    display: block;
    margin: 1.25rem auto 0;
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 480px) {
    #otp-step .otp-inputs { gap: 0.32rem; padding: 0.7rem 0.45rem; }
    #otp-step .otp-digit-cell { width: 42px; height: 52px; }
    #otp-step .otp-digit { font-size: 1.35rem; border-radius: 12px; }
    #otp-step .otp-phone-scene { width: 110px; height: 110px; }
    #otp-step .otp-phone-device { width: 46px; height: 78px; }
    #otp-step .otp-inputs-wrap { max-width: 100%; }
    #otp-step .otp-timer-circular { width: 76px; height: 76px; }
    #otp-step .otp-timer { font-size: 0.9rem; }
}

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; max-width: 460px; }
    .auth-hero { display: none; }
    .auth-page { padding: 1.5rem 1rem; }
}

@media (max-width: 480px) {
    .auth-panel { padding: 1.75rem 1.25rem; }
    .auth-features { grid-template-columns: 1fr; }
}

/* ─── Modal ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.modal {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    max-height: min(92vh, 92dvh);
    overflow-y: auto;
    overflow-x: hidden;
    margin: auto 0;
    flex-shrink: 0;
}

.modal.modal-compact {
    max-width: 520px;
    padding: 1.25rem 1.5rem;
}

.modal.modal-compact h2 {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
}

.modal.modal-compact .modal-lead {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    line-height: 1.55;
}

.modal.modal-compact .form-group {
    margin-bottom: 0.65rem;
}

.modal.modal-compact .modal-actions {
    margin-top: 1rem;
}

.revenue-split-box {
    margin-top: 0.35rem;
}

.revenue-split-box h4 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.revenue-split-box .split-sum-hint {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
}

.revenue-split-box .form-group {
    margin-bottom: 0.5rem;
}

.revenue-split-box .checkbox-touch label {
    min-height: 36px;
}

.split-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ─── Detail / Cards ───────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.detail-card { padding: 1.5rem; }
.detail-card p { margin-bottom: 0.5rem; font-size: 0.9rem; }

.patient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.test-card {
    padding: 1.5rem;
    transition: var(--transition);
}

.test-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ─── Toolbar ──────────────────────────────────────────────── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

/* ─── Section ──────────────────────────────────────────────── */
.section { margin-top: 2rem; }

.list-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

/* ─── Alerts ───────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.25);
    color: #86efac;
}

/* ─── Loading ──────────────────────────────────────────────── */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.loader-brand {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.loader-orb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    animation: pulse-glow 1.5s ease-in-out infinite;
    box-shadow: 0 0 30px var(--accent-glow);
    position: relative;
    z-index: 2;
}

.loader-rings {
    position: absolute;
    inset: 0;
}

.loader-rings span {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-top-color: var(--accent-light);
    border-radius: 50%;
    animation: loader-spin 1.2s linear infinite;
}

.loader-rings span:nth-child(2) {
    inset: 8px;
    border-top-color: var(--cyan);
    animation-duration: 1.8s;
    animation-direction: reverse;
}

.loader-rings span:nth-child(3) {
    inset: 16px;
    border-top-color: rgba(167, 139, 250, 0.5);
    animation-duration: 2.4s;
}

.loader-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.loader-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.loader-progress {
    width: min(240px, 70vw);
    height: 4px;
    background: var(--glass-border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.loader-progress-bar {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: 4px;
    animation: loader-progress 1.8s ease-in-out infinite;
}

@keyframes loader-spin {
    to { transform: rotate(360deg); }
}

@keyframes loader-progress {
    0% { transform: translateX(-100%); width: 30%; }
    50% { width: 60%; }
    100% { transform: translateX(350%); width: 30%; }
}

.boot-error { max-width: 480px; margin: 0 auto; }
.boot-error-icon {
    font-size: 2.5rem;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    margin-bottom: 0.5rem;
}
.boot-error-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.25rem 0;
}
.boot-error-hint { font-size: 0.8rem; max-width: 360px; }

/* Skeleton loaders */
.page-skeleton { padding: 1rem; animation: fade-in 0.2s ease; }
.skeleton-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.skeleton-card, .skeleton-panel {
    background: linear-gradient(90deg, var(--glass-bg) 25%, var(--glass-bg-hover) 50%, var(--glass-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
}
.skeleton-card { height: 100px; }
.skeleton-panel { height: 220px; }

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 2.5rem;
    opacity: 0.5;
    margin-bottom: 0.75rem;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 30px var(--accent-glow); }
    50% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 50px var(--accent-glow); }
}

.brand-icon.pulse { animation: pulse-glow 2s ease-in-out infinite; }

@keyframes slide-in {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in { animation: slide-in 0.4s ease-out; }

/* ─── Dashboard Grid ───────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.section-card { padding: 1.5rem; }

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toolbar-actions { display: flex; gap: 0.5rem; }

/* ─── Rooms Grid ───────────────────────────────────────────── */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.room-card {
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.room-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, transparent 60%, rgba(124,108,240,0.03) 100%);
    pointer-events: none;
}

.room-occupied {
    border-color: rgba(248, 113, 113, 0.25);
}

.room-occupied::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--danger), var(--warning));
    animation: room-pulse 2s ease-in-out infinite;
}

.room-free {
    border-color: rgba(52, 211, 153, 0.2);
}

@keyframes room-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.room-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.room-header h3 { flex: 1; margin: 0; }

.room-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

.room-status-dot.active {
    background: var(--danger);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.6);
    animation: room-pulse 1.5s ease-in-out infinite;
}

.room-session-info { margin-top: 0.5rem; }

.room-empty {
    text-align: center;
    padding: 1rem 0;
}

.session-timer {
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1rem;
    text-align: center;
    margin: 1rem 0;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}
.session-timer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(6,182,212,0.12), transparent 60%);
    pointer-events: none;
}

.timer-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
}

.timer-value {
    display: block;
    font-size: 2.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--cyan), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.08em;
    line-height: 1.2;
    position: relative;
    transition: transform 0.2s ease;
}
.timer-value.timer-pulse {
    animation: timer-pulse 0.55s ease;
}
@keyframes timer-pulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); filter: brightness(1.3); }
    100% { transform: scale(1); }
}

.timer-human {
    display: block;
    font-size: 0.82rem;
    color: var(--accent-light);
    margin-top: 0.25rem;
    font-weight: 600;
    position: relative;
}
.timer-started {
    display: block;
    font-size: 0.72rem;
    margin-top: 0.4rem;
    position: relative;
}

/* ─── Search Results ───────────────────────────────────────── */
.search-results {
    max-height: 150px;
    overflow-y: auto;
    margin-top: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

.search-result-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition);
}

.search-result-item:hover {
    background: rgba(124, 108, 240, 0.15);
}

.search-result-empty {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* ─── Therapist phone verification badge ───────────────────── */
.phone-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.therapist-phone-badge {
    min-height: 0;
    overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.therapist-phone-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: var(--success);
    font-size: 0.85rem;
    animation: therapistPhoneVerifiedIn 0.35s ease;
}

.therapist-phone-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.22);
    flex-shrink: 0;
}

.therapist-phone-check svg {
    width: 0.75rem;
    height: 0.75rem;
}

@keyframes therapistPhoneVerifiedIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Therapist created celebration modal ──────────────────── */
.therapist-created-modal {
    text-align: center;
    max-width: 420px;
}

.therapist-created-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--success);
    animation: therapistCreatedPulse 0.6s ease;
}

.therapist-created-icon svg {
    width: 2rem;
    height: 2rem;
}

@keyframes therapistCreatedPulse {
    0%   { transform: scale(0.7); opacity: 0; }
    60%  { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

.therapist-created-modal h2 {
    color: var(--success);
    margin-bottom: 0.75rem;
}

.therapist-created-modal .modal-actions {
    justify-content: center;
    margin-top: 1.25rem;
}

/* ─── Credentials box (legacy) ─────────────────────────────── */
.credentials-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
}

.cred-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cred-row code {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    background: rgba(124, 108, 240, 0.15);
    user-select: all;
}

/* ─── Therapist panel (پنل درمانگر) ────────────────────────── */
.clinic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.clinic-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    min-width: 180px;
}

.clinic-chip > div {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

.clinic-chip-icon {
    font-size: 1.3rem;
}

.clinic-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.clinic-filter-pills .pill {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(124, 108, 240, 0.35);
    background: transparent;
    color: var(--text, inherit);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.clinic-filter-pills .pill:hover {
    background: rgba(124, 108, 240, 0.12);
}

.clinic-filter-pills .pill.active {
    background: rgba(124, 108, 240, 0.28);
    border-color: rgba(124, 108, 240, 0.6);
    font-weight: 700;
}

/* ─── Invoice Document ─────────────────────────────────────── */
.invoice-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.text-left { text-align: left !important; }

/* ═══ Premium Invoice ═════════════════════════════════════════ */
.invoice-premium {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background:
        radial-gradient(circle at 100% 0%, rgba(124,58,237,0.10), transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(6,182,212,0.08), transparent 40%),
        var(--bg-secondary);
    box-shadow: 0 24px 70px rgba(0,0,0,0.4);
}
.invoice-premium::before {
    content: '';
    position: absolute;
    top: 0; inset-inline: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--accent), var(--cyan), var(--accent-light));
    z-index: 3;
}
.status-bg-paid { background-image: radial-gradient(circle at 80% 20%, rgba(16,185,129,0.06), transparent 50%), radial-gradient(circle at 0% 100%, rgba(6,182,212,0.08), transparent 40%), var(--bg-secondary); }
.status-bg-issued { background-image: radial-gradient(circle at 80% 20%, rgba(6,182,212,0.07), transparent 50%), radial-gradient(circle at 0% 100%, rgba(124,58,237,0.08), transparent 40%), var(--bg-secondary); }
.status-bg-cancelled { background-image: radial-gradient(circle at 80% 20%, rgba(244,63,94,0.06), transparent 50%), var(--bg-secondary); }

.invoice-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    font-weight: 800;
    color: rgba(124,58,237,0.04);
    transform: rotate(-22deg);
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
    letter-spacing: 0.05em;
    user-select: none;
}

.invoice-ribbon {
    position: absolute;
    top: 28px;
    inset-inline-start: -36px;
    transform: rotate(-45deg);
    z-index: 4;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.35rem 2.5rem;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.invoice-corner {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 2px solid rgba(124,58,237,0.25);
    pointer-events: none;
    z-index: 1;
}
.inv-corner-tl { top: 14px; inset-inline-start: 14px; border-inline-end: none; border-bottom: none; border-radius: 8px 0 0 0; }
.inv-corner-br { bottom: 14px; inset-inline-end: 14px; border-inline-start: none; border-top: none; border-radius: 0 0 8px 0; }

/* Topbar */
.invoice-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2.5rem 2.25rem 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}
.invoice-brand { display: flex; gap: 1rem; align-items: center; }
.invoice-logo {
    width: 58px; height: 58px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    box-shadow: 0 8px 24px var(--accent-glow);
    flex-shrink: 0;
}
.invoice-brand-text h2 { font-size: 1.4rem; margin-bottom: 0.15rem; }
.invoice-sub { font-size: 0.82rem; color: var(--text-muted); margin: 0; line-height: 1.7; }

.invoice-title-block { text-align: left; display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; position: relative; z-index: 2; }
.invoice-number-label { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.06em; }
.invoice-number { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.invoice-barcode {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 36px;
    margin-top: 0.5rem;
    opacity: 0.55;
}
.inv-bar {
    display: block;
    width: 3px;
    min-height: 30%;
    background: var(--text-muted);
    border-radius: 1px;
}
.invoice-status-chip {
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
}
.inv-status-issued { background: rgba(6,182,212,0.15); color: var(--cyan); border-color: rgba(6,182,212,0.35); }
.inv-status-paid { background: rgba(16,185,129,0.15); color: var(--success); border-color: rgba(16,185,129,0.4); }
.inv-status-cancelled { background: rgba(244,63,94,0.15); color: var(--danger); border-color: rgba(244,63,94,0.4); }

/* Parties */
.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 2.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}
.invoice-party {
    padding: 1.1rem 1.25rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
}
.invoice-party-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}
.invoice-party-name { font-size: 1.1rem; display: block; margin-bottom: 0.35rem; }
.invoice-party p { font-size: 0.85rem; margin: 0.15rem 0; color: var(--text-muted); }
.invoice-party-meta { display: flex; flex-direction: column; gap: 0.5rem; }
.invoice-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.invoice-meta-row span { font-size: 0.8rem; color: var(--text-muted); }
.invoice-meta-row strong { font-size: 0.88rem; }

/* Table */
.invoice-table-wrap {
    position: relative;
    z-index: 2;
    margin: 0 1.25rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.invoice-table thead th {
    background: linear-gradient(90deg, rgba(124,58,237,0.22), rgba(6,182,212,0.15));
    padding: 0.9rem 1.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: right;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}
.invoice-table thead th:first-child { padding-inline-start: 1.5rem; width: 44px; }
.invoice-table tbody td {
    padding: 0.95rem 1.5rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}
.invoice-table tbody tr:last-child td { border-bottom: none; }
.invoice-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.025); }
.invoice-table tbody tr:hover { background: rgba(124,58,237,0.06); }
.inv-cell-idx { color: var(--text-muted); width: 44px; font-weight: 600; }
.inv-cell-desc { font-weight: 600; }
.inv-item-sub { display: block; font-size: 0.74rem; color: var(--text-muted); font-weight: 400; margin-top: 0.2rem; }
.inv-cell-dur small { font-size: 0.72rem; color: var(--text-muted); }
.inv-cell-rate { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.inv-cell-amount { font-weight: 800; color: var(--accent-light); font-variant-numeric: tabular-nums; font-size: 0.95rem; }

/* Summary */
.invoice-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 1.5rem 2.25rem 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}
.invoice-words {
    flex: 1;
    min-width: 220px;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--glass-border);
}
.invoice-words-label { display: block; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.invoice-words p { font-size: 0.9rem; font-weight: 600; margin: 0; line-height: 1.9; }

.invoice-totals { width: 300px; max-width: 100%; }
.invoice-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--glass-border);
}
.invoice-total-line span:first-child { color: var(--text-muted); }
.invoice-total-line span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.invoice-grand {
    margin-top: 0.5rem;
    padding: 0.9rem 1.1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    box-shadow: 0 10px 26px var(--accent-glow);
}
.invoice-grand span:first-child { color: rgba(255,255,255,0.85); font-weight: 600; }
.invoice-grand span:last-child { color: #fff; font-size: 1.15rem; font-weight: 800; }

/* Footer */
.invoice-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 2rem 2.25rem 2.25rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--glass-border);
}
.invoice-sign { text-align: center; }
.invoice-sign-label { font-size: 0.78rem; color: var(--text-muted); }
.invoice-sign-box {
    margin-top: 0.5rem;
    width: 160px; height: 72px;
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
}
.invoice-note { text-align: left; flex: 1; }
.invoice-thanks { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.invoice-issuer { font-size: 0.74rem; }

/* Stamp overlay */
.invoice-stamp {
    position: absolute;
    top: 42%;
    inset-inline-end: 8%;
    transform: rotate(-18deg);
    padding: 0.5rem 1.75rem;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    border-radius: 12px;
    opacity: 0.22;
    pointer-events: none;
    z-index: 5;
}
.invoice-stamp-paid { color: var(--success); border: 5px double var(--success); }
.invoice-stamp-cancelled { color: var(--danger); border: 5px double var(--danger); }

@media (max-width: 640px) {
    .invoice-parties { grid-template-columns: 1fr; }
    .invoice-topbar, .invoice-parties, .invoice-summary, .invoice-foot { padding-inline: 1.25rem; }
    .invoice-table-wrap { margin-inline: 0.75rem; }
    .invoice-table thead th, .invoice-table tbody td { padding-inline: 1rem; }
    .invoice-title-block { align-items: flex-start; text-align: right; }
    .invoice-totals { width: 100%; }
    .invoice-ribbon { display: none; }
    .timer-adjust-btns { grid-template-columns: 1fr 1fr; }
}

/* ═══ Room session — manual time adjust ═══════════════════════ */
.btn-xs {
    padding: 0.35rem 0.65rem;
    font-size: 0.74rem;
    border-radius: 8px;
    font-weight: 600;
}
.timer-adjust {
    margin: 0 0 0.85rem;
    text-align: center;
    padding: 0.65rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--glass-border);
}
.timer-adjust-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.timer-adjust-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.timer-adjust-btns .btn-xs { font-variant-numeric: tabular-nums; width: 100%; }
.timer-btn-plus {
    border-color: rgba(16,185,129,0.35) !important;
    color: var(--success) !important;
    background: rgba(16,185,129,0.08) !important;
}
.timer-btn-plus:hover {
    background: rgba(16,185,129,0.18) !important;
    box-shadow: 0 0 12px rgba(16,185,129,0.25);
}
.timer-btn-minus {
    border-color: rgba(244,63,94,0.35) !important;
    color: var(--danger) !important;
    background: rgba(244,63,94,0.08) !important;
}
.timer-btn-minus:hover {
    background: rgba(244,63,94,0.18) !important;
    box-shadow: 0 0 12px rgba(244,63,94,0.25);
}

/* ─── Print Styles ─────────────────────────────────────────── */
@media print {
    body { background: #fff !important; color: #111 !important; }
    .arabesque-bg, .sidebar, .invoice-actions, .page-title, .no-print,
    .auth-orb, .sidebar-overlay { display: none !important; }
    .app-layout { display: block !important; }
    .main-content { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }

    .invoice-premium {
        background: #fff !important;
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
        color: #111 !important;
        border-radius: 0 !important;
        max-width: 100% !important;
    }
    .invoice-watermark, .invoice-ribbon, .invoice-corner { display: none !important; }
    .invoice-premium::before { background: #4f46e5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .invoice-brand-text h2, .invoice-party-name, .inv-cell-desc, .invoice-thanks { color: #111 !important; }
    .invoice-sub, .invoice-party p, .invoice-party-label, .invoice-words-label,
    .invoice-meta-row span, .invoice-total-line span:first-child, .invoice-number,
    .invoice-issuer, .invoice-sign-label { color: #555 !important; }
    .invoice-logo { background: #4f46e5 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .invoice-title, .inv-cell-amount { color: #4f46e5 !important; -webkit-text-fill-color: #4f46e5; }
    .invoice-party, .invoice-words { background: #f8fafc !important; border-color: #e5e7eb !important; }
    .invoice-table thead th { background: #eef2ff !important; color: #111 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .invoice-table tbody td { border-color: #e5e7eb !important; }
    .invoice-grand {
        background: #4f46e5 !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .invoice-grand span, .invoice-grand span:last-child { color: #fff !important; }
    .invoice-status-chip { border: 1px solid #ccc !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .invoice-table { page-break-inside: auto; }
    .invoice-table tr { page-break-inside: avoid; }
}

.error-page {
    text-align: center;
    padding: 4rem 2rem;
    margin: 2rem auto;
    max-width: 400px;
}

/* ─── Responsive ───────────────────────────────────────────── */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-nav-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

@media (max-width: 768px) {
    .mobile-nav-toggle { display: flex; align-items: center; justify-content: center; }

    .sidebar {
        position: fixed;
        transform: translateX(100%);
        transition: transform var(--transition);
        z-index: 150;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: -8px 0 40px rgba(0,0,0,0.5);
    }

    .main-content {
        margin-right: 0;
        padding: 1rem;
        padding-top: 4rem;
    }

    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .rooms-grid { grid-template-columns: 1fr; }
    .invoice-header { flex-direction: column; }
    .timer-value { font-size: 1.5rem; }
    .page-title { font-size: 1.35rem; }
}

/* ─── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Selection ────────────────────────────────────────────── */
::selection {
    background: var(--accent);
    color: #fff;
}

/* ─── Light Theme ──────────────────────────────────────────── */
[data-theme="light"] {
    color-scheme: light;
    --bg-primary:    #f0f4f8;
    --bg-secondary:  #e2e8f0;
    --glass-bg:      rgba(255, 255, 255, 0.72);
    --glass-bg-hover:rgba(255, 255, 255, 0.9);
    --glass-border:  rgba(15, 23, 42, 0.1);
    --glass-shadow:  0 8px 32px rgba(15, 23, 42, 0.08);
    --text-primary:  #0f172a;
    --text-muted:    #64748b;
    --accent-glow:   rgba(124, 58, 237, 0.25);
    --cyan-glow:     rgba(6, 182, 212, 0.2);
}

[data-theme="light"] .arabesque-bg {
    background:
        radial-gradient(ellipse at 15% 40%, rgba(124,58,237,0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(6,182,212,0.06) 0%, transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: rgba(255,255,255,0.8);
}

/* ─── Subscription Badge ───────────────────────────────────── */
.subscription-badge {
    margin: 0 0.75rem 1rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(124,58,237,0.12);
    border: 1px solid rgba(124,58,237,0.2);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.subscription-badge.badge-trial { background: rgba(6,182,212,0.12); border-color: rgba(6,182,212,0.25); }
.subscription-badge.badge-expired,
.subscription-badge.badge-suspended { background: rgba(244,63,94,0.12); border-color: rgba(244,63,94,0.25); }
.subscription-badge.badge-active { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.25); }

/* ─── Bar Chart ────────────────────────────────────────────── */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 140px;
    padding-top: 1rem;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.bar-fill {
    width: 100%;
    max-width: 28px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
}

.bar-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    max-height: 40px;
    overflow: hidden;
}

/* ─── Calendar ─────────────────────────────────────────────── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.cal-header {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.5rem;
    font-weight: 600;
}

.cal-cell {
    min-height: 90px;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    position: relative;
}

.cal-cell.empty { background: transparent; border: none; }
.cal-today { border: 2px solid var(--accent) !important; }
.cal-day { font-weight: 600; font-size: 0.85rem; }
.cal-event {
    font-size: 0.65rem;
    padding: 2px 4px;
    margin-top: 2px;
    background: rgba(124,58,237,0.15);
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-nav { display: flex; align-items: center; gap: 1rem; }
.has-events { border-color: rgba(124,58,237,0.2); }

/* ─── Expired Page ─────────────────────────────────────────── */
.expired-page {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2.5rem;
    text-align: center;
}

.expired-icon { font-size: 3rem; margin-bottom: 1rem; }
.expired-info { margin: 1.5rem 0; text-align: right; }

/* ─── Progress / Usage ─────────────────────────────────────── */
.progress-bar {
    height: 6px;
    background: var(--glass-border);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.usage-bar { display: flex; flex-direction: column; gap: 0.25rem; }

/* ─── Reports ──────────────────────────────────────────────── */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.report-card {
    padding: 1.5rem;
    text-align: center;
}

.page-header {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.page-header .page-title { flex: 1; min-width: 0; margin: 0; }

/* ─── Header bell (اعلان‌ها) ───────────────────────────────── */
.header-bell {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.header-bell:hover {
    transform: translateY(-1px);
    color: var(--accent-light);
    background: rgba(124,58,237,0.14);
    box-shadow: 0 6px 18px var(--accent-glow);
}
.header-bell svg { width: 22px; height: 22px; }
.header-bell.has-unread svg { animation: bell-swing 2.2s ease-in-out infinite; transform-origin: top center; }
@keyframes bell-swing {
    0%, 70%, 100% { transform: rotate(0); }
    75% { transform: rotate(12deg); }
    80% { transform: rotate(-10deg); }
    85% { transform: rotate(7deg); }
    90% { transform: rotate(-4deg); }
}
.header-bell-badge {
    position: absolute;
    top: -5px;
    inset-inline-end: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #f43f5e, #ec4899);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-primary), 0 2px 6px rgba(244,63,94,0.5);
    pointer-events: none;
    white-space: nowrap;
}
.header-bell-badge.badge-show {
    display: inline-flex;
    animation: bell-badge-pop 0.3s ease;
}
@keyframes bell-badge-pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.badge-trial { background: rgba(6,182,212,0.15); color: var(--cyan); }
.badge-active { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-suspended, .badge-expired { background: rgba(244,63,94,0.15); color: var(--danger); }

/* ─── Jalali Date Picker ───────────────────────────────────── */
.jalali-picker {
    position: relative;
}

.jp-field {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.jp-display {
    flex: 1;
    cursor: pointer;
    background: rgba(255,255,255,0.05);
}

.jp-toggle {
    flex-shrink: 0;
    min-width: 44px;
}

.jp-dropdown {
    position: fixed;
    z-index: 2000;
    padding: 0.85rem;
    width: 300px;
    min-width: 280px;
    max-width: calc(100vw - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 48px rgba(0,0,0,0.45), 0 0 32px var(--accent-glow);
    animation: fade-in 0.15s ease;
}

.jp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.jp-actions .jp-confirm {
    min-width: 88px;
}

.jalali-picker-date-only .jp-time-row[hidden],
.jp-dropdown.jalali-picker-date-only .jp-time-row {
    display: none !important;
}

.audit-date-picker-host {
    min-height: 42px;
    width: 100%;
}

.audit-date-picker-host .jalali-datetime-input,
.audit-date-field .jalali-datetime-input {
    width: 100%;
    min-height: 42px;
}

.audit-date-picker-host .jalali-picker,
.audit-date-picker-host.jalali-picker {
    width: 100%;
}

.audit-custom-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
}

.jp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.jp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.jp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 0.75rem;
}

.jp-day {
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.jp-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.jp-day:hover:not(.empty) {
    border-color: var(--accent);
    background: rgba(124,58,237,0.12);
}

.jp-day.today {
    border-color: var(--cyan);
}

.jp-day.selected {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.jp-time-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.jp-time-row label {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.jp-time {
    flex: 1;
    direction: ltr;
    text-align: center;
}

/* ─── Jalali / Support / UX Enhancements ─────────────────── */
.jalali-today {
    margin: 0 0.5rem 1rem;
    padding: 0.75rem 0.9rem;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent-light);
    border: 1px solid rgba(124, 58, 237, 0.28);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(6, 182, 212, 0.1));
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.12), inset 0 1px 0 rgba(255,255,255,0.08);
    animation: fade-in 0.5s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.jalali-today::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    transform: translateX(100%);
    animation: jalali-shine 4s ease-in-out infinite;
}

@keyframes jalali-shine {
    0%, 100% { transform: translateX(100%); }
    50% { transform: translateX(-100%); }
}

.jalali-today-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.25);
    flex-shrink: 0;
}

.jalali-today-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.jalali-today-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.15rem;
}

.jalali-today strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.support-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(6,182,212,0.08));
    animation: fade-in 0.6s ease;
}

.support-banner.compact { margin-top: 1rem; padding: 0.85rem 1rem; }

.support-banner-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.support-phone-link {
    color: var(--cyan);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: var(--transition);
}

.support-phone-link:hover {
    color: var(--accent-light);
    text-shadow: 0 0 16px var(--cyan-glow);
}

.support-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}

.touch-target {
    min-height: 44px;
    min-width: 44px;
}

.checkbox-touch label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    cursor: pointer;
}

.checkbox-touch input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.toolbar-wrap {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    min-height: 44px;
}

.animate-fade-in { animation: fade-in 0.45s ease; }

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
}

.cal-today {
    border-color: var(--accent) !important;
    box-shadow: 0 0 24px var(--accent-glow);
    background: linear-gradient(145deg, rgba(124,58,237,0.15), rgba(6,182,212,0.08));
}

.cal-today .cal-day {
    color: var(--accent-light);
    font-weight: 700;
}

.template-section {
    margin: 1.25rem 0;
    padding: 1rem;
}

.template-vars { font-size: 0.8rem; margin-bottom: 0.5rem; }

.template-input {
    width: 100%;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.15);
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.template-preview {
    margin-top: 0.75rem;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(6,182,212,0.08);
    border: 1px dashed rgba(6,182,212,0.25);
    font-size: 0.9rem;
    line-height: 1.7;
}

.clinics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.clinic-card {
    padding: 1.25rem;
    transition: var(--transition);
}

.clinic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.clinic-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.quick-actions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.desktop-only { display: block; }
.mobile-only { display: none; }

.sidebar-overlay.visible { display: block; }

body.sidebar-open { overflow: hidden; }

.stat-card {
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(124,58,237,0.06));
    pointer-events: none;
}

.nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    background: linear-gradient(90deg, rgba(124,58,237,0.15), transparent);
    border-right: 3px solid var(--accent);
}

.login-card {
    animation: login-float 0.8s ease;
}

@keyframes login-float {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.btn {
    transition: var(--transition);
}

.btn-primary:hover {
    box-shadow: 0 0 24px var(--accent-glow);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: grid !important; }

    .stats-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }

    .responsive-table thead { display: none; }

    .responsive-table tr {
        display: block;
        margin-bottom: 0.85rem;
        padding: 0.85rem;
        border-radius: var(--radius-sm);
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: 0.45rem 0;
        border: none;
        text-align: left;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .calendar-grid {
        gap: 4px;
    }

    .cal-cell {
        min-height: 64px;
        padding: 0.35rem;
    }

    .cal-event {
        font-size: 0.65rem;
        padding: 2px 4px;
    }

    .modal {
        width: calc(100% - 2rem);
        max-height: min(90vh, 90dvh);
        padding: 1.25rem;
    }

    .modal.modal-compact {
        padding: 1rem 1.15rem;
    }

    .support-banner {
        flex-direction: column;
        text-align: center;
    }
}

@media (min-width: 769px) {
    .sidebar-overlay { display: none !important; }
}

/* ─── Notify (Toast & Dialog) ─────────────────────────────── */
#notify-root {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: min(420px, calc(100vw - 2rem));
    pointer-events: none;
}

.notify-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.notify-toast-in { opacity: 1; transform: translateX(0); }
.notify-toast-out { opacity: 0; transform: translateX(-12px); }

.notify-toast-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.notify-success .notify-toast-icon { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.notify-error .notify-toast-icon { background: rgba(244, 63, 94, 0.2); color: var(--danger); }
.notify-info .notify-toast-icon { background: rgba(6, 182, 212, 0.2); color: var(--cyan); }
.notify-warning .notify-toast-icon { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

.notify-toast-body { flex: 1; font-size: 0.9rem; line-height: 1.5; }

.notify-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.notify-toast-close:hover { color: var(--text-primary); }

.notify-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.notify-dialog-overlay.notify-dialog-in { opacity: 1; }
.notify-dialog-overlay.notify-dialog-out { opacity: 0; }

.notify-dialog {
    width: min(420px, 100%);
    padding: 1.75rem;
    text-align: center;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.22s ease;
}

.notify-dialog-in .notify-dialog { transform: scale(1) translateY(0); }

.notify-dialog-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: rgba(124, 58, 237, 0.2);
    color: var(--accent-light);
}

.notify-dialog-icon.notify-danger {
    background: rgba(244, 63, 94, 0.2);
    color: var(--danger);
}

.notify-dialog-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.notify-dialog-message {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.notify-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.notify-prompt-input {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

[data-theme="light"] .notify-prompt-input {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .sidebar {
    background:
        linear-gradient(165deg, rgba(124, 58, 237, 0.08) 0%, rgba(6, 182, 212, 0.05) 38%, rgba(255,255,255,0.5) 100%),
        var(--glass-bg);
}

[data-theme="light"] .nav-icon-wrap {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.1);
}

[data-theme="light"] .jalali-today {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(6, 182, 212, 0.06));
}

/* ═══════════════════════════════════════════════════════════════
   v2 Enhancements — Tabs, Timeline, Pagination, Profile, Filters
   ═══════════════════════════════════════════════════════════════ */

/* ─── Extra badges ─────────────────────────────────────────── */
.badge-no_show { background: rgba(244,63,94,0.15); color: var(--danger); }
.badge-in_progress { background: rgba(245,158,11,0.18); color: var(--warning); }
.badge-waiting { background: rgba(6,182,212,0.15); color: var(--cyan); }
.badge-billed { background: rgba(124,58,237,0.18); color: var(--accent-light); }

/* ─── Success Button ───────────────────────────────────────── */
.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16,185,129,0.28);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,185,129,0.4); }

/* ─── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.breadcrumb a:hover { color: var(--accent-light); }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.5; }
.breadcrumb-current { color: var(--text-primary); font-weight: 600; }

/* ─── Profile Header ───────────────────────────────────────── */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.profile-avatar {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(124,58,237,0.28);
}
.profile-identity { flex: 1; min-width: 180px; }
.profile-identity h2 { margin-bottom: 0.5rem; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}
.profile-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.stats-grid-compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1.25rem; }
.stats-grid-compact .stat-card { padding: 1.1rem; }
.stats-grid-compact .stat-value { font-size: 1.7rem; }

.detail-key { color: var(--text-muted); font-size: 0.82rem; display: inline-block; min-width: 90px; }
.detail-val { color: var(--text-primary); }
.detail-card p { display: flex; gap: 0.5rem; align-items: baseline; }

/* ─── Tabs ─────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.7rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: var(--transition);
    border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent);
}
.tab-panel { display: none; animation: fade-in 0.35s ease; }
.tab-panel.active { display: block; }

/* ─── Timeline ─────────────────────────────────────────────── */
.timeline { padding: 1.5rem 1.5rem 0.5rem; }
.timeline-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.25rem;
    position: relative;
}
.timeline-item::before {
    content: '';
    position: absolute;
    right: 15px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--glass-border);
}
.timeline-item:last-child::before { display: none; }
.timeline-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    background: rgba(124,58,237,0.15);
    color: var(--accent-light);
    border: 1px solid var(--glass-border);
    z-index: 1;
}
.timeline-session .timeline-marker { background: rgba(6,182,212,0.15); color: var(--cyan); }
.timeline-invoice .timeline-marker { background: rgba(16,185,129,0.15); color: var(--success); }
.timeline-body { flex: 1; padding-top: 0.15rem; }
.timeline-head { display: flex; align-items: center; gap: 0.6rem; justify-content: space-between; }
.timeline-meta { font-size: 0.82rem; display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.2rem; }

/* ─── Empty inline ─────────────────────────────────────────── */
.empty-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: var(--text-muted);
}
.empty-inline-icon { font-size: 1.2rem; opacity: 0.6; }

/* ─── Count pill ───────────────────────────────────────────── */
.count-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.82rem;
    background: rgba(124,58,237,0.12);
    border: 1px solid rgba(124,58,237,0.2);
    color: var(--accent-light);
}

/* ─── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-light); }
.page-btn.active {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    border-color: transparent;
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-info { margin-right: auto; font-size: 0.82rem; }

/* ─── Segmented Filter ─────────────────────────────────────── */
.segmented {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.segment {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.segment:hover { color: var(--text-primary); }
.segment.active {
    background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(6,182,212,0.15));
    color: var(--text-primary);
}
.segment-count {
    font-size: 0.7rem;
    padding: 0.05rem 0.4rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
}

/* ─── Summary Cards ────────────────────────────────────────── */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.summary-card { padding: 1.25rem; }
.summary-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.summary-value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ─── Action stack (modals) ────────────────────────────────── */
.action-stack { display: flex; flex-direction: column; gap: 0.5rem; }

/* ─── Day appointments modal ───────────────────────────────── */
.day-appt-list { display: flex; flex-direction: column; gap: 0.6rem; max-height: 55vh; overflow-y: auto; }
.day-appt-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
}
.day-appt-time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--accent-light);
    font-size: 0.95rem;
    flex-shrink: 0;
}
.day-appt-info { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.day-appt-info strong { font-size: 0.9rem; }
.day-appt-info span { font-size: 0.78rem; }

/* ─── Calendar events by status ────────────────────────────── */
.cal-clickable { cursor: pointer; transition: var(--transition); }
.cal-clickable:hover { border-color: rgba(124,58,237,0.35); transform: translateY(-1px); }
.cal-event-confirmed { background: rgba(16,185,129,0.18); }
.cal-event-completed { background: rgba(16,185,129,0.14); }
.cal-event-cancelled { background: rgba(244,63,94,0.15); text-decoration: line-through; opacity: 0.7; }
.cal-event-no_show { background: rgba(244,63,94,0.12); opacity: 0.7; }

/* ─── Chart upgrades ───────────────────────────────────────── */
.bar-chart { position: relative; }
.bar-chart-grid {
    position: absolute;
    inset: 1rem 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}
.bar-chart-grid span {
    height: 1px;
    background: var(--glass-border);
    opacity: 0.5;
}
.bar-track {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.bar-fill {
    width: 100%;
    max-width: 26px;
    border-radius: 5px 5px 0 0;
    min-height: 0;
    position: relative;
    transition: height 0.6s cubic-bezier(0.4,0,0.2,1);
}
.bar-value {
    position: absolute;
    top: -1.1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.bar-col:hover .bar-value { opacity: 1; }
.bar-col:hover .bar-fill { filter: brightness(1.2); }
.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 140px;
    font-size: 0.9rem;
}

/* ─── Stat trend ───────────────────────────────────────────── */
.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.trend-up { background: rgba(16,185,129,0.15); color: var(--success); }
.trend-down { background: rgba(244,63,94,0.15); color: var(--danger); }

/* ─── Section head ─────────────────────────────────────────── */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.section-head h2 { margin: 0; font-size: 1.05rem; }
.section-sub { font-size: 0.78rem; text-decoration: none; color: var(--accent-light); }
a.section-sub:hover { color: var(--cyan); }

/* ─── Upcoming list ────────────────────────────────────────── */
.upcoming-list { display: flex; flex-direction: column; gap: 0.5rem; }
.list-item-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}
.list-item-link:hover { border-color: rgba(124,58,237,0.3); transform: translateX(-2px); }
.list-item-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--accent-glow);
}
.list-item-name { flex: 1; font-size: 0.9rem; }
.list-item-link .text-muted { font-size: 0.8rem; }

/* ─── Staggered entrance for grids ─────────────────────────── */
.stats-grid .stat-card,
.rooms-grid .room-card,
.summary-cards .summary-card,
.clinics-grid .clinic-card {
    animation: card-rise 0.45s cubic-bezier(0.4,0,0.2,1) both;
}
.stats-grid .stat-card:nth-child(2),
.summary-cards .summary-card:nth-child(2) { animation-delay: 0.06s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.12s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.18s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.24s; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes card-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ─── Light theme tweaks for v2 ────────────────────────────── */
[data-theme="light"] .chip,
[data-theme="light"] .segment-count { background: rgba(15,23,42,0.05); }
[data-theme="light"] .page-btn,
[data-theme="light"] .segmented { background: rgba(255,255,255,0.7); }

/* ─── Backup Panel (Super Admin) ───────────────────────────── */
.backup-settings-card { padding: 1.5rem; margin-bottom: 1.5rem; }
.backup-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}
.backup-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.backup-toggle input[type="checkbox"] {
    width: auto;
    accent-color: var(--accent);
}
.backup-freq-select {
    max-width: 200px;
}
.backup-list-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.backup-warning {
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 0.88rem;
    line-height: 1.6;
}
.backup-restore-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}
.backup-restore-zone:hover,
.backup-restore-zone.dragover {
    border-color: var(--accent);
    background: rgba(124, 58, 237, 0.08);
}
.backup-meta { font-size: 0.78rem; color: var(--text-muted); }

/* ─── Pricing Plans ────────────────────────────────────────── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}
.pricing-card {
    position: relative;
    padding: 1.75rem 1.5rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}
.pricing-card:hover { transform: translateY(-4px); border-color: rgba(124,58,237,0.35); }
.pricing-card-featured {
    border-color: rgba(124,58,237,0.45);
    background: linear-gradient(160deg, rgba(124,58,237,0.12), rgba(6,182,212,0.06));
    box-shadow: 0 12px 40px var(--accent-glow);
}
.pricing-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
}
.pricing-card h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.pricing-amount { font-size: 1.5rem; font-weight: 700; color: var(--accent-light); margin-bottom: 0.25rem; }
.pricing-per-month { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; }
.pricing-features {
    list-style: none;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem;
    padding: 0;
}
.pricing-features li { padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.pricing-footer { text-align: center; margin-top: 1rem; font-size: 0.88rem; }
.subscription-hero { padding: 2rem; margin-bottom: 0.5rem; text-align: center; }
.subscription-hero h2 { margin-bottom: 0.5rem; }
.plan-price-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.plan-price-input { max-width: 160px; }

/* ─── Trial expiry popup ───────────────────────────────────── */
.trial-popup-overlay { backdrop-filter: blur(8px); }
.trial-popup { max-width: 420px; text-align: center; padding: 2.5rem 2rem; }
.trial-popup-icon { font-size: 3rem; margin-bottom: 0.75rem; animation: pulse-soft 2s ease infinite; }
.trial-popup-text { color: var(--text-muted); margin: 0.75rem 0 1.25rem; line-height: 1.7; }
.trial-popup-phone {
    display: inline-block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cyan);
    text-decoration: none;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.trial-popup-brand { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.25rem; }

/* ─── Pricing discount display ─────────────────────────────── */
.pricing-amount-wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 0.75rem; margin-bottom: 0.25rem; }
.pricing-amount-original {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.75;
}
.pricing-discount-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-weight: 600;
}
.pricing-badge-code {
    right: 12px;
    left: auto;
    background: linear-gradient(135deg, #10b981, #059669);
}
.pricing-card-discounted {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15);
}

/* ─── Discount code input panel ────────────────────────────── */
.discount-code-panel {
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}
.discount-panel-empty {
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(124,58,237,0.14), transparent 55%),
        var(--surface, rgba(148,163,184,0.06));
}
.discount-code-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.discount-code-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(6,182,212,0.2));
    box-shadow: inset 0 0 0 1px rgba(124,58,237,0.3);
    animation: dc-ticket-tilt 3s ease-in-out infinite;
}
@keyframes dc-ticket-tilt {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(6deg); }
}
.discount-code-title { margin: 0; font-size: 1.05rem; }
.discount-code-caption { margin: 0.15rem 0 0; font-size: 0.82rem; }
.discount-code-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: stretch;
}
.discount-input-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
}
.discount-input-hash {
    position: absolute;
    inset-inline-start: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    pointer-events: none;
}
.discount-code-input {
    width: 100%;
    padding-inline-start: 2rem;
    font-family: monospace;
    letter-spacing: 0.12em;
    font-weight: 700;
    text-transform: uppercase;
}
.discount-apply-btn {
    position: relative;
    min-width: 130px;
    overflow: hidden;
}
.discount-apply-btn.is-loading { opacity: 0.85; cursor: progress; }
.discount-apply-btn.shake { animation: dc-shake 0.5s ease; }
@keyframes dc-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* حالت اعمال‌شده */
.discount-panel-applied {
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(16,185,129,0.18), transparent 55%),
        var(--surface, rgba(148,163,184,0.06));
    border-color: rgba(16,185,129,0.4) !important;
}
.discount-applied-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(80% 120% at 50% -10%, rgba(16,185,129,0.22), transparent 60%);
    pointer-events: none;
}
.discount-applied-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}
.discount-applied-check {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 0 0 6px rgba(16,185,129,0.18);
    animation: dc-check-pop 0.4s ease;
}
@keyframes dc-check-pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.discount-applied-text { display: flex; flex-direction: column; gap: 0.1rem; }
.discount-applied-text strong { color: #10b981; }
.discount-applied-text span { font-size: 0.88rem; color: var(--text-muted); }
.discount-applied-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.85rem;
    position: relative;
}
.discount-applied-code {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: rgba(124,58,237,0.12);
    border: 1px dashed rgba(124,58,237,0.4);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--cyan);
}
.discount-applied-prices { font-size: 0.95rem; color: var(--text-muted); }
.discount-applied-prices s { opacity: 0.7; }
.discount-applied-prices b { color: #10b981; font-size: 1.05rem; }
.discount-applied-remove { margin-inline-start: auto; }

/* ─── انیمیشن اعمال کد تخفیف (burst) ───────────────────────── */
.discount-burst-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.discount-burst-overlay.is-active { opacity: 1; }
.discount-burst-overlay.is-leaving { opacity: 0; }
.discount-burst-card {
    text-align: center;
    padding: 2.2rem 2.6rem;
    transform: scale(0.8);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 2;
}
.discount-burst-overlay.is-active .discount-burst-card { transform: scale(1); }
.discount-burst-ring {
    width: 78px;
    height: 78px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    box-shadow: 0 0 0 10px rgba(16,185,129,0.15), 0 12px 30px rgba(16,185,129,0.4);
    animation: dc-ring-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.discount-burst-check { color: #fff; font-size: 2.4rem; font-weight: 800; }
@keyframes dc-ring-pop {
    0% { transform: scale(0) rotate(-40deg); }
    100% { transform: scale(1) rotate(0); }
}
.discount-burst-title { margin: 0 0 0.35rem; font-size: 1.3rem; }
.discount-burst-pct {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}
.discount-burst-pct span { font-size: 1.1rem; -webkit-text-fill-color: var(--text-muted); }
.discount-burst-plan { margin: 0.25rem 0 0; color: var(--text-muted); }
.discount-burst-prices { margin-top: 0.75rem; display: flex; gap: 0.75rem; justify-content: center; align-items: baseline; }
.discount-burst-prices s { color: var(--text-muted); }
.discount-burst-prices b { font-size: 1.4rem; color: #10b981; }
.discount-burst-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.dc-confetti {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    background: hsl(calc(var(--i) * 40), 85%, 60%);
    opacity: 0;
    animation: dc-confetti-fly 1.5s ease-out forwards;
    animation-delay: calc(var(--i) * 0.02s);
}
@keyframes dc-confetti-fly {
    0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); }
    100% {
        opacity: 0;
        transform:
            translate(calc(-50% + (cos(var(--i) * 15deg) * 46vh)),
                      calc(-50% + (sin(var(--i) * 15deg) * 46vh)))
            rotate(720deg);
    }
}

/* ─── Gift popup animation ─────────────────────────────────── */
.gift-popup-overlay {
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.65);
}
.gift-popup-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem;
    position: relative;
}
.gift-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.gift-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: gold;
    top: calc(10% + (var(--i) * 7%) % 80%);
    left: calc(5% + (var(--i) * 13%) % 90%);
    animation: gift-sparkle-float 2.5s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.15s);
    opacity: 0;
}
@keyframes gift-sparkle-float {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    50% { opacity: 1; transform: translateY(-20px) scale(1.2); }
}
.gift-box-wrap {
    cursor: pointer;
    text-align: center;
    animation: gift-bounce 2s ease-in-out infinite;
    transition: transform 0.3s ease;
}
.gift-box-wrap:hover { transform: scale(1.05); }
.gift-box-wrap.gift-opened { animation: gift-open 0.7s ease forwards; pointer-events: none; }
@keyframes gift-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes gift-open {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3) translateY(-40px); opacity: 0; }
}
.gift-box-body {
    width: 140px;
    height: 100px;
    margin: 0 auto;
    background: linear-gradient(145deg, #7c3aed, #4f46e5);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 20px 50px rgba(124, 58, 237, 0.45);
}
.gift-box-lid {
    width: 150px;
    height: 36px;
    margin: 0 auto -4px;
    background: linear-gradient(145deg, #8b5cf6, #6366f1);
    border-radius: 6px 6px 2px 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.6s ease;
}
.gift-box-wrap.gift-opened .gift-box-lid { transform: translateY(-50px) rotate(-15deg); }
.gift-box-ribbon-v, .gift-box-ribbon-h {
    position: absolute;
    background: #fbbf24;
}
.gift-box-ribbon-v { width: 18px; height: 100%; left: 50%; transform: translateX(-50%); }
.gift-box-ribbon-h { height: 18px; width: 100%; top: 50%; transform: translateY(-50%); }
.gift-box-bow { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 2rem; }
.gift-tap-hint { margin-top: 1.5rem; color: var(--text-muted); font-size: 0.9rem; animation: pulse-soft 2s ease infinite; }
.gift-reveal { max-width: 440px; width: 100%; position: relative; }
.gift-reveal.hidden { display: none; }
.gift-reveal-card { padding: 2rem; text-align: center; position: relative; z-index: 2; }
.gift-reveal-icon { font-size: 3rem; margin-bottom: 0.5rem; animation: gift-icon-pop 0.6s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes gift-icon-pop {
    0% { transform: scale(0) rotate(-30deg); }
    100% { transform: scale(1) rotate(0); }
}
.gift-reveal-tag {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    margin-bottom: 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251,191,36,0.14);
    border: 1px solid rgba(251,191,36,0.35);
}
.gift-reveal-lead { color: var(--accent-light); font-weight: 700; margin: 0.5rem 0 1rem; font-size: 1.1rem; }
.gift-price-compare { display: flex; justify-content: center; gap: 0.7rem; align-items: baseline; margin-bottom: 1rem; }
.gift-price-old { text-decoration: line-through; color: var(--text-muted); }
.gift-price-arrow { color: var(--text-muted); }
.gift-price-new { font-size: 1.5rem; font-weight: 800; color: #10b981; }
.gift-reveal-actions { flex-direction: column; gap: 0.6rem; margin-top: 1.1rem; }
.gift-cta-pulse { animation: gift-cta-pulse 1.8s ease-in-out infinite; }
@keyframes gift-cta-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.5); }
    50% { box-shadow: 0 0 0 12px rgba(124,58,237,0); }
}

/* کانفتی هنگام باز شدن هدیه */
.gift-confetti { position: absolute; inset: -20% -20% 0; overflow: hidden; pointer-events: none; z-index: 1; }
.gift-confetti-piece {
    position: absolute;
    top: -10%;
    left: calc((var(--i) * 3.33%));
    width: 8px;
    height: 14px;
    border-radius: 2px;
    background: hsl(calc(var(--i) * 24), 85%, 62%);
    opacity: 0;
    animation: gift-confetti-fall 2.4s ease-in forwards;
    animation-delay: calc(var(--i) * 0.05s);
}
@keyframes gift-confetti-fall {
    0% { opacity: 0; transform: translateY(-40px) rotate(0); }
    10% { opacity: 1; }
    100% { opacity: 0; transform: translateY(560px) rotate(600deg); }
}
.gift-code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(124, 58, 237, 0.12);
    border-radius: 10px;
    border: 1px dashed rgba(124, 58, 237, 0.35);
}
.gift-code-box code { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.08em; color: var(--cyan); }
.gift-once-hint { font-size: 0.82rem; margin-top: 0.75rem; }
.gift-expiry-hint {
    font-size: 0.88rem;
    color: #fbbf24;
    margin: 0.5rem 0 0;
}
.alert-expiry-note,
.discount-expiry-note {
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
    color: var(--text-muted);
}
.alert-expiry-note strong,
.discount-expiry-note strong,
.gift-expiry-hint strong { color: var(--cyan); }
.discount-code-applied { align-items: flex-start; }
.discount-expiry-note { margin-top: 0.35rem; }

/* ─── Alert gift & announcements ───────────────────────────── */
.alert-item-gift { border-right: 3px solid #f59e0b; }
.alert-item-used { border-right-color: #10b981; opacity: 0.9; }
.alert-gift-code {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}
.alert-gift-code code {
    padding: 0.35rem 0.65rem;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 6px;
    font-size: 0.95rem;
}
.alert-gift-code-disabled code {
    text-decoration: line-through;
    opacity: 0.65;
    background: rgba(148,163,184,0.12);
}
.alert-gift-status {
    display: inline-block;
    margin-inline-start: 0.5rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: middle;
}
.alert-gift-status-used { background: rgba(16,185,129,0.16); color: #10b981; }
.alert-gift-status-expired { background: rgba(148,163,184,0.16); color: var(--text-muted); }
.alert-gift-used-note { font-size: 0.82rem; color: var(--text-muted); }
.announcement-form { padding: 1.5rem; max-width: 720px; }
.announcement-clinic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.75rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}
.announcement-clinic-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    cursor: pointer;
}
.announcement-all-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.super-discount-form .form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.super-discount-form .form-group { flex: 1; min-width: 160px; }
.expiry-preset-group { flex: 1 1 100%; min-width: 100%; margin-top: 0.25rem; }
.expiry-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.35rem;
}
.expiry-preset-option { cursor: pointer; }
.expiry-preset-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.expiry-preset-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.85rem 0.5rem;
    border-radius: 12px;
    border: 2px solid var(--glass-border, rgba(148,163,184,0.25));
    background: rgba(148,163,184,0.06);
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.expiry-preset-card strong { font-size: 1rem; color: var(--text, #e2e8f0); }
.expiry-preset-card small { font-size: 0.72rem; color: var(--text-muted); }
.expiry-preset-option:hover .expiry-preset-card {
    border-color: rgba(124,58,237,0.45);
    transform: translateY(-1px);
}
.expiry-preset-option input:checked + .expiry-preset-card {
    border-color: #7c3aed;
    background: linear-gradient(145deg, rgba(124,58,237,0.22), rgba(6,182,212,0.12));
    box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}
.expiry-preset-option input:checked + .expiry-preset-card strong { color: var(--cyan, #06b6d4); }
@media (max-width: 640px) {
    .expiry-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Clinic settings / logo ───────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}
.settings-logo-card { text-align: center; }
.logo-preview-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
}
.clinic-logo-preview {
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
}
.clinic-logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    color: #fff;
}
.invoice-logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    padding: 6px;
    flex-shrink: 0;
}

/* ─── Clinic Dashboard (redesign) ──────────────────────────── */
.dash-welcome {
    padding: 1.75rem 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(124,58,237,0.14), rgba(6,182,212,0.08));
    border: 1px solid rgba(124,58,237,0.2);
}
.dash-welcome-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.dash-welcome-emoji {
    font-size: 2.75rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(124,58,237,0.35));
}
.dash-welcome-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 0.35rem;
}
.dash-welcome-title em {
    font-style: normal;
    color: var(--accent-light);
}
.dash-welcome-sub {
    font-size: 0.92rem;
    color: var(--text-muted);
}
.dash-sub-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}
.dash-sub-banner span:first-child { font-size: 1.25rem; }
.dash-sub-link {
    display: block;
    margin-top: 0.35rem;
    color: var(--accent-light);
    text-decoration: none;
    font-size: 0.85rem;
}
.dash-section { margin-bottom: 1.75rem; }
.dash-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}
.dash-section-title span { font-size: 1.2rem; }
.dash-section-intro { margin-bottom: 1.25rem; line-height: 1.6; }

.dash-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
}
.dash-quick-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem 1rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--glass-border);
    border-right: 3px solid var(--dash-accent, var(--accent));
    position: relative;
    min-height: 130px;
    transition: var(--transition);
}
.dash-quick-card:hover {
    transform: translateY(-3px);
    border-color: var(--dash-accent, var(--accent));
    box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}
.dash-quick-emoji { font-size: 2rem; margin-bottom: 0.5rem; line-height: 1; }
.dash-quick-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.2rem; }
.dash-quick-hint { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.dash-quick-arrow {
    position: absolute;
    bottom: 0.85rem;
    left: 0.85rem;
    font-size: 0.85rem;
    color: var(--dash-accent, var(--accent));
    opacity: 0.7;
}

.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}
.dash-stat-bubble {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--glass-border);
}
.dash-stat-emoji { font-size: 1.75rem; line-height: 1; flex-shrink: 0; }
.dash-stat-body { display: flex; flex-direction: column; min-width: 0; }
.dash-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-light), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}
.dash-stat-label { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.dash-stat-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

.dash-charts-grid { margin-top: 0.5rem; }
.dash-chart-card .section-head h2,
.dash-upcoming-card .section-head h2 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1rem;
}
.dash-chart-icon { font-size: 1.15rem; }
.dash-chart-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: -0.25rem 0 1rem;
    line-height: 1.5;
}
.dash-link { color: var(--accent-light); text-decoration: none; font-size: 0.85rem; }

.dash-upcoming-list { display: flex; flex-direction: column; gap: 0.55rem; }
.dash-upcoming-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.dash-upcoming-item:hover { border-color: var(--accent); background: rgba(124,58,237,0.08); }
.dash-upcoming-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}
.dash-upcoming-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.dash-upcoming-info strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-upcoming-info span { font-size: 0.78rem; }
.dash-upcoming-time {
    font-size: 0.78rem;
    color: var(--accent-light);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.dash-empty {
    text-align: center;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.dash-empty-icon { font-size: 2.5rem; opacity: 0.6; }

/* ─── Super admin plan editor ──────────────────────────────── */
.super-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.super-plan-card { padding: 1.5rem; }
.super-plan-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.super-plan-desc-hint { font-size: 0.78rem; margin-bottom: 0.35rem; }
.super-plan-desc-input { min-height: 120px; resize: vertical; line-height: 1.6; }

/* ─── Pricing — mobile-first enhancements ────────────────── */
.pricing-scroll-wrap {
    margin: 0 -0.25rem;
    padding: 0.25rem;
}
.pricing-duration-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    background: rgba(124,58,237,0.18);
    color: var(--accent-light);
    margin-bottom: 0.5rem;
}
.pricing-card-top { margin-bottom: 0.75rem; }
.pricing-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.5;
}
.pricing-check {
    color: var(--success);
    font-weight: 700;
    margin-left: 0.35rem;
}
.pricing-cta {
    min-height: 48px;
    font-size: 1rem;
    font-weight: 600;
}
.pricing-footer {
    text-align: center;
    padding: 1.25rem;
    margin-top: 1rem;
}
.pricing-footer-phone {
    display: inline-block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cyan);
    text-decoration: none;
    margin-top: 0.35rem;
    letter-spacing: 0.04em;
}
.subscription-page { max-width: 960px; margin: 0 auto; }
.subscription-expired-page { width: 100%; }
.expired-pricing-mount { margin-top: 1.25rem; }

/* ─── Trust badges row (eNamad + Zibal) ──────────────────────── */
.trust-badges-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1rem;
    margin-top: 1.25rem;
    max-width: 680px;
    margin-inline: auto;
}
.enamad-trust,
.zibal-trust {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    text-align: center;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
    flex: 1 1 280px;
    max-width: 320px;
}
.zibal-trust-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    text-decoration: none;
}
.zibal-trust-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}
.zibal-trust-img {
    display: block;
    height: 85px;
    width: auto;
    border: 0;
}
.enamad-trust-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.enamad-trust-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
}
.enamad-trust-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}
.enamad-trust-img {
    display: block;
    width: 100px;
    height: auto;
    cursor: pointer;
}
.enamad-trust-hint {
    font-size: 0.78rem;
    margin: 0;
}

/* ─── Payment result pages ───────────────────────────────────── */
body.payment-route {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.payment-result-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.payment-result-card {
    width: 100%;
    max-width: 440px;
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 40px rgba(124, 58, 237, 0.08);
}
.payment-result-card h1 {
    font-size: 1.45rem;
    margin: 1rem 0 0.5rem;
}
.payment-result-lead {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.7;
}
.payment-result-details {
    text-align: right;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
}
.payment-result-details p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: 0.4rem 0;
    font-size: 0.9rem;
}
.payment-result-details span {
    color: var(--text-muted);
}
.payment-result-details strong {
    color: var(--accent-light);
    font-weight: 600;
}
.payment-result-note {
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}
.payment-result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.payment-checkmark {
    width: 72px;
    height: 72px;
    margin: 0 auto;
}
.payment-checkmark-svg {
    width: 100%;
    height: 100%;
}
.payment-checkmark-circle {
    stroke: var(--success);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: payment-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.payment-checkmark-check {
    stroke: var(--success);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: payment-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}
@keyframes payment-stroke {
    100% { stroke-dashoffset: 0; }
}
.payment-fail-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 700;
    color: var(--danger);
    background: rgba(244, 63, 94, 0.12);
    border: 2px solid rgba(244, 63, 94, 0.35);
    animation: payment-fail-pop 0.45s ease-out;
}
@keyframes payment-fail-pop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
[data-theme="light"] .enamad-trust-link,
[data-theme="light"] .zibal-trust-link {
    background: rgba(124, 58, 237, 0.04);
    border-color: rgba(124, 58, 237, 0.12);
}
@media (max-width: 480px) {
    .payment-result-card { padding: 1.5rem 1.15rem; }
    .trust-badges-row {
        flex-direction: column;
        align-items: center;
        gap: 0.85rem;
    }
    .enamad-trust,
    .zibal-trust {
        max-width: 100%;
        width: 100%;
    }
    .enamad-trust-img { width: 88px; }
    .zibal-trust-img { height: 72px; }
}

/* Subscription pages — mobile scroll fixes */
body.subscription-route {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    body.subscription-route .app-layout {
        display: block;
        min-height: auto;
        overflow: visible;
    }

    body.subscription-route .main-content {
        min-height: auto;
        overflow: visible;
        padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
        touch-action: pan-y;
    }

    body.subscription-route .subscription-page,
    body.subscription-route .expired-page,
    body.subscription-route .pricing-scroll-wrap,
    body.subscription-route .pricing-grid {
        overflow: visible;
        touch-action: pan-y;
    }

    body.subscription-route .expired-page {
        max-width: none;
        margin: 0;
        padding: 1.5rem 1rem;
    }

    body.subscription-route .subscription-hero {
        padding: 1.25rem 1rem;
    }
}

@media (max-width: 480px) {
    body.subscription-route .main-content {
        padding: 0.85rem;
        padding-top: 3.75rem;
        padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
    }

    body.subscription-route .pricing-card {
        padding: 1.25rem 1rem;
    }

    body.subscription-route .pricing-amount { font-size: 1.55rem; }

    body.subscription-route .pricing-footer {
        margin-bottom: 0.5rem;
    }

    body.subscription-route .subscription-steps {
        padding: 0.85rem;
    }
}

@media (max-width: 390px) {
    body.subscription-route .page-header .page-title { font-size: 1.1rem; }

    body.subscription-route .pricing-card h3 { font-size: 0.95rem; }

    body.subscription-route .pricing-cta {
        min-height: 44px;
        font-size: 0.92rem;
    }

    body.subscription-route .pricing-footer-phone {
        font-size: 1.15rem;
    }
}
.subscription-hero-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.subscription-hero-sub { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.35rem; }
.subscription-status-chip {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.45rem 1rem;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
}
.subscription-steps {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.sub-step {
    flex: 1;
    min-width: 90px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.sub-step span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
}
.sub-step p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.35; }

@media (max-width: 640px) {
    .dash-welcome-main { flex-direction: column; text-align: center; }
    .dash-welcome-title { font-size: 1.15rem; }
    .dash-quick-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
    .dash-quick-card { min-height: 115px; padding: 1rem 0.85rem; }
    .dash-quick-emoji { font-size: 1.65rem; }
    .dash-quick-title { font-size: 0.9rem; }
    .dash-quick-hint { font-size: 0.72rem; }
    .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
    .dash-stat-bubble { padding: 0.85rem; }
    .dash-stat-value { font-size: 1.15rem; }
    .dash-upcoming-time { font-size: 0.72rem; }
    .dashboard-grid { grid-template-columns: 1fr; }

    /* Pricing: full-width stacked cards on mobile */
    .pricing-scroll-wrap {
        margin: 0;
        padding: 0;
        overflow: visible;
    }
    .pricing-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        grid-template-columns: unset;
    }
    .pricing-card {
        width: 100%;
        padding: 1.5rem 1.25rem;
        text-align: right;
    }
    .pricing-card-featured {
        order: -1;
        transform: none;
    }
    .pricing-card:hover { transform: none; }
    .pricing-amount { font-size: 1.75rem; }
    .pricing-features { font-size: 0.88rem; }
    .pricing-features li {
        display: flex;
        align-items: flex-start;
        gap: 0.35rem;
        padding: 0.5rem 0;
    }
    .pricing-badge { top: auto; bottom: 12px; left: 12px; }
    .subscription-hero { padding: 1.5rem 1rem; }
    .subscription-steps { flex-direction: column; align-items: stretch; }
    .sub-step { flex-direction: row; text-align: right; gap: 0.75rem; }
    .sub-step p { flex: 1; font-size: 0.85rem; }
    .super-plans-grid { grid-template-columns: 1fr; }
    .page-header .page-title { font-size: 1.2rem; }
}

@media (min-width: 641px) and (max-width: 900px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pricing-card-featured {
        grid-column: span 2;
    }
}

@media (min-width: 901px) {
    .pricing-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
[data-theme="light"] .bar-value { color: var(--text-primary); }

/* ─── Mobile refinements for v2 ────────────────────────────── */
@media (max-width: 768px) {
    .profile-header { flex-direction: column; text-align: center; align-items: center; }
    .profile-tags { justify-content: center; }
    .profile-actions { width: 100%; justify-content: center; }
    .summary-cards { grid-template-columns: 1fr; }
    .stats-grid-compact { grid-template-columns: 1fr 1fr; }
    .tabs { gap: 0; }
    .tab { padding: 0.6rem 0.7rem; font-size: 0.82rem; }
    .day-appt-item { flex-wrap: wrap; }
}

/* ─── Nav badge (اعلان‌ها) ─────────────────────────────────── */
.nav-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-inline-start: auto;
    border-radius: 999px;
    background: var(--danger, #f43f5e);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-badge.badge-show {
    display: inline-flex;
}

/* ─── Notification feed (اعلان‌های کلینیک) ─────────────────── */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
}

.alert-item-body { flex: 1; min-width: 0; }

.alert-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.alert-item-time { font-size: 0.75rem; white-space: nowrap; }

.alert-item p { font-size: 0.85rem; margin: 0; line-height: 1.7; }

.alert-item.alert-unread {
    border-inline-start: 3px solid var(--accent);
    background: rgba(124, 58, 237, 0.08);
}

/* ─── Therapist availability (شیفت کاری) ───────────────────── */
.availability-card .avail-hint {
    font-size: 0.78rem;
    margin: 0.4rem 0 0;
    line-height: 1.7;
}

.avail-days {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
    transition: opacity 0.2s ease;
}

.avail-days.avail-days-off {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.4);
}

.avail-day-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm, 10px);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
}

.avail-day-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 110px;
    cursor: pointer;
    font-weight: 600;
}

.avail-day-times {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avail-day-times input[type="time"] {
    direction: ltr;
    text-align: center;
    width: 118px;
}

.avail-dash { color: var(--text-muted); font-size: 0.8rem; }

@media (max-width: 768px) {
    .avail-day-row { flex-direction: column; align-items: stretch; }
    .avail-day-times { justify-content: space-between; }
    .avail-day-times input[type="time"] { flex: 1; width: auto; }
}

/* ─── Sales Agent Panel ────────────────────────────────────── */
.agent-hero {
    padding: 2rem 2.25rem;
    margin-bottom: 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.agent-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.agent-hero-quote {
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    position: relative;
}

.agent-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
}

.agent-referral-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.agent-referral-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.agent-referral-code {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.agent-referral-code code {
    font-family: 'Vazirmatn', monospace;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.6rem 1.25rem;
    background: rgba(124,58,237,0.12);
    border: 1px dashed rgba(124,58,237,0.35);
    border-radius: var(--radius-sm);
    color: var(--accent-light);
    text-shadow: 0 0 20px rgba(124,58,237,0.3);
}

.agent-stat-card .stat-value {
    font-size: 1.6rem;
}

.agent-stat-card .stat-money {
    color: var(--cyan);
    text-shadow: 0 0 24px var(--cyan-glow);
}

/* Tier badges */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.06);
    color: var(--tier-color, var(--text-primary));
    box-shadow: 0 0 16px color-mix(in srgb, var(--tier-color, var(--accent)) 25%, transparent);
}

.tier-badge::before {
    content: '◆';
    font-size: 0.55rem;
    opacity: 0.85;
}

.tier-bronze  { --tier-color: #cd7f32; background: rgba(205,127,50,0.12); border-color: rgba(205,127,50,0.35); }
.tier-silver  { --tier-color: #c0c0c0; background: rgba(192,192,192,0.1);  border-color: rgba(192,192,192,0.3); }
.tier-gold    { --tier-color: #ffd700; background: rgba(255,215,0,0.1);    border-color: rgba(255,215,0,0.35); }
.tier-diamond { --tier-color: #67e8f9; background: rgba(103,232,249,0.1); border-color: rgba(103,232,249,0.35); box-shadow: 0 0 20px rgba(103,232,249,0.15); }

/* Tier progress */
.agent-tier-progress {
    margin-bottom: 1.25rem;
}

.agent-tier-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.agent-tier-progress-head h3 {
    font-size: 1rem;
    font-weight: 600;
}

.agent-progress-bar {
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    margin-bottom: 0.65rem;
}

.agent-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(270deg, var(--accent), var(--cyan), var(--accent-light));
    background-size: 200% 100%;
    animation: agent-progress-shimmer 3s ease infinite;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px var(--accent-glow);
}

@keyframes agent-progress-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

.agent-tier-max {
    text-align: center;
    padding: 2rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, rgba(255,215,0,0.06), rgba(124,58,237,0.08));
}

.agent-tier-max h3 {
    font-size: 1.1rem;
    background: linear-gradient(90deg, #ffd700, var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Offers grid */
.agent-offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.agent-offer-card {
    padding: 1.25rem 1.5rem;
    position: relative;
}

.agent-offer-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(245,158,11,0.15);
    color: var(--warning);
    margin-bottom: 0.6rem;
}

.agent-offer-card h4 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

/* Monthly history */
.agent-history {
    padding: 0.5rem 1.25rem;
}

.agent-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.agent-history-row:last-child {
    border-bottom: none;
}

.agent-history-row strong {
    color: var(--cyan);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .agent-referral-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .agent-referral-code {
        justify-content: center;
    }

    .agent-hero { padding: 1.5rem 1.25rem; }
    .agent-hero-quote { font-size: 1rem; }
}

/* Period picker (settlement) */
.period-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}
.period-picker label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.period-picker select {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.2);
    color: inherit;
    font-family: inherit;
    min-width: 5rem;
}

/* Advanced agent panel */
.agent-hero-tier-gold {
    background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(124,58,237,0.06));
}
.agent-hero-tier-diamond {
    background: linear-gradient(135deg, rgba(103,232,249,0.1), rgba(124,58,237,0.08));
    animation: agent-shimmer 4s ease-in-out infinite;
}
@keyframes agent-shimmer {
    0%, 100% { box-shadow: 0 0 30px rgba(103,232,249,0.12); }
    50% { box-shadow: 0 0 48px rgba(103,232,249,0.22); }
}
.agent-rank-pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(124,58,237,0.15);
    color: var(--accent-light);
    margin-bottom: 0.75rem;
}
.agent-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, rgba(6,182,212,0.08), rgba(124,58,237,0.08));
    border: 1px solid rgba(6,182,212,0.2);
}
.agent-cta-card h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.agent-milestones {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.25rem;
}
.agent-milestone {
    flex: 1;
    min-width: 90px;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    border: 1px dashed var(--glass-border);
    opacity: 0.45;
    transition: opacity 0.2s, transform 0.2s;
}
.agent-milestone.unlocked {
    opacity: 1;
    border-style: solid;
    border-color: rgba(124,58,237,0.35);
    transform: translateY(-2px);
}
.agent-milestone-icon { display: block; font-size: 1.25rem; margin-bottom: 0.25rem; }
.agent-milestone-label { font-size: 0.72rem; color: var(--text-muted); }
.agent-progress-pulse {
    animation: progress-pulse 2s ease-in-out infinite;
}
@keyframes progress-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}
.agent-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.25rem 0;
}
@media (max-width: 900px) {
    .agent-panel-grid { grid-template-columns: 1fr; }
}
.agent-leaderboard h3,
.agent-activity h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}
.agent-leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.agent-leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.88rem;
}
.agent-leaderboard-item.is-me {
    background: rgba(124,58,237,0.08);
    margin: 0 -0.5rem;
    padding: 0.6rem 0.5rem;
    border-radius: var(--radius-sm);
}
.agent-lb-rank {
    font-weight: 700;
    min-width: 1.5rem;
    color: var(--accent-light);
}
.agent-lb-name { flex: 1; min-width: 80px; }
.agent-lb-stat { font-size: 0.8rem; color: var(--text-muted); }
.agent-tier-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.agent-tier-compare-card {
    text-align: center;
    padding: 1rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.03);
}
.agent-tier-compare-card.current {
    border-color: rgba(124,58,237,0.45);
    background: rgba(124,58,237,0.08);
}
.agent-tier-compare-card p { font-size: 0.8rem; color: var(--text-muted); margin: 0.35rem 0; }
.agent-tier-current-tag {
    display: inline-block;
    font-size: 0.68rem;
    margin-top: 0.35rem;
    color: var(--accent-light);
}
.agent-activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}
.agent-activity-row:last-child { border-bottom: none; }
.agent-panel-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* ─── Super Admin — Sales Agents ───────────────────────────── */
.sa-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.sa-page-header h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.sa-back-link { margin-bottom: 0.75rem; }

.sa-period-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(124,58,237,0.15);
}
.sa-period-icon { font-size: 1.2rem; opacity: 0.8; }
.sa-period-label {
    margin-right: auto;
    font-weight: 600;
    color: var(--accent-light);
    font-size: 0.9rem;
}

.sa-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}
.sa-stat-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
}
.sa-stat-icon { font-size: 1.5rem; opacity: 0.85; }
.sa-stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.sa-stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.sa-stat-highlight {
    border-color: rgba(6,182,212,0.25);
    background: linear-gradient(135deg, rgba(6,182,212,0.06), rgba(124,58,237,0.04));
}

.sa-toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.sa-toolbar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    font-size: 0.88rem;
    border: 1px solid var(--glass-border);
    transition: background 0.2s, border-color 0.2s;
}
.sa-toolbar-link:hover {
    background: rgba(124,58,237,0.08);
    border-color: rgba(124,58,237,0.3);
}

.sa-table-card { overflow: hidden; margin-bottom: 1rem; }
.sa-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}
.sa-table-head h3 { font-size: 0.95rem; font-weight: 600; }

.sa-agent-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sa-agent-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(6,182,212,0.2));
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-light);
    flex-shrink: 0;
}
.sa-agent-avatar-lg { width: 3rem; height: 3rem; font-size: 0.95rem; }
.sa-agent-cell strong { display: block; font-size: 0.9rem; }
.sa-agent-cell small { font-size: 0.75rem; }
.sa-referral-code {
    font-family: 'Vazirmatn', monospace;
    font-size: 0.82rem;
    padding: 0.2rem 0.5rem;
    background: rgba(124,58,237,0.1);
    border-radius: 4px;
    letter-spacing: 0.06em;
}
.sa-stat-pill {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    font-weight: 600;
    font-size: 0.85rem;
}
.sa-row-inactive { opacity: 0.55; }

.sa-detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.sa-detail-agent h2 { font-size: 1.15rem; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sa-detail-hero-actions { display: flex; align-items: center; gap: 0.5rem; }

.sa-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.sa-detail-card { padding: 1.25rem 1.5rem; }
.sa-detail-card h3 { font-size: 0.95rem; margin-bottom: 1rem; }
.sa-info-rows { display: flex; flex-direction: column; gap: 0.65rem; }
.sa-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.88rem;
}
.sa-info-row:last-child { border-bottom: none; }
.sa-info-row span { color: var(--text-muted); }
.sa-settle-card { text-align: center; }
.sa-settle-amount { font-size: 1.75rem; font-weight: 700; margin: 0.5rem 0; }
.sa-settle-card .btn { margin-top: 0.75rem; width: 100%; }

.sa-jalali-date { font-size: 0.82rem; white-space: nowrap; color: var(--text-muted); }

.sa-comm-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.85rem;
    margin: 1rem 0;
}

/* Tier configuration */
.sa-tier-rules {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border-right: 3px solid var(--accent);
}
.sa-tier-rules h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }
.sa-tier-rules-list {
    margin: 0;
    padding-right: 1.25rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.8;
}
.sa-tier-rules-list strong { color: var(--text-primary); }

.sa-tier-ladder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
}
.sa-tier-ladder-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    font-size: 0.82rem;
    white-space: nowrap;
}
.sa-tier-ladder-icon { font-size: 1.1rem; }
.sa-tier-ladder-name { font-weight: 600; }
.sa-tier-ladder-req { color: var(--text-muted); font-size: 0.78rem; }
.sa-tier-ladder-pct { color: var(--cyan); font-weight: 600; }
.sa-tier-ladder-arrow { opacity: 0.4; margin: 0 0.25rem; }

.sa-section-title { font-size: 1rem; margin: 0 0 1rem; font-weight: 600; }

.sa-tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}
.sa-tier-card {
    padding: 0;
    overflow: hidden;
    border-top: 3px solid var(--tier-color, var(--accent));
}
.sa-tier-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--glass-border);
}
.sa-tier-card-icon { font-size: 1.75rem; }
.sa-tier-toggle { cursor: pointer; margin-right: auto; }
.sa-tier-toggle input { display: none; }
.sa-tier-card-body { padding: 1rem 1.25rem; }
.sa-tier-card-body .form-group { margin-bottom: 0.85rem; }
.sa-tier-card-body small { display: block; margin-top: 0.25rem; font-size: 0.72rem; }
.sa-tier-save { margin: 0 1.25rem 1.25rem; width: calc(100% - 2.5rem); }

.sa-color-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sa-color-input-wrap input[type="color"] {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    background: none;
}
.sa-color-input-wrap input[name="color_hex"] { flex: 1; }

.sa-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
}
.sa-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }

@media (max-width: 768px) {
    .sa-page-header { flex-direction: column; align-items: stretch; }
    .sa-period-label { margin-right: 0; width: 100%; }
    .sa-detail-hero { flex-direction: column; align-items: stretch; }
    .sa-tier-ladder { flex-direction: column; align-items: stretch; }
    .sa-tier-ladder-arrow { display: none; }
}

.sa-toolbar-btn { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
.sa-settings-bar { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.sa-toggle-label { display: flex; align-items: center; gap: 0.65rem; cursor: pointer; font-size: 0.9rem; }
.sa-stat-alert { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.06); }
.sa-top-agents { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.sa-top-agents h4 { margin-bottom: 0.65rem; font-size: 0.95rem; }
.sa-top-agents-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.sa-top-agents-list li { display: flex; justify-content: space-between; padding: 0.45rem 0; border-bottom: 1px solid var(--glass-border); font-size: 0.88rem; }
.sa-settle-breakdown { margin: 0.75rem 0; }
.sa-tier-card-actions { display: flex; gap: 0.5rem; padding: 0 1.25rem 1.25rem; }
.sa-offers-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.sa-offer-card { padding: 1.25rem; }
.sa-offer-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.sa-offer-meta { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: var(--text-muted); margin: 0.65rem 0; }
.sa-offer-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.modal-wide { max-width: 560px; width: 95%; }
.sa-referral-share-card { flex-direction: column; align-items: stretch; gap: 0.85rem; padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.sa-referral-link-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sa-referral-link { font-size: 0.78rem; word-break: break-all; padding: 0.4rem 0.65rem; background: rgba(124,58,237,0.1); border-radius: var(--radius-sm); flex: 1; min-width: 0; }
.sa-share-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.sa-share-wa { color: #25d366; border-color: rgba(37,211,102,0.3); }
.sa-share-tg { color: #0088cc; border-color: rgba(0,136,204,0.3); }
.agent-panel-grid-single { grid-template-columns: 1fr; }
.sa-settings-form { padding: 1.5rem; max-width: 520px; }
.sa-settings-form h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }
.sa-created-info { margin: 1rem 0; }
.sa-bulk-preview { margin: 1rem 0; padding: 0.75rem; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); }
.jalali-datetime-input { width: 100%; padding: 0.45rem 0.65rem; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: rgba(0,0,0,0.2); color: inherit; font-family: inherit; }

/* ─── Support Tickets ───────────────────────────────────────── */
.support-hero {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(124,58,237,0.14), rgba(6,182,212,0.1));
}

.support-hero-icon { font-size: 2.5rem; filter: drop-shadow(0 0 16px var(--accent-glow)); }

.support-phone-fallback { font-size: 0.85rem; margin-top: 0.5rem; }

.support-grid {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 960px) {
    .support-grid { grid-template-columns: 1fr; }
}

.support-form-card textarea,
.ticket-reply-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
}

.ticket-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.ticket-number {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background: rgba(124,58,237,0.15);
    border-radius: 6px;
    margin-bottom: 0.35rem;
}

.ticket-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 420px;
    overflow-y: auto;
    padding: 1rem;
}

.ticket-msg {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}

.ticket-msg-clinic { background: rgba(6,182,212,0.08); margin-left: 2rem; }
.ticket-msg-agent { background: rgba(124,58,237,0.1); margin-right: 2rem; }
.ticket-msg-admin { background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.25); }

.ticket-msg-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.ticket-msg-role {
    font-size: 0.72rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
}

.ticket-msg-body { line-height: 1.65; white-space: pre-wrap; word-break: break-word; }

.ticket-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.ticket-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--cyan, #06b6d4);
    font-size: 0.82rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ticket-attachment:hover {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.35);
}

.ticket-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}

.ticket-escalate-btn { margin-right: auto; }

.ticket-escalate-hint { font-size: 0.78rem; margin-top: 0.5rem; }

.ticket-escalated-row { background: rgba(251,191,36,0.06) !important; }

.ticket-assign-bar .form-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }

.star-rating { display: flex; gap: 0.15rem; }
.star-display, .star-btn {
    font-size: 1.35rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: default;
    padding: 0 0.1rem;
}
.star-btn { cursor: pointer; transition: var(--transition); }
.star-display.active, .star-btn.active, .star-btn:hover { color: #fbbf24; text-shadow: 0 0 12px rgba(251,191,36,0.5); }

.support-agent-hero { padding: 1.5rem; margin-bottom: 1.25rem; }

.ticket-rating-card { margin-top: 1rem; padding: 1rem 1.25rem; }

.agent-leaderboard-row {
    display: grid;
    grid-template-columns: 2rem 1fr auto auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.88rem;
}

.agent-leaderboard-row.is-me {
    background: rgba(124,58,237,0.12);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
}

.lb-rank { font-weight: 700; color: var(--cyan); }

@media (max-width: 720px) {
    .ticket-msg-clinic { margin-left: 0; }
    .ticket-msg-agent { margin-right: 0; }
    .agent-leaderboard-row { grid-template-columns: 1.5rem 1fr; }
}

/* ─── Super Admin — Layout & Navigation ─────────────────────── */
.super-admin-layout {
    --sa-accent: #8b5cf6;
    --sa-accent-soft: rgba(139, 92, 246, 0.12);
}
.super-admin-layout .sidebar {
    border-left: 1px solid rgba(139, 92, 246, 0.15);
    background: linear-gradient(180deg, rgba(15, 12, 28, 0.92) 0%, rgba(10, 8, 20, 0.96) 100%);
}
[data-theme="light"] .super-admin-layout .sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 246, 255, 0.98) 100%);
    border-left-color: rgba(139, 92, 246, 0.12);
}
.super-admin-layout .brand-icon {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    box-shadow: 0 0 24px rgba(124, 58, 237, 0.35);
}
.sa-nav { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; overflow-y: auto; padding-bottom: 0.5rem; }
.sa-nav-group { margin-bottom: 0.65rem; }
.sa-nav-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.75;
    padding: 0.35rem 0.85rem 0.25rem;
    margin-bottom: 0.15rem;
}
.sa-nav-links { gap: 0.15rem; }
.sa-nav-links a {
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s, transform 0.15s;
}
.sa-nav-links a:hover {
    background: var(--sa-accent-soft);
    transform: translateX(-2px);
}
.sa-nav-links a.active {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.22), rgba(6, 182, 212, 0.08));
    border-right: 2px solid var(--sa-accent);
}
.sa-main-content { max-width: 1280px; }
.sa-content-body { display: flex; flex-direction: column; gap: 1.25rem; }
.sa-main-header { margin-bottom: 0.25rem; }
.sa-main-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

/* Dashboard */
.sa-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(6, 182, 212, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.sa-dashboard-hero h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 0.25rem; }
.sa-dash-stats { margin-top: 0; }
.sa-stat-tile {
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.sa-stat-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.12);
}
.sa-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem;
}
.sa-quick-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.1rem 1rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.sa-quick-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 10px 32px rgba(124, 58, 237, 0.15);
}
.sa-quick-icon { font-size: 1.5rem; line-height: 1; }
.sa-quick-card strong { font-size: 0.92rem; }
.sa-quick-desc { font-size: 0.75rem; line-height: 1.4; }

.sa-section-block {
    padding: 1.25rem 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.sa-section-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.sa-section-block-head h3,
.sa-section-block-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin: 0;
}
.sa-stats-grid-compact { margin-bottom: 0; }
.sa-top-agents-inline { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--glass-border); }
.sa-top-agents-inline h4 { font-size: 0.88rem; margin-bottom: 0.5rem; }

/* Page headers & tools */
.sa-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(124, 58, 237, 0.04));
}
.sa-page-header h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.3rem; }
.sa-page-header-text p { margin: 0; font-size: 0.85rem; }
.sa-page-header-actions { display: flex; gap: 0.5rem; flex-shrink: 0; flex-wrap: wrap; }
.sa-toolbar-inline { margin-bottom: 0.25rem; }
.sa-search-input { max-width: 360px; width: 100%; }
.sa-table-card { overflow: hidden; }
.sa-form-card { padding: 1.5rem; }
.sa-empty-inline { padding: 2rem; text-align: center; }
.sa-warning-card {
    padding: 1rem 1.25rem;
    font-size: 0.88rem;
    line-height: 1.6;
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
}
.sa-toolbar-hidden { display: none; }

/* Filter tabs (tickets) */
.sa-filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}
.sa-filter-tab {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
}
.sa-filter-tab:hover {
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.3);
}
.sa-filter-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

@media (max-width: 768px) {
    .sa-dashboard-hero { flex-direction: column; align-items: stretch; }
    .sa-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .sa-page-header { flex-direction: column; }
    .sa-page-header-actions { width: 100%; }
    .sa-page-header-actions .btn { flex: 1; }
}

/* ─── Revenue Audit pages ───────────────────────────────────── */
.audit-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(16, 185, 129, 0.08));
}

.audit-hero-icon {
    font-size: 2.25rem;
    line-height: 1;
    filter: drop-shadow(0 0 14px rgba(6, 182, 212, 0.35));
}

.audit-hero > div:nth-child(2) { flex: 1; min-width: 200px; }
.audit-hero h2 { margin: 0 0 0.25rem; }

.audit-hero-actions,
.audit-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-inline-start: auto;
}

.audit-filter-panel,
.audit-filters {
    padding: 1.15rem 1.35rem;
    margin-bottom: 1.25rem;
}

.audit-chips,
.audit-period-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.audit-chip {
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.audit-chip:hover { border-color: rgba(6, 182, 212, 0.4); }
.audit-chip.active {
    background: rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.55);
    color: var(--cyan, #06b6d4);
    font-weight: 600;
}

.audit-filter-form .form-row,
.audit-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.audit-filter-actions { align-self: end; }

.audit-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.audit-card-therapist {
    border-color: rgba(16, 185, 129, 0.25);
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.1), transparent);
}

.audit-card-clinic {
    border-color: rgba(6, 182, 212, 0.25);
    background: linear-gradient(160deg, rgba(6, 182, 212, 0.1), transparent);
}

.share-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.share-pill.share-therapist {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
}

.share-pill.share-clinic {
    background: rgba(6, 182, 212, 0.14);
    color: #22d3ee;
}

@media (max-width: 720px) {
    .audit-hero { align-items: flex-start; }
    .audit-hero-actions { margin-inline-start: 0; width: 100%; }
    .audit-hero-actions .btn { flex: 1; }
}
