/* =============================================
   متغیرهای طراحی (Design Tokens)
   برای کنترل یکپارچه کل سیستم
   ============================================= */
:root {
    /* رنگ‌های اصلی */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.08);
    --primary-glow: rgba(79, 70, 229, 0.25);
    
    /* رنگ‌های سیستمی */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #06b6d4;
    --info-light: rgba(6, 182, 212, 0.1);

    /* رنگ‌های متن */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* رنگ‌های پس‌زمینه و_BORDER */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --border-color: rgba(148, 163, 184, 0.2);
    --border-strong: rgba(148, 163, 184, 0.35);

    /* سایه‌ها و افکت‌ها */
    --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03);
    --shadow-hover: 0 4px 6px rgba(15, 23, 42, 0.05), 0 10px 24px rgba(15, 23, 42, 0.08);
    --shadow-glass: 0 8px 32px rgba(15, 23, 42, 0.08);
    
    /* انیمیشن و گردی */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* تنظیمات کلی صفحه */
body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== هدر (Navbar) با افکت شیشه‌ای ===== */
.main-header {
    height: 56px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.menu-toggle {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
}
.menu-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}
.header-company {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-main);
    display: none;
    align-items: center;
    gap: .4rem;
}
@media (min-width: 768px) {
    .header-company { display: flex; }
}
.header-dropdown .dropdown-toggle {
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-main);
    padding: .35rem .75rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    display: flex;
    align-items: center;
}
.header-dropdown .dropdown-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.header-dropdown .dropdown-toggle::after {
    margin-right: .35rem;
    margin-left: 0;
}

/* ===== سایدبار ===== */
.sidebar {
    width: 260px;
    height: calc(100vh - 56px);
    background-color: var(--bg-surface);
    overflow: hidden;
    transition: transform var(--transition);
    z-index: 1040;
    display: flex;
    flex-direction: column;
}
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 12px;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        top: 56px;
        right: 0;
        transform: translateX(0) !important;
        box-shadow: -4px 0 20px rgba(15, 23, 42, 0.04);
        z-index: 1035;
    }
}
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        height: 100vh;
        transform: translateX(100%);
        box-shadow: var(--shadow-glass);
        z-index: 1055;
    }
    .sidebar.show {
        transform: translateX(0);
    }
}
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}
.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* هدر سایدبار */
.sidebar-header {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
}
.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.sidebar-brand-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-main);
}
.sidebar-close {
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--primary-light);
    color: var(--text-muted);
    font-size: .95rem;
    cursor: pointer;
    transition: all var(--transition);
}
.sidebar-close:hover {
    background: var(--danger);
    color: #fff;
    transform: rotate(90deg);
}
@media (max-width: 991.98px) {
    .sidebar-close { display: inline-flex; }
}

/* دسته‌بندی و جداکننده منو */
.sidebar-group-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: .06em;
    padding: .85rem 12px .35rem;
}
.sidebar-divider {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: .35rem 12px;
}

/* آیتم‌های منوی سایدبار */
.nav-pills .nav-link {
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.nav-pills .nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    transform: translateX(-4px);
}
.nav-pills .nav-link.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ===== محتوای اصلی ===== */
#page-content-wrapper {
    transition: margin-right var(--transition);
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
}
@media (min-width: 992px) {
    #page-content-wrapper {
        margin-right: 260px;
    }
}
#page-content-wrapper > .container-fluid {
    flex: 1;
}

/* ===== فوتر ===== */
.main-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: .85rem 0;
    font-size: .82rem;
    margin-top: auto;
}
.main-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}
.main-footer a:hover {
    color: var(--primary);
}

/* ===== کارت‌ها ===== */
.card {
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid var(--border-color);
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* کارت بدون هاور (لیست‌ها و فیلترها) */
.static-card, .form-card {
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.static-card:hover, .form-card:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
}

/* ===== جداول ===== */
.table {
    background-color: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.table thead th {
    background-color: var(--bg-body);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .82rem;
    border-bottom: 2px solid var(--border-strong);
    padding: 14px 16px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}
.table tbody tr {
    transition: all var(--transition);
}
.table tbody tr:hover {
    background-color: var(--primary-light);
}

/* ===== دکمه‌ها ===== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .88rem;
    transition: all var(--transition);
    border: 1.5px solid transparent;
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* =============================================
   فرم‌ها — استایل‌های عمومی
   ============================================= */
.form-card-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-body), var(--bg-surface));
}
.form-card-header h5 {
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    font-size: 1.05rem;
}
.form-card-body {
    padding: 1.5rem;
}

.form-section-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: .04em;
    margin-bottom: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.form-section-label i { font-size: .85rem; color: var(--primary); }
.form-section-label::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--border-strong), transparent);
}

.form-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--border-color), transparent);
    margin: 1.25rem 0;
}

