/* =============================================================
   اندیشکده فدراسیون کشتی - استایل داشبورد مدیریتی
   رنگ سازمانی: آبی آسمانی + خاکستری، متن سرمه‌ای تیره / مشکی
   ============================================================= */

@font-face {
    font-family: 'Vazirmatn';
    src: url('/lib/vazirmatn/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/lib/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/lib/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/lib/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/lib/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --brand-primary: #0ea5e9;
    --brand-primary-dark: #0284c7;
    --brand-primary-soft: #e0f2fe;
    --brand-secondary: #475569;
    --brand-navy: #0f172a;

    --bg-body: #eef2f7;
    --bg-surface: #ffffff;
    --bg-surface-2: #f8fafc;
    --bg-hover: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    --sidebar-width: 268px;
    --header-height: 62px;
    --footer-height: 46px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
}

[data-theme="dark"] {
    --brand-primary: #38bdf8;
    --brand-primary-dark: #0ea5e9;
    --brand-primary-soft: #0c4a6e;
    --brand-secondary: #94a3b8;

    --bg-body: #070d18;
    --bg-surface: #0f1a2b;
    --bg-surface-2: #131f33;
    --bg-hover: #1a2739;

    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-color: #1e2b3f;
    --border-strong: #27364d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: .92rem;
    margin: 0;
    direction: rtl;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--brand-primary-dark);
}

a:hover {
    color: var(--brand-primary);
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ==================== چیدمان اصلی ==================== */
.app-wrapper {
    min-height: 100vh;
}

.app-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1rem;
    z-index: 1040;
}

.app-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: var(--footer-height);
    right: 0;
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: transform .25s ease;
}

.app-main {
    margin-right: var(--sidebar-width);
    padding: calc(var(--header-height) + 1rem) 1.25rem calc(var(--footer-height) + 1rem);
    transition: margin .25s ease;
    min-height: 100vh;
}

.app-footer {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    height: var(--footer-height);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    font-size: .78rem;
    color: var(--text-muted);
    z-index: 1035;
}

body.sidebar-collapsed .app-sidebar {
    transform: translateX(100%);
}

body.sidebar-collapsed .app-main {
    margin-right: 0;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(100%);
    }

    .app-main {
        margin-right: 0;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: var(--header-height) 0 var(--footer-height) 0;
        background: rgba(2, 6, 23, .45);
        z-index: 1025;
    }
}

/* ==================== سربرگ ==================== */
.brand-block {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 200px;
}

.brand-block img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.brand-title {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: .7rem;
    color: var(--text-muted);
}

.header-search {
    position: relative;
    max-width: 330px;
    flex: 1;
}

.header-search input {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: .45rem 2.4rem .45rem 1rem;
    font-size: .8rem;
    width: 100%;
    color: var(--text-primary);
}

.header-search input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .15);
}

.header-search .bi-search {
    position: absolute;
    right: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .85rem;
}

.header-search-results {
    position: absolute;
    top: calc(100% + .35rem);
    right: 0;
    left: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

.header-search-results.show {
    display: block;
}

.header-search-results a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .85rem;
    color: var(--text-secondary);
    font-size: .82rem;
    border-bottom: 1px solid var(--border-color);
}

.header-search-results a:last-child {
    border-bottom: none;
}

.header-search-results a:hover {
    background: var(--bg-hover);
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all .15s ease;
}

.header-icon-btn:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    border-color: var(--brand-primary);
}

.header-icon-btn .badge-dot {
    position: absolute;
    top: 1px;
    left: 1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .5rem .25rem .65rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-surface-2);
}

.user-chip img,
.user-chip .avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
}

.user-chip .user-name {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.1;
}

.user-chip .user-role {
    font-size: .66rem;
    color: var(--text-muted);
}

