﻿@import url("/CSS/font.css");

:root {
    --primary: #1e88e5;
    --primary-dark: #1565c0;
    --primary-light: #e3f2fd;
    --secondary: #f0f2f5;
    --white: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    --sidebar-width: 220px;
    --sidebar-collapsed: 68px;
    --header-height: 60px;
    --header-height-mobile: 56px;
    --bp-sm: 576px;
    --bp-md: 768px;
    --bp-lg: 992px;
    --bp-xl: 1200px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'IRANSans', sans-serif;
}

html,
body {
    height: 100%;
}

body {
    background: var(--secondary);
    color: var(--text);
    direction: rtl;
    line-height: 1.6;
}

body.embedded {
    background: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.content {
    padding: 0px 10px 0px 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar backdrop (mobile drawer) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--primary);
    color: var(--white);
    transition: width .3s ease, transform .3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, .1);
    z-index: 1000;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    display: flex;
    flex-direction: column;
}

.sidebar-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    height: var(--header-height);
    padding: 20px;
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.logo-sidebar img {
    max-width: 40px; /* یا 100% بسته به نیاز */
    height: auto;
}

.sidebar-header h2 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-header h2 {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 14px 10px;
}

.sidebar-menu li {
    margin-bottom: 6px;
}

.sidebar-menu-skeleton {
    list-style: none;
    padding: 14px 10px;
    display: none;
}

.sidebar.is-access-pending .sidebar-menu-skeleton {
    display: block;
}

.sidebar.is-access-pending .sidebar-menu {
    display: none !important;
}

.sidebar-menu-skeleton li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
}

.sidebar-skel-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 11px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, .12) 25%,
        rgba(255, 255, 255, .28) 50%,
        rgba(255, 255, 255, .12) 75%);
    background-size: 1000px 100%;
    animation: shimmer 1.6s infinite linear;
}

.sidebar-skel-text {
    flex: 1;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, .14) 25%,
        rgba(255, 255, 255, .3) 50%,
        rgba(255, 255, 255, .14) 75%);
    background-size: 1000px 100%;
    animation: shimmer 1.6s infinite linear;
}

.sidebar.collapsed .sidebar-menu-skeleton .sidebar-skel-text {
    display: none;
}

.sidebar.collapsed .sidebar-menu-skeleton li {
    justify-content: center;
    padding: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-skel-icon,
    .sidebar-skel-text {
        animation: none;
        background: rgba(255, 255, 255, .2);
    }
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, .92);
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.sidebar-menu a.active {
    background: rgba(0, 0, 0, .18);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.sidebar-menu i,
.sidebar-menu .icon-sidebar {
    font-size: 26px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    line-height: 0;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.sidebar-menu .icon-sidebar svg {
    display: block;
    flex: 0 0 auto;
}

.sidebar-menu a:hover .icon-sidebar {
    background: rgba(255, 255, 255, .24);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
}

.sidebar-menu a.active .icon-sidebar {
    background: rgba(255, 255, 255, .28);
    box-shadow: 0 8px 16px rgba(0, 0, 0, .14);
}

.sidebar.collapsed .sidebar-menu {
    padding: 12px 10px;
}

.sidebar.collapsed .sidebar-menu span {
    display: none;
}

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-inline: auto;
    padding: 0;
    gap: 0;
    border-radius: 12px;
}

.sidebar.collapsed .sidebar-menu .icon-sidebar {
    width: 100%;
    height: 100%;
    min-width: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
}

.sidebar.collapsed .sidebar-menu a:hover {
    background: rgba(255, 255, 255, .14);
}

.sidebar.collapsed .sidebar-menu a.active {
    background: rgba(255, 255, 255, .22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.sidebar.collapsed .sidebar-menu a:hover .icon-sidebar,
.sidebar.collapsed .sidebar-menu a.active .icon-sidebar {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.sidebar-footer {
    padding: 12px 10px calc(12px + var(--safe-bottom));
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-install-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
    text-align: right;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.sidebar-install-btn:hover {
    background: rgba(255, 255, 255, .22);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
}

.sidebar-install-btn:active {
    transform: translateY(0);
}

.sidebar-install-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, .18);
}

.sidebar-install-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-install-text strong {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-install-text small {
    font-size: 11px;
    opacity: .86;
    line-height: 1.35;
}

.sidebar.collapsed .sidebar-footer {
    padding-inline: 8px;
}

.sidebar.collapsed .sidebar-install-btn {
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-inline: auto;
    padding: 0;
}

.sidebar.collapsed .sidebar-install-text {
    display: none;
}

.sidebar.collapsed .sidebar-install-icon {
    width: 100%;
    height: 100%;
    min-width: 0;
    background: transparent;
}

/* PWA install banner */
.pwa-install-banner {
    position: fixed;
    left: 50%;
    bottom: calc(16px + var(--safe-bottom));
    transform: translate(-50%, 120%);
    width: min(560px, calc(100vw - 24px));
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
    color: var(--text);
    box-shadow: 0 16px 40px rgba(21, 101, 192, .18), 0 0 0 1px rgba(30, 136, 229, .12);
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), opacity .28s ease;
}

.pwa-install-banner.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-install-banner__icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(30, 136, 229, .22);
}

.pwa-install-banner__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-install-banner__content {
    flex: 1;
    min-width: 0;
}

.pwa-install-banner__content strong {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
    color: #0f172a;
}

.pwa-install-banner__content p {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-light);
}

.pwa-install-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-banner__btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.pwa-install-banner__btn--primary {
    background: var(--primary);
    color: #fff;
}

.pwa-install-banner__btn--primary:hover {
    background: var(--primary-dark);
}

.pwa-install-banner__btn--ghost {
    background: transparent;
    color: var(--text-light);
}

.pwa-install-banner__btn--ghost:hover {
    background: rgba(30, 136, 229, .08);
    color: var(--primary-dark);
}

@media (max-width: 640px) {
    .pwa-install-banner {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .pwa-install-banner__actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Main */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    transition: margin-right .3s ease;
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.sidebar.collapsed~.main-content {
    margin-right: var(--sidebar-collapsed);
}

/* Header (single, deduped) */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
}

/* Right: hamburger */
.toggle-sidebar {
    order: -1;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    padding: 8px 10px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

.toggle-sidebar:hover {
    background: var(--primary-light);
}

/* Avatar button */
.user-avatar-circle {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
    box-shadow: none;
    padding: 0;
    line-height: 0;
    flex-shrink: 0;
}

.user-avatar-circle:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.user-avatar-circle:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 2px;
}

.user-avatar-icon {
    display: inline-flex;
    color: currentColor;
    line-height: 0;
}

.user-avatar-icon svg {
    display: block;
}

.user-dropdown.open {
    display: block;
    animation: fadeInUp .22s ease;
}

/* 1) ������������ ���� ʘ� (Ϙ��� ��䘡 ����� �) */
.is-disabled,
.disabled,
[aria-disabled="true"] {
    opacity: .55;
    filter: saturate(.2);
    cursor: not-allowed !important;
    pointer-events: none !important;
    /* ���� � ���� �� ������� */
}

/* ǐ� �� ���ӝ��� Ϙ�� ���� ������� �흘��� ���� �� �� ���� �� */
.btn.is-disabled,
.btn.disabled,
.btn[aria-disabled="true"] {
    background: #e0e0e0 !important;
    color: #999 !important;
    border-color: #d5d5d5 !important;
}

/* 2) ������������ �� ����� ���� �� ����? ����� (layout ��� ������) */
.is-disabled-area {
    position: relative;
}

.is-disabled-area::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .4);
    /* ������� */
    cursor: not-allowed;
    z-index: 1;
    /* ��� ����� �������� */
}

/* ������� �� ����� ���� ����� ���� ���� ���� �Ә��� �����? ���� */
.is-disabled-area>* {
    pointer-events: none;
}

