/*
 * Hooshmand Sarma — admin panel theme.
 *
 * Idea: the refrigeration cycle. Copper (the warm inlet of the tube) flows
 * into ice (the frosted outlet). That one gradient — the "cycle line" — is
 * the signature; it marks the topbar, the active navigation item, the page
 * title and the sign-in card. Everything else stays quiet: glacier-ink
 * chrome, frost-white work surface, rounded calm cards.
 *
 * Filament ships its CSS inside cascade layers, so these unlayered rules win
 * without !important. Palettes (primary/gray/warning) come from the panel
 * provider; this file only shapes surfaces.
 */

:root {
    --hs-glacier: oklch(0.235 0.042 228);
    --hs-glacier-2: oklch(0.285 0.046 226);
    --hs-glacier-line: oklch(1 0 0 / 0.08);
    --hs-copper: oklch(0.66 0.14 48);
    --hs-ice: oklch(0.86 0.07 210);
    --hs-on-glacier: oklch(0.9 0.018 220);
    --hs-on-glacier-muted: oklch(0.7 0.035 222);
    --hs-cycle: linear-gradient(to left, var(--hs-copper), var(--primary-500) 55%, var(--hs-ice));
    --hs-cycle-v: linear-gradient(to bottom, var(--hs-copper), var(--primary-400) 60%, var(--hs-ice));
    --hs-card-shadow: 0 1px 2px oklch(0.235 0.042 228 / 0.05), 0 10px 28px -14px oklch(0.235 0.042 228 / 0.18);
    --radius-card: 1rem;
}

html.dark {
    --hs-glacier: oklch(0.2 0.035 232);
    --hs-glacier-2: oklch(0.25 0.04 230);
    --hs-card-shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 12px 30px -16px oklch(0 0 0 / 0.6);
}

/* ---------- Work surface ---------- */

.fi-body {
    background:
        radial-gradient(900px 340px at 100% -120px, color-mix(in oklab, var(--primary-100) 70%, transparent), transparent 70%),
        radial-gradient(700px 300px at 0% 0%, color-mix(in oklab, var(--warning-50) 80%, transparent), transparent 70%),
        var(--gray-50);
    background-attachment: fixed;
    line-height: 1.75;
}

html.dark .fi-body {
    background:
        radial-gradient(900px 340px at 100% -120px, color-mix(in oklab, var(--primary-900) 35%, transparent), transparent 70%),
        var(--gray-950);
    background-attachment: fixed;
}

::selection {
    background: color-mix(in oklab, var(--primary-300) 55%, transparent);
}

/* ---------- Brand ---------- */

.hs-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--hs-glacier);
    white-space: nowrap;
}

.hs-brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    flex: none;
}

.hs-brand-tile {
    fill: var(--hs-glacier);
}

.hs-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.hs-brand-text strong {
    font-size: 1.05rem;
    font-weight: 700;
}

.hs-brand-text small {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.68;
}

html.dark .hs-brand,
.fi-topbar .hs-brand,
.fi-sidebar-header .hs-brand {
    color: #fff;
}

.fi-topbar .hs-brand-tile,
.fi-sidebar-header .hs-brand-tile,
html.dark .hs-brand-tile {
    fill: oklch(1 0 0 / 0.07);
}

/* ---------- Topbar: glacier band with the cycle line underneath ---------- */

.fi-topbar {
    position: relative;
    background-color: var(--hs-glacier);
    box-shadow: 0 6px 20px -12px oklch(0.235 0.042 228 / 0.7);
    color: var(--hs-on-glacier);
}

.fi-topbar::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 3px;
    background: var(--hs-cycle);
    pointer-events: none;
}

html.dark .fi-topbar {
    background-color: var(--hs-glacier);
}

.fi-topbar .fi-icon-btn {
    color: var(--hs-on-glacier-muted);
}

.fi-topbar .fi-icon-btn:hover,
.fi-topbar .fi-icon-btn:focus-visible {
    color: #fff;
    background-color: oklch(1 0 0 / 0.08);
}

.fi-topbar .fi-global-search-field .fi-input-wrp {
    background-color: oklch(1 0 0 / 0.07);
    --tw-ring-color: oklch(1 0 0 / 0.12);
    --tw-shadow: 0 0 #0000;
}

.fi-topbar .fi-global-search-field .fi-input-wrp:focus-within {
    background-color: oklch(1 0 0 / 0.12);
    --tw-ring-color: var(--primary-400);
}

.fi-topbar .fi-global-search-field .fi-input {
    color: #fff;
}