/* ==================== منوی کنار ==================== */
.sidebar-search {
    padding: .7rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-search input {
    width: 100%;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: .45rem .75rem;
    font-size: .78rem;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .45rem .5rem 1rem;
}

.menu-header {
    font-size: .66rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: .85rem .7rem .3rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .7rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: .83rem;
    font-weight: 500;
    transition: all .15s ease;
    margin-bottom: 2px;
}

.menu-link i {
    font-size: .98rem;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

.menu-link:hover {
    background: var(--bg-hover);
    color: var(--brand-primary-dark);
}

.menu-link:hover i {
    color: var(--brand-primary-dark);
}

.menu-link.active {
    background: linear-gradient(90deg, var(--brand-primary-soft), transparent);
    color: var(--brand-primary-dark);
    font-weight: 700;
    border-right: 3px solid var(--brand-primary);
}

.menu-link.active i {
    color: var(--brand-primary-dark);
}

.menu-sub {
    padding-right: 1.8rem;
}

.menu-sub .menu-link {
    font-size: .78rem;
    padding: .38rem .6rem;
}

.menu-sub .menu-link i {
    font-size: .78rem;
}


/* ==================== کارت‌ها و اجزای عمومی ==================== */
.page-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.page-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.page-card-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
}

.page-card-body {
    padding: 1rem;
}

/* نوار راهنمای صفحه (قابل بستن) */
.page-help {
    background: linear-gradient(90deg, var(--brand-primary-soft), transparent 85%);
    border: 1px solid var(--border-color);
    border-right: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: .75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    margin-bottom: 1rem;
}

.page-help .bi {
    color: var(--brand-primary-dark);
    font-size: 1.1rem;
    margin-top: .1rem;
}

.page-help-text {
    flex: 1;
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

.page-help-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1;
    padding: .15rem;
}

/* مسیر راهنما (breadcrumb) */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .8rem;
    flex-wrap: wrap;
}

.breadcrumb {
    margin: 0;
    font-size: .76rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

/* کارت آماری داشبورد */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: .95rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-label {
    font-size: .76rem;
    color: var(--text-muted);
}

.stat-trend {
    font-size: .7rem;
    font-weight: 600;
}


/* ==================== جداول ==================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table-app {
    width: 100%;
    margin: 0;
    font-size: .82rem;
    color: var(--text-secondary);
    border-collapse: separate;
    border-spacing: 0;
}

.table-app thead th {
    background: var(--bg-surface-2);
    color: var(--text-muted);
    font-weight: 700;
    font-size: .75rem;
    padding: .6rem .8rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-app thead th a {
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.table-app thead th a:hover {
    color: var(--brand-primary-dark);
}

.table-app tbody td {
    padding: .55rem .8rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table-app tbody tr:hover {
    background: var(--bg-hover);
}

.table-app tbody tr:last-child td {
    border-bottom: none;
}

.table-thumb {
    width: 54px;
    height: 38px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
}

.table-title {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-subtitle {
    font-size: .72rem;
    color: var(--text-muted);
}

.row-actions {
    display: flex;
    gap: .3rem;
    justify-content: flex-end;
}

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    font-size: .8rem;
    transition: all .15s ease;
}

.btn-icon:hover {
    background: var(--brand-primary-soft);
    border-color: var(--brand-primary);
    color: var(--brand-primary-dark);
}

.btn-icon.danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

/* ردیف برچسب فیلد با دکمه «افزودن» کنار آن (فرم فیلم) */
.field-label-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .35rem;
    margin-bottom: .35rem;
}

.field-label-row .form-label {
    margin-bottom: 0;
}

.btn-add-mini {
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--brand-primary);
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    font-size: .68rem;
    line-height: 1;
    transition: all .15s ease;
}

.btn-add-mini:hover {
    background: var(--brand-primary);
    color: #fff;
}

/* ==================== کمبوباکس جستجوپذیر ==================== */
.search-select {
    position: relative;
}

/* select اصلی برای ارسال فرم در DOM می‌ماند ولی دیده نمی‌شود (۱×۱ تا اعتبارسنجی آن را نبیند) */
.search-select > select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    border: 0;
}