/* ���� ������� ��� ����� (ǐ� ������ ���� ����) */
.is-disabled-area .is-disabled-msg {
    position: absolute;
    inset: auto 50% 12px auto;
    transform: translateX(50%);
    z-index: 2;
    font-size: 12px;
    color: #666;
    background: rgba(255, 255, 255, .9);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}


.user-menu-left {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    margin-left: 0;
    position: relative;
}

.user-dropdown {
    --user-dropdown-width: 300px;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: auto;
    width: var(--user-dropdown-width);
    max-width: min(var(--user-dropdown-width), calc(100vw - 24px));
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px;
    box-shadow:
        0 18px 40px rgba(15, 23, 42, .14),
        0 2px 8px rgba(15, 23, 42, .06);
    display: none;
    z-index: 1100;
    overflow: hidden;
}

.user-card {
    padding: 10px 8px 12px;
}

.user-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-card-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    line-height: 0;
    box-shadow: 0 8px 16px rgba(30, 136, 229, .22);
}

.user-card-avatar svg {
    display: block;
}

.user-card-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.user-card-row #userFullName {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-meta .muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-role {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, #fff);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.user-card-role:empty {
    display: none;
}

.user-card-role[hidden] {
    display: none;
}

.header-financial-year {
    --financial-year-color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    padding: 4px 12px;
    width: max-content;
    max-width: min(280px, calc(100vw - 140px));
    max-height: calc(var(--header-height) - 12px);
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--financial-year-color) 40%, #e2e8f0);
    background:
        linear-gradient(180deg, #fff, color-mix(in srgb, var(--financial-year-color) 14%, #fff));
    box-sizing: border-box;
    overflow: hidden;
    flex: 0 1 auto;
}

.header-financial-year[hidden] {
    display: none;
}

.header-financial-year__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.financial-year-color {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--financial-year-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--financial-year-color) 22%, transparent);
}

.financial-year-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    line-height: 1.2;
    flex: 1 1 auto;
}

.financial-year-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.financial-year-title,
.financial-year-text strong {
    font-size: 12px;
    font-weight: 800;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.financial-year-code {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    letter-spacing: .01em;
}

.financial-year-code[hidden] {
    display: none;
}

.financial-year-updated,
.financial-year-text small {
    color: #64748b;
    font-size: 10px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.financial-year-text small[hidden] {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.muted {
    font-size: .85rem;
    color: var(--text-light);
}

/* Divider */
.dropdown-sep {
    height: 1px;
    background: #eef2f7;
    margin: 4px 2px 8px;
}

/* Dropdown items */
.dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    border: none;
    background: transparent;
    text-align: right;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    transition: background .18s ease, color .18s ease;
}

.dropdown-item-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #475569;
    line-height: 0;
}

.dropdown-item-icon svg {
    display: block;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

.dropdown-item:hover .dropdown-item-icon {
    background: rgba(30, 136, 229, .12);
    color: var(--primary);
}

.dropdown-item.danger {
    color: #c62828;
}

.dropdown-item.danger .dropdown-item-icon {
    background: #fff1f1;
    color: #c62828;
}

.dropdown-item.danger:hover {
    background: #fff5f5;
    color: #b71c1c;
}

.dropdown-item.danger:hover .dropdown-item-icon {
    background: #ffe4e4;
    color: #b71c1c;
}

.dropdown-item.account-settings {
    color: #1565c0;
}

.dropdown-item.account-settings .dropdown-item-icon {
    background: rgba(30, 136, 229, .12);
    color: var(--primary);
}

.dropdown-item.account-settings:hover {
    background: rgba(30, 136, 229, .08);
    color: var(--primary-dark);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: .9rem;
}

/* Header actions (optional right/left controls besides hamburger & user) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Search (optional) */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 300px;
    padding: 5px 15px;
    background: var(--secondary);
    border-radius: 20px;
}

.search-box input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
}

/* Card */
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-light);
}

.card-title {
    margin: 20px 20px 0 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.account-settings-page {
    width: 100%;
    min-height: calc(100vh - 88px);
    min-height: calc(100dvh - 88px);
    margin: 0;
    padding: 18px 14px 28px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.password-settings-shell {
    width: min(920px, 100%);
    margin: 0 auto;
    padding: 28px 28px 32px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), #fff 42%),
        linear-gradient(135deg, rgba(30, 136, 229, .08), rgba(255, 255, 255, 0));
    box-shadow: 0 12px 36px rgba(15, 23, 42, .06);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.delete-account-shell {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .97), #fff 42%),
        linear-gradient(135deg, rgba(244, 67, 54, .07), rgba(255, 255, 255, 0));
}

.delete-account-hero__icon {
    background: linear-gradient(135deg, #ef5350, #c62828);
    box-shadow: 0 10px 24px rgba(198, 40, 40, .22);
}

.delete-account-eyebrow {
    color: #b71c1c;
}

.delete-account-confirm {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    width: fit-content;
    max-width: 52ch;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.7;
    cursor: pointer;
    user-select: none;
}

.delete-account-confirm input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: 0 0 18px;
    accent-color: var(--danger);
}

.delete-account-submit {
    min-width: 180px;
    min-height: 48px;
    padding-inline: 22px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ef5350, #c62828);
    border: 1px solid #c62828;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(198, 40, 40, .18);
}

.delete-account-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #e53935, #b71c1c);
    color: #fff;
}

.delete-account-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.password-settings-hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e8eef4;
}

.password-settings-hero__icon {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 24px rgba(30, 136, 229, .24);
}

.password-settings-hero__icon svg {
    width: 26px;
    height: 26px;
}

.password-settings-eyebrow {
    margin: 0 0 6px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

.password-settings-title {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.35;
}

.password-settings-lead {
    margin: 8px 0 0;
    max-width: 52ch;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.9;
}

.password-settings-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}

.password-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.password-settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-settings-label {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.password-settings-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d5dee8;
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.password-settings-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, .14);
}

.password-settings-hint {
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.7;
}

.password-settings-show {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.password-settings-show input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.password-settings-message {
    min-height: 0;
    margin: 0;
    padding: 0;
}

.password-settings-message:not(:empty) {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.password-settings-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: auto;
    padding-top: 8px;
}

.password-settings-submit {
    min-width: 180px;
    min-height: 48px;
    padding-inline: 22px;
    font-weight: 700;
}

.account-settings-message.is-error {
    color: #a12828;
    background: #fff1f1;
    border: 1px solid #efbaba;
}

.account-settings-message.is-success {
    color: #1b5e20;
    background: #edf7ed;
    border: 1px solid #b7dfb9;
}

@media (max-width: 768px) {
    .account-settings-page {
        min-height: calc(100vh - 72px);
        min-height: calc(100dvh - 72px);
        padding: 10px 8px 20px;
    }

    .password-settings-shell {
        padding: 20px 16px 22px;
        border-radius: 14px;
    }

    .password-settings-hero {
        flex-direction: column;
    }

    .password-settings-title {
        font-size: 22px;
    }

    .password-settings-actions,
    .password-settings-submit,
    .delete-account-submit {
        width: 100%;
    }
}

.admin-page {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: 18px 14px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    font-family: 'IRANSans', sans-serif;
}

.admin-page input,
.admin-page select,
.admin-page textarea,
.admin-page button {
    font-family: inherit;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), #fff 50%);
}

.admin-eyebrow {
    margin: 0 0 6px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

.admin-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
}

.admin-lead {
    margin: 8px 0 0;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
}