.form-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: .35rem;
}
.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control, .form-select {
    border-radius: var(--radius-sm);
    padding: .65rem .85rem;
    border: 1.5px solid var(--border-strong);
    font-size: .9rem;
    transition: all var(--transition);
    background-color: var(--bg-surface);
    color: var(--text-main);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background-color: var(--bg-surface);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { min-height: 100px; resize: vertical; }
select[multiple] { border-radius: var(--radius-sm); }

/* ===== سیستم انتخاب تگی (Tag Select) ===== */
.tag-select { position: relative; }
.tag-select-box {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 10px; min-height: 48px;
    border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--bg-surface); cursor: text;
    transition: all var(--transition); align-items: center;
}
.tag-select-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}
.tag-select-tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 8px 4px 12px;
    background: var(--primary-light);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 20px;
    font-size: .8rem; font-weight: 600; color: var(--primary);
    animation: tagPop .2s ease;
}
@keyframes tagPop {
    from { opacity: 0; transform: scale(.8); }
    to   { opacity: 1; transform: scale(1); }
}
.tag-select-tag .tag-remove {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(79, 70, 229, 0.15); color: var(--primary);
    font-size: .65rem; cursor: pointer;
    transition: all var(--transition); border: none; padding: 0;
}
.tag-select-tag .tag-remove:hover { background: var(--danger); color: #fff; }
.tag-select-input {
    border: none; outline: none; flex: 1; min-width: 100px;
    font-size: .88rem; padding: 2px 0; background: transparent; font-family: inherit;
}
.tag-select-input::placeholder { color: var(--text-light); }
.tag-select-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    background: var(--bg-surface); border: 1.5px solid var(--border-strong);
    border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-glass); max-height: 250px; overflow-y: auto; display: none;
}
.tag-select-dropdown.show { display: block; }
.tag-select-dropdown::-webkit-scrollbar { width: 5px; }
.tag-select-dropdown::-webkit-scrollbar-track { background: transparent; }
.tag-select-dropdown::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
.tag-select-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; cursor: pointer;
    transition: all .15s ease; border-bottom: 1px solid var(--border-color);
}
.tag-select-option:last-child { border-bottom: none; }
.tag-select-option:hover { background: var(--primary-light); }
.tag-select-option.selected { background: var(--primary-light); }
.tag-select-option .opt-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.tag-select-option .opt-info { flex: 1; min-width: 0; }
.tag-select-option .opt-name { font-size: .85rem; font-weight: 600; color: var(--text-main); }
.tag-select-option .opt-sub { font-size: .72rem; color: var(--text-light); }
.tag-select-option .opt-check {
    width: 20px; height: 20px; border-radius: 6px;
    border: 1.5px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; color: transparent;
    transition: all var(--transition); flex-shrink: 0;
}
.tag-select-option.selected .opt-check {
    background: var(--primary); border-color: var(--primary); color: #fff;
}
.tag-select-empty { padding: 20px; text-align: center; color: var(--text-light); font-size: .85rem; }
.tag-select-hint { font-size: .75rem; color: var(--text-muted); margin-top: 6px; }
.tag-select-hint strong { color: var(--primary); }

/* خلاصه تگ‌ها */
.tag-select-summary {
    display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 8px;
    padding: 8px 10px; background: var(--primary-light);
    border-radius: var(--radius-sm); border: 1px dashed rgba(79, 70, 229, 0.15);
}
.tag-select-summary-item { font-size: .78rem; color: var(--primary); font-weight: 500; }
.tag-select-summary-item:not(:last-child)::after { content: '،'; color: var(--border-strong); margin-left: 4px; }
.tag-select-empty-summary { font-size: .78rem; color: var(--text-light); font-style: italic; }

/* ===== لیست چک‌باکس اسکرولی ===== */
.checkbox-list {
    max-height: 180px; overflow-y: auto; padding: 12px;
    background: var(--bg-body); border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm); transition: all var(--transition);
}
.checkbox-list:focus-within {
    border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); background: var(--bg-surface);
}
.checkbox-list::-webkit-scrollbar { width: 4px; }
.checkbox-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
.checkbox-list .form-check { padding: 7px 0; border-bottom: 1px solid var(--border-color); margin-bottom: 0; }
.checkbox-list .form-check:last-child { border-bottom: none; }
.checkbox-list .form-check-label { font-size: .88rem; font-weight: 500; cursor: pointer; }
.checkbox-list .form-check { padding-right: 1.75rem; padding-left: 0; padding-top: 0; padding-bottom: 0; }
.checkbox-list .form-check-input { float: right; margin-right: -1.75rem; margin-left: 0; }

/* ===== نوار اقدامات پایین فرم ===== */
.form-actions {
    display: flex; justify-content: flex-end; gap: .5rem;
    padding-top: 1.25rem; margin-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}
.form-actions .btn {
    padding: .6rem 1.75rem; font-weight: 600; border-radius: var(--radius-sm);
}

/* ===== دکمه‌های عملیات جداول ===== */
.action-btn, .btn-icon {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); transition: all var(--transition);
    font-size: .85rem; padding: 0;
}
.action-btn:hover, .btn-icon:hover { transform: translateY(-2px); }

