/* ═══════════════════════════════════════════════════════════════
   Psyno UI v3 — لایهٔ طراحی یکپارچه
   افکت‌ها، اجزای جدید و هماهنگی بصری همهٔ بخش‌ها
   (بعد از app.css بارگذاری می‌شود)
   ═══════════════════════════════════════════════════════════════ */

:root {
    --ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --radius-lg: 22px;
    --surface-1: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --line: rgba(255, 255, 255, 0.08);
    --shadow-lift: 0 18px 50px rgba(0, 0, 0, 0.35);
    --grad-violet: linear-gradient(135deg, #8b5cf6, #6366f1);
    --grad-cyan: linear-gradient(135deg, #22d3ee, #0891b2);
    --grad-green: linear-gradient(135deg, #34d399, #059669);
    --grad-amber: linear-gradient(135deg, #fbbf24, #f97316);
    --grad-rose: linear-gradient(135deg, #fb7185, #e11d48);
    --grad-indigo: linear-gradient(135deg, #818cf8, #4338ca);
    --tone-violet: #a78bfa;
    --tone-cyan: #22d3ee;
    --tone-green: #34d399;
    --tone-amber: #fbbf24;
    --tone-rose: #fb7185;
    --tone-indigo: #818cf8;
}

[data-theme="light"] {
    --surface-1: rgba(15, 23, 42, 0.035);
    --surface-2: rgba(15, 23, 42, 0.06);
    --line: rgba(15, 23, 42, 0.08);
    --shadow-lift: 0 18px 44px rgba(15, 23, 42, 0.12);
    --tone-violet: #7c3aed;
    --tone-cyan: #0891b2;
    --tone-green: #059669;
    --tone-amber: #d97706;
    --tone-rose: #e11d48;
    --tone-indigo: #4f46e5;
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html.theme-transition, html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, fill 0.4s ease !important;
}

:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
    border-radius: 8px;
}

.text-danger { color: var(--danger) !important; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

/* ─── پس‌زمینهٔ شفق (Aurora) ─────────────────────────────────── */
.arabesque-bg .aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    pointer-events: none;
    will-change: transform;
}
.aurora-1 { width: 520px; height: 520px; top: -160px; right: 10%; background: radial-gradient(circle, rgba(139, 92, 246, 0.55), transparent 65%); animation: aurora-a 26s ease-in-out infinite; }
.aurora-2 { width: 460px; height: 460px; bottom: -140px; left: 5%; background: radial-gradient(circle, rgba(6, 182, 212, 0.45), transparent 65%); animation: aurora-b 32s ease-in-out infinite; }
.aurora-3 { width: 380px; height: 380px; top: 40%; left: 40%; background: radial-gradient(circle, rgba(16, 185, 129, 0.28), transparent 65%); animation: aurora-a 38s ease-in-out infinite reverse; }
[data-theme="light"] .arabesque-bg .aurora { opacity: 0.28; }
@keyframes aurora-a { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-60px, 50px) scale(1.12); } }
@keyframes aurora-b { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(70px, -40px) scale(0.92); } }

/* ─── ورود صفحه و ظاهر شدن تدریجی ──────────────────────────────── */
.page-enter > * { animation: page-rise 0.55s var(--ease-out) both; }
.page-enter > *:nth-child(1) { animation-delay: 0.02s; }
.page-enter > *:nth-child(2) { animation-delay: 0.07s; }
.page-enter > *:nth-child(3) { animation-delay: 0.12s; }
.page-enter > *:nth-child(4) { animation-delay: 0.17s; }
.page-enter > *:nth-child(5) { animation-delay: 0.22s; }
.page-enter > *:nth-child(n+6) { animation-delay: 0.26s; }
@keyframes page-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* فقط وقتی ui.js فعال است پنهان می‌شود؛ بدون JS یا در صورت خطا، محتوا همیشه دیده می‌شود */
html.fx-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
html.fx-reveal .reveal.in { opacity: 1; transform: none; }
.page-enter > .reveal { animation: none; }

/* ─── موج لمسی، نور دنبال‌کننده، کج‌شدن ─────────────────────────── */
.has-ripple { overflow: hidden; }
.fx-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 70%);
    transform: scale(0);
    animation: fx-ripple 0.65s ease-out forwards;
    pointer-events: none;
    z-index: 0;
}
@keyframes fx-ripple { to { transform: scale(1); opacity: 0; } }

/* نور دنبال‌کنندهٔ ماوس — با background-image تا با ::before/::after کارت‌ها تداخل نکند */
.fx-spot { position: relative; }
.fx-spot:hover {
    background-image: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(167, 139, 250, 0.14), transparent 45%);
}
[data-theme="light"] .fx-spot:hover {
    background-image: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 58, 237, 0.08), transparent 45%);
}
.tilt { transition: transform 0.25s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease; transform-style: preserve-3d; }

/* ─── دکمه‌ها ───────────────────────────────────────────────── */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary::after, .btn-success::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(120%);
    transition: transform 0.7s ease;
    pointer-events: none;
}
.btn-primary:hover::after, .btn-success:hover::after { transform: translateX(-120%); }
.btn-primary { background: linear-gradient(135deg, #8b5cf6, #6366f1 55%, #0ea5e9); background-size: 160% 160%; transition: background-position 0.5s ease, transform 0.2s ease, box-shadow 0.25s ease; }
.btn-primary:hover { background-position: 100% 50%; }
.btn-ghost { background: var(--surface-1); }
.btn-ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-xs { border-radius: 8px; }
.link-btn { background: none; border: none; color: var(--accent-light); cursor: pointer; font-family: inherit; font-size: 0.82rem; padding: 0.25rem 0; }

input, select, textarea { transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease; }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: rgba(167, 139, 250, 0.35); }
textarea { line-height: 1.85; resize: vertical; }

/* ─── منوی کناری گروه‌بندی‌شده ────────────────────────────────── */
.nav-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 2px;
    margin-bottom: 0.5rem;
    scrollbar-width: thin;
}
.nav-scroll .nav-links { flex: none; overflow: visible; margin-bottom: 0.35rem; }
.nav-group + .nav-group { margin-top: 0.35rem; }
.nav-group-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    opacity: 0.75;
    padding: 0.55rem 0.9rem 0.3rem;
}
.nav-scroll .nav-links a { padding: 0.55rem 0.8rem; margin-bottom: 0.2rem; }
.nav-links a .nav-icon-wrap svg { transition: transform 0.3s var(--ease-spring); }
.nav-links a:hover .nav-icon-wrap svg { transform: scale(1.15) rotate(-6deg); }
.nav-links a.active .nav-icon-wrap { box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.35), 0 6px 18px rgba(124, 58, 237, 0.35); }
.nav-badge.badge-urgent { background: var(--grad-rose); animation: badge-throb 1.6s ease-in-out infinite; }
@keyframes badge-throb { 0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.55); } 50% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); } }

/* ─── سربرگ و ابزارها ───────────────────────────────────────── */
.page-header { align-items: center; }
.page-header-compact { margin-bottom: 1rem; }
.page-header-spacer { flex: 1; }
.header-tools { display: flex; align-items: center; gap: 0.6rem; margin-inline-start: auto; }
.cmdk-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 260px;
    padding: 0.55rem 0.85rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.84rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.cmdk-trigger svg { width: 18px; height: 18px; flex-shrink: 0; }
.cmdk-trigger span { flex: 1; text-align: start; }
.cmdk-trigger:hover { border-color: rgba(167, 139, 250, 0.45); box-shadow: 0 8px 24px rgba(124, 58, 237, 0.18); transform: translateY(-1px); }
kbd {
    font-family: inherit;
    font-size: 0.68rem;
    direction: ltr;
    padding: 0.12rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: var(--surface-1);
    color: var(--text-muted);
}
.header-alarm.is-ringing { color: var(--warning); border-color: rgba(245, 158, 11, 0.45); }
.header-alarm.is-ringing svg { animation: alarm-ring 1.4s ease-in-out infinite; transform-origin: 50% 20%; }
@keyframes alarm-ring { 0%, 60%, 100% { transform: rotate(0); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-12deg); } 30% { transform: rotate(9deg); } 40% { transform: rotate(-6deg); } 50% { transform: rotate(3deg); } }

/* ─── سربرگ قهرمان صفحات (Page Hero) ───────────────────────────── */
.page-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    padding: 1.6rem 1.75rem;
    border-radius: var(--radius-lg);
    --hero-a: rgba(139, 92, 246, 0.35);
    --hero-b: rgba(6, 182, 212, 0.25);
    background:
        radial-gradient(600px 220px at 85% -20%, var(--hero-a), transparent 70%),
        radial-gradient(500px 220px at 0% 120%, var(--hero-b), transparent 70%),
        var(--glass-bg);
}
.hero-green { --hero-a: rgba(16, 185, 129, 0.35); --hero-b: rgba(6, 182, 212, 0.22); }
.hero-amber { --hero-a: rgba(245, 158, 11, 0.32); --hero-b: rgba(244, 63, 94, 0.18); }
.hero-cyan { --hero-a: rgba(6, 182, 212, 0.35); --hero-b: rgba(139, 92, 246, 0.22); }
.hero-indigo { --hero-a: rgba(99, 102, 241, 0.38); --hero-b: rgba(236, 72, 153, 0.18); }
.page-hero-main { display: flex; align-items: center; gap: 1rem; position: relative; z-index: 1; min-width: 0; }
.page-hero-icon {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.85rem;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: hero-float 5s ease-in-out infinite;
}
@keyframes hero-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-3deg); } }
.page-hero-title {
    margin: 0 0 0.25rem;
    font-size: 1.45rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-hero-sub { margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; max-width: 640px; }
.page-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; position: relative; z-index: 1; }
.hero-orb { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(2px); }
.hero-orb-1 { width: 140px; height: 140px; left: -40px; top: -60px; background: radial-gradient(circle, var(--hero-a), transparent 70%); animation: orb-drift 9s ease-in-out infinite; }
.hero-orb-2 { width: 90px; height: 90px; left: 30%; bottom: -50px; background: radial-gradient(circle, var(--hero-b), transparent 70%); animation: orb-drift 12s ease-in-out infinite reverse; }
@keyframes orb-drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, 18px); } }