.admin-role-badge {
    margin: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-tab {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.admin-tab.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.admin-message {
    min-height: 0;
}

.admin-message:not(:empty) {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.admin-message.is-error {
    color: #a12828;
    background: #fff1f1;
    border: 1px solid #efbaba;
}

.admin-message.is-success {
    color: #1b5e20;
    background: #edf7ed;
    border: 1px solid #b7dfb9;
}

.admin-form,
.admin-table-wrap {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    padding: 18px;
}

.admin-form--modal {
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.admin-form--modal .admin-grid {
    margin: 0;
}

.admin-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.admin-search-field,
.admin-combo-field {
    flex: 1 1 260px;
    min-width: 240px;
}

.admin-search {
    position: relative;
    display: block;
    width: 100%;
}

.admin-search-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: #64748b;
    display: inline-flex;
    pointer-events: none;
}

.admin-search-input,
.admin-combobox-input,
.admin-grid input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
.admin-grid textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d5dee8;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    direction: rtl;
    text-align: right;
    outline: none;
}

.admin-search-input {
    padding: 10px 40px 10px 12px;
}

.admin-search-input::-webkit-search-decoration,
.admin-search-input::-webkit-search-cancel-button,
.admin-search-input::-webkit-search-results-button,
.admin-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.admin-search-input::placeholder,
.admin-combobox-input::placeholder,
.admin-grid input:not([type="checkbox"])::placeholder {
    color: #8a97a8;
    font-weight: 500;
}

.admin-search-input:focus,
.admin-combobox-input:focus,
.admin-grid input:not([type="checkbox"]):not([type="hidden"]):focus,
.admin-grid textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, .12);
}

.admin-combobox {
    position: relative;
}

.admin-combobox-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 20;
    max-height: 240px;
    overflow: auto;
    background: #fff;
    border: 1px solid #d5dee8;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.admin-combobox-option,
.admin-combobox-empty {
    width: 100%;
    display: block;
    text-align: right;
    background: none;
    border: 0;
    padding: 10px 12px;
    font: inherit;
    cursor: pointer;
}

.admin-combobox-option:hover,
.admin-combobox-option:focus {
    background: #eef5ff;
}

.admin-combobox-empty {
    color: var(--text-light);
    cursor: default;
}

.admin-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.admin-pager-count,
.admin-pager [data-pager-label] {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
}

.admin-pager .page-jump {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

#adminCompanyModal .modal-modal,
#adminClientModal .modal-modal,
#adminModuleModal .modal-modal {
    overflow: visible;
}

#adminClientModal .modal-modal-body {
    overflow: visible;
}

#adminClientModal .wad-pretty-select {
    width: 100%;
}

#adminClientModal .wad-pretty-select__menu,
#adminClientModal .admin-combobox-list {
    z-index: 80;
}

.admin-form h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-grid label,
.admin-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.admin-grid input:not([type="checkbox"]):not([type="hidden"]),
.admin-grid textarea {
    min-height: 42px;
}

.admin-check {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
}

.admin-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
    margin-top: 14px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: 'IRANSans', sans-serif;
    font-weight: 500;
}

.admin-table th,
.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eef2f6;
    text-align: right;
    direction: rtl;
    unicode-bidi: isolate;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    font-size: 13px;
}

.admin-table thead th {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.admin-hint {
    color: var(--text-light);
    font-size: 13px;
}

.admin-module-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-module-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
}

.admin-feature-groups {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-feature-group h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.admin-feature-group .admin-module-list {
    margin: 0;
}

.admin-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 768px) {
    .admin-grid,
    .admin-module-list,
    .admin-hero {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}

.card-body {
    position: relative;
    padding: 20px;
}

div.card-body>ul {
    padding: 0 20px 20px;
}

/* Buttons */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.btn {
    border: none;
    background: var(--primary);
    color: #fff;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-outline {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.btn-outline:hover {
    background: var(--secondary);
}

.btn i,
.btn-outline i {
    margin-left: 6px;
}

.btn .btn-icon,
.btn-outline .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    color: inherit;
    line-height: 0;
}

.btn .btn-icon svg,
.btn-outline .btn-icon svg {
    display: block;
}

/* آیکون فیلتر در دکمه primary سفید بماند */
.btn-primary .icon-sidebar {
    color: #fff;
}

.btn-outline .icon-sidebar {
    color: inherit;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--secondary);
    color: var(--text);
}

.badge-primary {
    background: rgba(30, 136, 229, 0.12);
    color: var(--primary);
}

.badge-outline {
    border: 1px solid var(--border);
    background: #fff;
}

.form-control {
    text-align: center;
    direction: ltr;
    font-weight: 600;
    font-family: 'IRANSans', sans-serif;
}

.form-control,
.picker-btn,
select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    min-height: 40px;
}

.form-control:focus,
select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.picker-btn {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.form-label {
    font-weight: 600;
    color: var(--text);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint {
    font-size: 12px;
    color: var(--text-light);
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
}

.table-container,
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin: 16px 0;
    background: #fff;
    overscroll-behavior-x: contain;
}

.table-container table,
.table-wrap table,
.rpt-scroll table,
.tr-table-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    text-align: center;
    white-space: nowrap;
}

thead th {
    position: sticky;
    top: 0;
    background: var(--primary);
    color: #fff;
    z-index: 1;
}

tr:nth-child(even) {
    background: #fafafa;
}

tr:hover {
    background: #f5f9ff;
}

.status-tag,
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--secondary);
    color: var(--text);
}

.status.debtor,
.status-debtor {
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
}

.status.creditor,
.status-creditor {
    background: rgba(76, 175, 80, 0.12);
    color: #2e7d32;
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.table-pagination .btn {
    min-width: 110px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.table-pagination .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    font-weight: 600;
    color: var(--primary-dark);
    font-weight: 700;
    color: #1e40af;
    font-size: 14px;
    padding: 8px 16px;    
}

.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.summary-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-light), #f0f7ff);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.summary-label {
    font-weight: 600;
    color: var(--primary-dark);
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.context-menu,
.context {
    position: fixed;
    z-index: 1600;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    display: none;
}

.context-menu-item,
.ctx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.context-menu-item:hover,
.ctx-row:hover {
    background: var(--primary-light);
}

.context-menu-shortcut,
.ctx-row span:last-child {
    color: var(--text-light);
    font-size: 12px;
}

.reports-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reports-tabs {
    display: block;
    background: var(--white);
    border-radius: 14px;
    padding: 10px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin: 20px 10px 0 10px;
    height: auto;
}

.reports-tabs-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 6px;
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.reports-tabs-toggle::-webkit-details-marker {
    display: none;
}

.reports-tabs-toggle:focus-visible {
    outline: 3px solid rgba(30, 136, 229, .4);
    outline-offset: 2px;
    border-radius: 8px;
}

.reports-tabs-chevron {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .2s ease;
}

.reports-tabs[open] .reports-tabs-chevron {
    transform: rotate(135deg);
}

.reports-tabs-body {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 10px;
}

.reports-tabs-scroller {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    mask-image: linear-gradient(to left, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}

.reports-tabs-scroller::-webkit-scrollbar {
    display: none;
}

.reports-tabs-nav {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--primary-dark);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s ease, color .15s ease, opacity .15s ease, border-color .15s ease;
}

.reports-tabs-nav::before {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.reports-tabs-nav[data-dir="start"]::before {
    transform: rotate(45deg);
}

.reports-tabs-nav[data-dir="end"]::before {
    transform: rotate(-135deg);
}

.reports-tabs-nav:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.reports-tabs-nav:focus-visible {
    outline: 3px solid rgba(30, 136, 229, .4);
    outline-offset: 2px;
}

.reports-tabs-nav:disabled {
    opacity: .35;
    cursor: default;
}

.reports-tabs .tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    border-bottom: none;
    min-width: max-content;
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab {
    padding: 8px 20px;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.tab:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(30, 136, 229, 0.25);
}

.tab-content {
    display: none;
}

.tab-content.active,
.tab-content[aria-hidden="false"] {
    display: block;
}

.subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.subtab {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s ease;
}

.subtab.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300PX, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(30, 136, 229, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
}

.chart-container {
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-body {
    position: relative;
    flex: 1;
    min-height: 260px;
    overflow: hidden;
}

.chart-body canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}


.chart-title {
    text-align: center;
    color: var(--primary);
    margin: 0;
}

.d-flex {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 14px;
}

.g-1 {
    grid-template-columns: 1fr;
}

.g-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.g-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {

    .g-2,
    .g-3 {
        grid-template-columns: 1fr;
    }
}

.sumbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 16px;
    background: #fafafa;
    border-top: 1px solid var(--border);
}