.action-btn.btn-outline-primary:hover, .btn-icon.btn-outline-primary:hover { background: var(--primary); color: #fff !important; border-color: var(--primary); box-shadow: 0 4px 12px var(--primary-glow);}
.action-btn.btn-outline-warning:hover, .btn-icon.btn-outline-warning:hover { background: var(--warning); color: #fff !important; border-color: var(--warning); box-shadow: 0 4px 12px var(--warning-light);}
.action-btn.btn-outline-danger:hover, .btn-icon.btn-outline-danger:hover  { background: var(--danger); color: #fff !important; border-color: var(--danger); box-shadow: 0 4px 12px var(--danger-light);}
.action-btn.btn-outline-success:hover { background: var(--success); color: #fff !important; border-color: var(--success); box-shadow: 0 4px 12px var(--success-light);}

.btn-lift { transition: all var(--transition); }
.btn-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* ===== شماره ردیف دایره‌ای ===== */
.row-number, .reso-number {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: .78rem; font-weight: 700; flex-shrink: 0;
}
.row-number { background: var(--bg-body); color: var(--text-muted); }
.reso-number { background: var(--primary); color: #fff; box-shadow: 0 2px 8px var(--primary-glow);}

/* ===== حالت خالی جداول ===== */
.table-empty, .tbl-empty { padding: 3.5rem 1rem; text-align: center; }
.table-empty-icon { width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-body); margin-bottom: .75rem; }
.table-empty-icon i { font-size: 1.4rem; color: var(--text-light); }
.tbl-empty-icon { font-size: 2.8rem; color: var(--border-strong); margin-bottom: .75rem; }
.table-empty-title, .tbl-empty-title { font-weight: 600; color: var(--text-muted); margin-bottom: .25rem; font-size: 1rem;}
.table-empty-desc, .tbl-empty-desc { font-size: .85rem; color: var(--text-light); }

/* ===== درخت شرکت‌ها ===== */
.tree-toggle {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; border: none;
    background: var(--primary-light); color: var(--primary);
    font-size: .65rem; cursor: pointer;
    transition: all var(--transition); flex-shrink: 0;
}
.tree-toggle:hover { background: rgba(79, 70, 229, 0.15); transform: scale(1.1); }
.tree-toggle .toggle-icon { transition: transform .2s ease; display: inline-block; }
.company-node.collapsed .toggle-icon { transform: rotate(-90deg); }
.tree-connector { position: absolute; right: -16px; top: 0; bottom: 0; width: 1.5px; background: var(--primary-light); }

/* =============================================
   صفحه جزئیات جلسه
   ============================================= */
.info-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 20px;
    font-size: .8rem; font-weight: 500; white-space: nowrap;
    background: var(--bg-body); color: var(--text-muted); border: 1px solid var(--border-color);
}
.info-chip i { font-size: .75rem; color: var(--primary); }

/* پنل حاضرین / غائبین */
.attendee-panel {
    padding: 1rem; border-radius: var(--radius-md);
    border: 1px solid var(--border-color); background: var(--bg-surface); height: 100%;
}
.attendee-panel--present { border-color: rgba(16, 185, 129, 0.2); background: rgba(16, 185, 129, 0.02); }
.attendee-panel--absent  { border-color: rgba(239, 68, 68, 0.15); background: rgba(239, 68, 68, 0.02); }

.attendee-panel-title {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; margin-bottom: .75rem;
    display: flex; align-items: center; gap: 6px;
}
.attendee-panel-title--present { color: #059669; }
.attendee-panel-title--absent  { color: #dc2626; }

.attendee-sub-label {
    font-size: .72rem; font-weight: 600; color: var(--text-muted);
    margin-bottom: .4rem; padding-bottom: .3rem;
    border-bottom: 1px dashed var(--border-strong);
}

/* چپ کاربر */
.user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: var(--radius-md);
    background: var(--bg-surface); border: 1px solid var(--border-color);
    transition: all var(--transition);
}
.user-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.user-chip-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; color: #fff; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
}
.user-chip-body { min-width: 0; }
.user-chip-name {
    display: block; font-size: .84rem; font-weight: 600;
    color: var(--text-main); line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px;
}
.user-chip-sub { display: block; font-size: .7rem; color: var(--text-light); line-height: 1.3; }

/* چپ شخص خارجی */
.ext-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: var(--radius-sm);
    background: var(--bg-body); border: 1px solid var(--border-color);
    font-size: .82rem; color: var(--text-main);
}
.ext-chip-icon {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; flex-shrink: 0;
}
.ext-chip--present .ext-chip-icon { background: var(--success-light); color: var(--success); }
.ext-chip--absent  .ext-chip-icon { background: var(--danger-light); color: var(--danger); }
.ext-chip-sub { color: var(--text-light); font-size: .72rem; }

.attendee-none {
    display: flex; align-items: center; gap: 6px;
    font-size: .82rem; color: var(--text-light); font-style: italic; padding: 4px 0;
}

/* =============================================
   ضمایم و یادداشت‌ها
   ============================================= */
.att-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg-surface); border: 1px solid var(--border-color);
    text-decoration: none; transition: all var(--transition);
}
.att-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.att-item--file:hover { border-color: var(--success); }
.att-item-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .95rem;
}
.att-item-icon--file { background: var(--success-light); color: var(--success); }
.att-item-icon--note { background: var(--warning-light); color: var(--warning); }
.att-item-name { font-size: .84rem; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.att-item-hint { font-size: .7rem; color: var(--text-light); }
.att-item-download { color: var(--text-light); font-size: .85rem; flex-shrink: 0; margin-right: auto; transition: color var(--transition); }
.att-item:hover .att-item-download { color: var(--primary); }

.att-note {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--warning-light); border: 1px dashed rgba(245, 158, 11, 0.2);
}
.att-note i { color: var(--warning); font-size: .85rem; flex-shrink: 0; margin-top: 2px; }
.att-note span { font-size: .82rem; color: var(--text-main); line-height: 1.6; }

/* =============================================
   آکاردئون مصوبات
   ============================================= */
.resolutions-accordion .accordion-button::after { margin-right: auto; margin-left: 0; }
.resolutions-accordion .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%234f46e5'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
.resolutions-accordion .accordion-button {
    border-radius: var(--radius-md) !important; padding: 1rem 1.25rem; transition: all var(--transition); font-weight: 600;
}
.resolutions-accordion .accordion-button:not(.collapsed) {
    background: var(--primary-light); box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.1); color: var(--text-main);
}
.resolutions-accordion .accordion-item {
    border-radius: var(--radius-md) !important; overflow: hidden;
    border: 1px solid var(--border-color); transition: box-shadow var(--transition); margin-bottom: .75rem; background: var(--bg-surface);
}
.resolutions-accordion .accordion-item:hover { box-shadow: var(--shadow-hover) !important; }
.resolutions-accordion .accordion-body { padding: 1.25rem 1.5rem; }