.fi-topbar .fi-global-search-field .fi-input::placeholder,
.fi-topbar .fi-global-search-field .fi-icon {
    color: var(--hs-on-glacier-muted);
}

.fi-topbar .fi-user-avatar {
    box-shadow: 0 0 0 2px var(--hs-glacier), 0 0 0 3.5px color-mix(in oklab, var(--hs-copper) 70%, transparent);
}

/* ---------- Sidebar: the glacier column ---------- */

.fi-main-sidebar {
    background-color: var(--hs-glacier);
    background-image: linear-gradient(to bottom, transparent 60%, var(--hs-glacier-2));
}

@media (min-width: 1024px) {
    .fi-main-sidebar,
    html.dark .fi-main-sidebar {
        background-color: var(--hs-glacier);
    }
}

.fi-body-has-topbar .fi-sidebar-header {
    background-color: var(--hs-glacier);
    --tw-ring-color: var(--hs-glacier-line);
}

.fi-sidebar-nav {
    scrollbar-color: oklch(1 0 0 / 0.16) transparent;
    scrollbar-width: thin;
}

.fi-sidebar-group-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--hs-on-glacier-muted);
}

.fi-sidebar-group-label::before {
    content: '';
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--hs-copper);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--hs-copper) 22%, transparent);
    flex: none;
}

.fi-sidebar-group-btn .fi-icon,
.fi-sidebar-group-dropdown-trigger-btn .fi-icon {
    color: var(--hs-on-glacier-muted);
}

.fi-sidebar-item-label {
    color: var(--hs-on-glacier);
}

.fi-sidebar-item-btn > .fi-icon {
    color: var(--hs-on-glacier-muted);
}

.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover,
.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:focus-visible,
.fi-sidebar-group-dropdown-trigger-btn:hover {
    background-color: oklch(1 0 0 / 0.06);
}

.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:focus-visible {
    box-shadow: inset 0 0 0 1.5px var(--primary-400);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: linear-gradient(to left, color-mix(in oklab, var(--primary-500) 30%, transparent), oklch(1 0 0 / 0.03));
}

html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: linear-gradient(to left, color-mix(in oklab, var(--primary-500) 26%, transparent), oklch(1 0 0 / 0.03));
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn::before {
    content: '';
    position: absolute;
    inset-inline-start: -0.5rem;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 3px;
    border-radius: 3px;
    background: var(--hs-cycle-v);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label,
html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: #fff;
    font-weight: 600;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon,
html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon {
    color: var(--hs-ice);
}

.fi-sidebar-item-grouped-border-part-not-first,
.fi-sidebar-item-grouped-border-part-not-last {
    background-color: oklch(1 0 0 / 0.14);
}

.fi-sidebar-item-grouped-border-part {
    background-color: oklch(1 0 0 / 0.3);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-grouped-border > .fi-sidebar-item-grouped-border-part {
    background-color: var(--hs-ice);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--hs-ice) 25%, transparent);
}

.fi-sidebar .fi-badge {
    --tw-ring-color: transparent;
}

/* ---------- Page header: title carries a short cycle line ---------- */

.fi-header-heading {
    position: relative;
    padding-bottom: 0.6rem;
    color: var(--hs-glacier);
    letter-spacing: 0;
}

html.dark .fi-header-heading {
    color: #fff;
}

.fi-header-heading::after {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    width: 3.25rem;
    height: 3px;
    border-radius: 3px;
    background: var(--hs-cycle);
}

.fi-header-subheading {
    margin-top: 0.6rem;
}

/* ---------- Cards: sections, tables, stats, widgets ---------- */

.fi-section:not(.fi-section-not-contained):not(.fi-aside),
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-chart .fi-section {
    border-radius: var(--radius-card);
    box-shadow: var(--hs-card-shadow);
    --tw-ring-color: color-mix(in oklab, var(--gray-300) 55%, transparent);
}

html.dark .fi-section:not(.fi-section-not-contained):not(.fi-aside),
html.dark .fi-ta-ctn,
html.dark .fi-wi-stats-overview-stat {
    box-shadow: var(--hs-card-shadow), inset 0 1px 0 oklch(1 0 0 / 0.04);
}

.fi-section-header-heading {
    font-weight: 700;
    color: var(--hs-glacier);
}

html.dark .fi-section-header-heading {
    color: #fff;
}

.fi-wi-stats-overview-stat {
    position: relative;
    overflow: hidden;
}

.fi-wi-stats-overview-stat::before {
    content: '';
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 1.5rem;
    width: 2rem;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--hs-copper);
}