.sumbar strong {
    margin-left: 6px;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-right-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1200px) and (min-width: 993px) {
    .main-content {
        margin-right: var(--sidebar-collapsed);
    }

    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar-header h2,
    .sidebar-menu span {
        display: none;
    }

    .sidebar .sidebar-menu {
        padding: 12px 10px;
    }

    .sidebar .sidebar-menu a {
        justify-content: center;
        width: 40px;
        height: 40px;
        margin-inline: auto;
        padding: 0;
        gap: 0;
        border-radius: 12px;
    }

    .sidebar .sidebar-menu .icon-sidebar {
        width: 100%;
        height: 100%;
        min-width: 0;
        border-radius: 12px;
        background: transparent;
        box-shadow: none;
    }

    .sidebar .sidebar-menu a:hover {
        background: rgba(255, 255, 255, .14);
    }

    .sidebar .sidebar-menu a.active {
        background: rgba(255, 255, 255, .22);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
    }

    .sidebar .sidebar-menu a:hover .icon-sidebar,
    .sidebar .sidebar-menu a.active .icon-sidebar {
        background: transparent;
        box-shadow: none;
        transform: none;
    }

    .sidebar.collapsed {
        width: var(--sidebar-collapsed);
    }
}

@media (max-width: 992px) {
    .sidebar-backdrop {
        display: block;
    }

    .sidebar {
        width: min(var(--sidebar-width), 86vw);
        transform: translateX(105%);
        box-shadow: none;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: -8px 0 28px rgba(15, 23, 42, .28);
    }

    .sidebar.collapsed {
        width: min(var(--sidebar-width), 86vw);
    }

    .sidebar.collapsed .sidebar-header h2,
    .sidebar.collapsed .sidebar-menu span {
        display: revert;
    }

    .sidebar.collapsed .sidebar-menu {
        padding: 14px 10px;
    }

    .sidebar.collapsed .sidebar-menu a {
        justify-content: flex-start;
        width: auto;
        height: auto;
        margin-inline: 0;
        padding: 10px 12px;
        gap: 12px;
    }

    .sidebar.collapsed .sidebar-menu .icon-sidebar {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 11px;
        background: rgba(255, 255, 255, .14);
    }

    .sidebar.collapsed .sidebar-menu a.active {
        background: rgba(0, 0, 0, .18);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
    }

    .sidebar.collapsed .sidebar-menu a.active .icon-sidebar {
        background: rgba(255, 255, 255, .28);
        box-shadow: 0 8px 16px rgba(0, 0, 0, .14);
    }

    .sidebar.collapsed .sidebar-menu a:hover .icon-sidebar {
        background: rgba(255, 255, 255, .24);
        transform: translateY(-1px);
        box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
    }

    .main-content,
    .sidebar.collapsed ~ .main-content {
        margin-right: 0;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .header {
        height: var(--header-height-mobile);
        padding: 0 12px;
        padding-top: var(--safe-top);
        gap: 8px;
        min-height: calc(var(--header-height-mobile) + var(--safe-top));
    }

    .user-menu-left {
        gap: 8px;
        min-width: 0;
        flex: 0 0 auto;
        justify-content: flex-end;
        position: relative;
    }

    .header-financial-year {
        margin: 6px 0;
        padding: 4px 10px;
        max-width: min(220px, calc(100vw - 120px));
        max-height: calc(var(--header-height-mobile) - 12px);
        gap: 8px;
    }

    .financial-year-text strong {
        font-size: 11px;
    }

    .financial-year-text small {
        font-size: 9px;
    }

    .user-avatar-circle {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .user-dropdown {
        --user-dropdown-width: 280px;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: auto;
        width: min(var(--user-dropdown-width), calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        z-index: 1200;
    }

    .search-box {
        width: 100%;
        max-width: 220px;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .chart-body {
        min-height: 200px;
    }

    .header {
        padding: 0 10px;
        padding-top: var(--safe-top);
    }

    .search-box {
        display: none;
    }

    .content {
        padding: 12px;
        padding-bottom: calc(12px + var(--safe-bottom));
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    /* فقط دکمه‌های نوار ابزار / فوتر مودال — نه همهٔ دکمه‌های صفحه */
    .toolbar > .btn,
    .toolbar > .btn-outline,
    .account-header__actions > .btn,
    .account-header__actions > .btn-outline,
    .accounting-document-actions > .btn,
    .accounting-document-actions > .btn-outline,
    .modal-modal-footer .modal-btn,
    .modal-footer .btn,
    .modal-footer .btn-outline {
        width: 100%;
        min-height: 44px;
    }

    .btn,
    .btn-outline {
        min-height: 40px;
    }
}

@media (max-width: 576px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .summary-box {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    input.form-control,
    select.form-control,
    textarea.form-control,
    .modal-form-control,
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--secondary);
    color: var(--text);
}

.status-badge.status-debtor {
    background: rgba(255, 152, 0, 0.12);
    color: #e65100;
}

.status-badge.status-creditor {
    background: rgba(76, 175, 80, 0.12);
    color: #2e7d32;
}

.hidden {
    display: none !important;
}

.table-wrap {
    max-height: 65vh;
}

.ctx-hr {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.role-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.role-btn {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-btn.active,
.role-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.mb-20 {
    margin-bottom: 20px;
}

input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.reports-shell {
    margin-bottom: 24px;
}

.reports-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.reports-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.reports-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 10px 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}





.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    overflow: hidden;
}



.account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
}

.account-header__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 260px;
}

.account-header__details {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-header__code {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.account-header__title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    text-align: right;
}

.account-header__label {
    color: var(--text-light);
    font-weight: 500;
}

.account-header__value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.account-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-light);
    font-size: 13px;
}

.account-header__meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.account-header__meta-value {
    color: var(--text);
    font-weight: 600;
}

.account-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.account-header__actions .btn {
    min-width: 120px;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-link:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.taraz-action-col {
    text-align: center;
    width: 140px;
}

.taraz-action-cell {
    text-align: center;
}

/* Taraz tab navigation */
.taraz-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px;
}

.taraz-tabstrip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    padding-bottom: 6px;
}

.taraz-tabstrip .taraz-tab {
    border: none;
    background: #f4f6f9;
    color: #2d3440;
    padding: 6px 10px 6px 8px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.taraz-tabstrip .taraz-tab:hover {
    background: #e3ebff;
}

.taraz-tabstrip .taraz-tab.active {
    background: #1e88e5;
    color: #fff;
    box-shadow: 0 2px 6px rgba(30, 136, 229, .25);
}

.taraz-tabstrip .taraz-tab-close {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    opacity: .7;
}

.taraz-tabstrip .taraz-tab-close:hover {
    background: rgba(0, 0, 0, .12);
    opacity: 1;
}

.taraz-tabstrip .taraz-tab.active .taraz-tab-close:hover {
    background: rgba(255, 255, 255, .22);
}

.taraz-host {
    min-height: 320px;
}

#tbl-taraz tbody tr {
    cursor: pointer;
}

#tbl-taraz tfoot .taraz-total-row td {
    font-weight: 700;
    background: #fff8e1;
}

.tab.disabled {
    pointer-events: none;
    opacity: 0.45;
}

#tbl-ledger tbody tr {
    cursor: pointer;
}

#tbl-ledger tbody tr.ledger-row--factor .ledger-kind-cell {
    background: #e3f2fd;
}

#tbl-ledger tbody tr.ledger-row--doc .ledger-kind-cell {
    background: #fce4ec;
}

#tbl-ledger tbody tr.ledger-row--pay .ledger-kind-cell {
    background: #f3e5f5;
}