/* موج‌های EEG در سربرگ اتاق‌های عصبی */
.eeg-waves { position: absolute; inset: auto 0 0 0; width: 100%; height: 70%; opacity: 0.35; pointer-events: none; }
.eeg-waves path { fill: none; stroke-width: 1.6; stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: eeg-draw 6s linear infinite; }
.eeg-waves path:nth-child(1) { stroke: #22d3ee; }
.eeg-waves path:nth-child(2) { stroke: #a78bfa; animation-duration: 8s; animation-delay: -2s; opacity: 0.7; }
.eeg-waves path:nth-child(3) { stroke: #34d399; animation-duration: 10s; animation-delay: -4s; opacity: 0.55; }
@keyframes eeg-draw { to { stroke-dashoffset: -1200; } }

/* ─── کارت‌های شاخص (KPI) ─────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.9rem; }
.kpi-grid-4 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi-grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.kpi-card {
    --tone: var(--tone-violet);
    --tone-grad: var(--grad-violet);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.05rem 1.1rem;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.kpi-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: var(--tone-grad);
    opacity: 0.85;
    transform-origin: right;
    transform: scaleX(0.35);
    transition: transform 0.5s var(--ease-out);
}
.kpi-card:hover { border-color: color-mix(in srgb, var(--tone) 45%, transparent); box-shadow: var(--shadow-lift); }
.kpi-card:hover::after { transform: scaleX(1); }
.tone-cyan { --tone: var(--tone-cyan); --tone-grad: var(--grad-cyan); }
.tone-green { --tone: var(--tone-green); --tone-grad: var(--grad-green); }
.tone-amber { --tone: var(--tone-amber); --tone-grad: var(--grad-amber); }
.tone-rose { --tone: var(--tone-rose); --tone-grad: var(--grad-rose); }
.tone-indigo { --tone: var(--tone-indigo); --tone-grad: var(--grad-indigo); }
.tone-danger { --tone: var(--tone-rose); color: var(--tone-rose); }
.tone-muted { color: var(--text-muted); }
.kpi-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    border-radius: 15px;
    background: color-mix(in srgb, var(--tone) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
    transition: transform 0.35s var(--ease-spring);
}
.kpi-card:hover .kpi-icon { transform: scale(1.08) rotate(-6deg); }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.kpi-value { font-size: 1.45rem; font-weight: 800; line-height: 1.35; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value.count-done { animation: count-pop 0.4s var(--ease-spring); }
@keyframes count-pop { 50% { transform: scale(1.06); } }
.kpi-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; min-height: 1.1rem; }
.kpi-hint { font-size: 0.72rem; color: var(--text-muted); }
.kpi-delta { font-size: 0.7rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 999px; }
.kpi-delta.up { color: #34d399; background: rgba(16, 185, 129, 0.14); }
.kpi-delta.down { color: #fb7185; background: rgba(244, 63, 94, 0.14); }

/* ─── چیدمان ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-2-wide { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.section-block { display: flex; flex-direction: column; gap: 0.85rem; }
.block-title { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 0.4rem; }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel-toolbar p { margin: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.section-head h2 { margin: 0; font-size: 1.02rem; }
.chart-hint { font-size: 0.82rem; color: var(--text-muted); margin: -0.25rem 0 0.75rem; }

.summary-list { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; margin: 0 0 0.75rem; }
.summary-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.2rem; border-bottom: 1px dashed var(--line); font-size: 0.88rem; }
.summary-list li:last-child { border-bottom: none; }
.summary-list li span { color: var(--text-muted); }
.collect-meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.collect-meter span { display: block; height: 100%; border-radius: inherit; background: var(--grad-green); animation: meter-fill 1.2s var(--ease-out) both; transform-origin: right; }
@keyframes meter-fill { from { transform: scaleX(0); } }

.best-day { display: inline-flex; align-items: center; gap: 0.65rem; margin-bottom: 0.85rem; border-color: rgba(251, 191, 36, 0.35); }
.best-day > span { font-size: 1.4rem; }
.best-day small { display: block; font-size: 0.72rem; }

.details-card > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; }
.details-card > summary::-webkit-details-marker { display: none; }
.details-card > summary::after { content: '▾'; color: var(--text-muted); transition: transform 0.3s ease; }
.details-card[open] > summary::after { transform: rotate(180deg); }
.details-card[open] > summary { margin-bottom: 1rem; }

.month-switcher { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.4rem; border-radius: 14px; }
.month-switcher strong { min-width: 110px; text-align: center; font-size: 0.92rem; }
.month-switcher.compact strong { min-width: 50px; }

.empty-hero { text-align: center; padding: 2.5rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.empty-hero h3 { margin: 0; }
.empty-hero p { margin: 0 0 0.5rem; max-width: 420px; }
.empty-hero-icon {
    font-size: 2.6rem;
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    background: radial-gradient(circle at 30% 30%, rgba(167, 139, 250, 0.3), rgba(6, 182, 212, 0.12));
    border: 1px solid var(--line);
    animation: hero-float 4s ease-in-out infinite;
}

/* ─── نمودار ستونی ─────────────────────────────────────────── */
.vchart { position: relative; height: calc(var(--h, 190px) + 26px); padding-top: 8px; }
.vchart-grid { position: absolute; inset: 8px 0 26px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vchart-grid span { border-top: 1px dashed var(--line); }
.vchart-cols { position: relative; display: flex; align-items: flex-end; gap: clamp(2px, 0.6vw, 7px); height: 100%; }
.vchart-col {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    font-family: inherit;
    color: inherit;
}
.vchart-col.is-zero { cursor: default; }
.vchart-bar {
    position: relative;
    display: block;
    height: 0;
    min-height: 0;
    margin-bottom: 26px;
    border-radius: 8px 8px 3px 3px;
    overflow: hidden;
    transform-origin: bottom;
    animation: bar-grow 0.9s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 22ms);
    transition: filter 0.25s ease, transform 0.25s ease;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.18);
}
.vchart-stack { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 0 0 3px 3px; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.vchart-col:hover .vchart-bar { filter: brightness(1.18) saturate(1.1); transform: scaleY(1.02); }
.vchart-col.is-highlight .vchart-bar { box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.8), 0 10px 26px rgba(251, 191, 36, 0.3); }
.vchart-label { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }
.vchart-col.is-highlight .vchart-label { color: var(--warning); font-weight: 700; }
.vchart-col[data-tip]:hover::after,
.vchart-col[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% - 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    white-space: nowrap;
    padding: 0.4rem 0.65rem;
    border-radius: 10px;
    font-size: 0.74rem;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    animation: tip-in 0.18s ease;
}
.vchart-col:first-child:hover::after { left: auto; right: 0; transform: none; }
.vchart-col:last-child:hover::after { left: 0; transform: none; }
@keyframes tip-in { from { opacity: 0; transform: translate(-50%, 4px); } }
.chart-legend { display: flex; gap: 0.85rem; font-size: 0.78rem; color: var(--text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 4px; flex-shrink: 0; }

/* ─── نمودار دونات ─────────────────────────────────────────── */
.donut-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.donut {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: conic-gradient(var(--stops));
    display: grid;
    place-items: center;
    animation: donut-in 1s var(--ease-out) both;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}
@keyframes donut-in { from { transform: rotate(-90deg) scale(0.6); opacity: 0; } }
.donut-hole { width: 108px; height: 108px; border-radius: 50%; background: var(--bg-secondary); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.25); }
.donut-hole span { font-size: 0.7rem; color: var(--text-muted); }
.donut-hole strong { font-size: 0.85rem; }
.donut-legend { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; min-width: 180px; }
.donut-legend li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.2rem 0.5rem; font-size: 0.86rem; }
.donut-legend small { grid-column: 2 / -1; font-size: 0.72rem; }

/* ─── حلقهٔ پیشرفت ─────────────────────────────────────────── */
.progress-ring { flex-shrink: 0; transform: rotate(-90deg); }
.progress-ring text { transform: rotate(90deg); transform-origin: center; font-size: 0.72rem; font-weight: 800; fill: var(--text-primary); font-family: inherit; }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--tone-green); stroke-width: 6; stroke-linecap: round; stroke-dasharray: var(--c); stroke-dashoffset: var(--c); animation: ring-fill 1.3s var(--ease-out) 0.15s forwards; filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.45)); }
@keyframes ring-fill { to { stroke-dashoffset: var(--o); } }

/* ─── جدول برترین‌ها ──────────────────────────────────────── */
.leader-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.leader-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.65rem; border-radius: 14px; background: var(--surface-1); animation: page-rise 0.5s var(--ease-out) both; animation-delay: calc(var(--i) * 60ms); }
.leader-rank { width: 26px; text-align: center; font-weight: 800; color: var(--text-muted); }
.leader-row:nth-child(1) .leader-rank { color: #fbbf24; }
.leader-row:nth-child(2) .leader-rank { color: #cbd5e1; }
.leader-row:nth-child(3) .leader-rank { color: #f59e0b; }
.leader-avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.leader-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.leader-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.leader-bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad-violet); animation: meter-fill 1s var(--ease-out) both; transform-origin: right; }
.leader-stat { text-align: left; display: flex; flex-direction: column; }
.leader-stat small { font-size: 0.7rem; }

/* ─── چیپ‌ها، فیلترها و کلیدها ────────────────────────────────── */
.filter-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--surface-1);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}
.pill b { font-weight: 700; opacity: 0.75; }
.pill:hover { color: var(--text-primary); border-color: rgba(167, 139, 250, 0.4); }
.pill.active { color: #fff; background: var(--grad-violet); border-color: transparent; box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35); }

.chip-radios { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--surface-1);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.22s var(--ease-out);
    user-select: none;
}
.chip-radio span i { font-style: normal; }
.chip-radio:hover span { border-color: rgba(167, 139, 250, 0.45); transform: translateY(-1px); }
.chip-radio input:checked + span { background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(6, 182, 212, 0.18)); border-color: rgba(167, 139, 250, 0.7); color: var(--text-primary); box-shadow: 0 6px 16px rgba(124, 58, 237, 0.2); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.chip-radios.small .chip-radio span { padding: 0.32rem 0.6rem; font-size: 0.76rem; direction: ltr; }

.chip-btn {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px dashed var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.76rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}
.chip-btn:hover, .chip-btn.active { border-style: solid; border-color: var(--accent-light); color: var(--text-primary); background: rgba(139, 92, 246, 0.14); }
.quick-presets, .var-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.55rem; }
.var-chips .chip-btn { direction: ltr; }

.seg-toggle { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--glass-border); }
.seg-toggle button { border: none; background: none; color: var(--text-muted); font-family: inherit; font-size: 0.82rem; padding: 0.4rem 0.85rem; border-radius: 9px; cursor: pointer; transition: all 0.25s ease; }
.seg-toggle button.active { background: var(--grad-violet); color: #fff; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); }
.seg-radios { display: flex; gap: 0.35rem; }
.seg-radios label { flex: 1; }
.seg-radios input { position: absolute; opacity: 0; }
.seg-radios span { display: block; text-align: center; padding: 0.5rem; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--surface-1); cursor: pointer; font-size: 0.82rem; transition: all 0.2s ease; }
.seg-radios input:checked + span { border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); font-weight: 700; }
.seg-radios span.tone-cyan { color: var(--tone-cyan); }
.seg-radios span.tone-danger { color: var(--tone-rose); }

.switch-row { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 0.25rem; border-bottom: 1px dashed var(--line); cursor: pointer; }
.switch-text { flex: 1; display: flex; flex-direction: column; }
.switch-text small { font-size: 0.76rem; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--glass-border); flex-shrink: 0; transition: background 0.3s ease; }
.switch::after { content: ''; position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.35s var(--ease-spring); }
.switch-input:checked + .switch { background: var(--grad-green); border-color: transparent; }
.switch-input:checked + .switch::after { transform: translateX(-20px); }
.switch-input:focus-visible + .switch { outline: 2px solid var(--accent-light); outline-offset: 2px; }

.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 0.15rem; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 1.6rem; color: var(--surface-2); -webkit-text-stroke: 1px var(--text-muted); cursor: pointer; transition: transform 0.2s var(--ease-spring), color 0.2s ease; margin: 0; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #fbbf24; -webkit-text-stroke: 0; }
.star-input label:hover { transform: scale(1.2); }