/* بج وضعیت مصوبه */
.reso-status { min-width: 72px; text-align: center; font-size: .76rem; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.reso-status--done    { background: var(--success-light); color: #059669; }
.reso-status--active  { background: var(--warning-light); color: #d97706; }
.reso-status--new     { background: var(--bg-body); color: var(--text-muted); border: 1px solid var(--border-color); }

/* باکس متن مصوبه */
.reso-text-box {
    padding: 1rem; border-radius: var(--radius-sm);
    background: var(--primary-light); border-right: 4px solid var(--primary);
    line-height: 1.9; font-size: .9rem; color: var(--text-main);
}

/* کارت اطلاعات کلیدی مصوبه */
.reso-info-card { padding: .85rem; border-radius: var(--radius-sm); background: var(--bg-body); border: 1px solid var(--border-color); height: 100%; }
.reso-info-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--text-light); margin-bottom: .35rem; letter-spacing: .03em; }
.reso-info-value { font-size: .86rem; font-weight: 600; color: var(--text-main); }

.actions-table tbody tr { transition: background .12s ease; }
.actions-table tbody tr:hover { background: var(--primary-light) !important; }

/* عدد تاثیر */
.impact-badge {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--info-light); color: var(--info); font-size: .85rem; font-weight: 700;
}