#tbl-ledger tbody tr.ledger-row--opening .ledger-kind-cell {
    background: #fff8e1;
    font-weight: 600;
}



/* بهبود responsive design */
@media (max-width: 768px) {
    .account-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .account-header__actions {
        width: 100%;
        justify-content: space-between;
    }

    .account-header__actions .btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        height: auto;
        align-self: auto;
    }

    .filter-section {
        flex-direction: column;
        gap: 12px;
    }

    .filter-group {
        width: 100%;
        justify-content: space-between;
    }

    .summary-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

/* بهبود table responsive */
.table-container {
    overflow-x: auto;
    position: relative;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* بهبود empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: var(--primary-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-danger {
    border: 2px dashed var(--danger) !important;
    background: #fdecea;
}

.empty-state:hover {
    border-color: var(--primary);
    background: var(--white);
    transform: translateY(-2px);
}

.empty-state.empty-danger:hover {
    border-color: var(--danger) !important;
    background: #fdecea;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.empty-sub {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
}


/* Loading Overlay */
.loading-text {
    color: var(--text-light);
    font-size: 14px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}

.loading-box {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}


/* اضافه کردن این استایل‌ها به انتهای main.css */

/* ========== بهبودهای Empty State ========== */
.empty-state {
    border: 2px dashed #d0d0d0;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    margin: 24px 0;
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    transition: all .3s ease;
}

.empty-state:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f8fbff, #eef5ff);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, .1);
}

.empty-icon {
    margin-bottom: 16px;
}

.empty-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.empty-sub {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* ========== بهبودهای جدول ========== */
.table-container {
    position: relative;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-container table,
.table-wrap table {
    min-width: 720px;
}

thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    z-index: 10;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

tbody tr {
    transition: all .2s ease;
}

tbody tr:hover {
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(30, 136, 229, .08);
}

tbody tr:active {
    background: #e3f2fd;
}

th.num,
td.num {
    text-align: center;
    direction: ltr;
    font-family: 'IRANSans', monospace;
}

.num-bed {
    text-align: center;
    direction: ltr;
    font-family: 'IRANSans', monospace;
    font-weight: 600;
    color: #1d8529;
}

.num-bes {
    text-align: center;
    direction: ltr;
    font-family: 'IRANSans', monospace;
    font-weight: 600;
    color: #851d1d;
}

.num-remain {
    text-align: center;
    direction: ltr;
    font-family: 'IRANSans', monospace;
    font-weight: 600;
    color: #1d4085;
}

#tbl-acc .account-status-cell {
    text-align: center;
}

#tbl-acc .account-status {
    font-weight: 800;
}

#tbl-acc .account-status--debtor {
    color: #0d47a1;
}

#tbl-acc .account-status--creditor {
    color: #8b1a1a;
}

#tbl-acc .account-status--balanced {
    color: #1b5e20;
}

#tbl-acc .account-kind-cell {
    color: #000;
    font-weight: 700;
    text-align: center;
}

/* Delphi TColor $00FFCF9F (BGR) */
#tbl-acc .account-kind--factor {
    background-color: #9fcfff;
}

/* Delphi TColor $00B7FFB7 (BGR) */
#tbl-acc .account-kind--receipt {
    background-color: #b7ffb7;
}

/* Delphi TColor $00BFBFFF (BGR) */
#tbl-acc .account-kind--manual {
    background-color: #ffbfbf;
}

#tbl-acc .account-description-heading {
    text-align: center;
}

#tbl-acc .account-description-cell {
    text-align: right;
    direction: rtl;
}

.summary-value.summary-balance-status {
    font-weight: 800;
}

.summary-value.summary-balance-status--debtor {
    color: #0d47a1;
}

.summary-value.summary-balance-status--creditor {
    color: #8b1a1a;
}

.summary-value.summary-balance-status--balanced {
    color: #1b5e20;
}

/* ========== بهبودهای Summary Container ========== */
.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.summary-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 2px solid #e3f2fd;
    box-shadow: 0 4px 12px rgba(30, 136, 229, .08);
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}

.summary-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.summary-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 136, 229, .15);
    border-color: var(--primary);
}

.summary-label {
    font-weight: 600;
    color: #5a5a5a;
    font-size: 14px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'IRANSans', monospace;
}

/* ========== بهبودهای Filter Section ========== */
.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    border: 1px solid #e3f2fd;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label {
    font-weight: 600;
    color: var(--primary-dark);
    white-space: nowrap;
    font-size: 14px;
}

.filter-group .form-control {
    min-width: 140px;
    background: #fff;
    border: 1px solid var(--border);
    font-weight: 600;
    color: var(--primary);
}

/* ========== بهبودهای دکمه‌ها ========== */
.btn,
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before,
.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .3);
    transform: translate(-50%, -50%);
    transition: width .4s ease, height .4s ease;
    z-index: -1;
}

.btn:hover::before,
.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active,
.btn-primary:active {
    transform: scale(.97);
}

/* ========== Loading States ========== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.loading-skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}

/* ========== Sentinel (برای Infinite Scroll) ========== */
#sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: #999;
    font-size: 13px;
    margin: 16px 0;
}

#sentinel::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-left: 8px;
}

/* ========== Context Menu بهبود یافته ========== */
.context-menu {
    min-width: 240px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .16);
    padding: 8px;
    animation: fadeInUp .2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s ease;
    font-size: 14px;
}

.context-menu-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(-2px);
}

.context-menu-shortcut {
    color: #999;
    font-size: 12px;
    font-family: monospace;
}

.ctx-hr {
    height: 1px;
    background: linear-gradient(to right,
            transparent,
            var(--border),
            transparent);
    margin: 6px 0;
}

/* ========== Responsive Improvements ========== */
@media (max-width: 768px) {
    .empty-state {
        padding: 32px 16px;
    }

    .empty-title {
        font-size: 16px;
    }

    .empty-sub {
        font-size: 13px;
    }

    .filter-section {
        padding: 16px;
    }

    .summary-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-box {
        padding: 16px 18px;
    }

    .summary-value {
        font-size: 18px;
    }

    .table-container {
        border-radius: 8px;
    }

    thead th {
        font-size: 12px;
        padding: 10px 8px;
    }

    tbody td {
        font-size: 13px;
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .filter-label {
        text-align: right;
    }

    .filter-group .form-control {
        min-width: 100%;
    }
}

/* ========== Accessibility ========== */
.btn:focus-visible,
.form-control:focus-visible {
    outline: 3px solid rgba(30, 136, 229, .4);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Print Styles ========== */
@media print {

    .sidebar,
    .sidebar-backdrop,
    .header,
    .btn,
    .filter-section,
    .empty-state,
    .context-menu,
    .reports-tabs,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #000;
    }

    table {
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tr {
        page-break-inside: avoid;
    }
}


/* اضافه کردن این استایل‌ها به آخر main.css یا modal.css */

/* Loading Overlay - اولویت بالا */
.loading-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    /* بالاترین z-index ممکن */
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 24, 61, .5);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}

/* وقتی باز است */
.loading-overlay.is-open {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* کارت لودینگ */
.loading-card {
    background: #fff;
    border: 1px solid #eef2ff;
    border-radius: 20px;
    padding: 28px 32px;
    width: min(92vw, 380px);
    display: grid;
    justify-items: center;
    gap: 14px;
    box-shadow: 0 24px 64px rgba(15, 47, 122, .28);
    animation: fadeInScale .3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* متن لودینگ */
.loading-card .loading-text {
    color: #133a99;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
}

/* Spinner */
.loading-card .spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 5px solid #e9efff;
    border-top-color: #1f57e6;
    animation: spin .8s linear infinite;
    box-shadow: inset 0 0 0 4px rgba(47, 107, 255, .08);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* قفل کردن scroll */
body.modal-locked {
    overflow: hidden !important;
    position: relative;
}

/* Responsive */
@media (max-width: 480px) {
    .loading-card {
        padding: 20px 24px;
        width: min(92vw, 320px);
    }

    .loading-card .spinner {
        width: 52px;
        height: 52px;
        border-width: 4px;
    }

    .loading-card .loading-text {
        font-size: 14px;
    }
}

/* اطمینان از عدم تداخل با سایر المان‌ها */
#loadingOverlay {
    pointer-events: none;
}

#loadingOverlay.is-open {
    pointer-events: auto;
}