/* ─── مودال ───────────────────────────────────────────────── */
.modal-overlay { animation: overlay-in 0.25s ease both; backdrop-filter: blur(8px); }
.modal-overlay .modal { animation: modal-in 0.42s var(--ease-spring) both; }
.modal-overlay.modal-leaving { animation: overlay-out 0.18s ease forwards; }
.modal-overlay.modal-leaving .modal { animation: modal-out 0.18s ease forwards; }
@keyframes overlay-in { from { opacity: 0; } }
@keyframes overlay-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(0.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(12px) scale(0.98); } }
.modal { border-radius: var(--radius-lg); }
.modal h2 { display: flex; align-items: center; gap: 0.4rem; }
.modal-lead { margin: -0.5rem 0 1rem; font-size: 0.84rem; }
.modal-wide { max-width: 640px; width: 96%; }
.modal-xl { max-width: 980px; width: min(97%, calc(100vw - 2rem)); overflow-x: hidden; }
.modal-xl > *, .role-editor-form, .role-editor-form > * { min-width: 0; max-width: 100%; }
.role-editor-form .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.role-editor-form .form-row > *, .role-editor-form .form-group,
.role-editor-form input, .role-editor-form select, .role-editor-form textarea { min-width: 0; max-width: 100%; }
.role-editor-form .role-shift-row { grid-template-columns: minmax(130px, 1fr) minmax(105px, 0.7fr) minmax(105px, 0.7fr); }
@media (max-width: 700px) {
    .modal-xl { width: calc(100vw - 1rem); padding-inline: 1rem; }
    .role-editor-form .form-row,
    .role-editor-form .role-shift-row { grid-template-columns: minmax(0, 1fr); }
    .role-editor-form .perm-matrix { grid-template-columns: minmax(0, 1fr); }
}
.modal-tall textarea.report-editor { min-height: 300px; }
.modal-actions { flex-wrap: wrap; }
.picked-patient { display: flex; align-items: center; gap: 0.6rem; }
.picked-avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.smart-hint { color: var(--tone-green) !important; }
.draft-pill { font-size: 0.72rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.char-count { font-size: 0.72rem; color: var(--text-muted); }
.report-editor { font-size: 0.92rem; background-image: linear-gradient(transparent calc(1.85em - 1px), var(--line) 0); background-size: 100% 1.85em; background-attachment: local; }
.report-editor.flash, textarea.flash { animation: field-flash 0.6s ease; }
@keyframes field-flash { 30% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.45); border-color: #34d399; } }
.inline-select { width: auto; display: inline-block; padding: 0.2rem 2rem 0.2rem 0.5rem; margin-inline-start: 0.4rem; font-size: 0.8rem; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }

/* ─── پیگیری‌ها ──────────────────────────────────────────── */
.fu-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.fu-col { padding: 0.9rem; border-radius: var(--radius-lg); --col: var(--tone-cyan); }
.fu-col-overdue { --col: var(--tone-rose); }
.fu-col-today { --col: var(--tone-amber); }
.fu-col-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; padding: 0 0.25rem; }
.fu-col-head h3 { margin: 0; flex: 1; font-size: 0.95rem; }
.fu-col-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--col); box-shadow: 0 0 10px var(--col); }
.fu-col-overdue .fu-col-dot { animation: room-pulse 1.4s ease-in-out infinite; }
.fu-col-count { min-width: 28px; text-align: center; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 800; font-size: 0.8rem; background: color-mix(in srgb, var(--col) 18%, transparent); color: var(--col); }
.fu-col-body { display: flex; flex-direction: column; gap: 0.65rem; }
.fu-empty { text-align: center; padding: 1.5rem 0.5rem; color: var(--text-muted); font-size: 0.85rem; }
.fu-empty span { font-size: 1.8rem; display: block; margin-bottom: 0.25rem; }

.fu-card {
    position: relative;
    padding: 0.8rem 0.85rem 0.7rem;
    border-radius: 16px;
    background: var(--surface-1);
    border: 1px solid var(--glass-border);
    border-right: 4px solid var(--tone-cyan);
    animation: page-rise 0.45s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 45ms);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.4s ease;
}
.fu-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.fu-card.prio-high { border-right-color: var(--tone-rose); }
.fu-card.prio-low { border-right-color: var(--text-muted); }
.fu-card.is-overdue { background: linear-gradient(90deg, transparent, rgba(244, 63, 94, 0.08)); }
.fu-card.is-completing { transform: translateX(-30px) scale(0.96); opacity: 0; border-right-color: var(--tone-green); }
.fu-card-top { display: flex; align-items: flex-start; gap: 0.5rem; }
.fu-cat { font-size: 1.15rem; line-height: 1.4; }
.fu-title { flex: 1; font-size: 0.9rem; line-height: 1.55; }
.fu-prio { font-size: 0.68rem; font-weight: 800; padding: 0.1rem 0.45rem; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); white-space: nowrap; }
.fu-note { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fu-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; margin: 0.5rem 0; font-size: 0.75rem; color: var(--text-muted); }
.fu-meta a { color: var(--accent-light); text-decoration: none; }
.fu-meta a:hover { text-decoration: underline; }
.fu-due.late { color: var(--tone-rose); font-weight: 700; }
.fu-actions { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.fu-snooze { position: relative; }
.fu-snooze > summary { list-style: none; }
.fu-snooze > summary::-webkit-details-marker { display: none; }
.fu-snooze-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; display: flex; flex-direction: column; min-width: 150px; padding: 0.35rem; border-radius: 14px; animation: modal-in 0.25s var(--ease-spring) both; }
.fu-snooze-menu button { background: none; border: none; text-align: start; color: var(--text-primary); font-family: inherit; font-size: 0.82rem; padding: 0.5rem 0.65rem; border-radius: 9px; cursor: pointer; }
.fu-snooze-menu button:hover { background: rgba(139, 92, 246, 0.16); }
.fu-done-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.fu-done-item { display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem 0.65rem; border-radius: 12px; background: var(--surface-1); }
.fu-done-item > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fu-done-item small { font-size: 0.74rem; }
.fu-done-check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(16, 185, 129, 0.18); color: #34d399; font-weight: 800; flex-shrink: 0; }
.dash-fu-list { display: flex; flex-direction: column; gap: 0.55rem; }
.dash-fu-list .fu-note { display: none; }
.patient-fu-strip { display: flex; align-items: center; gap: 0.8rem; border-color: rgba(245, 158, 11, 0.4); background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), transparent); }
.patient-fu-strip > div { flex: 1; display: flex; flex-direction: column; }
.patient-fu-icon { font-size: 1.4rem; animation: alarm-ring 2.4s ease-in-out infinite; }

/* ─── پنجرهٔ آلارم ───────────────────────────────────────── */
.fu-alarm {
    position: fixed;
    left: 1.25rem;
    bottom: 6.25rem;
    z-index: 1200;
    width: min(380px, calc(100vw - 2rem));
    padding: 1rem;
    border-radius: var(--radius-lg);
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 158, 11, 0.25), 0 0 40px rgba(245, 158, 11, 0.2);
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.35s ease, transform 0.45s var(--ease-spring);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.fu-alarm.is-open { opacity: 1; transform: none; }
.fu-alarm-head { display: flex; align-items: center; gap: 0.75rem; }
.fu-alarm-head > div { flex: 1; display: flex; flex-direction: column; }
.fu-alarm-head small { color: var(--text-muted); font-size: 0.78rem; }
.fu-alarm-bell { font-size: 1.8rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--grad-amber); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); animation: alarm-ring 1.2s ease-in-out infinite, halo 1.6s ease-out infinite; }
@keyframes halo { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); } 100% { box-shadow: 0 0 0 18px rgba(245, 158, 11, 0); } }
.fu-alarm-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.fu-alarm-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 46vh; overflow-y: auto; }
.fu-alarm-item { padding: 0.65rem; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--glass-border); border-right: 3px solid var(--tone-amber); }
.fu-alarm-item.prio-high { border-right-color: var(--tone-rose); }
.fu-alarm-item-main { display: flex; align-items: center; gap: 0.55rem; }
.fu-alarm-item-main > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fu-alarm-item-main small { color: var(--text-muted); font-size: 0.74rem; }
.fu-alarm-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* ─── گزارش پرونده ───────────────────────────────────────── */
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.9rem; }
.pr-card { padding: 1rem 1.1rem; border-radius: 18px; display: flex; flex-direction: column; gap: 0.6rem; animation: page-rise 0.45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.pr-card-head { display: flex; align-items: flex-start; gap: 0.65rem; }
.pr-card-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pr-card-title small { font-size: 0.74rem; }
.report-type-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; font-size: 1.2rem; border-radius: 12px; background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(6, 182, 212, 0.14)); border: 1px solid var(--line); }
.report-type-icon.lg { width: 54px; height: 54px; font-size: 1.6rem; border-radius: 16px; }
.report-preview { margin: 0; font-size: 0.84rem; line-height: 1.85; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.pr-card-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: auto; padding-top: 0.5rem; border-top: 1px dashed var(--line); }
.badge-lock { background: rgba(245, 158, 11, 0.15); color: var(--warning); white-space: nowrap; }
.report-view-head { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem; }
.report-view-head h2 { margin: 0 0 0.2rem; }
.report-view-head p { margin: 0; }
.report-view-body { padding: 1rem 1.15rem; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--line); line-height: 2; font-size: 0.92rem; max-height: 55vh; overflow-y: auto; }
.report-view-body.compact { max-height: 30vh; margin-bottom: 1rem; font-size: 0.86rem; }

/* ─── گزارش پرسنل ───────────────────────────────────────── */
.sr-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.sr-filters select { width: auto; min-width: 170px; }
.sr-day { display: flex; flex-direction: column; gap: 0.7rem; }
.sr-day-title { display: flex; align-items: baseline; gap: 0.6rem; margin: 0.5rem 0 0; font-size: 0.95rem; }
.sr-day-title span { padding: 0.2rem 0.75rem; border-radius: 999px; background: var(--surface-2); }
.sr-card { display: flex; gap: 0.9rem; padding: 1rem 1.1rem; border-radius: 18px; animation: page-rise 0.45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.sr-card.type-incident { border-color: rgba(244, 63, 94, 0.35); }
.sr-card.type-evaluation { border-color: rgba(251, 191, 36, 0.35); }
.sr-avatar { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.05rem; }
.sr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.sr-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sr-head strong { font-size: 0.95rem; }
.sr-type { font-size: 0.74rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }
.sr-stars { color: #fbbf24; letter-spacing: 2px; font-size: 1rem; }
.sr-content { font-size: 0.86rem; line-height: 1.95; color: var(--text-primary); opacity: 0.92; }
.sr-review { font-size: 0.82rem; padding: 0.55rem 0.75rem; border-radius: 12px; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.25); }
.sr-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.25rem; }