/* نوار پیشرفت مینیاتوری */
.mini-progress, .mini-bar { background: var(--border-color); border-radius: 10px; overflow: hidden; }
.mini-progress { width: 80px; height: 6px; }
.mini-bar { width: 64px; height: 5px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.mini-progress-fill, .mini-bar-fill { height: 100%; border-radius: 10px; transition: width .4s ease; }
.mini-progress-fill--done, .mini-bar-fill--done   { background: var(--success); }
.mini-progress-fill--active, .mini-bar-fill--active { background: var(--warning); }
.mini-progress-fill--new, .mini-bar-fill--new    { background: var(--border-strong); }

.progress-text { font-size: .76rem; font-weight: 600; }
.progress-text--done   { color: var(--success); }
.progress-text--active { color: #d97706; }
.progress-text--new    { color: var(--text-light); }

/* ضمایم درون مصوبه */
.reso-att-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: .78rem; text-decoration: none; transition: all var(--transition); }
.reso-att-chip--file { background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-main); }
.reso-att-chip--file:hover { border-color: var(--success); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.reso-att-chip--note { background: var(--warning-light); color: var(--text-main); border: none; }

/* ضریب تاثیر */
.impact-badge-reso { font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: rgba(124,58,237,.08); color: #7c3aed; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(124,58,237,0.15);}
.impact-badge-reso i { font-size: .68rem; }

/* حاشیه رنگی مصوبات */
.reso-card--new    { border-left: 4px solid var(--text-light) !important; }
.reso-card--active { border-left: 4px solid var(--warning) !important; }
.reso-card--done   { border-left: 4px solid var(--success) !important; }

/* =============================================
   تایم‌لاین لاگ‌ها
   ============================================= */
.log-timeline { position: relative; }
.log-item { position: relative; padding-right: 36px; padding-bottom: 8px; border-radius: var(--radius-sm); transition: background var(--transition); margin-bottom: 4px;}
.log-item:hover { background: var(--primary-light); }
.log-item::before { content: ''; position: absolute; right: 10px; top: 30px; bottom: -4px; width: 2px; background: var(--border-color); }
.log-item:last-child::before { display: none; }

.log-dot { position: absolute; right: 2px; top: 8px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--bg-surface); box-shadow: 0 0 0 2px var(--border-strong); }
.log-dot--create  { background: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
.log-dot--edit    { background: var(--info); }
.log-dot--delete  { background: var(--danger); }
.log-dot--progress{ background: var(--success); }
.log-dot--default { background: var(--text-muted); }

.log-badge { font-size: .72rem; padding: 3px 10px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.log-badge--create  { background: var(--primary-light); color: var(--primary); }
.log-badge--edit    { background: var(--info-light); color: #0891b2; }
.log-badge--delete  { background: var(--danger-light); color: var(--danger); }
.log-badge--progress{ background: var(--success-light); color: var(--success); }
.log-badge--default { background: var(--bg-body); color: var(--text-muted); }

.log-meta { font-size: .76rem; color: var(--text-light); display: flex; align-items: center; gap: 5px; }
.log-meta-sep { color: var(--border-strong); }

/* =============================================
   استایل میتینگ لیست
   ============================================= */
.stat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.stat-chip--green  { background: var(--success-light); color: #059669; }
.stat-chip--red    { background: var(--danger-light); color: #dc2626; }
.stat-chip--blue   { background: var(--primary-light); color: var(--primary); }
.stat-chip--gray   { background: var(--bg-body); color: var(--text-muted); border: 1px solid var(--border-color);}

.m-row { transition: background var(--transition); cursor: default; }
.m-row:hover { background: var(--primary-light); }

.session-code {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 26px; padding: 0 8px;
    border-radius: 6px; font-size: .8rem; font-weight: 700;
    background: var(--bg-body); color: var(--text-muted); border: 1px solid var(--border-color);
}

.filter-select {
    border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: .5rem .85rem; font-size: .88rem; transition: all var(--transition); background: var(--bg-surface);
}
.filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); outline: none; }

/* =============================================
   باکس‌بندی فرم‌ها (سبک KPI/سکشن‌ها)
   ============================================= */
.sbox {
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 24px; margin-bottom: 24px;
    box-shadow: var(--shadow-soft); transition: box-shadow var(--transition);
}
.sbox:hover { box-shadow: var(--shadow-hover); }
.stitle {
    font-size: .88rem; font-weight: 700; color: var(--text-main);
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex; align-items: center; gap: 8px;
}
.stitle i { color: var(--primary); }
.rg { display: flex; gap: 12px; flex-wrap: wrap; }
.rg label {
    cursor: pointer; padding: 10px 20px;
    border: 2px solid var(--border-strong); border-radius: var(--radius-md);
    font-size: .85rem; font-weight: 600;
    transition: all var(--transition); margin-bottom: 0;
}
.rg label:hover { border-color: var(--text-light); transform: translateY(-1px); }
.rg label:has(input:checked) {
    border-color: var(--primary); background: var(--primary-light); color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}
.rg input { display: none; }
.fg { display: none; }
.fg.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.ilc { display: flex; gap: 8px; align-items: flex-start; }
.ilc select, .ilc input { flex: 1; }
.abtn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); flex-shrink: 0; transition: all var(--transition); }
.abtn:hover { transform: scale(1.05); }

/* بخش‌های کشویی */
.collapse-section { outline: none; }
.collapse-section summary { list-style: none; cursor: pointer; user-select: none; }
.collapse-section summary::-webkit-details-marker { display: none; }
.collapse-section[open] .collapse-chevron { transform: rotate(180deg); }
.collapse-chevron { transition: transform .25s ease; }

/* =============================================
   اسکرول‌بار سفارشی
   ============================================= */
.custom-scroll::-webkit-scrollbar { width: 5px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== ریسپانسیو نهایی ===== */
@media (max-width: 768px) {
    .card-header h5 { font-size: 1.1rem; }
    .accordion-button { padding: 1rem; }
    .d-flex.flex-column.flex-md-row { flex-direction: column !important; align-items: stretch !important; }
    .d-flex.flex-column.flex-md-row > div { margin-bottom: 1rem; }
    .form-card-body { padding: 1rem; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
    
    /* بهبود تایپوگرافی در موبایل */
    body { font-size: 14px; }
    .table thead th, .table tbody td { padding: 10px 8px; font-size: .82rem; }
	
}

/* ===== آیتم‌های لینک‌دار سایدبار داخلی صفحات ===== */
.sidebar-sub-item {
    transition: all var(--transition);
    border: 1px solid transparent;
}
.sidebar-sub-item:hover {
    background: var(--primary-light);
    border-color: rgba(79, 70, 229, 0.1);
    transform: translateX(-4px);
}
.sidebar-sub-item:hover i.bi-chevron-left {
    color: var(--primary);
}


/* =============================================
   درخت ساختار شرکتی (Company Tree View)
   ============================================= */
.tree-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* استایل پایه هر نود */
.tree-node-item {
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

/* نودهای ریشه (شرکت مادر) */
.tree-node-item:has(> .tree-children-wrapper) {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}
.tree-node-item:has(> .tree-children-wrapper) > .tree-node-content {
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}
/* نمایش خط زیر ریشه وقتی باز است */
.tree-node-item.is-parent:not(.is-collapsed):has(> .tree-children-wrapper) > .tree-node-content {
    border-bottom-color: var(--border-color);
}

/* نودهای فرزند (زیرمجموعه‌ها) - ظاهر لیستی و فشرده */
.tree-children-inner > .tree-node-item {
    background: transparent;
    border: none;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    margin: 0;
}
.tree-children-inner > .tree-node-item:last-child {
    border-bottom: none;
}
/* تورفتگی زیرمجموعه‌ها */
.tree-children-inner {
    padding-right: 24px;
    background: linear-gradient(to left, rgba(79, 70, 229, 0.02), transparent);
}

/* هاور نودها */
.tree-node-content {
    transition: background var(--transition);
    border-radius: var(--radius-md);
}
.tree-children-inner > .tree-node-item > .tree-node-content:hover {
    background: var(--primary-light);
    border-radius: 0;
}
.tree-node-item:has(> .tree-children-wrapper) > .tree-node-content:hover {
    background: var(--bg-body);
}

/* دکمه باز/بسته */
.tree-toggle-spot {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tree-toggle {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .7rem;
    cursor: pointer;
    transition: all var(--transition);
}
.tree-toggle:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}
/* چرخش فلش هنگام بسته بودن */
.tree-node-item.is-collapsed .toggle-icon {
    transform: rotate(-90deg);
}
.toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

/* لوگو و آواتار درخت */
.tree-node-logo {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1.5px solid var(--border-color);
    flex-shrink: 0;
}
.tree-node-logo-placeholder {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* متون درخت */
.tree-node-name {
    color: var(--text-main) !important;
    font-size: .92rem;
    transition: color var(--transition);
}
.tree-node-name:hover {
    color: var(--primary) !important;
}
.tree-node-meta {
    color: var(--text-light);
    font-size: .78rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tree-node-meta i {
    font-size: .7rem;
}

/* مخفی کردن عملیات در موبایل برای جلوگیری از شلوغی */
.tree-node-actions {
    opacity: 0.5;
    transition: opacity var(--transition);
}
.tree-node-content:hover .tree-node-actions {
    opacity: 1;
}
@media (max-width: 768px) {
    .tree-children-inner {
        padding-right: 12px;
    }
    .tree-node-actions {
        opacity: 1;
    }
}

/* =============================================
   فوتر کاربر در سایدبار
   ============================================= */
.sidebar-user-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-body);
    margin-top: auto;
    flex-shrink: 0;
}
.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.sidebar-user-info {
    flex-grow: 1;
    min-width: 0;
}
.sidebar-user-name {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: .72rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-settings {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-light);
    transition: all var(--transition);
    text-decoration: none;
}
.sidebar-user-settings:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* بج تعداد اعلان‌های سایدبار */
.sidebar-badge {
    margin-right: auto;
    margin-left: 0;
    background: var(--danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* =============================================
   هدر (لوگوی شرکت و آواتار کاربر)
   ============================================= */
/* =============================================
   هدر (لوگوی شرکت و آواتار کاربر - نسخه نهایی)
   ============================================= */
.header-company-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid var(--border-color);
}
.header-company-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
}
.header-company-text {
    font-weight: 600;
    color: var(--text-main);
    font-size: .9rem;
}
.header-icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}
.header-icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* دکمه پروفایل کاربر (حذف کادر مشکی بوت‌استرپ) */
.header-user-btn {
    display: flex;
    align-items: center;
    background: transparent;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 4px;
    color: var(--text-main);
    transition: all var(--transition);
    border-radius: 8px;
}
.header-user-btn::after {
    margin-right: 10px;
    margin-left: 0;
    vertical-align: middle;
}
.header-user-btn:focus, .header-user-btn:active {
    background: var(--bg-body) !important;
    color: var(--text-main) !important;
    box-shadow: none !important;
}

.header-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}
.header-username {
    font-weight: 500;
    font-size: .88rem;
    margin-right: 4px;
}

/* =============================================
   فوتر سایت
   ============================================= */
.footer-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border-strong);
    display: inline-block;
}

/* =============================================
   پیام‌های سیستمی مدرن (Toast-like Alerts)
   ============================================= */
.messages-container {
    position: relative;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.5rem;
}
.modern-alert {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
    border-right: 5px solid var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
	transition: all 0.3s ease-out;
}

/* رنگ‌بندی پیام‌ها */
.modern-alert--success { border-right-color: var(--success); }
.modern-alert--error { border-right-color: var(--danger); }
.modern-alert--warning { border-right-color: var(--warning); }
.modern-alert--info { border-right-color: var(--info); }

.modern-alert-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.modern-alert--success .modern-alert-icon { color: var(--success); }
.modern-alert--error .modern-alert-icon { color: var(--danger); }
.modern-alert--warning .modern-alert-icon { color: var(--warning); }
.modern-alert--info .modern-alert-icon { color: var(--info); }

.modern-alert-text {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-main);
}