.fi-wi-stats-overview-stat-label {
    font-weight: 500;
}

.fi-wi-stats-overview-stat-value {
    color: var(--hs-glacier);
    letter-spacing: 0;
}

html.dark .fi-wi-stats-overview-stat-value {
    color: #fff;
}

/* Tables: a frosted header row, roomier rows */
.fi-ta-ctn {
    overflow: hidden;
}

.fi-ta-header-cell {
    background-color: color-mix(in oklab, var(--primary-50) 60%, var(--gray-50));
    color: var(--gray-600);
    font-size: 0.8rem;
}

html.dark .fi-ta-header-cell {
    background-color: oklch(1 0 0 / 0.03);
    color: var(--gray-300);
}

.fi-ta-row {
    transition: background-color 120ms ease;
}

/* ---------- Controls ---------- */

.fi-btn {
    border-radius: 0.7rem;
    font-weight: 600;
}

.fi-btn.fi-color-primary:not(.fi-outlined):not(.fi-link) {
    box-shadow: 0 6px 16px -8px color-mix(in oklab, var(--primary-600) 80%, transparent), inset 0 1px 0 oklch(1 0 0 / 0.18);
}

.fi-input-wrp {
    border-radius: 0.7rem;
    transition: box-shadow 120ms ease, background-color 120ms ease;
}

.fi-input-wrp:focus-within:not(.fi-disabled) {
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow),
        0 0 0 4px color-mix(in oklab, var(--primary-500) 14%, transparent);
}

.fi-fo-field-label-content {
    font-weight: 600;
}

.fi-tabs-item.fi-active {
    box-shadow: inset 0 -2px 0 var(--primary-500);
}

.fi-dropdown-panel {
    border-radius: 0.9rem;
}

.fi-modal-window {
    border-radius: 1.25rem;
}

@media (max-width: 639px) {
    .fi-modal-window {
        border-radius: 1.25rem 1.25rem 0 0;
    }
}

.fi-badge {
    border-radius: 999px;
}

/* ---------- Sign-in: the coil on a glacier wall ---------- */

.fi-body:has(.fi-simple-layout) {
    background:
        radial-gradient(800px 500px at 90% 110%, color-mix(in oklab, var(--primary-500) 22%, transparent), transparent 70%),
        radial-gradient(600px 400px at 10% -10%, color-mix(in oklab, var(--hs-copper) 18%, transparent), transparent 70%),
        var(--hs-glacier);
}

.fi-simple-layout {
    background: url('coil.svg') no-repeat;
    background-size: auto min(92dvh, 860px);
    background-position: left -60px center;
}

@media (max-width: 899px) {
    .fi-simple-layout {
        background-size: auto 70dvh;
        background-position: left -180px bottom -80px;
        opacity: 1;
    }
}

.fi-simple-layout-header .fi-icon-btn {
    color: var(--hs-on-glacier-muted);
}

.fi-simple-main {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    box-shadow: 0 40px 90px -30px oklch(0 0 0 / 0.65), 0 0 0 1px oklch(1 0 0 / 0.06);
}

.fi-simple-main::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 4px;
    background: var(--hs-cycle);
}

.fi-simple-header .fi-logo {
    margin-bottom: 0.5rem;
}

.fi-simple-header-heading {
    color: var(--hs-glacier);
    letter-spacing: 0;
}

html.dark .fi-simple-header-heading {
    color: #fff;
}

/* ---------- Sidebar groups: the cycle runs down the menu, copper to ice ---------- */

/* Group 1 is the unlabelled «داشبورد» group; the labelled ones start at 2. */
.fi-sidebar-nav-groups > .fi-sidebar-group:nth-child(2) .fi-sidebar-group-label::before { --hs-dot: var(--hs-copper); }
.fi-sidebar-nav-groups > .fi-sidebar-group:nth-child(3) .fi-sidebar-group-label::before { --hs-dot: color-mix(in oklab, var(--hs-copper) 80%, var(--hs-ice)); }
.fi-sidebar-nav-groups > .fi-sidebar-group:nth-child(4) .fi-sidebar-group-label::before { --hs-dot: color-mix(in oklab, var(--hs-copper) 60%, var(--primary-400)); }
.fi-sidebar-nav-groups > .fi-sidebar-group:nth-child(5) .fi-sidebar-group-label::before { --hs-dot: color-mix(in oklab, var(--hs-copper) 30%, var(--primary-400)); }
.fi-sidebar-nav-groups > .fi-sidebar-group:nth-child(6) .fi-sidebar-group-label::before { --hs-dot: var(--primary-400); }
.fi-sidebar-nav-groups > .fi-sidebar-group:nth-child(n + 7) .fi-sidebar-group-label::before { --hs-dot: var(--hs-ice); }