/* ─── اتاق‌ها ────────────────────────────────────────────── */
.room-card { --room-c: #8b5cf6; border-radius: var(--radius-lg); animation: page-rise 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease; }
.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.room-card.room-free { border-color: color-mix(in srgb, var(--room-c) 30%, transparent); }
.room-type-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); margin: -0.4rem 0 0.6rem; }
.room-desc { font-size: 0.8rem; margin: 0 0 0.5rem; }
.room-edit-btn { width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--surface-1); color: var(--text-muted); cursor: pointer; transition: all 0.2s ease; }
.room-edit-btn:hover { color: var(--text-primary); border-color: var(--accent-light); transform: rotate(-8deg); }
.room-patient { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.65rem; }
.room-patient > div { display: flex; flex-direction: column; }
.room-patient a { color: inherit; text-decoration: none; }
.room-patient a:hover strong { color: var(--accent-light); }
.room-patient small { font-size: 0.76rem; }
.room-patient-avatar { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; }
.room-session-info .btn-block + .btn-block { margin-top: 0.45rem; }
.room-empty-icon { font-size: 2.3rem; display: block; margin-bottom: 0.25rem; animation: hero-float 4s ease-in-out infinite; }
.room-type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.room-type-option input { position: absolute; opacity: 0; }
.room-type-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.3rem; padding: 0.9rem 0.6rem; border-radius: 16px; border: 1px solid var(--glass-border); background: var(--surface-1); cursor: pointer; height: 100%; transition: all 0.25s var(--ease-out); }
.room-type-card small { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }
.room-type-emoji { font-size: 1.9rem; transition: transform 0.35s var(--ease-spring); }
.room-type-option:hover .room-type-card { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.room-type-option input:checked + .room-type-card { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: 0 10px 26px color-mix(in srgb, var(--c) 25%, transparent); }
.room-type-option input:checked + .room-type-card .room-type-emoji { transform: scale(1.18); }
.room-type-option input:focus-visible + .room-type-card { outline: 2px solid var(--accent-light); outline-offset: 2px; }

/* ─── نوروفیدبک و نقشه مغزی ─────────────────────────────────── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.85rem; }
.course-card { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 1rem; border-radius: 18px; animation: page-rise 0.45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.course-card.is-done .ring-fill { stroke: #fbbf24; filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5)); }
.course-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.course-info a { color: inherit; text-decoration: none; }
.course-info a:hover strong { color: var(--accent-light); }
.course-info small { font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-summary { display: flex; align-items: center; gap: 1.1rem; padding: 1rem 1.25rem; border-radius: 18px; margin-bottom: 1rem; }
.course-summary h3 { margin: 0 0 0.2rem; }
.course-summary p { margin: 0; }
.mood-shift { font-size: 0.74rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; white-space: nowrap; align-self: flex-start; }
.mood-shift.up { color: #34d399; background: rgba(16, 185, 129, 0.14); }
.mood-shift.down { color: #fb7185; background: rgba(244, 63, 94, 0.14); }
.mood-trend { margin-top: 0.4rem; }
.sparkline { width: 240px; max-width: 100%; height: 56px; display: block; }
.sparkline polyline { fill: none; stroke: var(--tone-green); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: eeg-draw-once 1.6s var(--ease-out) forwards; }
.sparkline circle { fill: var(--tone-green); }
@keyframes eeg-draw-once { to { stroke-dashoffset: 0; } }

.neuro-list { display: flex; flex-direction: column; gap: 0.55rem; }
.neuro-row { display: flex; align-items: center; gap: 0.8rem; border-radius: 14px; animation: page-rise 0.4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); transition: border-color 0.2s ease, transform 0.2s ease; }
.neuro-row:hover { border-color: rgba(167, 139, 250, 0.4); transform: translateX(-2px); }
.neuro-row-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; font-size: 1.15rem; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.neuro-row-icon b { font-size: 0.95rem; }
.neuro-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.neuro-row-main small { font-size: 0.74rem; }
.neuro-row-actions { display: flex; gap: 0.2rem; }
.site-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; direction: ltr; justify-content: flex-end; }
.site-tags i { font-style: normal; font-size: 0.68rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 6px; background: rgba(6, 182, 212, 0.14); color: var(--tone-cyan); }

.neuro-form-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, 1fr); gap: 1.25rem; align-items: start; }
.neuro-map-col { position: sticky; top: 0; }
.map-label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; color: var(--text-muted); }
.eeg-map-wrap { padding: 0.75rem; border-radius: 18px; background: var(--surface-1); border: 1px solid var(--line); }
.eeg-map { width: 100%; max-width: 300px; display: block; margin: 0 auto; direction: ltr; }
.eeg-head { stroke: rgba(167, 139, 250, 0.55); stroke-width: 2; }
.eeg-nose, .eeg-ear { fill: none; stroke: rgba(167, 139, 250, 0.55); stroke-width: 2; }
.eeg-guide { stroke: var(--line); stroke-dasharray: 3 4; }
.eeg-site { cursor: pointer; outline: none; }
.eeg-site circle { fill: var(--bg-secondary); stroke: rgba(148, 163, 184, 0.55); stroke-width: 1.5; transition: fill 0.25s ease, stroke 0.25s ease, r 0.25s ease; }
.eeg-site text { font-size: 7.5px; font-weight: 700; fill: var(--text-muted); pointer-events: none; font-family: system-ui, sans-serif; }
.eeg-site:hover circle, .eeg-site:focus-visible circle { stroke: #22d3ee; stroke-width: 2; }
.eeg-site.on circle { fill: #10b981; stroke: #6ee7b7; filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.75)); animation: site-pulse 2s ease-in-out infinite; }
.eeg-site.on text { fill: #fff; }
@keyframes site-pulse { 50% { filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.9)); } }
.eeg-map-tools { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: center; margin-top: 0.6rem; }
.eeg-selected { text-align: center; font-size: 0.76rem; margin: 0.5rem 0 0; direction: rtl; }
.mood-slider label { display: flex; align-items: center; gap: 0.35rem; }
.mood-face { font-size: 1.25rem; transition: transform 0.25s var(--ease-spring); display: inline-block; }
.mood-slider input[type=range] { padding: 0; height: 6px; accent-color: #10b981; background: var(--surface-2); border-radius: 999px; }

/* ─── پیامک ───────────────────────────────────────────────── */
.sms-compose { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 0.9rem; align-items: start; }
.sms-phone { position: relative; padding: 1.4rem 0.75rem 0.75rem; border-radius: 26px; border: 2px solid var(--glass-border); background: linear-gradient(180deg, var(--surface-2), var(--surface-1)); min-height: 150px; }
.sms-phone-notch { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 56px; height: 6px; border-radius: 999px; background: var(--glass-border); }
.sms-bubble { padding: 0.6rem 0.75rem; border-radius: 16px 16px 4px 16px; background: var(--grad-cyan); color: #fff; font-size: 0.8rem; line-height: 1.7; box-shadow: 0 8px 20px rgba(6, 182, 212, 0.25); animation: modal-in 0.4s var(--ease-spring) both; white-space: pre-wrap; word-break: break-word; }
.sms-bubble .text-muted { color: rgba(255, 255, 255, 0.8); }
.sms-count { display: block; margin-top: 0.4rem; font-size: 0.7rem; color: var(--text-muted); text-align: center; }
.sms-log-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; max-height: 520px; overflow-y: auto; }
.sms-log { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.6rem 0.7rem; border-radius: 12px; background: var(--surface-1); }
.sms-log > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sms-log small { font-size: 0.72rem; }
.sms-log p { margin: 0.25rem 0 0; font-size: 0.78rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sms-log-dot { width: 9px; height: 9px; margin-top: 0.4rem; border-radius: 50%; background: #34d399; flex-shrink: 0; }
.sms-log.failed .sms-log-dot { background: #fb7185; }
.inline-form { display: flex; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.inline-form input { flex: 1; }
.cron-hint { padding: 0.8rem 0.9rem; border-radius: 14px; background: var(--surface-1); border: 1px dashed var(--line); }
.cron-hint p { margin: 0.3rem 0 0.5rem; font-size: 0.8rem; }
.cron-hint code { display: block; font-size: 0.72rem; word-break: break-all; padding: 0.4rem 0.55rem; border-radius: 8px; background: var(--surface-2); }

/* ─── فاکتورهای روز ─────────────────────────────────────── */
.day-invoice-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 55vh; overflow-y: auto; }
.day-invoice { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; transition: border-color 0.2s ease, transform 0.2s ease; }
.day-invoice:hover { border-color: var(--accent); transform: translateX(-3px); }
.day-invoice > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.day-invoice small { font-size: 0.74rem; }
.day-invoice-icon { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.day-invoice-amt { align-items: flex-end; flex: none !important; gap: 0.2rem; }

/* ─── دکمهٔ شناور افزودن سریع ─────────────────────────────────── */
.fab-wrap { position: fixed; left: 1.5rem; bottom: 1.5rem; z-index: 900; display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; pointer-events: none; }
.fab-btn {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #0ea5e9);
    box-shadow: 0 14px 34px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
    transition: transform 0.35s var(--ease-spring), box-shadow 0.3s ease, border-radius 0.35s ease;
    animation: fab-breathe 3.5s ease-in-out infinite;
    pointer-events: auto;
}
.fab-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 40px rgba(14, 165, 233, 0.5); }
.fab-plus { display: block; font-size: 2rem; line-height: 1; font-weight: 300; transition: transform 0.4s var(--ease-spring); }
.fab-wrap.open .fab-btn { border-radius: 50%; }
.fab-wrap.open .fab-plus { transform: rotate(135deg); }
@keyframes fab-breathe { 0%, 100% { box-shadow: 0 14px 34px rgba(124, 58, 237, 0.45); } 50% { box-shadow: 0 14px 40px rgba(14, 165, 233, 0.55); } }
.fab-menu { display: flex; flex-direction: column; gap: 0.45rem; pointer-events: none; }
.fab-menu button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 1rem 0.6rem 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.86rem;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(14px) scale(0.92);
    transition: opacity 0.25s ease, transform 0.35s var(--ease-spring), border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}
.fab-menu button span { font-size: 1.1rem; }
.fab-menu button:hover { border-color: var(--accent-light); }
.fab-wrap.open .fab-menu { pointer-events: auto; }
.fab-wrap.open .fab-menu button { opacity: 1; transform: none; }
.fab-wrap.open .fab-menu button:nth-child(4) { transition-delay: 0.02s; }
.fab-wrap.open .fab-menu button:nth-child(3) { transition-delay: 0.06s; }
.fab-wrap.open .fab-menu button:nth-child(2) { transition-delay: 0.1s; }
.fab-wrap.open .fab-menu button:nth-child(1) { transition-delay: 0.14s; }

/* ─── جستجوی سریع (Ctrl+K) ───────────────────────────────── */
.cmdk-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; background: rgba(2, 6, 23, 0.55); backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.18s ease; }
.cmdk-overlay.open { opacity: 1; }
.cmdk { width: min(620px, 100%); border-radius: 20px; overflow: hidden; transform: translateY(-10px) scale(0.98); transition: transform 0.3s var(--ease-spring); }
.cmdk-overlay.open .cmdk { transform: none; }
.cmdk-input-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
.cmdk-input { border: none !important; background: transparent !important; box-shadow: none !important; font-size: 1rem; padding: 0.3rem 0; }
.cmdk-list { list-style: none; max-height: 52vh; overflow-y: auto; padding: 0.4rem; }
.cmdk-item { display: flex; align-items: center; gap: 0.65rem; padding: 0.65rem 0.75rem; border-radius: 12px; cursor: pointer; transition: background 0.12s ease; }
.cmdk-item.active { background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.14)); }
.cmdk-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); flex-shrink: 0; }
.cmdk-label { flex: 1; }
.cmdk-item small { color: var(--text-muted); font-size: 0.72rem; }
.cmdk-empty { padding: 1.2rem; text-align: center; }
.cmdk-foot { display: flex; gap: 1rem; justify-content: center; padding: 0.55rem; border-top: 1px solid var(--line); font-size: 0.72rem; }