.search-select-control {
    width: 100%;
    min-height: 38px;
    padding: .375rem .75rem;
    text-align: right;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: .875rem;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.search-select-control::after {
    content: "\F282";
    font-family: bootstrap-icons;
    font-size: .7rem;
    color: var(--text-secondary);
    transform: translateY(1px);
}

.search-select-control.is-empty {
    color: var(--text-secondary);
}

.search-select-control:hover,
.search-select.open .search-select-control {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 .15rem var(--brand-primary-soft);
}

.search-select-menu {
    display: none;
    position: absolute;
    z-index: 1055;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
    overflow: hidden;
}

.search-select.open .search-select-menu {
    display: block;
}

.search-select-search-wrap {
    padding: .45rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-2);
}

.search-select-search {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: .3rem .55rem;
    font-size: .8rem;
    background: var(--bg-surface);
    color: var(--text-primary);
}

.search-select-list {
    max-height: 240px;
    overflow-y: auto;
    padding: .25rem;
}

.search-select-option {
    padding: .38rem .55rem;
    border-radius: 7px;
    font-size: .82rem;
    cursor: pointer;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-select-option:hover,
.search-select-option.focused {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
}

.search-select-option.selected {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    font-weight: 600;
}

.search-select-empty {
    padding: .5rem .55rem;
    font-size: .78rem;
    color: var(--text-secondary);
}

/* ==================== انتخاب‌گر برچسب ==================== */
.tag-picker {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: .55rem;
    background: var(--bg-surface-2);
}

.tag-picker-selected {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    min-height: 34px;
    align-items: center;
    padding-bottom: .45rem;
    margin-bottom: .45rem;
    border-bottom: 1px dashed var(--border-color);
}

.tag-picker-placeholder {
    font-size: .78rem;
    color: var(--text-secondary);
}

.tag-selected {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .45rem .18rem .35rem;
    border-radius: 999px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    border: 1px solid var(--brand-primary);
    font-size: .76rem;
    font-weight: 600;
}

.tag-selected-remove {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: .95rem;
    line-height: 1;
    padding: 0 0 0 .1rem;
    cursor: pointer;
}

.tag-picker-search {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: .32rem .55rem;
    font-size: .8rem;
    margin-bottom: .45rem;
    background: var(--bg-surface);
    color: var(--text-primary);
}

.tag-picker-list {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    max-height: 190px;
    overflow-y: auto;
}

.tag-chip {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: .18rem .6rem;
    font-size: .76rem;
    cursor: pointer;
    transition: all .12s ease;
}

.tag-chip:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
}

.tag-picker-noresult {
    font-size: .78rem;
    color: var(--text-secondary);
    padding: .35rem .1rem 0;
}

.tag-picker-clear {
    font-size: .74rem;
    color: #b91c1c;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

/* نوار ابزار جدول */
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-2);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.table-toolbar .form-control,
.table-toolbar .form-select {
    font-size: .8rem;
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.advanced-filters {
    display: none;
    padding: .7rem 1rem;
    background: var(--bg-surface-2);
    border-bottom: 1px solid var(--border-color);
}

.advanced-filters.show {
    display: block;
}

/* صفحه‌بندی */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .65rem 1rem;
    border-top: 1px solid var(--border-color);
    font-size: .78rem;
    color: var(--text-muted);
}

.pagination {
    margin: 0;
    gap: .2rem;
}

.pagination .page-link {
    border-radius: 7px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: .78rem;
    padding: .3rem .6rem;
    background: var(--bg-surface);
}

.pagination .page-item.active .page-link {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    opacity: .6;
}


/* ==================== نشان‌ها (Badge) ==================== */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .22rem .5rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
}