.modern-alert-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.modern-alert-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* انیمیشن ورود پیام */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =============================================
   اصلاح لایه‌بندی پاپ‌آپ تقویم شمسی
   ============================================= */
.pdp-container,
.jalali-datepicker-container,
.datepicker-dropdown,
[id*="pdp"],
[id*="jalali"] {
    z-index: 9999 !important;
}


/* =============================================
   آکاردئون سایدبار (نسخه نهایی و بدون باگ)
   ============================================= */
.sidebar-accordion .accordion-item {
    background: transparent;
    border: none;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
}

.sidebar-accordion .accordion-button {
    background: var(--bg-body); /* متغیر برای جلوگیری از نیاز به رفرش */
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 700;
    padding: 11px 12px;
    box-shadow: none !important;
    gap: 10px;
    border-right: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-accordion .accordion-button:hover {
    filter: brightness(0.95);
}

.sidebar-accordion .accordion-button:focus {
    box-shadow: none !important;
    border-color: transparent;
}
.sidebar-accordion .accordion-collapse { border: none; }
.sidebar-accordion .accordion-body { padding: 0 0 0 8px; }

/* رفع قطعی مشکل فلش (استفاده از متغیر بوت‌استرپ) */
.sidebar-accordion .accordion-button::after {
    width: .75rem;
    height: .75rem;
    background-size: .75rem;
    transition: transform 0.2s ease-in-out;
}


/* ═══ رنگ‌بندی بخش‌ها (حالت بسته: ملایم، حالت باز: پررنگ) ═══ */

/* ۱. سازمانی (آبی) */
.sec-org .accordion-button {
    border-right-color: rgba(79, 70, 229, 0.3);
}
.sec-org .accordion-button:not(.collapsed) {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
    border-right-color: var(--primary);
}
.sec-org .accordion-button:not(.collapsed)::after {
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%234f46e5'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* ۲. جلسات (فیروزه‌ای) */
.sec-meetings .accordion-button {
    border-right-color: rgba(6, 182, 212, 0.3);
}
.sec-meetings .accordion-button:not(.collapsed) {
    color: var(--info);
    background: rgba(6, 182, 212, 0.08);
    border-right-color: var(--info);
}
.sec-meetings .accordion-button:not(.collapsed)::after {
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2306b6d4'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* ۳. فرآیندی (بنفش) */
.sec-proc .accordion-button {
    border-right-color: rgba(124, 58, 237, 0.3);
}
.sec-proc .accordion-button:not(.collapsed) {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    border-right-color: #7c3aed;
}
.sec-proc .accordion-button:not(.collapsed)::after {
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%237c3aed'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* ۴. تنظیمات (طوسی) */
.sec-settings .accordion-button {
    border-right-color: rgba(100, 116, 139, 0.3);
}
.sec-settings .accordion-button:not(.collapsed) {
    color: var(--text-main);
    background: rgba(100, 116, 139, 0.08);
    border-right-color: var(--text-muted);
}
.sec-settings .accordion-button:not(.collapsed)::after {
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* =============================================
   استایل لینک فعال داخل آکاردئون (نرم و هماهنگ)
   ============================================= */

/* لغو کردن استایل پررنگ قبلی برای لینک‌های داخل سایدبار */
.sidebar-accordion .nav-link.active {
    background: transparent !important;
    color: var(--text-main) !important;
    box-shadow: none !important;
    transform: none !important;
    border-right: 3px solid var(--border-strong); /* خط رنگی پیش‌فرض */
}

/* رنگ‌بندی لینک فعال بر اساس بخش مربوطه */

/* ۱. لینک فعال در بخش سازمانی (آبی ملایم) */
.sec-org .nav-link.active {
    border-right-color: var(--primary) !important;
    color: var(--primary) !important;
    background: rgba(79, 70, 229, 0.06) !important;
}

/* ۲. لینک فعال در بخش جلسات (فیروزه‌ای ملایم) */
.sec-meetings .nav-link.active {
    border-right-color: var(--info) !important;
    color: var(--info) !important;
    background: rgba(6, 182, 212, 0.06) !important;
}

/* ۳. لینک فعال در بخش فرآیندی (بنفش ملایم) */
.sec-proc .nav-link.active {
    border-right-color: #7c3aed !important;
    color: #7c3aed !important;
    background: rgba(124, 58, 237, 0.06) !important;
}

/* ۴. لینک فعال در بخش تنظیمات (طوسی ملایم) */
.sec-settings .nav-link.active {
    border-right-color: var(--text-muted) !important;
    color: var(--text-main) !important;
    background: rgba(100, 116, 139, 0.06) !important;
}

/* =============================================
   ۵. لینک فعال در بخش زنجیره تامین (نارنجی ملایم)
   ============================================= */
.sec-supply .nav-link.active {
    border-right-color: #ea580c !important;
    color: #ea580c !important;
    background: rgba(234, 88, 12, 0.06) !important;
}

/* =============================================
   ۶. لینک فعال در بخش فرم‌ساز و درخواست داده (صورتی/فوشیا ملایم)
   ============================================= */
.sec-forms .nav-link.active {
    border-right-color: #db2777 !important;
    color: #db2777 !important;
    background: rgba(219, 39, 119, 0.06) !important;
}

/* =============================================
   ۷. لینک فعال در بخش مدیریت مستندات (سبز ملایم)
   ============================================= */
.sec-docs .nav-link.active {
    border-right-color: var(--success) !important;
    color: var(--success) !important;
    background: rgba(16, 185, 129, 0.06) !important;
}



/* =============================================
   سنجه تکمیل پروفایل (Circular Gauge)
   ============================================= */
.gauge-container {
    width: 90px;
    height: 90px;
    position: relative;
}
.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.gauge-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 3.8;
}
.gauge-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3.8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s ease-in-out;
}
.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
}

/* استایل پیشرفت بار داخل مودال */
.modal .progress {
    box-shadow: none;
}


/* =============================================
   کامپوننت جستجوی هوشمند (SmartSearch)
   ============================================= */
.ss-wrapper { position: relative; }
.ss-input {
    width: 100%; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: .65rem .85rem; font-size: .9rem; transition: all var(--transition); background-color: var(--bg-surface);
}
.ss-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); outline: none; }
.ss-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 9999;
    background: var(--bg-surface); border: 1.5px solid var(--border-strong); border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm); box-shadow: var(--shadow-glass);
    max-height: 260px; overflow-y: auto; display: none;
}
.ss-dropdown.show { display: block; }
.ss-dropdown::-webkit-scrollbar { width: 5px; }
.ss-dropdown::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
.ss-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; cursor: pointer; transition: all .15s ease; border-bottom: 1px solid var(--border-color);
}
.ss-item:last-child { border-bottom: none; }
.ss-item:hover { background: var(--primary-light); }
.ss-item.selected { background: var(--primary-light); border-right: 3px solid var(--primary); }
.ss-item-name { font-size: .88rem; font-weight: 600; color: var(--text-main); }
.ss-item-sub { font-size: .72rem; color: var(--text-light); direction: ltr; }
.ss-empty { padding: 15px; text-align: center; color: var(--text-light); font-size: .85rem; }