/* ─── جشن، نوار اسکرول، پیشرفت اعلان ─────────────────────────── */
.fx-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5000; }
.fx-confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: confetti-burst 1s var(--ease-out) forwards; }
@keyframes confetti-burst {
    0% { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 80px)) rotate(var(--r)); opacity: 0; }
}
#scroll-progress { position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: 4000; background: linear-gradient(90deg, #22d3ee, #8b5cf6, #ec4899); transform-origin: right; transform: scaleX(0); pointer-events: none; }
.notify-toast { position: relative; overflow: hidden; }
.notify-toast-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: currentColor; opacity: 0.35; transform-origin: right; animation: toast-progress linear forwards; }
.notify-success .notify-toast-progress { background: var(--success); opacity: 0.7; }
.notify-error .notify-toast-progress { background: var(--danger); opacity: 0.7; }
.notify-warning .notify-toast-progress { background: var(--warning); opacity: 0.7; }
.notify-info .notify-toast-progress { background: var(--cyan); opacity: 0.7; }
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ─── هماهنگی بخش‌های قدیمی با طراحی جدید ─────────────────────── */
.section-card, .glass-panel.section-card { border-radius: var(--radius-lg); }
.dash-quick-card { border-radius: 18px; overflow: hidden; }
.dash-quick-card:hover .dash-quick-emoji { transform: scale(1.15) rotate(-8deg); }
.dash-quick-emoji { transition: transform 0.35s var(--ease-spring); }
.dash-stat-bubble { border-radius: 16px; transition: transform 0.25s var(--ease-out), border-color 0.25s ease; }
.dash-stat-bubble:hover { transform: translateY(-2px); border-color: rgba(167, 139, 250, 0.35); }
.dash-stat-hint a { color: var(--accent-light); text-decoration: none; }
.tab { position: relative; transition: color 0.2s ease, background 0.2s ease; }
.tab.active::after { content: ''; position: absolute; inset: auto 15% -1px 15%; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--accent-light)); box-shadow: 0 0 10px var(--accent-glow); animation: tab-line 0.35s var(--ease-out); }
@keyframes tab-line { from { transform: scaleX(0); } }
.data-table tbody tr { transition: background 0.2s ease; }
.badge-in_progress { animation: badge-live 2s ease-in-out infinite; }
@keyframes badge-live { 50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15); } }
.profile-actions { flex-wrap: wrap; }