.fi-sidebar-nav-groups > .fi-sidebar-group .fi-sidebar-group-label::before {
    background: var(--hs-dot, var(--hs-copper));
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--hs-dot, var(--hs-copper)) 22%, transparent);
}

.fi-sidebar-item-btn > .fi-icon {
    transition: transform 160ms ease, color 160ms ease;
}

.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover > .fi-icon {
    color: var(--hs-ice);
    transform: translateX(-2px);
}

/* ---------- Loading bar: the cycle line, moving ---------- */

#nprogress .bar {
    background: var(--hs-cycle) !important;
    height: 3px !important;
}

#nprogress .peg {
    box-shadow: 0 0 10px var(--hs-ice), 0 0 5px var(--hs-ice) !important;
}

/* ---------- Page entrance ---------- */

/*
 * `backwards`, not `both`: an animation on `transform` that stays in effect
 * after it ends makes the page the containing block of every fixed element
 * inside it, so an action's modal opened in a relation manager was placed on
 * the page instead of the window and could not be scrolled.
 */
.fi-page-content,
.fi-page-header-main-ctn {
    animation: hs-rise 260ms ease-out backwards;
}

.fi-page-content {
    animation-delay: 40ms;
}

@keyframes hs-rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Dashboard greeting ---------- */

.hs-welcome {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1.6rem 1.75rem;
    border-radius: 1.25rem;
    color: var(--hs-on-glacier);
    background:
        radial-gradient(520px 260px at 0% 130%, color-mix(in oklab, var(--primary-500) 40%, transparent), transparent 70%),
        radial-gradient(420px 220px at 100% -40%, color-mix(in oklab, var(--hs-copper) 30%, transparent), transparent 70%),
        var(--hs-glacier);
    box-shadow: var(--hs-card-shadow);
}

.hs-welcome::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 3px;
    background: var(--hs-cycle);
}

.hs-welcome-text {
    position: relative;
    z-index: 1;
    max-width: 40rem;
}

.hs-welcome-date {
    margin: 0;
    font-size: 0.82rem;
    color: var(--hs-on-glacier-muted);
}

.hs-welcome h2 {
    margin: 0.15rem 0 0.4rem;
    font-size: 1.55rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.5;
}

.hs-welcome-season {
    margin: 0;
    font-size: 0.92rem;
    color: var(--hs-on-glacier);
}

.hs-welcome-season b {
    display: inline-block;
    margin-inline-end: 0.35rem;
    padding: 0 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: color-mix(in oklab, var(--hs-copper) 55%, transparent);
}

.hs-welcome-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hs-welcome-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.8rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    background: oklch(1 0 0 / 0.08);
    box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.1);
    transition: background-color 140ms ease, transform 140ms ease;
}

.hs-welcome-actions a:hover,
.hs-welcome-actions a:focus-visible {
    background: oklch(1 0 0 / 0.16);
    transform: translateY(-1px);
}

.hs-welcome-actions a:focus-visible {
    outline: 2px solid var(--hs-ice);
    outline-offset: 2px;
}

.hs-welcome-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--hs-ice);
}

.hs-welcome-coil {
    position: absolute;
    inset-inline-end: 22%;
    top: -60px;
    width: 220px;
    height: 360px;
    background: url('coil.svg') no-repeat center / contain;
    opacity: 0.18;
    transform: rotate(90deg);
    pointer-events: none;
}

@media (max-width: 767px) {
    .hs-welcome { padding: 1.3rem 1.2rem; }
    .hs-welcome h2 { font-size: 1.3rem; }
    .hs-welcome-coil { display: none; }
}

/* ---------- Empty states and notifications ---------- */

.fi-ta-empty-state-icon-bg {
    background: linear-gradient(to bottom, var(--primary-50), var(--primary-100));
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary-300) 50%, transparent);
    border-radius: 1rem;
}

.fi-ta-empty-state-icon-bg .fi-icon {
    color: var(--primary-600);
}

html.dark .fi-ta-empty-state-icon-bg {
    background: color-mix(in oklab, var(--primary-500) 14%, transparent);
}

.fi-no-notification {
    position: relative;
    border-radius: 1rem;
}

.fi-no-notification::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: var(--hs-cycle);
}

/* ---------- Sign-in: frost drifting past the coil ---------- */