.badge-soft-primary { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.badge-soft-success { background: #dcfce7; color: #15803d; }
.badge-soft-warning { background: #fef3c7; color: #b45309; }
.badge-soft-danger  { background: #fee2e2; color: #b91c1c; }
.badge-soft-secondary { background: #e2e8f0; color: #475569; }
.badge-soft-info    { background: #e0f2fe; color: #0369a1; }

[data-theme="dark"] .badge-soft-success { background: #052e16; color: #4ade80; }
[data-theme="dark"] .badge-soft-warning { background: #422006; color: #fbbf24; }
[data-theme="dark"] .badge-soft-danger  { background: #450a0a; color: #f87171; }
[data-theme="dark"] .badge-soft-secondary { background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .badge-soft-info { background: #0c4a6e; color: #7dd3fc; }

/* ==================== فرم‌ها ==================== */
.form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: .3rem;
}

.form-label .required {
    color: #ef4444;
    margin-right: .15rem;
}

.form-control,
.form-select {
    font-size: .83rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: .45rem .7rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .14);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-size: .78rem;
}

.form-text {
    font-size: .72rem;
    color: var(--text-muted);
}

.field-validation-error {
    display: block;
    font-size: .72rem;
    color: #dc2626;
    margin-top: .2rem;
}

.input-validation-error {
    border-color: #dc2626 !important;
}

.form-check-input:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* تب‌های مدرن */
.nav-tabs-app {
    border-bottom: 1px solid var(--border-color);
    gap: .25rem;
    padding: 0 .5rem;
}

.nav-tabs-app .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: .83rem;
    font-weight: 600;
    padding: .6rem .85rem;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: transparent;
}

.nav-tabs-app .nav-link:hover {
    color: var(--brand-primary-dark);
    background: var(--bg-hover);
}

.nav-tabs-app .nav-link.active {
    color: var(--brand-primary-dark);
    border-bottom-color: var(--brand-primary);
    background: transparent;
}

.nav-tabs-app .nav-link i {
    margin-left: .3rem;
}


/* ==================== ورود ==================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 15% 20%, rgba(14, 165, 233, .22), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(2, 132, 199, .18), transparent 45%),
        var(--bg-body);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.login-logo {
    width: 68px;
    height: 68px;
    margin: 0 auto .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 8px 20px rgba(14, 165, 233, .35);
}

.login-title {
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: .2rem;
}

.login-subtitle {
    font-size: .78rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.4rem;
}

.login-footer {
    text-align: center;
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: 1.2rem;
}

/* ==================== اجزای دیگر ==================== */
.avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-surface);
    box-shadow: var(--shadow-md);
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.timeline {
    position: relative;
    padding-right: 1.6rem;
}

.timeline::before {
    content: '';
    position: absolute;
    right: .45rem;
    top: .3rem;
    bottom: .3rem;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -1.35rem;
    top: .35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-primary);
    border: 2px solid var(--bg-surface);
}

.timeline-title {
    font-size: .83rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: .15rem;
}

.timeline-meta {
    font-size: .72rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state .bi {
    font-size: 2.4rem;
    color: var(--border-strong);
    margin-bottom: .6rem;
    display: block;
}

.empty-state-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-box {
    position: relative;
    height: 260px;
}

/* اصلاح تقویم شمسی */
.datepicker-plot-area {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    border-radius: var(--radius-sm);
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow-lg);
}

.datepicker-plot-area .datepicker-day-view .table-days td span.selected {
    background-color: var(--brand-primary) !important;
}

/* سازگاری دارک مود با بوت‌استرپ */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .offcanvas,
[data-theme="dark"] .accordion-item,
[data-theme="dark"] .accordion-button {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: var(--bg-hover);
    color: var(--brand-primary);
}

[data-theme="dark"] .btn-light {
    background: var(--bg-surface-2);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-secondary);
}

[data-theme="dark"] .dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--brand-primary);
}

[data-theme="dark"] .bg-white {
    background: var(--bg-surface) !important;
}

[data-theme="dark"] .bg-light {
    background: var(--bg-surface-2) !important;
}

/* چاپ */
@media print {
    .app-header, .app-sidebar, .app-footer, .table-toolbar, .row-actions, .page-help {
        display: none !important;
    }

    .app-main {
        margin: 0;
        padding: 0;
    }
}