/* ─── تم روشن ────────────────────────────────────────────── */
[data-theme="light"] .vchart-col[data-tip]:hover::after { background: #0f172a; }
[data-theme="light"] .donut-hole { background: #f8fafc; }
[data-theme="light"] .eeg-site circle { fill: #fff; }
[data-theme="light"] .page-hero-icon { background: rgba(255, 255, 255, 0.8); }
[data-theme="light"] .fab-menu button, [data-theme="light"] .cmdk-trigger { box-shadow: 0 10px 26px rgba(15, 23, 42, 0.1); }
[data-theme="light"] .cmdk-overlay { background: rgba(15, 23, 42, 0.25); }
[data-theme="light"] .fu-alarm { box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(245, 158, 11, 0.35); }

/* ─── واکنش‌گرا ──────────────────────────────────────────── */
@media (max-width: 1100px) {
    .fu-board { grid-template-columns: 1fr; }
    .grid-2, .grid-2-wide { grid-template-columns: 1fr; }
    .neuro-form-grid { grid-template-columns: 1fr; }
    .neuro-map-col { position: static; order: -1; }
}

@media (max-width: 768px) {
    .cmdk-trigger { min-width: 0; padding: 0.55rem; }
    .cmdk-trigger span, .cmdk-trigger kbd { display: none; }
    .header-tools { gap: 0.4rem; }
    .page-hero { padding: 1.2rem; }
    .page-hero-icon { width: 48px; height: 48px; font-size: 1.5rem; }
    .page-hero-title { font-size: 1.2rem; }
    .page-hero-actions { width: 100%; }
    .page-hero-actions .btn { flex: 1; }
    .kpi-grid, .kpi-grid-4, .kpi-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
    .kpi-card { padding: 0.8rem; gap: 0.6rem; }
    .kpi-icon { width: 38px; height: 38px; font-size: 1.15rem; border-radius: 12px; }
    .kpi-value { font-size: 1.1rem; }
    .room-type-picker { grid-template-columns: 1fr; }
    .room-type-card { flex-direction: row; text-align: start; }
    .sms-compose { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr 1fr; }
    .fab-wrap { left: 1rem; bottom: 1rem; }
    .fab-btn { width: 52px; height: 52px; }
    .fu-alarm { left: 0.75rem; right: 0.75rem; bottom: 5rem; width: auto; }
    .vchart-label { font-size: 0.6rem; }
    .report-list { grid-template-columns: 1fr; }
    .sr-card { padding: 0.85rem; gap: 0.65rem; }
    .sr-avatar { width: 36px; height: 36px; }
    .donut { width: 140px; height: 140px; }
    .donut-hole { width: 90px; height: 90px; }
}

@media print {
    .fab-wrap, .fu-alarm, #scroll-progress, .header-tools, .arabesque-bg { display: none !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
}

/* ─── کاهش حرکت ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
    .arabesque-bg .aurora { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   v3.1 — نقش‌های کلینیک، اتاق‌های یکپارچه، پیامک و صیقل کلی
   ═══════════════════════════════════════════════════════════════ */
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; }
.btn-lg { padding: 0.85rem 1.4rem; font-size: 1rem; border-radius: 14px; }

/* ─── صفحهٔ انتخاب نقش ───────────────────────────────────── */
body.role-gate-route .mobile-nav-toggle, body.role-gate-route .fab-wrap { display: none !important; }
.rs-screen { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.rs-shell { width: min(980px, 100%); display: flex; flex-direction: column; align-items: center; gap: 1.75rem; }
.rs-head { text-align: center; animation: page-rise 0.6s var(--ease-out) both; }
.rs-logo { width: 84px; height: 84px; margin: 0 auto 0.85rem; border-radius: 26px; display: grid; place-items: center; background: linear-gradient(135deg, #8b5cf6, #06b6d4); box-shadow: 0 20px 50px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3); overflow: hidden; animation: hero-float 5s ease-in-out infinite; }
.rs-logo-img { width: 100%; height: 100%; object-fit: cover; }
.rs-logo-psi { font-size: 2.6rem; color: #fff; font-weight: 800; }
.rs-greet { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.rs-title { margin: 0.15rem 0; font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-light)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rs-sub { margin: 0; color: var(--text-muted); }
.rs-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; transition: opacity 0.3s ease; }
.rs-card {
    --rc: #8b5cf6;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.6rem 1rem 1.3rem;
    border-radius: 24px;
    border: 1px solid color-mix(in srgb, var(--rc) 30%, var(--glass-border));
    background: linear-gradient(170deg, color-mix(in srgb, var(--rc) 16%, transparent), var(--glass-bg));
    backdrop-filter: blur(18px);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    animation: rs-card-in 0.6s var(--ease-spring) both;
    animation-delay: calc(0.08s + var(--i) * 70ms);
    transition: transform 0.35s var(--ease-spring), box-shadow 0.35s ease, border-color 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}
@keyframes rs-card-in { from { opacity: 0; transform: translateY(26px) scale(0.92); } }
.rs-card:hover, .rs-card:focus-visible { transform: translateY(-6px) scale(1.02); border-color: var(--rc); box-shadow: 0 24px 50px color-mix(in srgb, var(--rc) 35%, transparent); }
.rs-card-glow { position: absolute; inset: -40% -20% auto; height: 120%; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--rc) 45%, transparent), transparent 60%); opacity: 0.55; pointer-events: none; transition: opacity 0.3s ease; }
.rs-card:hover .rs-card-glow { opacity: 1; }
.rs-card-icon { position: relative; width: 74px; height: 74px; display: grid; place-items: center; font-size: 2.3rem; border-radius: 24px; background: color-mix(in srgb, var(--rc) 24%, rgba(255, 255, 255, 0.05)); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); box-shadow: 0 12px 30px color-mix(in srgb, var(--rc) 30%, transparent); transition: transform 0.4s var(--ease-spring); }
.rs-card:hover .rs-card-icon { transform: scale(1.1) rotate(-6deg); }
.rs-card-name { position: relative; font-size: 1.05rem; }
.rs-card-desc { position: relative; color: var(--text-muted); font-size: 0.76rem; line-height: 1.6; }
.rs-card-tag { position: relative; font-size: 0.68rem; font-weight: 700; padding: 0.12rem 0.55rem; border-radius: 999px; background: color-mix(in srgb, var(--rc) 22%, transparent); color: var(--text-primary); }
.rs-card-lock { position: relative; font-size: 0.72rem; color: var(--warning); }
.rs-card.is-locked { filter: grayscale(0.6); }
.rs-grid.has-pick .rs-card:not(.is-picked) { opacity: 0.35; transform: scale(0.95); filter: blur(1px); }
.rs-card.is-picked { border-color: var(--rc); box-shadow: 0 0 0 2px var(--rc), 0 24px 50px color-mix(in srgb, var(--rc) 40%, transparent); transform: translateY(-4px); }
.rs-pass { --rc: #8b5cf6; width: min(420px, 100%); padding: 1.4rem; border-radius: 24px; border-color: color-mix(in srgb, var(--rc) 45%, transparent); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4), 0 0 0 1px color-mix(in srgb, var(--rc) 20%, transparent); opacity: 0; transform: translateY(16px) scale(0.97); transition: opacity 0.35s ease, transform 0.45s var(--ease-spring); }
.rs-pass.open { opacity: 1; transform: none; }
.rs-pass.shake { animation: rs-shake 0.45s ease; }
.rs-pass.success { box-shadow: 0 0 0 2px #10b981, 0 30px 70px rgba(16, 185, 129, 0.35); }
@keyframes rs-shake { 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.rs-back { background: none; border: none; color: var(--text-muted); font-family: inherit; cursor: pointer; padding: 0; margin-bottom: 0.75rem; }
.rs-back:hover { color: var(--text-primary); }
.rs-pass-role { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.rs-pass-role > div { display: flex; flex-direction: column; }
.rs-pass-role strong { font-size: 1.15rem; }
.rs-pass-icon { width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.7rem; border-radius: 17px; background: color-mix(in srgb, var(--rc) 22%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); }
.rs-input-wrap { position: relative; }
.rs-input-wrap input { font-size: 1.15rem; letter-spacing: 0.25em; padding: 0.85rem 1rem 0.85rem 3rem; border-radius: 14px; text-align: center; }
.rs-eye, .pw-eye { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1.05rem; opacity: 0.7; }
.rs-eye:hover, .pw-eye:hover { opacity: 1; }
.rs-error { min-height: 1.4rem; margin: 0.5rem 0; color: var(--danger); font-size: 0.84rem; text-align: center; }
.rs-foot { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; }

/* انتخاب مرحله‌ای منشی: یک کارت در صفحه و فهرست افراد داخل مودال */
.secretary-account-list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.35rem 0 0.6rem; }
.secretary-picker-overlay {
    background: rgba(3, 7, 18, 0.72);
    backdrop-filter: blur(14px) saturate(0.75);
    -webkit-backdrop-filter: blur(14px) saturate(0.75);
}
.secretary-picker-modal { width: min(520px, calc(100vw - 2rem)); max-width: 520px; padding: 1.4rem; overflow-x: hidden; }
.secretary-picker-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.1rem; }
.secretary-picker-head h2 { margin: 0; }
.secretary-picker-head p { margin: 0.15rem 0 0; font-size: 0.84rem; }
.secretary-picker-icon { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; border-radius: 18px; font-size: 1.8rem; background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(245, 158, 11, 0.4); box-shadow: 0 12px 28px rgba(245, 158, 11, 0.18); }
.secretary-picker-list { display: flex; flex-direction: column; gap: 0.65rem; }
.secretary-picker-person { --rc: #f59e0b; width: 100%; min-width: 0; display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 0.9rem; border: 1px solid var(--glass-border); border-radius: 16px; background: var(--surface-1); color: var(--text-primary); font-family: inherit; text-align: start; cursor: pointer; animation: page-rise 0.35s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.secretary-picker-person:hover, .secretary-picker-person:focus-visible { transform: translateY(-2px); border-color: var(--rc); background: color-mix(in srgb, var(--rc) 12%, var(--surface-1)); outline: none; }
.secretary-picker-person.is-locked, .secretary-picker-person.needs-password { opacity: 0.65; }
.secretary-picker-avatar { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--rc) 24%, var(--surface-2)); color: #fff; font-size: 1.1rem; font-weight: 800; }
.secretary-picker-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.secretary-picker-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secretary-picker-copy small { color: var(--text-muted); font-size: 0.75rem; }
.secretary-picker-arrow { color: var(--text-muted); font-size: 1.1rem; }
@media (max-width: 520px) {
    .secretary-picker-modal { width: calc(100vw - 1rem); padding: 1rem; }
    .secretary-picker-head { align-items: flex-start; }
}

/* ─── نقش در منوی کناری ────────────────────────────────────── */
.sidebar-role { --rc: #8b5cf6; display: flex; align-items: center; gap: 0.65rem; margin: 0 0.25rem 0.85rem; padding: 0.6rem 0.7rem; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--rc) 22%, transparent), transparent); border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent); flex-shrink: 0; }
.sidebar-role-icon { width: 38px; height: 38px; display: grid; place-items: center; font-size: 1.25rem; border-radius: 12px; background: color-mix(in srgb, var(--rc) 28%, transparent); }
.sidebar-role-text { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.sidebar-role-text small { font-size: 0.66rem; color: var(--text-muted); }
.sidebar-role-text strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-role-switch { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--glass-border); background: var(--surface-1); color: var(--text-primary); cursor: pointer; font-size: 1rem; transition: transform 0.35s var(--ease-spring), border-color 0.2s ease; }
.sidebar-role-switch:hover { transform: rotate(180deg); border-color: var(--rc); }
.sidebar-foot-row { display: flex; gap: 0.5rem; }
.sidebar-foot-row .btn { flex: 1; }
.role-badge { --rc: #8b5cf6; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: color-mix(in srgb, var(--rc) 18%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent); }
.role-badge i { font-style: normal; }
.role-badge.sm { font-size: 0.72rem; padding: 0.1rem 0.5rem; }

/* ─── ویزارد راه‌اندازی نقش‌ها ───────────────────────────────── */
.setup-screen { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; align-items: flex-start; padding: 2.5rem 1rem; }
.setup-shell { width: min(960px, 100%); padding: 1.75rem; border-radius: 28px; animation: modal-in 0.5s var(--ease-spring) both; }
.setup-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.4rem; }
.setup-head h1 { margin: 0 0 0.3rem; font-size: 1.45rem; }
.setup-head p { margin: 0; line-height: 1.8; }
.setup-head-icon { width: 64px; height: 64px; flex-shrink: 0; display: grid; place-items: center; font-size: 2rem; border-radius: 20px; background: linear-gradient(135deg, #6366f1, #06b6d4); box-shadow: 0 14px 34px rgba(99, 102, 241, 0.4); animation: hero-float 5s ease-in-out infinite; }
.setup-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 1.5rem; counter-reset: s; }
.setup-steps li { position: relative; display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; border-radius: 14px; background: var(--surface-1); color: var(--text-muted); font-size: 0.82rem; transition: all 0.3s ease; }
.setup-steps li span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-weight: 800; font-size: 0.78rem; flex-shrink: 0; }
.setup-steps li.active { background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.15)); color: var(--text-primary); box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.45); }
.setup-steps li.active span { background: var(--grad-violet); color: #fff; animation: badge-throb 2s ease-in-out infinite; }
.setup-steps li.done { color: var(--tone-green); }
.setup-steps li.done span { background: var(--grad-green); color: #fff; }
.setup-step { animation: page-rise 0.45s var(--ease-out) both; }
.setup-lead { color: var(--text-muted); margin: 0 0 1rem; line-height: 1.8; }
.setup-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.setup-hero-card { --rc: #8b5cf6; display: flex; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 20px; margin-bottom: 1.25rem; background: linear-gradient(135deg, color-mix(in srgb, var(--rc) 22%, transparent), transparent); border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent); }
.setup-hero-card p { margin: 0.2rem 0 0; font-size: 0.85rem; }
.setup-owner-icon { font-size: 2.4rem; animation: hero-float 4s ease-in-out infinite; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.85rem; }
.preset-card { --rc: #8b5cf6; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; padding: 1.2rem 0.9rem; border-radius: 20px; border: 1px solid var(--glass-border); background: var(--surface-1); color: var(--text-primary); font-family: inherit; cursor: pointer; transition: all 0.3s var(--ease-out); }
.preset-card small { color: var(--text-muted); font-size: 0.74rem; line-height: 1.6; }
.preset-icon { font-size: 2rem; transition: transform 0.35s var(--ease-spring); }
.preset-perms { font-size: 0.7rem; color: var(--text-muted); }
.preset-check { position: absolute; top: 0.6rem; left: 0.6rem; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 800; color: #fff; background: var(--rc); transform: scale(0); transition: transform 0.35s var(--ease-spring); }
.preset-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--rc) 50%, transparent); }
.preset-card.on { border-color: var(--rc); background: linear-gradient(170deg, color-mix(in srgb, var(--rc) 20%, transparent), var(--surface-1)); box-shadow: 0 14px 30px color-mix(in srgb, var(--rc) 25%, transparent); }
.preset-card.on .preset-check { transform: scale(1); }
.preset-card.on .preset-icon { transform: scale(1.15); }
.preset-add { border-style: dashed; }
.custom-roles { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.custom-role-row { display: flex; align-items: center; gap: 0.6rem; }
.custom-role-row input { flex: 1; }
.setup-role-list { display: flex; flex-direction: column; gap: 0.75rem; }
.setup-role { --rc: #8b5cf6; border-right: 4px solid var(--rc); padding: 0; overflow: hidden; }
.setup-role > summary { list-style: none; display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 1rem; cursor: pointer; }
.setup-role > summary::-webkit-details-marker { display: none; }
.setup-role-icon { font-size: 1.5rem; }
.setup-role-name { flex: 1; max-width: 280px; font-weight: 700; background: transparent !important; border-color: transparent !important; }
.setup-role-name:hover, .setup-role-name:focus { border-color: var(--glass-border) !important; }
.setup-role-chevron { transition: transform 0.3s ease; color: var(--text-muted); }
.setup-role[open] .setup-role-chevron { transform: rotate(180deg); }
.setup-role-body { padding: 0.25rem 1rem 1rem; animation: page-rise 0.35s var(--ease-out) both; }
.setup-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.75rem; }
.review-role { --rc: #8b5cf6; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 1rem; border-radius: 18px; background: linear-gradient(170deg, color-mix(in srgb, var(--rc) 18%, transparent), var(--surface-1)); border: 1px solid color-mix(in srgb, var(--rc) 35%, transparent); animation: rs-card-in 0.5s var(--ease-spring) both; }
.review-role span { font-size: 1.8rem; }
.review-role small { color: var(--text-muted); font-size: 0.74rem; }
.setup-note { margin-top: 1rem; line-height: 1.8; font-size: 0.86rem; }

/* ─── آیکون، رنگ و رمز ──────────────────────────────────────── */
.icon-picker, .color-picker { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.icon-picker input, .color-picker input { position: absolute; opacity: 0; }
.icon-picker span { width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.25rem; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--surface-1); cursor: pointer; transition: all 0.2s var(--ease-spring); }
.icon-picker label:hover span { transform: scale(1.1); }
.icon-picker input:checked + span { border-color: var(--accent-light); background: rgba(139, 92, 246, 0.2); transform: scale(1.12); box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3); }
.icon-picker input:focus-visible + span, .color-picker input:focus-visible + span { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.color-picker span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; border: 3px solid transparent; transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease; }
.color-picker label:hover span { transform: scale(1.12); }
.color-picker input:checked + span { border-color: var(--bg-primary); box-shadow: 0 0 0 2px var(--c), 0 6px 16px var(--c); transform: scale(1.12); }
.pw-field { position: relative; }
.pw-field input { padding-left: 2.6rem; }
.pw-meter { display: block; height: 4px; margin-top: 0.35rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 0.35s var(--ease-out), background 0.3s ease; }
.pw-meter[data-s="1"] i { width: 25%; background: #f43f5e; }
.pw-meter[data-s="2"] i { width: 50%; background: #f59e0b; }
.pw-meter[data-s="3"] i { width: 75%; background: #22d3ee; }
.pw-meter[data-s="4"] i { width: 100%; background: #10b981; }
.pw-field .pw-eye { top: 1.25rem; }

/* ─── ماتریس دسترسی ─────────────────────────────────────────── */
.perm-title { display: block; font-weight: 700; margin: 0.5rem 0 0.6rem; }
.perm-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.perm-quick { display: flex; gap: 0.35rem; }
.perm-total { font-weight: 400; font-size: 0.78rem; color: var(--text-muted); margin-inline-start: 0.4rem; }
.perm-total b { color: var(--accent-light); }
.perm-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.perm-matrix.is-locked { opacity: 0.6; pointer-events: none; }
.perm-group { border: 1px solid var(--glass-border); border-radius: 16px; padding: 0.4rem 0.75rem 0.65rem; background: var(--surface-1); min-width: 0; }
.perm-group legend { padding: 0 0.3rem; width: 100%; }
.perm-group-head { display: flex; align-items: center; gap: 0.45rem; cursor: pointer; margin: 0 !important; color: var(--text-primary) !important; }
.perm-group-head input { width: 16px; height: 16px; accent-color: #8b5cf6; flex-shrink: 0; }
.perm-group-icon { font-size: 1.05rem; }
.perm-group-head strong { flex: 1; font-size: 0.88rem; }
.perm-count { font-size: 0.7rem; font-weight: 800; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }
.perm-items { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.35rem; }
.perm-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.35rem; border-radius: 10px; cursor: pointer; margin: 0 !important; color: var(--text-primary) !important; font-size: 0.82rem !important; transition: background 0.2s ease; }
.perm-item:hover { background: var(--surface-2); }
.perm-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.perm-switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--glass-border); transition: background 0.25s ease; }
.perm-switch::after { content: ''; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition: transform 0.3s var(--ease-spring); }
.perm-item input:checked + .perm-switch { background: var(--grad-green); border-color: transparent; }
.perm-item input:checked + .perm-switch::after { transform: translateX(-14px); }
.perm-item input:focus-visible + .perm-switch { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.perm-label { flex: 1; line-height: 1.5; }
.perm-item.flash-dep { animation: field-flash 0.7s ease; }
.owner-note { line-height: 1.8; margin-bottom: 1rem; border-color: rgba(251, 191, 36, 0.35); }
.preset-strip { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: -0.25rem 0 1rem; }

/* ─── کارت‌های نقش (تنظیمات) ───────────────────────────────── */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.role-card { --rc: #8b5cf6; display: flex; flex-direction: column; gap: 0.75rem; padding: 1.1rem; border-radius: 22px; border-top: 4px solid var(--rc); animation: page-rise 0.45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.role-card.is-off { opacity: 0.6; }
.role-card-head { display: flex; align-items: center; gap: 0.75rem; }
.role-card-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.role-card-head small { font-size: 0.76rem; line-height: 1.5; }
.role-card-icon { width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center; font-size: 1.6rem; border-radius: 17px; background: color-mix(in srgb, var(--rc) 22%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent); transition: transform 0.35s var(--ease-spring); }
.role-card:hover .role-card-icon { transform: rotate(-8deg) scale(1.06); }
.role-meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.role-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rc), color-mix(in srgb, var(--rc) 50%, #fff)); animation: meter-fill 1s var(--ease-out) both; transform-origin: right; }
.role-perm-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.role-perm-chips li { font-size: 0.74rem; padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--surface-2); }
.role-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.role-card-foot small { font-size: 0.72rem; }
.role-card-actions { display: flex; gap: 0.3rem; }
.role-card-add { align-items: center; justify-content: center; text-align: center; min-height: 190px; border: 2px dashed var(--glass-border); background: transparent; color: var(--text-primary); font-family: inherit; cursor: pointer; transition: all 0.3s ease; }
.role-card-add span { font-size: 2.2rem; color: var(--accent-light); transition: transform 0.4s var(--ease-spring); }
.role-card-add:hover { border-color: var(--accent-light); background: rgba(139, 92, 246, 0.06); }
.role-card-add:hover span { transform: rotate(90deg) scale(1.15); }
.settings-roles-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; border-radius: 22px; text-decoration: none; color: inherit; border-color: rgba(99, 102, 241, 0.4); background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(6, 182, 212, 0.06)); transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease; }
.settings-roles-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.settings-roles-card > div { flex: 1; min-width: 0; }
.settings-roles-card p { margin: 0.2rem 0 0.5rem; font-size: 0.84rem; }
.settings-roles-icon { font-size: 2.2rem; }
.settings-roles-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.settings-roles-go { font-weight: 700; color: var(--accent-light); white-space: nowrap; }

/* ─── نوار نقش‌ها در گزارش پرسنل ─────────────────────────────── */
.role-strip { display: flex; gap: 0.65rem; overflow-x: auto; padding-bottom: 0.35rem; scrollbar-width: thin; }
.role-chip-card { --rc: #8b5cf6; flex: 0 0 auto; min-width: 170px; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.8rem 0.95rem; border-radius: 18px; border: 1px solid var(--glass-border); border-top: 3px solid var(--rc); background: var(--glass-bg); color: var(--text-primary); font-family: inherit; cursor: pointer; text-align: start; transition: all 0.25s var(--ease-out); }
.role-chip-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--rc) 50%, transparent); }
.role-chip-card.active { background: linear-gradient(170deg, color-mix(in srgb, var(--rc) 22%, transparent), var(--glass-bg)); box-shadow: 0 0 0 1px var(--rc), 0 12px 26px color-mix(in srgb, var(--rc) 25%, transparent); }
.rcc-icon { font-size: 1.4rem; }
.role-chip-card small { font-size: 0.72rem; color: var(--text-muted); }
.rcc-pending { color: var(--warning); }
.rcc-last { opacity: 0.8; }
.sr-card { border-right: 3px solid var(--rc, transparent); }
.sr-author { font-weight: 800; }

/* ─── اتاق‌های یکپارچه ─────────────────────────────────────── */
.room-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; }
.room-tab { --c: #8b5cf6; display: flex; align-items: center; gap: 0.65rem; padding: 0.75rem 0.85rem; border-radius: 18px; border: 1px solid var(--glass-border); background: var(--glass-bg); backdrop-filter: blur(14px); color: var(--text-primary); font-family: inherit; cursor: pointer; text-align: start; transition: all 0.3s var(--ease-out); }
.room-tab > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.room-tab strong { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-tab small { font-size: 0.72rem; color: var(--text-muted); }
.room-tab-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; font-size: 1.3rem; border-radius: 13px; background: color-mix(in srgb, var(--c) 18%, transparent); transition: transform 0.35s var(--ease-spring); }
.room-tab:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.room-tab:hover .room-tab-icon { transform: scale(1.1) rotate(-6deg); }
.room-tab.active { border-color: var(--c); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, transparent), var(--glass-bg)); box-shadow: 0 12px 28px color-mix(in srgb, var(--c) 25%, transparent); }
.room-add-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; min-height: 230px; border-radius: var(--radius-lg); border: 2px dashed var(--glass-border); background: transparent; color: var(--text-primary); font-family: inherit; cursor: pointer; animation: page-rise 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); transition: all 0.3s ease; }
.room-add-tile small { color: var(--text-muted); font-size: 0.78rem; }
.room-add-plus { width: 64px; height: 64px; display: grid; place-items: center; font-size: 2rem; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #8b5cf6, #06b6d4); box-shadow: 0 14px 30px rgba(124, 58, 237, 0.4); transition: transform 0.4s var(--ease-spring); }
.room-add-tile:hover { border-color: var(--accent-light); background: rgba(139, 92, 246, 0.06); }
.room-add-tile:hover .room-add-plus { transform: rotate(90deg) scale(1.08); }

/* ─── پیامک ───────────────────────────────────────────────── */
.sms-status-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; border-radius: 16px; }
.sms-status-bar.is-on { border-color: rgba(16, 185, 129, 0.45); background: linear-gradient(90deg, rgba(16, 185, 129, 0.14), transparent); }
.sms-status-bar.is-off { border-color: rgba(245, 158, 11, 0.45); background: linear-gradient(90deg, rgba(245, 158, 11, 0.14), transparent); }
.sms-status-dot { width: 12px; height: 12px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); animation: halo 1.8s ease-out infinite; }
.is-on .sms-status-dot { background: #10b981; animation-name: halo-green; }
@keyframes halo-green { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); } 100% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); } }
.sms-tabs { margin-bottom: 0; }
.sms-save-bar { position: sticky; bottom: 0; padding-top: 1rem; margin-top: 1rem; background: linear-gradient(180deg, transparent, var(--bg-secondary) 40%); }
.help-steps { padding-inline-start: 1.1rem; display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.84rem; line-height: 1.8; color: var(--text-muted); }
.help-steps b { color: var(--text-primary); }