.fi-body:has(.fi-simple-layout)::before {
    content: '';
    position: fixed;
    inset: -200px 0 0;
    pointer-events: none;
    background-image:
        radial-gradient(1.5px 1.5px at 20px 30px, oklch(1 0 0 / 0.55), transparent),
        radial-gradient(1px 1px at 80px 120px, oklch(1 0 0 / 0.45), transparent),
        radial-gradient(2px 2px at 150px 60px, oklch(0.9 0.05 210 / 0.5), transparent),
        radial-gradient(1px 1px at 190px 170px, oklch(1 0 0 / 0.4), transparent),
        radial-gradient(1.5px 1.5px at 110px 190px, oklch(0.9 0.05 210 / 0.45), transparent);
    background-size: 210px 210px;
    animation: hs-frost 28s linear infinite;
    opacity: 0.7;
}

@keyframes hs-frost {
    from { transform: translateY(0); }
    to { transform: translateY(210px); }
}

.fi-simple-main::after {
    content: 'سامانهٔ داخلی تیم فروش، اجرا و خدمات';
    display: block;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--gray-200);
    text-align: center;
    font-size: 0.78rem;
    color: var(--gray-500);
}

html.dark .fi-simple-main::after {
    border-top-color: oklch(1 0 0 / 0.1);
}

/* ---------- Greeting card: today's counts ---------- */

.hs-welcome-today {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.hs-welcome-today a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: oklch(1 0 0 / 0.07);
}

.hs-welcome-today a::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 99px;
    background: var(--hs-ice);
}

.hs-welcome-today a.hs-tone-copper::before {
    background: var(--hs-copper);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--hs-copper) 30%, transparent);
}

.hs-welcome-today a:hover {
    background: oklch(1 0 0 / 0.14);
}

/* ---------- Global search: a «/» key cap ---------- */

@media (min-width: 1024px) {
    .fi-topbar .fi-global-search-field .fi-input-wrp {
        position: relative;
    }

    .fi-topbar .fi-global-search-field .fi-input-wrp::after {
        content: '/';
        position: absolute;
        inset-inline-end: 0.55rem;
        top: 50%;
        transform: translateY(-50%);
        min-width: 1.3rem;
        padding: 0 0.3rem;
        border-radius: 0.35rem;
        font-size: 0.75rem;
        line-height: 1.3rem;
        text-align: center;
        color: var(--hs-on-glacier-muted);
        box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.18);
        pointer-events: none;
    }

    .fi-topbar .fi-global-search-field .fi-input-wrp:focus-within::after {
        opacity: 0;
    }
}

/* ---------- Loading widgets: a frost shimmer instead of a blank pulse ---------- */

.fi-loading-section {
    animation: none;
    background:
        linear-gradient(100deg, transparent 30%, color-mix(in oklab, var(--primary-100) 70%, transparent) 50%, transparent 70%) no-repeat,
        var(--color-white);
    background-size: 200% 100%, auto;
    animation: hs-shimmer 1.4s ease-in-out infinite;
}

html.dark .fi-loading-section {
    background:
        linear-gradient(100deg, transparent 30%, oklch(1 0 0 / 0.05) 50%, transparent 70%) no-repeat,
        var(--gray-900);
    background-size: 200% 100%, auto;
}

@keyframes hs-shimmer {
    from { background-position: 150% 0, 0 0; }
    to { background-position: -50% 0, 0 0; }
}

/* ---------- Tables: tabular figures and a copper hover mark ---------- */

.fi-ta-table {
    font-variant-numeric: tabular-nums;
}

.fi-ta-row:hover > td:first-child {
    box-shadow: inset -3px 0 0 var(--hs-copper);
}

.fi-ta-row:hover {
    background-color: color-mix(in oklab, var(--primary-50) 55%, transparent);
}

html.dark .fi-ta-row:hover {
    background-color: oklch(1 0 0 / 0.03);
}

/* ---------- Print: just the page content ---------- */

@media print {
    .fi-topbar-ctn,
    .fi-sidebar,
    .fi-sidebar-close-overlay,
    .proposal-journey,
    .hs-welcome-actions,
    .fi-header-actions-ctn,
    .fi-ta-header-toolbar,
    .fi-pagination {
        display: none !important;
    }

    .fi-body {
        background: #fff !important;
    }

    .fi-main-ctn {
        margin: 0 !important;
    }

    .fi-section,
    .fi-ta-ctn,
    .fi-wi-stats-overview-stat {
        box-shadow: none !important;
        break-inside: avoid;
    }
}

/* ---------- «میز کار من»: role work queues ---------- */