/* برای جلوگیری از نمایش همزمان چند لودینگ */
.loading-overlay+.loading-overlay {
    display: none !important;
}

/* ========== استایل‌های دکمه‌های حالت نمایش نمودار ========== */
.chart-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    /* برای نمایش بهتر در موبایل */
}

.view-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.view-mode-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.view-mode-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(30, 136, 229, .2);
}

.view-mode-btn i {
    font-size: 14px;
}


/* ========== استایل‌های مربوط به حالت‌های نمایش نمودار ========== */

/* حالت فشرده (پیش‌فرض) */
.chart-body {
    overflow-x: auto;
    /* همیشه اسکرول افقی فعال باشد */
    overflow-y: hidden;
}

.chart-body canvas {
    min-width: 100%;
}

/* حالت گسترده */
.chart-body.expanded {
    overflow-x: hidden;
    /* در حالت گسترده اسکرول لازم نیست */
}

.chart-body.expanded canvas {
    min-width: 100%;
    width: 100% !important;
}


/* ========== بهبود واکنش‌گرایی برای دکمه‌ها ========== */
@media (max-width: 520px) {
    .chart-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .chart-actions>div:last-child {
        margin-right: 0;
        width: 100%;
        display: flex;
    }

    .view-mode-btn {
        flex: 1;
        justify-content: center;
    }
}

.chart-body {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
}

.chart-body.expanded canvas {
    min-width: 1500px;
    height: 400px;
}


.chart-body:not(.expanded) canvas {
    min-width: 100%;
}

/* ========== استایل‌های مربوط به حالت‌های نمایش نمودار ========== */

/* حالت فشرده (پیش‌فرض) - بدون اسکرول اضافی، عرض فیت */
.chart-body:not(.expanded) {
    overflow-x: hidden;
    /* اسکرول افقی لازم نیست، چون فشرده است */
}

.chart-body:not(.expanded) canvas {
    width: 100% !important;
    /* کاملاً فیت والد */
    min-width: 100%;
    height: 300px;
    /* ارتفاع کمتر برای فشرده */
}

/* حالت گسترده - اسکرول افقی فعال، عرض دینامیک از JS */
.chart-body.expanded {
    overflow-x: auto;
    /* اسکرول افقی فعال */
    overflow-y: hidden;
}

.chart-body.expanded canvas {
    width: auto !important;
    /* عرض دینامیک از JS */
    min-width: unset;
    /* حذف min-width ثابت قبلی */
    height: 400px;
    /* ارتفاع بیشتر برای خوانایی */
}

/* اطمینان از ثابت بودن عرض کادر پشت (chart-body) */
.chart-body {
    position: relative;
    width: 100%;
    /* عرض ثابت نسبت به والد (chart-container) */
    max-width: 100%;
    /* جلوگیری از بزرگ شدن بیش از حد */
    border: 1px solid var(--border);
    /* اختیاری: برای دیدن کادر */
    border-radius: 8px;
    padding: 10px;
    /* فاصله داخلی */
    box-sizing: border-box;
}

/* جلوگیری از اسکرول صفحه اصلی */
.charts-container {
    overflow: hidden;
    /* صفحه اصلی اسکرول نخوره */
}

/* بهبود اسکرول بار */
.chart-body::-webkit-scrollbar {
    height: 8px;
}

.chart-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chart-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.chart-body::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* استایل اضافی برای نمودار قابل اسکرول */
.chart-body {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
}

.chart-body::-webkit-scrollbar {
    height: 8px;
}

.chart-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chart-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.chart-body::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.chart-body canvas {
    min-width: 100%;
}

/* حالت گسترده */
.chart-body.expanded canvas {
    min-width: auto;
    width: auto !important;
}

/* بهبود نمایش در صفحات کوچک */
@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
    }

    .chart-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* استایل دکمه‌های حالت نمایش */
.chart-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.view-mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.view-mode-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.view-mode-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.view-mode-btn i {
    font-size: 14px;
}

/* استایل‌های گروه‌بندی داشبورد */
.dashboard-section {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.icon-sidebar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.toggle-sidebar .icon-blue,
.user-avatar-circle .icon-white {
    position: static;
    top: auto;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.icon-white {
    position: absolute;
    top: 15px;
    margin: 1px;
    color: #ffffff;
}

.icon-blue {
    position: absolute;
    top: 15px;
    margin: 1px;
    color: rgb(30, 136, 229);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}

.section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: 0 0 40px;
    line-height: 0;
}

.section-icon svg,
.stat-icon svg,
.dashboard-check-panel__icon svg,
.dashboard-inline-icon svg {
    display: block;
}

.dashboard-inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    color: inherit;
    line-height: 0;
    vertical-align: middle;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e3f2fd;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.12);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(30, 136, 229, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex: 0 0 56px;
    line-height: 0;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'IRANSans', monospace;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* رنگ‌های متفاوت برای بخش حسابداری */
.accounting-section .stat-icon {
    background: rgba(76, 175, 80, 0.12);
    color: #2e7d32;
}

.accounting-section .stat-value {
    color: #2e7d32;
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .dashboard-section {
        margin: 12px;
        padding: 16px;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-section {
        margin: 10px 0;
        padding: 14px;
        border-radius: 12px;
    }

    .section-header {
        margin-bottom: 14px;
    }

    .section-title {
        font-size: 16px;
    }

    .stat-value {
        font-size: 1.05rem;
    }

    .table-pagination {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
    }

    .table-pagination .btn {
        min-width: 0;
        flex: 1 1 140px;
        min-height: 44px;
    }

    .page-jump {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .reports-tabs {
        margin: 12px 0 0;
        padding: 8px;
        border-radius: 12px;
    }

    .tab {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
    }

    .reports-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .reports-content {
        padding: 0 0 16px;
    }
}



/* استایل‌های صفحه‌بندی */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.table-pagination .btn {
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.table-pagination .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.table-pagination .btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.2);
}

.page-jump {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.page-number-input {
    width: 58px;
    height: 38px;
    padding: 4px 7px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: #0f3d91;
    font: inherit;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.page-number-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, .12);
}

#tbl-cl {
    min-width: 1510px;
}

@media (max-width: 992px) {
    #tbl-cl {
        min-width: 980px;
    }

    thead th {
        font-size: 13px;
        padding: 10px 10px;
    }
}

@media (max-width: 768px) {
    #tbl-cl {
        min-width: 860px;
    }

    .table-container table,
    .table-wrap table,
    .rpt-scroll table,
    .tr-table-container table {
        min-width: 560px;
    }

    /* ستون‌های متنی گزارش اجازهٔ شکستن خط داشته باشند */
    .table-container td.col-name,
    .table-wrap td.col-name,
    .rpt-scroll td.col-name,
    .tr-table-container td.col-name,
    .rpt-table td.col-name {
        white-space: normal;
        overflow-wrap: anywhere;
        min-width: 0;
    }
}

#tbl-cl th,
#tbl-cl td {
    white-space: nowrap;
    vertical-align: middle;
}

/* Sticky key columns (RTL) for wide check-list */
#tbl-cl th:nth-child(1),
#tbl-cl td:nth-child(1) {
    position: sticky;
    right: 0;
    z-index: 4;
    background: #fff;
    box-shadow: -6px 0 10px -6px rgba(15, 23, 42, .22);
}

#tbl-cl thead th:nth-child(1) {
    z-index: 14;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