/* ─── صیقل جدول‌ها، تقویم و فهرست مراجعین ─────────────────────── */
.table-wrap.glass-panel { border-radius: var(--radius-lg); overflow: hidden; }
.data-table thead th { background: var(--surface-1); font-weight: 700; letter-spacing: 0.01em; position: sticky; top: 0; backdrop-filter: blur(10px); }
.data-table tbody tr { animation: page-rise 0.4s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 20) * 25ms); }
.data-table tbody tr:hover td { background: linear-gradient(90deg, rgba(139, 92, 246, 0.08), transparent); }
.patient-row { cursor: pointer; }
.patient-cell { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.patient-cell-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; transition: transform 0.3s var(--ease-spring); }
.patient-row:hover .patient-cell-avatar { transform: scale(1.1) rotate(-6deg); }
.file-chip { font-size: 0.76rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 8px; background: var(--surface-2); color: var(--text-muted); direction: ltr; display: inline-block; }
.phone-link { color: var(--accent-light) !important; text-decoration: none; }
.search-input { border-radius: 14px; padding-inline-start: 2.4rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9cb8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.85rem center; }
.calendar-grid .cal-cell { border-radius: 14px; transition: transform 0.25s var(--ease-out), border-color 0.25s ease, box-shadow 0.25s ease; }
.calendar-grid .cal-cell.cal-clickable:hover { transform: translateY(-2px); border-color: rgba(167, 139, 250, 0.5); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2); }
.calendar-grid .cal-today { box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.7), 0 10px 24px rgba(251, 191, 36, 0.18); }
.calendar-grid .cal-event { border-radius: 7px; transition: transform 0.2s ease; }
.calendar-grid .cal-cell:hover .cal-event { transform: translateX(-2px); }
.cal-nav { border-radius: 16px; }
.profile-header { border-radius: 24px; position: relative; overflow: hidden; }
.profile-header::after { content: ''; position: absolute; inset: auto -10% -60% 40%; height: 160%; background: radial-gradient(circle, rgba(139, 92, 246, 0.18), transparent 60%); pointer-events: none; }
.profile-avatar { transition: transform 0.4s var(--ease-spring); }
.profile-header:hover .profile-avatar { transform: rotate(-6deg) scale(1.05); }
.tabs { gap: 0.25rem; padding: 0.3rem; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); }
.tab { border-radius: 12px !important; border-bottom: none !important; white-space: nowrap; }
.tab.active { background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.12)); color: var(--text-primary) !important; }
.tab.active::after { display: none; }
.empty-inline { padding: 1.5rem 0; }

@media (max-width: 900px) {
    .room-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .setup-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .rs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
    .rs-card { padding: 1.1rem 0.6rem; border-radius: 20px; }
    .rs-card-icon { width: 58px; height: 58px; font-size: 1.8rem; }
    .rs-card-desc { display: none; }
    .setup-shell { padding: 1.1rem; border-radius: 22px; }
    .setup-head { flex-direction: column; text-align: center; }
    .perm-matrix { grid-template-columns: 1fr; }
    .settings-roles-card { flex-direction: column; text-align: center; }
    .room-tab small { display: none; }
}