.hs-desk {
    padding: 1.25rem 1.35rem 1.35rem;
    border-radius: var(--radius-card);
    background: var(--color-white);
    box-shadow: var(--hs-card-shadow), 0 0 0 1px color-mix(in oklab, var(--gray-300) 55%, transparent);
}

html.dark .hs-desk {
    background: var(--gray-900);
    box-shadow: var(--hs-card-shadow), 0 0 0 1px oklch(1 0 0 / 0.08);
}

.hs-desk-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.hs-desk-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hs-glacier);
}

html.dark .hs-desk-head h2 {
    color: #fff;
}

.hs-desk-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.8rem;
    background: var(--gray-100);
}

html.dark .hs-desk-tabs {
    background: oklch(1 0 0 / 0.05);
}

.hs-desk-tabs button {
    padding: 0.3rem 0.9rem;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
    transition: background-color 140ms ease, color 140ms ease;
}

.hs-desk-tabs button:hover {
    color: var(--gray-800);
}

.hs-desk-tabs button.is-active {
    color: #fff;
    background: var(--hs-glacier);
    box-shadow: 0 4px 10px -4px oklch(0.235 0.042 228 / 0.6);
}

html.dark .hs-desk-tabs button.is-active {
    background: var(--primary-600);
}

.hs-desk-tabs button:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 1px;
}

.hs-desk-lanes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.9rem;
}

.hs-lane {
    min-width: 0;
    padding: 0.85rem 0.9rem 0.6rem;
    border-radius: 0.9rem;
    background: color-mix(in oklab, var(--primary-50) 60%, var(--gray-50));
}

html.dark .hs-lane {
    background: oklch(1 0 0 / 0.03);
}

.hs-lane > header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.hs-lane h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700);
}

html.dark .hs-lane h3 {
    color: var(--gray-200);
}

.hs-lane > header a {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-600);
}

.hs-lane ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hs-lane li + li {
    border-top: 1px dashed color-mix(in oklab, var(--gray-300) 70%, transparent);
}

html.dark .hs-lane li + li {
    border-top-color: oklch(1 0 0 / 0.08);
}

.hs-lane li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-inline: -0.4rem;
    padding: 0.5rem 0.4rem;
    border-radius: 0.55rem;
    transition: background-color 120ms ease;
}

.hs-lane li a:hover,
.hs-lane li a:focus-visible {
    background: color-mix(in oklab, var(--color-white) 80%, transparent);
}

html.dark .hs-lane li a:hover {
    background: oklch(1 0 0 / 0.04);
}

.hs-row-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hs-row-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--gray-900);
}

html.dark .hs-row-main strong {
    color: var(--gray-100);
}

.hs-row-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.74rem;
    color: var(--gray-500);
}

.hs-row-bar {
    display: block;
    height: 4px;
    margin-top: 0.3rem;
    border-radius: 99px;
    background:
        linear-gradient(to left, var(--primary-500), var(--hs-ice)) no-repeat right / var(--p) 100%,
        var(--gray-200);
}

html.dark .hs-row-bar {
    background:
        linear-gradient(to left, var(--primary-500), var(--hs-ice)) no-repeat right / var(--p) 100%,
        oklch(1 0 0 / 0.08);
}