/* =============================================
   چیپ‌های حاضرین / غائبین فرم جلسه
   ============================================= */
.att-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 20px; font-size: .8rem; font-weight: 500;
    margin: 3px; cursor: pointer; transition: all .15s ease; border: 1px solid transparent;
}
.att-chip.present { background: rgba(40,167,69,.1); color: #198754; border-color: rgba(40,167,69,.25); }
.att-chip.absent { background: rgba(220,53,69,.08); color: #dc3545; border-color: rgba(220,53,69,.2); }
.att-chip.unselected { background: var(--bg-body); color: var(--text-light); border-color: var(--border-color); }
.att-chip .remove-chip { font-size: .7rem; opacity: .6; }
.att-chip .remove-chip:hover { opacity: 1; }


/* =============================================
   کارت امتیاز ریسک (فرم چالش‌ها)
   ============================================= */
.risk-score-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6; border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem; transition: all 0.3s ease;
}
.risk-score-card.score-low { border-color: #198754; background: linear-gradient(135deg, #f8f9fa 0%, #d1e7dd 100%); }
.risk-score-card.score-med { border-color: #ffc107; background: linear-gradient(135deg, #f8f9fa 0%, #fff3cd 100%); }
.risk-score-card.score-high { border-color: #dc3545; background: linear-gradient(135deg, #f8f9fa 0%, #f8d7da 100%); }

.risk-score-value {
    font-size: 2.5rem; font-weight: 800; color: #6c757d; line-height: 1; transition: color 0.3s ease;
}
.score-low .risk-score-value { color: #198754; }
.score-med .risk-score-value { color: #ffc107; }
.score-high .risk-score-value { color: #dc3545; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* =============================================
   اسلایدرهای ماتریس ریسک (Cross Browser)
   ============================================= */
.risk-range {
    height: 8px; border-radius: 5px; outline: none;
    -webkit-appearance: none; appearance: none; transition: all 0.2s; margin-top: 5px;
}
.risk-range::-webkit-slider-runnable-track { width: 100%; height: 8px; border-radius: 5px; background: #e9ecef; }
.risk-range::-moz-range-track { width: 100%; height: 8px; border-radius: 5px; background: #e9ecef; border: none; }

.risk-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: #fff; border: 3px solid #6c757d; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15); margin-top: -7px; transition: all 0.2s;
}
.risk-range::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%; background: #fff;
    border: 3px solid #6c757d; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.15); transition: all 0.2s;
}

.risk-range--danger::-webkit-slider-thumb { border-color: #dc3545; }
.risk-range--danger::-moz-range-thumb { border-color: #dc3545; }
.risk-range--danger:active::-webkit-slider-thumb { background: #dc3545; box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25); }
.risk-range--danger:active::-moz-range-thumb { background: #dc3545; box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25); }

.risk-range--warning::-webkit-slider-thumb { border-color: #ff9800; }
.risk-range--warning::-moz-range-thumb { border-color: #ff9800; }
.risk-range--warning:active::-webkit-slider-thumb { background: #ff9800; box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.25); }
.risk-range--warning:active::-moz-range-thumb { background: #ff9800; box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.25); }

.risk-range--primary::-webkit-slider-thumb { border-color: #0d6efd; }
.risk-range--primary::-moz-range-thumb { border-color: #0d6efd; }
.risk-range--primary:active::-webkit-slider-thumb { background: #0d6efd; box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25); }
.risk-range--primary:active::-moz-range-thumb { background: #0d6efd; box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25); }

.risk-range:hover::-webkit-slider-thumb { transform: scale(1.15); }
.risk-range:hover::-moz-range-thumb { transform: scale(1.15); }

/* =============================================
   استایل‌های نهایی داشبورد (بدون تداخل)
   ============================================= */

/* ۱. سیستم جستجوی هوشمند (افزایش z-index برای جلوگیری از تداخل کارت‌ها) */
.ss-wrapper { position: relative; }
.ss-input {
    width: 100%; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: .65rem .85rem; font-size: .9rem; font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-surface); color: var(--text-main); transition: all var(--transition);
}
.ss-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.ss-input::placeholder { color: var(--text-light); }

.ss-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 9999 !important;
    background: var(--bg-surface); border: 1.5px solid var(--border-strong); border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm); box-shadow: var(--shadow-glass);
    max-height: 280px; overflow-y: auto; display: none; margin-top: -2px;
}
.ss-dropdown.show { display: block; }
.ss-dropdown::-webkit-scrollbar { width: 5px; }
.ss-dropdown::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

.ss-item {
    display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem;
    cursor: pointer; transition: all .15s ease; border-bottom: 1px solid var(--border-color);
}
.ss-item:last-child { border-bottom: none; }
.ss-item:hover { background: var(--primary-light); }
.ss-item.selected { background: var(--primary-light); border-right: 3px solid var(--primary); }
.ss-item-name { font-size: .9rem; font-weight: 600; color: var(--text-main); flex-grow: 1; }
.ss-item-sub { font-size: .75rem; color: var(--text-light); flex-shrink: 0; margin-right: 1rem; }
.ss-empty { padding: 1.25rem; text-align: center; color: var(--text-light); font-size: .88rem; }


/* ۲. مودال اختصاصی داشبورد */
#dynamicModal .modal-content { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-glass); overflow: hidden; border: 1px solid var(--border-color); }
#dynamicModal .modal-header { background: var(--bg-body); border-bottom: 1px solid var(--border-color); padding: 1rem 1.5rem; }
#dynamicModal .modal-title { font-size: 1rem; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 0.5rem; }
#dynamicModal .modal-body { padding: 1.25rem 1.5rem; }
#dynamicModal .btn-close { opacity: 0.5; transition: all var(--transition); }
#dynamicModal .btn-close:hover { opacity: 1; transform: rotate(90deg); }

/* استایل لیست مودال ماده ۲۴۱ */
#dynamicModal .list-group { display: flex; flex-direction: column; gap: 0.5rem; }
#dynamicModal .list-group-item { border: 1px solid var(--border-color); border-radius: var(--radius-sm) !important; background: var(--bg-surface); padding: 0.85rem 1rem; transition: all var(--transition); }
#dynamicModal .list-group-item:hover { background: var(--danger-light); border-color: rgba(239, 68, 68, 0.2); transform: translateX(-4px); }
#dynamicModal .list-group-item > div:last-child { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
#dynamicModal .list-group-item .badge.bg-danger { font-size: .65rem; padding: 0.3em 0.6em; font-weight: 600; border: 1px solid rgba(239, 68, 68, 0.2); }

/* استایل جداول داخل مودال */
#dynamicModal .table { overflow: visible !important; min-width: auto !important; border-radius: 0 !important; box-shadow: none !important; margin-bottom: 0; font-size: .88rem; }
#dynamicModal .table thead th { font-size: .75rem; padding: 0.6rem 0.85rem; }
#dynamicModal .table tbody td { padding: 0.75rem 0.85rem; vertical-align: middle; }
#dynamicModal .table tbody td .text-muted { font-size: .8rem; }


/* ۳. جدول تحلیلی ریسپانسیو */
.table-responsive { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; width: 100%; }
.table-responsive > .table { overflow: visible !important; min-width: 1000px; }

@media (max-width: 768px) {
    .table-responsive { border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-surface); box-shadow: var(--shadow-soft); margin-bottom: 1rem; }
    .table-responsive > .table { border: none !important; box-shadow: none !important; border-radius: 0 !important; margin-bottom: 0 !important; }
    .table-responsive > .table tfoot td { border-top: 2px solid var(--border-strong); }
}

/* رفع قطعی فونت بنر شرکت انتخاب شده در داشبورد */
.active-company-banner, .active-company-banner strong {
    font-family: 'Vazirmatn', sans-serif !important;
}
.active-company-banner strong {
    font-weight: 800 !important;
}


/* تضمین قطعی فاصله استاندارد برای تمام صفحات */
body #page-content-wrapper > .container-fluid {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}