#tbl-cl th:nth-child(2),
#tbl-cl td:nth-child(2) {
    position: sticky;
    right: 70px;
    z-index: 3;
    background: #fff;
    box-shadow: -6px 0 10px -6px rgba(15, 23, 42, .18);
}

#tbl-cl thead th:nth-child(2) {
    z-index: 13;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

#tbl-cl tbody tr:nth-child(even) td:nth-child(1),
#tbl-cl tbody tr:nth-child(even) td:nth-child(2) {
    background: #fafafa;
}

#tbl-cl tbody tr:hover td:nth-child(1),
#tbl-cl tbody tr:hover td:nth-child(2) {
    background: #f0f7ff;
}

#tbl-cl .cl-active-heading {
    width: 52px;
    min-width: 52px;
}

#tbl-cl .cl-register-cell,
#tbl-cl .cl-active-cell {
    text-align: center;
}

.cl-register {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #f5e6a8;
    color: #aa8616;
    font-size: 23px;
    line-height: 1;
}

.cl-register:not(.is-registered) {
    opacity: .38;
    filter: grayscale(1);
}

.cl-active-mark {
    display: inline-grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 4px;
    color: #fff;
    font-weight: 800;
}

.cl-active-mark.is-active {
    background: #22a447;
}

.cl-active-mark.is-inactive {
    background: #b8b8b8;
}

.cl-status {
    display: inline-block;
    min-width: 100px;
    padding: 5px 9px;
    border-radius: 5px;
    text-align: center;
    font-weight: 700;
}

.cl-status.is-success { background: #bdf6c9; color: #146c2e; }
.cl-status.is-warning { background: #fff0b4; color: #8a6500; }
.cl-status.is-info { background: #c9c8ff; color: #343085; }
.cl-status.is-danger { background: #ffd0d0; color: #9c2525; }
.cl-status.is-returned-payment { background: #eadcff; color: #5b2a86; }
.cl-status.is-muted { background: #dce7f5; color: #425b76; }
.cl-status.is-pending { background: #ffd59d; color: #7c4a00; }

#tbl-cl .cl-row-inactive {
    color: #667085;
}

/* کارت‌های چک داشبورد */
.section-subtitle {
    margin: 4px 0 0;
    color: var(--text-light);
    font-size: 12px;
}

/* نمودار داشبورد */
.dashboard-chart-section {
    --dashboard-chart-height: 320px;
    --dashboard-chart-sale: #1e88e5;
    --dashboard-chart-purchase: #f43f5e;
    padding: 18px 20px 20px;
}

.dashboard-chart-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-chart-head__info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.dashboard-chart-head__icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 85%, #fff), var(--primary-dark));
    color: #fff;
    line-height: 0;
    box-shadow: 0 8px 18px rgba(30, 136, 229, .26);
}

.dashboard-chart-head__icon svg {
    display: block;
}

.dashboard-chart-head__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.2px;
}

.dashboard-chart-head__subtitle {
    margin: 2px 0 0;
    color: var(--text-light);
    font-size: 11.5px;
}

.dashboard-chart-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-chart-legend__item {
    --legend-color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 13px;
    border-radius: 14px;
    background: var(--white);
    border: 1px solid #e6edf5;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .05);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.dashboard-chart-legend__item:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--legend-color) 40%, #e6edf5);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--legend-color) 16%, transparent);
}

.dashboard-chart-legend__item--sale {
    --legend-color: var(--dashboard-chart-sale, #1e88e5);
}

.dashboard-chart-legend__item--purchase {
    --legend-color: var(--dashboard-chart-purchase, #f43f5e);
}

.dashboard-chart-legend__dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--legend-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--legend-color) 16%, transparent);
}

.dashboard-chart-legend__text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.dashboard-chart-legend__label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
}

.dashboard-chart-legend__value {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dashboard-chart-card {
    position: relative;
    max-width: 100%;
    margin-inline: 0;
    padding: 18px 14px 10px;
    border-radius: 20px;
    border: 1px solid #e6edf5;
    background:
        radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--primary) 7%, transparent) 0%, transparent 62%),
        linear-gradient(180deg, #fdfeff 0%, #f6f9fc 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .07), inset 0 1px 0 #fff;
    overflow: hidden;
}

.dashboard-chart-body {
    position: relative;
    height: var(--dashboard-chart-height);
    min-height: var(--dashboard-chart-height);
    max-height: var(--dashboard-chart-height);
    overflow: hidden;
    border: none;
    border-radius: 12px;
    padding: 0;
    background: transparent;
    flex: none;
}

.dashboard-chart-body canvas {
    width: 100% !important;
    min-width: 100% !important;
    height: 100% !important;
}

.dashboard-chart-loading,
.dashboard-chart-card>.empty-state {
    min-height: var(--dashboard-chart-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .dashboard-chart-section {
        --dashboard-chart-height: 260px;
        padding: 14px 14px 16px;
    }

    .dashboard-chart-legend {
        width: 100%;
        gap: 8px;
    }

    .dashboard-chart-legend__item {
        flex: 1 1 0;
        min-width: 0;
        padding: 7px 10px;
        border-radius: 12px;
    }

    .dashboard-chart-legend__value {
        font-size: 12px;
    }

    .dashboard-chart-card {
        max-width: none;
        padding: 14px 8px 6px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .dashboard-chart-section {
        --dashboard-chart-height: 230px;
    }

    .dashboard-chart-head__title {
        font-size: 15px;
    }
}

.dashboard-checks-section {
    --dashboard-check-card-height: 142px;
    --dashboard-check-card-gap: 12px;
}

.dashboard-check-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-check-panel {
    min-width: 0;
    padding: 16px;
    border: 1px solid #e3eaf3;
    border-radius: 14px;
    background: #f8fafc;
}

.dashboard-check-panel__header {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 14px;
}

.dashboard-check-panel__header h3 {
    margin: 0 0 3px;
    font-size: 16px;
    color: #26364a;
}

.dashboard-check-panel__header span {
    color: var(--text-light);
    font-size: 11px;
}

.dashboard-check-panel__icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    line-height: 0;
}

.dashboard-check-panel--payable .dashboard-check-panel__icon {
    color: #c2410c;
    background: #ffedd5;
}

.dashboard-check-panel--receivable .dashboard-check-panel__icon {
    color: #047857;
    background: #d1fae5;
}

.dashboard-check-scroll {
    height: calc((var(--dashboard-check-card-height) * 4) + (var(--dashboard-check-card-gap) * 3));
    min-height: 0;
    padding-left: 5px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    outline: none;
}

.dashboard-check-scroll:focus-visible {
    border-radius: 10px;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, .14);
}

.dashboard-check-cards {
    display: flex;
    flex-direction: column;
    gap: var(--dashboard-check-card-gap);
}

.dashboard-check-card {
    height: var(--dashboard-check-card-height);
    flex: 0 0 var(--dashboard-check-card-height);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 7px;
    box-sizing: border-box;
    padding: 13px 14px;
    overflow: hidden;
    border: 1px solid #e1e8f0;
    border-right: 4px solid var(--primary);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .045);
}

.dashboard-check-panel--payable .dashboard-check-card {
    border-right-color: #f97316;
}

.dashboard-check-panel--receivable .dashboard-check-card {
    border-right-color: #10b981;
}

.dashboard-check-card__top,
.dashboard-check-card__bottom,
.dashboard-check-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.dashboard-check-card__number {
    min-width: 0;
    overflow: hidden;
    color: #334155;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-check-card__number strong {
    color: #0f172a;
    font-size: 14px;
}