.hs-when {
    flex: none;
    padding: 0.05rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.hs-when.hs-tone-copper { color: var(--warning-700); background: var(--warning-50); }
.hs-when.hs-tone-ice { color: var(--primary-700); background: var(--primary-100); }
.hs-when.hs-tone-gray { color: var(--gray-500); background: var(--gray-100); }
.hs-when.hs-tone-green { color: var(--success-700); background: var(--success-50); }

html.dark .hs-when.hs-tone-copper { color: var(--warning-300); background: color-mix(in oklab, var(--warning-500) 18%, transparent); }
html.dark .hs-when.hs-tone-ice { color: var(--primary-300); background: color-mix(in oklab, var(--primary-500) 18%, transparent); }
html.dark .hs-when.hs-tone-gray { color: var(--gray-400); background: oklch(1 0 0 / 0.05); }
html.dark .hs-when.hs-tone-green { color: var(--success-300); background: color-mix(in oklab, var(--success-500) 18%, transparent); }

.hs-lane-empty {
    margin: 0.35rem 0 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.hs-lane-empty::before {
    content: '✓';
    margin-inline-end: 0.4rem;
    color: var(--success-600);
    font-weight: 700;
}

/* ---------- First-visit tour ---------- */

.hs-tour {
    position: fixed;
    inset: 0;
    z-index: 60;
    opacity: 0;
    transition: opacity 200ms ease;
}

.hs-tour.is-open {
    opacity: 1;
}

.hs-tour-spot {
    position: fixed;
    border-radius: 1rem;
    box-shadow: 0 0 0 9999px oklch(0.17 0.035 230 / 0.62), 0 0 0 2px var(--hs-ice), 0 0 24px 4px color-mix(in oklab, var(--hs-ice) 45%, transparent);
    transition: top 320ms cubic-bezier(.2,.8,.2,1), left 320ms cubic-bezier(.2,.8,.2,1), width 320ms cubic-bezier(.2,.8,.2,1), height 320ms cubic-bezier(.2,.8,.2,1);
    pointer-events: none;
}

.hs-tour.is-centered .hs-tour-spot {
    box-shadow: 0 0 0 9999px oklch(0.17 0.035 230 / 0.62);
}

.hs-tour-card {
    position: fixed;
    width: min(22rem, calc(100vw - 24px));
    padding: 1.15rem 1.2rem 1rem;
    border-radius: 1.1rem;
    background: var(--color-white);
    color: var(--gray-800);
    box-shadow: 0 24px 60px -20px oklch(0 0 0 / 0.55);
    overflow: hidden;
    transition: top 320ms cubic-bezier(.2,.8,.2,1), left 320ms cubic-bezier(.2,.8,.2,1);
    outline: none;
}

.hs-tour-card::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: var(--hs-cycle);
}

html.dark .hs-tour-card {
    background: var(--gray-900);
    color: var(--gray-100);
    box-shadow: 0 24px 60px -20px oklch(0 0 0 / 0.8), 0 0 0 1px oklch(1 0 0 / 0.08);
}

.hs-tour.is-centered .hs-tour-card {
    width: min(26rem, calc(100vw - 24px));
    padding: 1.5rem 1.5rem 1.2rem;
}

.hs-tour-count {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--hs-copper);
}

.hs-tour-card h2 {
    margin: 0.2rem 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hs-glacier);
}

html.dark .hs-tour-card h2 {
    color: #fff;
}

.hs-tour-card #hs-tour-body {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--gray-600);
}

html.dark .hs-tour-card #hs-tour-body {
    color: var(--gray-300);
}

.hs-tour-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
}

.hs-tour-actions button {
    padding: 0.35rem 0.85rem;
    border-radius: 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.hs-tour-actions button:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.hs-tour-skip {
    color: var(--gray-500);
    padding-inline: 0.2rem !important;
}

.hs-tour-skip:hover {
    color: var(--gray-800);
}

.hs-tour-dots {
    display: inline-flex;
    gap: 0.25rem;
    margin-inline-start: auto;
}

.hs-tour-dots i {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 99px;
    background: var(--gray-300);
    transition: width 200ms ease, background-color 200ms ease;
}

.hs-tour-dots i.on {
    width: 1.1rem;
    background: var(--primary-500);
}

.hs-tour-prev {
    color: var(--gray-700);
    background: var(--gray-100);
}

html.dark .hs-tour-prev {
    color: var(--gray-200);
    background: oklch(1 0 0 / 0.07);
}

.hs-tour-next {
    color: #fff;
    background: var(--primary-600);
    box-shadow: 0 6px 14px -8px var(--primary-600);
}

.hs-tour-next:hover {
    background: var(--primary-700);
}

/* ---------- Motion & accessibility ---------- */

/* Jalali date picker (public/css/hooshmand/jalali-date-picker.js): Filament's
   panel classes, plus month arrows and the «امروز / پاک کردن» row. */
.hs-jalali-picker-panel .fi-fo-date-time-picker-panel-header {
    align-items: center;
    gap: 0.25rem;
}

.hs-jalali-picker-step {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    color: var(--gray-500);
    font-size: 1.1rem;
    line-height: 1;
}

.hs-jalali-picker-step:hover {
    background: var(--gray-100);
    color: var(--primary-600);
}

.hs-jalali-picker-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
    font-size: 0.8rem;
}

.hs-jalali-picker-actions button {
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    color: var(--primary-600);
}

.hs-jalali-picker-actions button:hover {
    background: var(--primary-50);
}

.dark .hs-jalali-picker-step:hover,
.dark .hs-jalali-picker-actions button:hover {
    background: var(--gray-800);
}

.dark .hs-jalali-picker-actions {
    border-color: var(--gray-800);
}