/* ─── بازیابی امن حساب و نقش ─────────────────────────────── */
.security-setup-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1rem; }
.security-setup-card { width: min(900px, 100%); padding: clamp(1.2rem, 3vw, 2rem); border-radius: 28px; }
.security-setup-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.security-setup-head h1 { margin: 0 0 .25rem; font-size: clamp(1.35rem, 3vw, 1.9rem); }
.security-setup-head p { margin: 0; }
.security-setup-icon, .role-request-icon { width: 64px; height: 64px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 20px; font-size: 2rem; background: linear-gradient(135deg, #7c3aed, #06b6d4); box-shadow: 0 14px 34px rgba(124,58,237,.35); }
.security-screenshot-note { margin: 1rem 0 1.4rem; line-height: 1.8; }
.security-name-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: 1rem 0; }
.security-name-grid.compact { max-height: 52vh; overflow-y: auto; padding: .15rem; }
.security-name { position: relative; min-height: 54px; padding: .8rem 2.7rem .8rem .8rem; border: 1px solid var(--glass-border); border-radius: 15px; background: var(--surface-1); color: var(--text-primary); font-family: inherit; cursor: pointer; text-align: right; transition: .2s ease; }
.security-name:hover { border-color: var(--accent); transform: translateY(-1px); }
.security-name.selected { border-color: #10b981; background: color-mix(in srgb, #10b981 15%, var(--surface-1)); box-shadow: 0 0 0 2px color-mix(in srgb, #10b981 18%, transparent); }
.security-order { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-muted); font-weight: 800; }
.security-name.selected .security-order { background: #10b981; color: white; }
.security-selection { min-height: 54px; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .7rem; border: 1px dashed var(--glass-border); border-radius: 14px; color: var(--text-muted); }
.security-selection span { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text-primary); font-size: .82rem; }
.security-selection b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: white; }
.security-ack { display: flex; align-items: flex-start; gap: .55rem; margin: 1rem 0; line-height: 1.7; cursor: pointer; }
.security-ack input { margin-top: .35rem; }
.security-actions { display: flex; justify-content: space-between; gap: .8rem; }
.role-recovery-actions { margin: .3rem 0 .8rem; }
.role-recovery-actions .alert { margin: 0; text-align: center; line-height: 1.7; }
.owner-recovery-modal { max-width: 680px; }
.role-access-request-modal { text-align: center; }
.role-access-request-modal .role-request-icon { margin: 0 auto 1rem; }
@media (max-width: 620px) {
    .security-name-grid { grid-template-columns: 1fr; }
    .security-setup-head { align-items: flex-start; }
    .security-setup-icon { width: 52px; height: 52px; font-size: 1.6rem; border-radius: 16px; }
    .security-actions { flex-direction: column-reverse; }
}

/* ─── منوی کناری فشرده و گروه‌های جمع‌شونده ───────────────── */
.sidebar { padding-top: .75rem; padding-bottom: .65rem; }
.sidebar .brand { margin-bottom: .45rem; padding-block: .3rem; }
.sidebar .jalali-today { margin-bottom: .45rem; padding-block: .5rem; }
.sidebar .subscription-badge { margin-bottom: .45rem; padding-block: .45rem; }
.sidebar .sidebar-role { margin-bottom: .45rem; }
.sidebar-nav-scroll { overscroll-behavior: contain; scrollbar-gutter: stable; padding-bottom: .35rem; }
.nav-accordion { border-radius: 13px; transition: background .2s ease; }
.nav-accordion[open] { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.nav-accordion > summary { list-style: none; display: flex; align-items: center; gap: .45rem; cursor: pointer; user-select: none; border-radius: 11px; }
.nav-accordion > summary::-webkit-details-marker { display: none; }
.nav-accordion > summary span { flex: 1; }
.nav-accordion > summary small { min-width: 22px; text-align: center; padding: .05rem .35rem; border-radius: 999px; background: var(--surface-1); font-size: .64rem; }
.nav-accordion > summary i { font-style: normal; transition: transform .25s ease; }
.nav-accordion[open] > summary i { transform: rotate(180deg); }
.nav-accordion:not([open]) + .nav-accordion { margin-top: .12rem; }
.nav-accordion .nav-links { padding-bottom: .15rem; }
.nav-scroll .nav-links a { min-height: 40px; padding-block: .4rem; }
.sidebar-footer { padding-top: .45rem; gap: .35rem; }
.sidebar-account-menu > summary { list-style: none; cursor: pointer; }
.sidebar-account-menu > summary::-webkit-details-marker { display: none; }
.sidebar-account-menu .user-badge { margin: 0; padding: .45rem .55rem; }
.account-chevron { margin-inline-start: auto; color: var(--text-muted); transition: transform .25s ease; }
.sidebar-account-menu[open] .account-chevron { transform: rotate(180deg); }
.sidebar-account-actions { display: grid; gap: .4rem; padding-top: .45rem; animation: page-rise .2s ease both; }
.patient-form-modal, .appointment-edit-modal { max-width: 720px; }
@media (max-height: 720px) {
    .sidebar .brand-sub, .sidebar .jalali-today-label { display: none; }
    .sidebar .jalali-today { padding-block: .35rem; }
    .sidebar-role-icon, .sidebar .user-avatar { width: 32px; height: 32px; }
}
@media (max-width: 768px) {
    .sidebar { width: min(var(--sidebar-w), calc(100vw - 1rem)); padding-bottom: calc(.65rem + env(safe-area-inset-bottom)); }
}

button.search-result-item { width: 100%; display: block; border: 0; background: transparent; color: var(--text-primary); font-family: inherit; text-align: right; }

.appointment-summary { display: grid; gap: .3rem; margin-bottom: 1rem; padding: .75rem .9rem; }
.appointment-summary span, .appointment-summary small { line-height: 1.65; }

/* ─── فرم افزودن/ویرایش تعرفه ─────────────────────────────── */
.tariff-modal { max-width: 620px; }
.tariff-rate-hint { margin: -.35rem 0 1rem; font-size: .78rem; }
.tariff-flags { margin-bottom: 1rem; }
.tariff-flags > label { display: flex; align-items: center; gap: .55rem; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); cursor: pointer; }
.tariff-flags input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }

/* ─── تعرفه استاندارد ۱۴۰۵ و مشخصات حرفه‌ای ─────────────── */
.tariff-derived { display: grid; gap: .35rem; margin: -.25rem 0 1rem; font-size: .82rem; }
.tariff-derived span { display: flex; justify-content: space-between; gap: .75rem; }
.tariff-standard-box, .professional-profile-box { margin: .75rem 0 1rem; padding: .9rem 1rem; }
.tariff-standard-box h4, .professional-profile-box h4 { margin: 0 0 .7rem; }
.professional-check { display: flex !important; align-items: flex-start; gap: .55rem; margin: .55rem 0; line-height: 1.65; cursor: pointer; }
.professional-check input[type="checkbox"] { width: 20px; height: 20px; margin-top: .15rem; flex: 0 0 auto; accent-color: var(--accent); }
.standard-tariff-toggle { padding: .65rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--glass-border)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
#tariff-standard-fields[hidden] { display: none; }
@media (max-width: 520px) { .tariff-derived span { display: grid; gap: .1rem; } }

.standard-tariff-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1.25rem; margin-bottom: 1rem; padding: .85rem 1rem; }
.standard-tariff-summary > div { display: grid; margin-inline-end: auto; }
.standard-tariff-summary span { white-space: nowrap; }
.standard-tariff-summary a { color: var(--accent-light); font-size: .82rem; }

.tariff-rate-inputs { grid-template-columns: 1fr 1fr minmax(120px, .6fr); }
@media (max-width: 680px) { .tariff-rate-inputs { grid-template-columns: 1fr; } }

/* مدیریت مستقل و قابل‌انتخاب پروفایل منشی‌ها در ویرایش نقش */
.secretary-profile-manager { margin-top: 1rem; }
.secretary-profile-manager-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.secretary-profile-manager-head > div { display: flex; flex-direction: column; min-width: 0; }
.secretary-profile-manager-head label { margin: 0; font-weight: 800; }
.secretary-profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.7rem; }
.secretary-profile-card { width: 100%; min-width: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "avatar main status" "avatar edit edit"; align-items: center; gap: 0.25rem 0.7rem; padding: 0.8rem; border: 1px solid var(--glass-border); border-radius: 17px; background: var(--surface-1); color: var(--text-primary); font-family: inherit; text-align: start; cursor: pointer; transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease; animation: page-rise .3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.secretary-profile-card:hover, .secretary-profile-card:focus-visible { transform: translateY(-2px); border-color: rgba(245, 158, 11, .65); outline: none; }
.secretary-profile-card.is-selected { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 10%, var(--surface-1)); box-shadow: 0 0 0 2px rgba(245, 158, 11, .16); }
.secretary-profile-avatar, .secretary-editor-avatar { display: grid; place-items: center; color: #fff; font-weight: 800; background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 8px 20px rgba(245, 158, 11, .22); }
.secretary-profile-avatar { grid-area: avatar; width: 46px; height: 46px; border-radius: 14px; }
.secretary-profile-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
.secretary-profile-main strong, .secretary-profile-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secretary-profile-main small { color: var(--text-muted); }
.secretary-profile-status { grid-area: status; display: inline-flex; align-items: center; white-space: nowrap; padding: .16rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 800; }
.secretary-profile-status.is-ready { color: #6ee7b7; background: rgba(16, 185, 129, .14); border: 1px solid rgba(16, 185, 129, .3); }
.secretary-profile-status.needs-setup { color: #fcd34d; background: rgba(245, 158, 11, .14); border: 1px solid rgba(245, 158, 11, .3); }
.secretary-profile-edit { grid-area: edit; color: var(--accent-light); font-size: .74rem; }
.secretary-profile-editor { margin-top: .85rem; padding: 1rem; border-color: rgba(245, 158, 11, .34); animation: page-rise .3s var(--ease-out) both; }
.secretary-editor-head { display: flex; align-items: center; gap: .75rem; padding-bottom: .85rem; margin-bottom: .85rem; border-bottom: 1px solid var(--glass-border); }
.secretary-editor-head > div { flex: 1; min-width: 0; }
.secretary-editor-head h3 { margin: 0; }
.secretary-editor-avatar { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px; font-size: 1.2rem; }
.secretary-editor-section { padding: .85rem 0; }
.secretary-editor-section + .secretary-editor-section { border-top: 1px dashed var(--glass-border); }
.secretary-editor-section-title { display: flex; align-items: center; gap: .65rem; margin-bottom: .75rem; }
.secretary-editor-section-title > span { font-size: 1.35rem; }
.secretary-editor-section-title > div { display: flex; flex-direction: column; }
.secretary-security-section { margin-top: .25rem; }
.secretary-security-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.secretary-creator-panel { margin-top: .8rem; padding: 1rem; border-style: dashed; }
.secretary-creator-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: .75rem; }
.secretary-creator-head > div { display: flex; flex-direction: column; }
.secretary-first-login-note { display: flex; align-items: center; gap: .55rem; padding: .7rem; border-radius: 12px; background: rgba(6, 182, 212, .08); color: var(--text-muted); }
.secretary-profile-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; min-height: 120px; padding: 1rem; border: 1px dashed var(--glass-border); border-radius: 16px; color: var(--text-muted); text-align: center; }
.secretary-profile-empty > span { font-size: 1.8rem; }
.password-checklist.compact { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-bottom: .75rem; }
.password-checklist.compact li { font-size: .72rem; }
@media (max-width: 700px) {
    .secretary-profile-manager-head, .secretary-editor-head { align-items: stretch; flex-direction: column; }
    .secretary-profile-manager-head .btn { width: 100%; }
    .secretary-profile-grid { grid-template-columns: minmax(0, 1fr); }
    .secretary-editor-head .secretary-profile-status { align-self: flex-start; }
    .secretary-security-actions .btn { width: 100%; }
}