.dashboard-check-card__amount {
    color: #0f3d91;
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-check-card__amount small {
    margin-right: 4px;
    color: var(--text-light);
    font-size: 10px;
    font-weight: 500;
}

.dashboard-check-card__meta {
    justify-content: flex-start;
    color: #64748b;
    font-size: 11px;
}

.dashboard-check-card__meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-check-card__meta span:first-child {
    flex: 1 1 60%;
}

.dashboard-check-card__meta span:last-child {
    flex: 1 1 40%;
}

.dashboard-check-card__meta i,
.dashboard-check-card__bottom i,
.dashboard-check-card__meta .dashboard-inline-icon,
.dashboard-check-card__bottom .dashboard-inline-icon {
    margin-left: 4px;
    color: #94a3b8;
}

.dashboard-check-card__bottom {
    padding-top: 7px;
    border-top: 1px dashed #e2e8f0;
    color: #475569;
    font-size: 11px;
}

.dashboard-check-due-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-check-due-badge.is-today {
    background: #fef3c7;
    color: #92400e;
}

.dashboard-check-due-badge.is-overdue {
    background: #fee2e2;
    color: #b91c1c;
}

.dashboard-check-feedback {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 6px 2px;
    color: #64748b;
    font-size: 11px;
    text-align: center;
}

.dashboard-check-feedback .spinner {
    width: 20px;
    height: 20px;
    border-width: 3px;
}

.dashboard-check-empty {
    height: calc((var(--dashboard-check-card-height) * 4) + (var(--dashboard-check-card-gap) * 3));
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding: 24px;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 11px;
    background: #fff;
    text-align: center;
}

.dashboard-check-empty i,
.dashboard-check-empty .dashboard-inline-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: #94a3b8;
    font-size: 26px;
    line-height: 0;
}

.dashboard-check-retry {
    margin-right: 8px;
    padding: 5px 10px;
    color: var(--primary-dark);
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    background: #eff6ff;
    font: inherit;
    cursor: pointer;
}

.dashboard-check-card.is-skeleton {
    border-right-color: #dbe4ee;
    background: linear-gradient(90deg, #f8fafc 25%, #eef2f7 37%, #f8fafc 63%);
    background-size: 400% 100%;
    animation: dashboard-check-shimmer 1.25s ease-in-out infinite;
}

@keyframes dashboard-check-shimmer {
    from { background-position: 100% 0; }
    to { background-position: 0 0; }
}

.dashboard-check-scroll::-webkit-scrollbar {
    width: 7px;
}

.dashboard-check-scroll::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 999px;
}

.dashboard-check-scroll::-webkit-scrollbar-thumb {
    background: #b8c4d2;
    border-radius: 999px;
}

@media (max-width: 900px) {
    .dashboard-check-panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dashboard-checks-section {
        --dashboard-check-card-height: 150px;
    }

    .dashboard-check-panel {
        padding: 12px;
    }

    .dashboard-check-card__meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .dashboard-check-card__meta span {
        width: 100%;
    }
}

/* ========== Responsive shell polish (mobile / tablet) ========== */
@media (max-width: 992px) {
    .content {
        padding-inline: 10px;
    }

    .card {
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .account-header__actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .account-header__actions .btn,
    .account-header__actions .btn-outline {
        flex: 1 1 calc(50% - 8px);
        min-height: 44px;
    }

    .summary-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-section {
        gap: 12px;
    }

    .toolbar {
        gap: 10px;
    }

    /* اسکرول افقی جدول داخل کارت‌ها قطع نشود */
    .card:has(.table-container),
    .card:has(.table-wrap),
    .card:has(.rpt-scroll),
    .card:has(.accounting-document-table-container),
    .card:has(.payment-grid-wrap) {
        overflow: visible;
    }

    button,
    .btn,
    .btn-outline,
    .toggle-sidebar,
    .tab,
    .payment-tab,
    .sidebar-menu a {
        touch-action: manipulation;
    }
}

@media (max-width: 768px) {
    .summary-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-header__actions .btn,
    .account-header__actions .btn-outline {
        flex: 1 1 100%;
        height: auto;
        max-height: none;
        align-self: auto;
    }

    .sumbar {
        gap: 10px;
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .header-financial-year__label,
    .financial-year-updated {
        display: none;
    }

    .header-financial-year {
        padding: 4px 8px;
        max-width: min(160px, calc(100vw - 130px));
    }

    .financial-year-title {
        font-size: 11px;
        line-height: 1.3;
    }
}

@media (max-width: 576px) {
    .header-financial-year {
        max-width: min(120px, calc(100vw - 110px));
    }

    .financial-year-code {
        display: none !important;
    }
}

/* Sticky first columns for generic report tables (RTL) */
.table-container .rpt-table th:first-child,
.table-container .rpt-table td:first-child,
.table-wrap .rpt-table th:first-child,
.table-wrap .rpt-table td:first-child,
.rpt-scroll .rpt-table th:first-child,
.rpt-scroll .rpt-table td:first-child,
.tr-table-container .rpt-table th:first-child,
.tr-table-container .rpt-table td:first-child {
    position: sticky;
    right: 0;
    z-index: 4;
    background: #fff;
    box-shadow: -6px 0 10px -6px rgba(15, 23, 42, .2);
}

.table-container .rpt-table thead th:first-child,
.table-wrap .rpt-table thead th:first-child,
.rpt-scroll .rpt-table thead th:first-child,
.tr-table-container .rpt-table thead th:first-child {
    z-index: 14;
    background: var(--rpt-header-bg, var(--primary));
    color: #fff;
}

.table-container .rpt-table tbody tr:nth-child(even) td:first-child,
.table-wrap .rpt-table tbody tr:nth-child(even) td:first-child,
.rpt-scroll .rpt-table tbody tr:nth-child(even) td:first-child,
.tr-table-container .rpt-table tbody tr:nth-child(even) td:first-child {
    background: var(--rpt-row-even, #E1ECF4);
}

.table-container .rpt-table tbody tr:hover td:first-child,
.table-wrap .rpt-table tbody tr:hover td:first-child,
.rpt-scroll .rpt-table tbody tr:hover td:first-child,
.tr-table-container .rpt-table tbody tr:hover td:first-child {
    background: var(--rpt-row-hover, #d6e8f5);
}

.table-container .rpt-table tbody tr.is-selected td:first-child,
.table-wrap .rpt-table tbody tr.is-selected td:first-child,
.rpt-scroll .rpt-table tbody tr.is-selected td:first-child,
.tr-table-container .rpt-table tbody tr.is-selected td:first-child,
.table-container .rpt-table tbody tr.selected td:first-child,
.tr-table-container .rpt-table tbody tr.selected td:first-child {
    background: var(--rpt-row-selected, #2C9DF8);
    color: var(--rpt-row-selected-fg, #fff);
}

/* col-code + col-name sticky pair (taraz etc.) */
.rpt-table th.col-code,
.rpt-table td.col-code {
    position: sticky;
    right: 0;
    z-index: 5;
    background: #fff;
    box-shadow: -6px 0 10px -6px rgba(15, 23, 42, .2);
}

.rpt-table th.col-name,
.rpt-table td.col-name {
    position: sticky;
    right: 110px;
    z-index: 4;
    background: #fff;
    box-shadow: -6px 0 10px -6px rgba(15, 23, 42, .16);
}

.rpt-table thead th.col-code,
.rpt-table thead th.col-name {
    z-index: 15;
    background: var(--rpt-header-bg, var(--primary));
    color: #fff;
}

.rpt-table tbody tr:nth-child(even) td.col-code,
.rpt-table tbody tr:nth-child(even) td.col-name {
    background: var(--rpt-row-even, #E1ECF4);
}

.rpt-table tbody tr:hover td.col-code,
.rpt-table tbody tr:hover td.col-name {
    background: var(--rpt-row-hover, #d6e8f5);
}

@media print {
    .sidebar-backdrop,
    .rpt-table th.col-code,
    .rpt-table td.col-code,
    .rpt-table th.col-name,
    .rpt-table td.col-name,
    .table-container .rpt-table th:first-child,
    .table-container .rpt-table td:first-child {
        position: static !important;
        box-shadow: none !important;
    }
}