@media (prefers-reduced-motion: reduce) {
    .fi-ta-row,
    .fi-input-wrp,
    .fi-sidebar-item-btn > .fi-icon,
    .hs-welcome-actions a,
    .hs-tour,
    .hs-tour-spot,
    .hs-tour-card,
    .hs-tour-dots i {
        transition: none;
    }

    .fi-page-content,
    .fi-page-header-main-ctn,
    .fi-body:has(.fi-simple-layout)::before,
    .fi-loading-section {
        animation: none;
    }
}

/* ---------- AI credit in the topbar ---------- */

.hs-credit {
    position: relative;
    margin-inline-end: 0.5rem;
}

.hs-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.1rem;
    padding-inline: 0.7rem;
    border-radius: 999px;
    border: 1px solid oklch(1 0 0 / 0.12);
    background-color: oklch(1 0 0 / 0.07);
    color: var(--hs-on-glacier);
    font-size: 0.8rem;
    white-space: nowrap;
    transition: background-color 0.15s;
}

.hs-credit-pill:hover,
.hs-credit-pill:focus-visible {
    background-color: oklch(1 0 0 / 0.12);
}

.hs-credit-icon {
    width: 1rem;
    height: 1rem;
    color: var(--hs-ice);
}

.hs-credit-label {
    color: var(--hs-on-glacier-muted);
}

.hs-credit-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.hs-credit-pill.hs-credit-low {
    border-color: oklch(0.64 0.2 18 / 0.7);
    background-color: oklch(0.64 0.2 18 / 0.22);
}

.hs-credit-pill.hs-credit-low .hs-credit-icon {
    color: oklch(0.8 0.13 18);
}

.hs-credit-panel {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 0.5rem);
    z-index: 40;
    width: min(22rem, calc(100vw - 2rem));
    max-height: min(32rem, calc(100vh - 6rem));
    overflow-y: auto;
    border-radius: 0.85rem;
    border: 1px solid var(--gray-200);
    background-color: #fff;
    color: var(--gray-900);
    box-shadow: var(--hs-card-shadow);
    font-size: 0.82rem;
}

html.dark .hs-credit-panel {
    border-color: var(--gray-700);
    background-color: var(--gray-900);
    color: var(--gray-100);
}

.hs-credit-head,
.hs-credit-section,
.hs-credit-stats {
    padding: 0.85rem 1rem;
}

.hs-credit-section,
.hs-credit-stats {
    border-top: 1px solid var(--gray-100);
}

html.dark .hs-credit-section,
html.dark .hs-credit-stats {
    border-top-color: var(--gray-800);
}

.hs-credit-big {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.hs-credit-big.hs-credit-low {
    color: var(--danger-600);
}

.hs-credit-sub {
    margin-top: 0.2rem;
    color: var(--gray-500);
    line-height: 1.6;
}

.hs-credit-alert {
    margin-top: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    background-color: var(--danger-50);
    color: var(--danger-700);
}

html.dark .hs-credit-alert {
    background-color: oklch(0.64 0.2 18 / 0.16);
    color: var(--danger-300);
}

.hs-credit-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 0;
}

.hs-credit-stats dt {
    color: var(--gray-500);
    font-size: 0.72rem;
}

.hs-credit-stats dd {
    margin: 0.15rem 0 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.hs-credit-title {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--gray-700);
}

html.dark .hs-credit-title {
    color: var(--gray-300);
}

.hs-credit-list {
    display: grid;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hs-credit-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.hs-credit-list li span:last-child {
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hs-credit-row {
    display: flex;
    gap: 0.4rem;
}

.hs-credit-row input {
    flex: 1;
    min-width: 0;
    height: 2.1rem;
    padding-inline: 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-300);
    background: transparent;
    color: inherit;
}

html.dark .hs-credit-row input {
    border-color: var(--gray-700);
}

.hs-credit-row button {
    height: 2.1rem;
    padding-inline: 0.9rem;
    border-radius: 0.5rem;
    background-color: var(--primary-600);
    color: #fff;
    font-weight: 600;
}

.hs-credit-error {
    margin-top: 0.35rem;
    color: var(--danger-600);
}

@media (max-width: 640px) {
    .hs-credit-label {
        display: none;
    }
}



.hs-credit-pending {
    padding: 0.6rem 0.7rem;
    border-radius: 0.5rem;
    background-color: var(--warning-50);
}

html.dark .hs-credit-pending {
    background-color: oklch(0.66 0.14 48 / 0.14);
}

.hs-credit-row button.hs-credit-secondary {
    background-color: transparent;
    border: 1px solid var(--gray-300);
    color: inherit;
}

html.dark .hs-credit-row button.hs-credit-secondary {
    border-color: var(--gray-700);
}

.hs-credit-actions {
    margin-top: 0.5rem;
}



