/* ============================================ */
/*  CRM Tamassoki — Glassmorphism Design System */
/* ============================================ */

[x-cloak] { display: none !important; }

:root {
    --brand-300: #a5b4fc;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --aqua-400: #fb923c;
    --transition-spring: cubic-bezier(.22,1,.36,1);
}

/* ─── Vazirmatn Farsi-Digits: code 0-9, display ۰-۹ ─── */
@font-face {
    font-family: 'Vazirmatn FD';
    src: url('/fonts/vazirmatn-fd/Vazirmatn-FD-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn FD';
    src: url('/fonts/vazirmatn-fd/Vazirmatn-FD-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn FD';
    src: url('/fonts/vazirmatn-fd/Vazirmatn-FD-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn FD';
    src: url('/fonts/vazirmatn-fd/Vazirmatn-FD-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn FD';
    src: url('/fonts/vazirmatn-fd/Vazirmatn-FD-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn FD';
    src: url('/fonts/vazirmatn-fd/Vazirmatn-FD-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

body, body * {
    font-family: 'Vazirmatn FD', 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

/* ─── Background Glow (on fi-body, not behind it) ─── */
.fi-body {
    background: linear-gradient(160deg, #f0f2ff 0%, #ffffff 45%, #fff7f0 100%) !important;
}
.fi-body::before,
.fi-body::after {
    content: '' !important;
    position: fixed !important;
    border-radius: 9999px !important;
    z-index: 0 !important;
    pointer-events: none !important;
}
.fi-body::before {
    top: -6rem !important;
    right: 12% !important;
    height: 26rem !important;
    width: 26rem !important;
    background: rgba(99, 102, 241, 0.18) !important;
    filter: blur(90px) !important;
    animation: crmFloaty 6s ease-in-out infinite !important;
}
.fi-body::after {
    bottom: -6rem !important;
    left: 8% !important;
    height: 22rem !important;
    width: 22rem !important;
    background: rgba(251, 146, 60, 0.14) !important;
    filter: blur(90px) !important;
    animation: crmFloaty 6s ease-in-out infinite !important;
    animation-delay: -3s !important;
}
/* make main content sit above glow */
.fi-main, .fi-main-ctn {
    position: relative !important;
    z-index: 1 !important;
}

/* ─── Stats Cards (correct selector) ─── */
.fi-wi-stats-overview-stat {
    border-radius: 1rem !important;
    border: 1px solid rgba(99,102,241,0.14) !important;
    background: rgba(255,255,255,0.92) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 4px 24px -8px rgba(99,102,241,0.18), 0 1px 3px rgba(0,0,0,0.05) !important;
    transition: all 0.4s var(--transition-spring) !important;
    overflow: hidden !important;
    position: relative !important;
}
.fi-wi-stats-overview-stat::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    height: 3px !important;
    background: linear-gradient(to left, var(--brand-400), var(--brand-500)) !important;
    opacity: 1 !important;
}
.fi-wi-stats-overview-stat:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 40px -8px rgba(99,102,241,0.28) !important;
    border-color: rgba(99,102,241,0.4) !important;
}

/* ─── Section Cards ─── */
.fi-section {
    border-radius: 1rem !important;
    border: 1px solid rgba(99,102,241,0.12) !important;
    background: rgba(255,255,255,0.92) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 4px 24px -8px rgba(0,0,0,0.08) !important;
    transition: all 0.4s var(--transition-spring) !important;
    position: relative !important;
    overflow: visible !important;
}
.fi-section::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    height: 2px !important;
    background: linear-gradient(to left, var(--brand-400), var(--aqua-400), transparent) !important;
    opacity: 1 !important;
    border-radius: 1rem 1rem 0 0 !important;
}
.fi-section:has(.choices.is-open),
.fi-section:has(.choices__list--dropdown.is-active) {
    overflow: visible !important;
    z-index: 40;
}
.choices.is-open,
.choices.is-focused {
    z-index: 50 !important;
}
.choices.is-open .choices__list--dropdown,
.choices__list--dropdown.is-active {
    z-index: 50 !important;
    overflow: visible !important;
}
.choices__list--dropdown .choices__list {
    max-height: 15rem !important;
    overflow: auto !important;
}
.fi-section:hover {
    box-shadow: 0 12px 36px -8px rgba(99,102,241,0.18) !important;
    border-color: rgba(99,102,241,0.3) !important;
}

/* ─── Table ─── */
.fi-ta-table, .fi-ta-ctn {
    border-radius: 1rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}
.fi-ta-row, .fi-ta-cell {
    transition: background 0.2s ease !important;
}
.fi-ta-row:hover, .fi-ta-row:nth-child(even) {
    background-color: rgba(99,102,241,0.03) !important;
}
.fi-ta-row:hover {
    background-color: rgba(99,102,241,0.08) !important;
}
.fi-ta-header-cell {
    background: linear-gradient(to left, rgba(99,102,241,0.08), rgba(99,102,241,0.03)) !important;
    font-weight: 700 !important;
    color: var(--brand-600) !important;
}

/* ─── Buttons ─── */
.fi-btn {
    border-radius: 0.75rem !important;
    transition: all 0.25s var(--transition-spring) !important;
    font-weight: 600 !important;
}
.fi-btn:hover {
    transform: translateY(-1px) !important;
}
.fi-btn:active {
    transform: translateY(0) scale(0.97) !important;
}
.fi-btn-primary, .fi-btn-color-primary {
    background: linear-gradient(to left, var(--brand-500), var(--brand-400)) !important;
    box-shadow: 0 2px 12px -3px rgba(99,102,241,0.45) !important;
    border-color: transparent !important;
}
.fi-btn-primary:hover, .fi-btn-color-primary:hover {
    box-shadow: 0 6px 24px -4px rgba(99,102,241,0.6) !important;
    filter: brightness(1.08) !important;
}

/* ─── Input ─── */
.fi-input {
    border-radius: 0.75rem !important;
    transition: all 0.25s var(--transition-spring) !important;
}
.fi-input:focus {
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2) !important;
    border-color: var(--brand-500) !important;
}

/* ─── Badge ─── */
.fi-badge {
    border-radius: 9999px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}

/* ─── Sidebar ─── */
.fi-main-sidebar, .fi-sidebar {
    border-left: 1px solid rgba(99,102,241,0.1) !important;
    border-right: none !important;
    background: rgba(255,255,255,0.92) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
}
.fi-sidebar-item {
    border-radius: 0.75rem !important;
    transition: all 0.25s var(--transition-spring) !important;
    margin: 2px 8px !important;
}
.fi-sidebar-item:hover {
    transform: translateX(-4px) !important;
    background-color: rgba(99,102,241,0.1) !important;
}
.fi-sidebar-item-active {
    background: linear-gradient(to left, rgba(99,102,241,0.18), rgba(99,102,241,0.04)) !important;
    color: var(--brand-600) !important;
    font-weight: 700 !important;
    position: relative !important;
}
.fi-sidebar-item-active::before {
    content: '' !important;
    position: absolute !important;
    right: -8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 4px !important;
    height: 70% !important;
    background: linear-gradient(to bottom, var(--brand-400), var(--brand-600)) !important;
    border-radius: 9999px !important;
    animation: crmPulseBar 2s ease-in-out infinite !important;
}
.fi-sidebar-group-label {
    color: var(--brand-500) !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    font-size: 0.7rem !important;
}

/* ─── Widget Grid Stagger ─── */
.fi-widgets-grid > *, .fi-wi-widget {
    animation: crmFadeUp 0.55s var(--transition-spring) both !important;
}
.fi-widgets-grid > *:nth-child(1) { animation-delay: 0.05s !important; }
.fi-widgets-grid > *:nth-child(2) { animation-delay: 0.12s !important; }
.fi-widgets-grid > *:nth-child(3) { animation-delay: 0.19s !important; }
.fi-widgets-grid > *:nth-child(4) { animation-delay: 0.26s !important; }
.fi-widgets-grid > *:nth-child(5) { animation-delay: 0.33s !important; }
.fi-widgets-grid > *:nth-child(6) { animation-delay: 0.40s !important; }
.fi-widgets-grid > *:nth-child(7) { animation-delay: 0.47s !important; }
.fi-widgets-grid > *:nth-child(8) { animation-delay: 0.54s !important; }

/* ─── Page Entry ─── */
.fi-main {
    animation: crmFadeIn 0.3s ease-out !important;
}

/* ─── Page Title ─── */
.fi-header-heading h1, .fi-page h1 {
    background: linear-gradient(to left, var(--brand-600), var(--brand-400)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ─── Card (generic) ─── */
.fi-card {
    border-radius: 1rem !important;
    transition: all 0.3s var(--transition-spring) !important;
    border: 1px solid rgba(99,102,241,0.12) !important;
}
.fi-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 32px -8px rgba(99,102,241,0.2) !important;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px !important; height: 6px !important; }
::-webkit-scrollbar-track { background: transparent !important; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.35) !important; border-radius: 9999px !important; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-500) !important; }

/* ─── Topbar ─── */
.fi-topbar {
    position: relative !important;
    z-index: 50 !important;
    overflow: visible !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    background: rgba(255,255,255,0.88) !important;
    border-bottom: 1px solid rgba(99,102,241,0.1) !important;
}
.fi-topbar .fi-dropdown-panel {
    z-index: 9999 !important;
    max-height: calc(100dvh - 5rem) !important;
}

/* ─── Modal ─── */
.fi-modal-window {
    border-radius: 1.25rem !important;
    box-shadow: 0 25px 60px -12px rgba(99,102,241,0.25) !important;
    border: 1px solid rgba(99,102,241,0.15) !important;
    max-height: calc(100dvh - 2rem) !important;
    height: auto !important;
    overflow: hidden !important;
}
.fi-modal-window .fi-modal-content {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
}
.fi-modal-window .fi-modal-content.space-y-4 {
    max-height: calc(100dvh - 180px) !important;
}

/* backdrop-filter و transform روی والد، یک containing block برای عناصر fixed می‌سازند و مودال را
   به اندازهٔ همان باکس محدود می‌کنند؛ پس برای هر باکسی که مودال دارد غیرفعال می‌شوند. */
:is(.fi-section, .glass-card, .fi-ta, .fi-ta-ctn, .fi-wi-widget, .fi-card):has(.fi-modal),
:is(.fi-section, .glass-card, .fi-ta, .fi-ta-ctn, .fi-wi-widget, .fi-card):has(.fi-modal):hover {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    filter: none !important;
    will-change: auto !important;
    contain: none !important;
}

/* مودالِ دارای تقویم/لیست بازشو: پنل‌های بازشو نباید در باکس مودال بریده یا اسکرول شوند */
.fi-modal-window:has(.fi-fo-date-time-picker, .fi-fo-select) {
    overflow: visible !important;
    max-height: none !important;
}
.fi-modal-window:has(.fi-fo-date-time-picker, .fi-fo-select) .fi-modal-content {
    overflow: visible !important;
    max-height: none !important;
}

/* ─── Glass Card (custom blade) ─── */
.glass-card {
    position: relative !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(99,102,241,0.14) !important;
    background: rgba(255,255,255,0.9) !important;
    box-shadow: 0 8px 32px -12px rgba(99,102,241,0.15) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    transition: all 0.5s var(--transition-spring) !important;
}
.glass-card:hover {
    border-color: rgba(99,102,241,0.4) !important;
    box-shadow: 0 16px 48px -12px rgba(99,102,241,0.25) !important;
    transform: translateY(-3px) !important;
}

/* ─── Chip ─── */
.chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    border-radius: 9999px !important;
    padding: 0.25rem 0.625rem !important;
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
}

/* ─── Gradient Button ─── */
.btn-gradient {
    border-radius: 0.75rem !important;
    background: linear-gradient(to left, var(--brand-500), var(--brand-400)) !important;
    padding: 0.625rem 1.25rem !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    box-shadow: 0 4px 16px -4px rgba(99,102,241,0.5) !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
}
.btn-gradient:hover {
    box-shadow: 0 6px 24px -4px rgba(99,102,241,0.65) !important;
    filter: brightness(1.1) !important;
    transform: translateY(-2px) !important;
}

/* ─── Page Glow ─── */
.page-glow {
    pointer-events: none !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    overflow: hidden !important;
}
.page-glow::before {
    content: '' !important;
    position: absolute !important;
    top: -10rem !important;
    right: 10% !important;
    height: 34rem !important;
    width: 34rem !important;
    border-radius: 9999px !important;
    background: rgba(99, 102, 241, 0.16) !important;
    filter: blur(100px) !important;
    animation: crmFloaty 5s ease-in-out infinite !important;
}
.page-glow::after {
    content: '' !important;
    position: absolute !important;
    bottom: -10rem !important;
    left: 5% !important;
    height: 30rem !important;
    width: 30rem !important;
    border-radius: 9999px !important;
    background: rgba(251, 146, 60, 0.12) !important;
    filter: blur(100px) !important;
    animation: crmFloaty 5s ease-in-out infinite !important;
    animation-delay: -2.5s !important;
}

/* ─── Progress / Stat description ─── */
.fi-wi-stats-overview-stat-value {
    background: linear-gradient(to left, var(--brand-600), var(--brand-400)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}
.fi-wi-stats-overview-stat-description {
    font-weight: 600 !important;
}

/* ─── Stagger ─── */
.stagger-1 { animation-delay: 0.05s !important; }
.stagger-2 { animation-delay: 0.15s !important; }
.stagger-3 { animation-delay: 0.25s !important; }
.stagger-4 { animation-delay: 0.35s !important; }
.stagger-5 { animation-delay: 0.45s !important; }
.stagger-6 { animation-delay: 0.55s !important; }
.stagger-7 { animation-delay: 0.65s !important; }
.stagger-8 { animation-delay: 0.75s !important; }

/* ─── Keyframes ─── */
@keyframes crmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes crmSlideUp {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes crmFadeUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes crmScaleIn {
    0% { opacity: 0; transform: scale(.92); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes crmFloaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes crmShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@keyframes crmPulseBar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes crmPulseRing {
    0% { box-shadow: 0 0 0 0 rgba(99,102,241,.5); }
    70% { box-shadow: 0 0 0 8px rgba(99,102,241,0); }
    100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}

/* ─── Animate Utilities ─── */
/* Release the transform after entrance: nested fixed Filament modals must use the viewport. */
.animate-fade-up { animation: crmFadeUp 0.6s var(--transition-spring) backwards !important; }
.animate-fade-in { animation: crmFadeIn 0.8s ease both !important; }
.animate-scale-in { animation: crmScaleIn 0.5s var(--transition-spring) backwards !important; }
.animate-floaty { animation: crmFloaty 5s ease-in-out infinite !important; }
.animate-shimmer { animation: crmShimmer 2.5s linear infinite !important; }
.animate-pulse-ring { animation: crmPulseRing 2s ease infinite !important; }


/* پاپ‌آپ یادآوری پیگیری */
.crm-reminder-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 5vh 16px; background: rgba(17, 24, 39, .55); }
.crm-reminder-card { width: 100%; max-width: 680px; padding: 20px; border-radius: 16px; background: #fff; color: #111827; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35); }
.crm-reminder-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.crm-reminder-icon { width: 32px; height: 32px; flex-shrink: 0; color: #f59e0b; }
.crm-reminder-titles { flex: 1; min-width: 0; }
.crm-reminder-titles h2 { font-size: 18px; font-weight: 700; }
.crm-reminder-titles p { font-size: 13px; color: #6b7280; }
.crm-reminder-lead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin-bottom: 16px; border-radius: 12px; background: #f9fafb; }
.crm-reminder-lead strong, .crm-reminder-lead span, .crm-reminder-lead small { display: block; }
.crm-reminder-lead span { text-align: right; color: #374151; }
.crm-reminder-lead small { margin-top: 2px; color: #6b7280; }
.crm-reminder-alert { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; margin-bottom: 16px; border-radius: 10px; font-size: 13px; background: #fffbeb; color: #92400e; }
.crm-reminder-group { margin-bottom: 16px; }
.crm-reminder-group > label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.crm-reminder-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-reminder-form { margin-bottom: 16px; }
.crm-reminder-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.dark .crm-reminder-card { background: rgb(var(--gray-900)); color: #f3f4f6; }
.dark .crm-reminder-lead { background: rgba(255, 255, 255, .05); }
.dark .crm-reminder-lead span { color: #d1d5db; }
.dark .crm-reminder-titles p, .dark .crm-reminder-lead small { color: #9ca3af; }
.dark .crm-reminder-alert { background: rgba(245, 158, 11, .12); color: #fcd34d; }
.dark .crm-reminder-footer { border-color: rgba(255, 255, 255, .1); }

/* داشبورد کارشناس */
.crm-welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 10px 30px -12px rgba(79, 70, 229, .55); }
.crm-welcome h2 { font-size: 20px; font-weight: 800; }
.crm-welcome p { margin-top: 4px; font-size: 14px; opacity: .92; }
.crm-welcome .crm-text-danger { color: #fecaca; font-weight: 700; }
.crm-welcome-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 1024px) { .crm-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.crm-kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 16px; background: #fff; border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.crm-kpi-label { font-size: 13px; font-weight: 600; color: #6b7280; }
.crm-kpi-value { font-size: 28px; font-weight: 800; line-height: 1.2; color: #111827; }
.crm-kpi-value small { font-size: 12px; font-weight: 500; color: #6b7280; }
.crm-kpi-note { font-size: 12px; color: #9ca3af; }
.crm-kpi-hero { flex-direction: row; align-items: center; gap: 14px; grid-column: span 2; }
@media (min-width: 1024px) { .crm-kpi-hero { grid-column: span 1; } }
.crm-kpi-ring { position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.crm-kpi-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.crm-kpi-ring circle { fill: none; stroke-width: 3.4; }
.crm-ring-bg { stroke: #e5e7eb; }
.crm-ring-fg { stroke-linecap: round; stroke: currentColor; }
.crm-kpi-ring strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; font-weight: 800; color: #111827; }
.crm-tone-success { color: #16a34a; } .crm-tone-warning { color: #d97706; } .crm-tone-danger { color: #dc2626; }
.crm-text-danger { color: #dc2626; }
.crm-spark { width: 100%; height: 34px; margin-top: 4px; }
.crm-spark polyline { fill: none; stroke: #7c3aed; stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.dark .crm-kpi { background: rgb(var(--gray-900)); border-color: rgba(255, 255, 255, .08); }
.dark .crm-kpi-value, .dark .crm-kpi-ring strong { color: #f3f4f6; }
.dark .crm-kpi-label, .dark .crm-kpi-value small { color: #9ca3af; }
.dark .crm-ring-bg { stroke: rgba(255, 255, 255, .12); }
.crm-followups { display: flex; flex-direction: column; gap: 8px; }
.crm-followup { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f9fafb; border-inline-start: 4px solid #f59e0b; }
.crm-followup.is-overdue { border-inline-start-color: #dc2626; background: #fef2f2; }
.crm-followup-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crm-followup-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #818cf8, #4f46e5); }
.crm-followup strong { display: block; font-size: 14px; color: #111827; }
.crm-followup span.sub { display: block; font-size: 12px; color: #6b7280; }
.crm-followup-actions { display: flex; align-items: center; gap: 8px; }
.dark .crm-followup { background: rgba(255, 255, 255, .04); }
.dark .crm-followup.is-overdue { background: rgba(220, 38, 38, .12); }
.dark .crm-followup strong { color: #f3f4f6; }

/* ارتفاع باکس کناری هم‌تراز با ستون اصلی */
.fi-wi-widget > .fi-section { height: 100%; }
@media (min-width: 1280px) { .fi-wi-widget > .crm-followups-section { min-height: 340px; } }

/* تقویم بازه‌ای شمسی (JalaliDateRangePicker) */
.crm-jrange-input { cursor: pointer; }
.crm-jrange-panel { position: fixed; z-index: 60; width: 18.5rem; max-width: calc(100vw - 16px); padding: 12px; border-radius: 12px; background: #fff; box-shadow: 0 10px 30px rgba(17, 24, 39, .16); outline: 1px solid rgba(17, 24, 39, .08); }
.crm-jrange-head { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.crm-jrange-title { flex: 1; text-align: center; font-size: 14px; font-weight: 600; color: #111827; }
.crm-jrange-nav { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #6b7280; }
.crm-jrange-nav:hover { background: #f3f4f6; color: #111827; }
.crm-jrange-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.crm-jrange-weekdays { margin-bottom: 4px; text-align: center; font-size: 12px; font-weight: 500; color: #6b7280; }
.crm-jrange-blank { height: 34px; }
.crm-jrange-day { height: 34px; font-size: 13px; color: #111827; border-radius: 8px; }
.crm-jrange-day:hover { background: #f3f4f6; }
.crm-jrange-day.is-today { color: rgb(var(--primary-600)); font-weight: 700; }
.crm-jrange-day.is-between { background: rgb(var(--primary-50)); border-radius: 0; }
.crm-jrange-day.is-start, .crm-jrange-day.is-end { background: rgb(var(--primary-600)); color: #fff; font-weight: 600; }
.crm-jrange-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f3f4f6; font-size: 12px; color: #6b7280; }
.crm-jrange-clear { color: rgb(var(--danger-600)); font-weight: 500; }
.crm-jrange-clear:hover { text-decoration: underline; }
.dark .crm-jrange-panel { background: rgb(var(--gray-900)); outline-color: rgba(255, 255, 255, .1); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.dark .crm-jrange-title, .dark .crm-jrange-day { color: #f3f4f6; }
.dark .crm-jrange-nav { color: #9ca3af; }
.dark .crm-jrange-nav:hover, .dark .crm-jrange-day:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.dark .crm-jrange-day.is-today { color: rgb(var(--primary-400)); }
.dark .crm-jrange-day.is-between { background: rgba(var(--primary-500), .2); }
.dark .crm-jrange-day.is-start, .dark .crm-jrange-day.is-end { background: rgb(var(--primary-500)); color: #fff; }
.dark .crm-jrange-foot { border-top-color: rgba(255, 255, 255, .1); color: #9ca3af; }

/* باکس بازه هم‌عرض فیلترهای دیگر است؛ در ستون باریک، آیکون حذف و متن فشرده می‌شود تا بازه بریده نشود. */
.crm-jrange-anchor { container-type: inline-size; }
@container (max-width: 220px) {
    .crm-jrange-anchor .fi-input-wrp-suffix { display: none; }
}
@container (max-width: 170px) {
    .crm-jrange-anchor .crm-jrange-input { padding-inline: 6px; font-size: 12px; }
}

/* ============================================ */
/*  صفحهٔ ورود دوستونی (App\Filament\Pages\Auth\Login) */
/*  دسکتاپ: دقیقاً هم‌اندازهٔ صفحه، بدون اسکرول؛ تصویر کامل و بدون برش */
/* ============================================ */
.fi-simple-main:has(.crm-login) {
    margin: 0 !important; padding: 0 !important; max-width: none !important;
    background: transparent !important; box-shadow: none !important; border-radius: 0 !important;
    --tw-ring-shadow: 0 0 #0000 !important;
}
.fi-simple-main:has(.crm-login) .fi-simple-header { display: none !important; }
.fi-simple-main:has(.crm-login) .fi-simple-page > section { gap: 0 !important; display: block !important; }
.fi-simple-layout:has(.crm-login) { background: #f5f6fb; min-height: 100dvh; }
html.dark .fi-simple-layout:has(.crm-login) { background: #0b1020; }

.crm-login { display: flex; width: 100%; height: 100dvh; overflow: hidden; }

.crm-login__form-side {
    flex: 0 0 40%; display: flex; align-items: center; justify-content: center;
    padding: 2rem; position: relative; overflow-y: auto;
}
.crm-login__form-side::before {
    content: ""; position: absolute; width: 28rem; height: 28rem; border-radius: 9999px;
    background: radial-gradient(circle, rgba(99,102,241,.16), transparent 70%);
    top: -8rem; right: -10rem; pointer-events: none;
}
.crm-login__form-wrap { position: relative; width: 100%; max-width: 25rem; margin: auto 0; }

.crm-login__brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 2rem; }
.crm-login__brand-mark {
    display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .9rem; color: #fff;
    background: linear-gradient(135deg, var(--brand-500), #2563eb);
    box-shadow: 0 10px 24px -8px rgba(79,70,229,.55);
}
.crm-login__brand-name { font-weight: 800; font-size: 1.1rem; color: #1e1b4b; letter-spacing: -.01em; }
html.dark .crm-login__brand-name { color: #e0e7ff; }

.crm-login__title { font-size: 1.85rem; font-weight: 800; color: #0f172a; margin: 0 0 .5rem; }
html.dark .crm-login__title { color: #f8fafc; }
.crm-login__subtitle { color: #64748b; font-size: .92rem; line-height: 1.9; margin: 0 0 1.75rem; }
html.dark .crm-login__subtitle { color: #94a3b8; }

.crm-login__form .fi-input-wrp { border-radius: .8rem; min-height: 2.9rem; }
.crm-login__form .fi-btn { border-radius: .8rem; min-height: 2.9rem; font-weight: 700;
    background: linear-gradient(135deg, var(--brand-500), #2563eb) !important;
    box-shadow: 0 12px 24px -10px rgba(79,70,229,.6); transition: transform .2s var(--transition-spring), box-shadow .2s; }
.crm-login__form .fi-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 28px -10px rgba(79,70,229,.7); }

.crm-login__footer { margin-top: 2rem; text-align: center; font-size: .78rem; color: #94a3b8; }

/* تصویر کامل با نسبت اصلی، وسط ستون؛ هرگز برش نمی‌خورد */
.crm-login__media {
    flex: 1 1 60%; min-width: 0; display: flex; align-items: center; justify-content: center;
    padding: 1.25rem;
}
.crm-login__media picture { display: contents; }
.crm-login__media img {
    display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
    object-fit: contain; border-radius: 1.5rem;
    box-shadow: 0 30px 60px -30px rgba(15,23,42,.6);
}

@media (max-width: 1023px) {
    .crm-login { flex-direction: column; height: auto; min-height: 100dvh; overflow: visible; }
    .crm-login__media { order: -1; flex: 0 0 auto; padding: .75rem .75rem 0; }
    .crm-login__media img { width: 100%; max-height: none; border-radius: 1.1rem; }
    .crm-login__form-side { flex: 1 1 auto; padding: 1.75rem 1rem 2.5rem; overflow: visible; }
    .crm-login__brand { margin-bottom: 1.25rem; }
}@media (max-width: 1023px) {
    .crm-login__form-side { padding: 1.1rem 1rem 1rem; }
    .crm-login__brand { margin-bottom: .75rem; }
    .crm-login__brand-mark { width: 2.25rem; height: 2.25rem; }
    .crm-login__title { font-size: 1.45rem; margin-bottom: .25rem; }
    .crm-login__subtitle { font-size: .85rem; line-height: 1.7; margin-bottom: 1rem; }
    .crm-login__footer { margin-top: 1rem; }
}