* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { background: var(--bg); color: #333; min-height: 100vh; }
.hidden { display: none !important; }

.login-box { max-width: 420px; margin: 80px auto; background: white; padding: 40px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.1); }
.login-box h1 { text-align: center; color: var(--text); margin-bottom: 10px; font-size: 26px; }
.login-box .subtitle { text-align: center; color: var(--muted-2); margin-bottom: 30px; font-size: 13px; }
.login-box input, .login-box select { width: 100%; padding: 13px; margin-bottom: 15px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; transition: 0.2s; }
.login-box input:focus, .login-box select:focus { border-color: var(--primary); outline: none; }
.login-box button { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: white; border: none; border-radius: 10px; font-size: 15px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.login-box button:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(52,152,219,0.3); }
#loginScreen { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 18%, #254f79 0, transparent 28%), linear-gradient(135deg, #101d32, #182f4a 55%, #0c4b64); position: relative; isolation: isolate; overflow: hidden; }
.login-decor { position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; z-index: -1; }
.login-decor-one { width: 42vw; height: 42vw; top: -22vw; left: -8vw; background: rgba(87,180,218,.08); }
.login-decor-two { width: 30vw; height: 30vw; bottom: -17vw; right: -6vw; background: rgba(64,146,198,.1); }
#loginScreen .login-box { width: min(440px, 100%); max-width: none; margin: 0; padding: 38px; border: 1px solid #dfe9f2; border-radius: 22px; box-shadow: 0 28px 90px rgba(0,10,26,.3); }
.login-mark { width: 58px; height: 58px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg,#17a8bf,#2378bf); color: white; font-size: 30px; font-weight: 800; box-shadow: 0 8px 24px rgba(12,125,177,.3); }
#loginScreen h1 { letter-spacing: .3px; margin-bottom: 8px; }
#loginScreen .subtitle { margin-bottom: 30px; color: #5d738a; }
#loginScreen label { display: block; margin: 0 0 7px; color: #29425e; font-size: 12px; font-weight: 700; }
#loginScreen input, #loginScreen select { background: #f7fafd; border: 1px solid #d9e5ef; margin-bottom: 18px; }
#loginScreen input:focus, #loginScreen select:focus { border-color: #2495bb; box-shadow: 0 0 0 3px rgba(36,149,187,.13); }
#loginScreen button { margin-top: 6px; background: linear-gradient(120deg,#147baf,#11638c); padding: 15px; }
.login-credit { margin-top: 24px; text-align: center; color: #8293a5; font-size: 12px; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 16px; }
.project-card { padding: 22px; border-radius: 16px; background: white; border: 1px solid #e5edf3; box-shadow: 0 3px 16px rgba(18,48,72,.06); }
.project-card h3 { margin-bottom: 10px; color: var(--text); }
.project-card p { color: #647789; font-size: 13px; line-height: 1.7; margin-bottom: 14px; }
.project-progress { height: 9px; border-radius: 10px; background: #edf3f6; overflow: hidden; margin: 12px 0; }
.project-progress span { display: block; height: 100%; background: linear-gradient(90deg,#17a8bf,#1c79b7); }
.project-event { border-right: 3px solid #93c9da; padding: 9px 13px; margin: 10px 0; background: #f7fafc; font-size: 13px; }
.project-event small { display: block; color: #8293a5; margin-top: 4px; }
.mention-picker { width: 100%; margin: 8px 0; padding: 9px; border: 1px solid #d6e4ed; border-radius: 8px; }
.mention-option { display: inline-flex !important; align-items: center; gap: 6px; margin: 5px 8px; font-size: 12px; cursor: pointer; }
.mention-option input { width: auto; accent-color: #147baf; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: linear-gradient(180deg, var(--text), var(--text-2)); color: white; padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px; }
.sidebar .logo h2 { font-size: 18px; margin-bottom: 4px; }
.sidebar .logo small { color: var(--muted-2); font-size: 11px; }
.sidebar .user-info { padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 15px; }
.sidebar .user-info strong { display: block; margin-bottom: 4px; color: var(--border); font-size: 14px; }
.sidebar .user-info span { color: var(--primary); font-size: 12px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: var(--border); text-decoration: none; cursor: pointer; transition: 0.2s; font-size: 14px; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(52,152,219,0.2); border-right: 4px solid var(--primary); }
.sidebar .logout { margin-top: 20px; padding: 12px 20px; background: rgba(192,57,43,0.3); cursor: pointer; text-align: center; color: var(--border); transition: 0.2s; }
.sidebar .logout:hover { background: rgba(192,57,43,0.5); }

.main { flex: 1; padding: 25px; overflow-x: auto; }
.topbar { display: flex; justify-content: flex-end; margin-bottom: 20px; gap: 15px; align-items: center; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.page-header h1 { color: var(--text); font-size: 24px; }

.btn { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; transition: 0.2s; font-weight: 500; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.notif-bell { position: relative; cursor: pointer; font-size: 22px; padding: 10px 14px; background: white; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,0.08); transition: 0.2s; }
.notif-bell:hover { transform: scale(1.05); }
.notif-badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: white; border-radius: 50%; min-width: 20px; height: 20px; font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0 5px; font-weight: bold; }
.notif-dropdown { position: absolute; top: 55px; left: 0; width: min(400px, 90vw); max-height: 500px; overflow-y: auto; background: white; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); z-index: 200; cursor: default; }
.notif-dropdown .header { padding: 15px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: white; z-index: 1; }
.notif-dropdown .header h3 { font-size: 15px; }
.notif-dropdown .header button { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 12px; }
.notif-item { padding: 12px 15px; border: 0; border-bottom: 1px solid #f5f5f5; background: white; width: 100%; text-align: right; cursor: pointer; transition: 0.2s; display: flex; gap: 10px; font: inherit; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-50); border-right: 3px solid var(--primary); }
.notif-item .icon { font-size: 24px; }
.notif-item .content { flex: 1; min-width: 0; }
.notif-item .title { display: block; font-weight: bold; font-size: 13px; margin-bottom: 3px; }
.notif-item .msg { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item .time { display: block; font-size: 11px; color: var(--muted-2); margin-top: 4px; }
.notif-empty { padding: 30px; text-align: center; color: var(--muted-2); }
.notif-more { width: 100%; padding: 13px; background: #f7fbfe; color: #17679a; border: 0; cursor: pointer; font-weight: bold; }
.notif-more:hover { background: var(--primary-50); }
.task-detail-quick-actions { display: flex; justify-content: flex-start; margin: 12px 0 18px; }
.inbox-filters { display: flex; gap: 10px; margin-bottom: 15px; }
.inbox-filters button { background: #eef2f7; color: #36516c; }
.inbox-filters button.active { background: #176b9e; color: white; }
.inbox-layout { display: grid; grid-template-columns: minmax(240px, 36%) minmax(0, 1fr); border: 1px solid #e1e9f0; border-radius: 12px; min-height: 430px; overflow: hidden; }
.inbox-list { border-left: 1px solid #e1e9f0; max-height: 65vh; overflow-y: auto; }
.inbox-row { display: flex; flex-direction: column; gap: 5px; width: 100%; border: 0; border-bottom: 1px solid #e9eef3; background: #fff; text-align: right; cursor: pointer; padding: 15px; font: inherit; }
.inbox-row:hover, .inbox-row.selected { background: #eff7fc; }
.inbox-row.unread { background: #f0f8ff; }
.inbox-row-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #233d56; }
.inbox-row.unread .inbox-row-title { font-weight: 800; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2185bb; flex: none; }
.inbox-row-preview { display: block; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #687c8e; font-size: 12px; }
.inbox-row-date, .inbox-detail-date { color: #7c8b9a; font-size: 12px; }
.inbox-detail { padding: 25px; }
.inbox-detail h2 { overflow-wrap: anywhere; }
.inbox-detail-message { white-space: pre-wrap; line-height: 2; margin: 22px 0; overflow-wrap: anywhere; }
@media (max-width: 720px) { .inbox-layout { grid-template-columns: 1fr; } .inbox-list { border-left: 0; border-bottom: 1px solid #e1e9f0; max-height: 280px; } }

.toast-container { position: fixed; top: 20px; left: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: white; padding: 15px 20px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); min-width: 300px; display: flex; gap: 12px; align-items: flex-start; animation: slideIn 0.3s ease; border-right: 4px solid var(--primary); }
.toast.success { border-right-color: var(--success); }
.toast.warning { border-right-color: var(--warning); }
.toast.error { border-right-color: var(--danger); }
.toast .icon { font-size: 22px; }
.toast .content { flex: 1; }
.toast .title { font-weight: bold; font-size: 13px; margin-bottom: 3px; }
.toast .msg { font-size: 12px; color: var(--muted); }
@keyframes slideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 25px; }
.kpi-card { background: white; padding: 20px; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); position: relative; overflow: hidden; transition: 0.2s; }
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.kpi-card .kpi-icon { position: absolute; top: 15px; left: 15px; font-size: 36px; opacity: 0.15; }
.kpi-card .kpi-label { color: var(--muted); font-size: 12px; margin-bottom: 8px; font-weight: 500; }
.kpi-card .kpi-value { font-size: 32px; font-weight: bold; color: var(--text); margin-bottom: 5px; }
.kpi-card .kpi-trend { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.kpi-card .kpi-trend.up { color: var(--success); }
.kpi-card .kpi-trend.down { color: var(--danger); }
.kpi-card.blue { background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: white; }
.kpi-card.blue .kpi-label, .kpi-card.blue .kpi-value { color: white; }
.kpi-card.green { background: linear-gradient(135deg, var(--success), var(--success-700)); color: white; }
.kpi-card.green .kpi-label, .kpi-card.green .kpi-value { color: white; }
.kpi-card.orange { background: linear-gradient(135deg, var(--warning), var(--orange)); color: white; }
.kpi-card.orange .kpi-label, .kpi-card.orange .kpi-value { color: white; }
.kpi-card.red { background: linear-gradient(135deg, var(--danger), var(--danger-700)); color: white; }
.kpi-card.red .kpi-label, .kpi-card.red .kpi-value { color: white; }

.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; margin-bottom: 25px; }
.chart-card { background: white; padding: 20px; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.chart-card h3 { margin-bottom: 15px; color: var(--text); font-size: 16px; }
.chart-container { position: relative; height: 280px; }

.card { background: white; border-radius: 14px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); margin-bottom: 20px; }
.card h2 { margin-bottom: 15px; color: var(--text); font-size: 17px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: right; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: var(--surface-2); color: var(--text); font-weight: bold; font-size: 13px; }
tr:hover { background: var(--surface-2); }
.badge { padding: 4px 10px; border-radius: 12px; font-size: 11px; display: inline-block; font-weight: bold; }
.badge-new { background: var(--primary); color: white; }
.badge-progress { background: var(--warning); color: white; }
.badge-done { background: var(--success); color: white; }
.badge-rejected { background: var(--danger); color: white; }
.badge-low { background: var(--muted-2); color: white; }
.badge-normal { background: var(--primary); color: white; }
.badge-high { background: var(--orange); color: white; }
.badge-urgent { background: var(--danger); color: white; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(3px); }
.modal { background: white; border-radius: 14px; padding: 30px; width: 90%; max-width: 700px; max-height: 90vh; overflow-y: auto; }
.modal h2 { margin-bottom: 20px; color: var(--text); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text); font-weight: bold; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; transition: 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); outline: none; }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.task-rating-panel { margin-top: 20px; padding: 16px; border: 1px solid #b6dfc8; border-radius: 12px; background: #f2fbf5; }
.task-rating-panel h4 { margin: 0 0 9px; color: #176c43; }

.task-detail-row { display: flex; gap: 15px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f5f5f5; }
.task-detail-row strong { min-width: 130px; color: var(--muted); font-size: 13px; }
.task-detail-row span { flex: 1; font-size: 14px; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { padding: 8px 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; }

.empty { text-align: center; padding: 40px; color: var(--muted-2); }

.progress-bar { background: var(--border); height: 8px; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); transition: 0.5s; }

.upload-area { border: 2px dashed #bdc3c7; border-radius: 12px; padding: 30px; text-align: center; cursor: pointer; transition: 0.2s; margin-bottom: 15px; background: #fafbfc; }
.upload-area:hover, .upload-area.dragover { border-color: var(--primary); background: var(--primary-50); }
.upload-area .icon { font-size: 48px; margin-bottom: 10px; }
.upload-area input { display: none; }
.upload-area .hint { font-size: 12px; color: var(--muted-2); margin-top: 5px; }

.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 15px; }
.attachment-item { background: var(--surface-2); border-radius: 10px; padding: 12px; position: relative; transition: 0.2s; border: 1px solid var(--border); }
.attachment-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.attachment-item .preview { width: 100%; height: 100px; border-radius: 6px; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 36px; margin-bottom: 8px; overflow: hidden; }
.attachment-item .preview img { width: 100%; height: 100%; object-fit: cover; }
.attachment-item .name { font-size: 12px; font-weight: bold; color: var(--text); word-break: break-word; margin-bottom: 4px; }
.attachment-item .size { font-size: 11px; color: var(--muted-2); margin-bottom: 8px; }
.attachment-item .actions { display: flex; gap: 5px; }
.attachment-item .actions a, .attachment-item .actions button { flex: 1; padding: 5px; font-size: 11px; border-radius: 5px; text-align: center; text-decoration: none; cursor: pointer; border: none; }
.attachment-item .actions a { background: var(--primary); color: white; }
.attachment-item .actions button { background: var(--danger); color: white; }

.upload-progress { margin-top: 10px; }
.upload-progress-item { background: var(--primary-50); padding: 10px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.upload-progress-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.upload-progress-bar .fill { height: 100%; background: var(--primary); transition: 0.3s; }

.comments-section { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--border); }
.comment { background: var(--surface-2); padding: 12px; border-radius: 10px; margin-bottom: 10px; }
.comment .header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; }
.comment .header strong { color: var(--text); }
.comment .header .time { color: var(--muted-2); }
.comment .body { font-size: 13px; color: #555; line-height: 1.5; }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-thread { max-height: 360px; overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.ticket-thread .comment { max-width: 92%; border: 1px solid var(--border); }
.ticket-thread .comment.own { margin-right: auto; background: var(--primary-50); border-color: #d1e9fa; }
.comment-form { display: flex; gap: 10px; margin-top: 10px; }
.comment-form textarea { flex: 1; min-width: 0; padding: 10px; border: 2px solid var(--border); border-radius: 8px; font: inherit; resize: vertical; }
.comment-form button { padding: 10px 20px; background: var(--primary); color: white; border: none; border-radius: 8px; cursor: pointer; }

.brands-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.brand-card { background: white; padding: 20px; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); position: relative; overflow: hidden; }
.brand-card::before { content: ''; position: absolute; top: 0; right: 0; width: 4px; height: 100%; background: var(--brand-color, var(--primary)); }
.brand-card h3 { color: var(--text); margin-bottom: 5px; }
.brand-card .manager { color: var(--muted); font-size: 12px; margin-bottom: 15px; }
.brand-stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Multi-select Assignee */
.assignee-selector { border: 2px solid var(--border); border-radius: 8px; padding: 10px; max-height: 200px; overflow-y: auto; background: #fafbfc; }
.assignee-search { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 6px; margin-bottom: 10px; font-size: 13px; }
.assignee-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.assignee-item:hover { background: var(--primary-50); }
.assignee-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.assignee-item label { cursor: pointer; font-size: 13px; flex: 1; }
.selected-assignees { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.selected-tag { background: var(--primary); color: white; padding: 3px 10px; border-radius: 12px; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.selected-tag .remove { cursor: pointer; font-weight: bold; }

/* Pending files in create modal */
.pending-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pending-file { background: var(--primary-50); padding: 6px 12px; border-radius: 8px; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.pending-file .remove { cursor: pointer; color: var(--danger); font-weight: bold; }

.daily-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.daily-label input { width: auto; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.profile-grid > div { background: var(--surface-2); padding: 12px; border-radius: 8px; }

.dashboard-task-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dashboard-task-tab { border: 1px solid #d9e2ea; background: var(--surface-2); border-radius: 9px; padding: 10px 14px; cursor: pointer; font-size: 13px; }
.dashboard-task-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.dashboard-task-tab span { margin-right: 5px; font-weight: bold; }
.dashboard-task-list { max-height: 430px; overflow: auto; }
.dashboard-task-list th { position: sticky; top: 0; z-index: 1; }
.overdue-date { color: var(--danger-700); font-weight: bold; }

.jalali-input { display: flex; gap: 6px; }
.jalali-input input { cursor: pointer; }
.jalali-input button { border: 0; border-radius: 8px; background: var(--primary-50); color: var(--primary-600); cursor: pointer; padding: 0 12px; font-size: 18px; }
.jalali-picker { border: 1px solid #d9e2ea; border-radius: 10px; padding: 10px; margin-top: 6px; background: white; width: min(100%, 310px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.jalali-header, .jalali-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jalali-header { margin-bottom: 8px; }
.jalali-header button, .jalali-footer button { border: 0; background: var(--primary-50); color: var(--primary-600); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.jalali-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jalali-grid .weekday { color: var(--muted); font-size: 12px; padding: 7px 0; }
.jalali-day { border: 0; border-radius: 7px; background: transparent; cursor: pointer; padding: 7px 0; font-size: 12px; }
.jalali-day:hover { background: var(--primary-50); }
.jalali-day.outside { color: #aeb6bf; }
.jalali-day.today { border: 1px solid var(--primary); }
.jalali-day.selected { color: white; background: var(--primary); }
.jalali-footer { justify-content: flex-end; margin-top: 8px; }
.task-edit-note { color: #53677a; background: var(--primary-50); padding: 10px 12px; border-radius: 8px; margin-bottom: 15px; font-size: 13px; }
.staff-note { color: #53677a; background: #f1f6fa; border-radius: 8px; padding: 10px 12px; margin-bottom: 15px; font-size: 13px; line-height: 1.7; }
.permission-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:10px; margin:15px 0 20px; }
.permission-grid label { display:flex; align-items:center; gap:9px; padding:10px 12px; border:1px solid #dbe5ef; border-radius:9px; background:#f8fafc; cursor:pointer; }
.permission-grid input { width:18px; height:18px; flex:none; }

/* فیلتر ستونی جدول تسک‌ها */
.table-scroll { overflow-x: auto; }
#tasksTable .filter-row th { background: #f7f9fb; padding: 6px 4px; position: static; }
#tasksTable .filter-row input, #tasksTable .filter-row select { width: 100%; min-width: 80px; padding: 5px 6px; border: 1px solid #dfe6ec; border-radius: 6px; font-size: 12px; font-family: inherit; background: white; }
/* پروژه‌های داشبورد: بعد از چند ردیف اسکرول بخورد */
.dashboard-projects-scroll { max-height: 360px; overflow-y: auto; padding-left: 4px; }
.project-meta { font-size: 12px; color: #7a8b9a; margin-bottom: 8px; }
.project-code { display: inline-block; direction: ltr; background: var(--primary-50); color: var(--primary-700); border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: bold; margin-bottom: 6px; }
.due-soon { color: var(--orange); font-weight: bold; }
#tasksTable td:nth-child(2) { min-width: 200px; }
/* فیلتر چندگزینه‌ای وضعیت */
.multi-filter { position: relative; }
.multi-filter summary { list-style: none; cursor: pointer; padding: 5px 6px; border: 1px solid #dfe6ec; border-radius: 6px; background: white; font-size: 12px; font-weight: normal; min-width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.multi-filter summary::-webkit-details-marker { display: none; }
.multi-filter summary::after { content: ' ▾'; color: #7a8b9a; }
.multi-filter-menu { position: absolute; z-index: 20; top: 100%; right: 0; background: white; border: 1px solid #dfe6ec; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 6px 4px; min-width: 150px; text-align: right; }
.multi-filter-menu label { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 13px; font-weight: normal; cursor: pointer; white-space: nowrap; }
.multi-filter-menu label:hover { background: #f3f7fa; border-radius: 6px; }
/* گروه‌بندی پروژه‌ها */
.project-group { margin-bottom: 26px; }
.project-group-title { font-size: 17px; color: var(--text); margin: 6px 0 12px; padding-bottom: 6px; border-bottom: 2px solid #e5edf3; }
.project-group-title span { font-size: 12px; background: var(--primary-50); color: var(--primary-700); border-radius: 10px; padding: 1px 9px; margin-right: 6px; }
.project-cat { display: inline-block; background: #fff4e5; color: #9a5b00; border-radius: 6px; padding: 1px 8px; font-size: 12px; margin-bottom: 6px; }
/* روال پروژه‌های بازرگانی */
.trade-panel { background: #f7fafc; border: 1px solid #e3ebf2; border-radius: 12px; padding: 10px 12px; margin: 4px 0 12px; }
.trade-title { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.trade-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 8px; }
.trade-step { font-size: 12px; padding: 3px 9px; border-radius: 14px; border: 1px solid #d6dee6; background: #fff; color: var(--muted); white-space: nowrap; }
.trade-step.done { background: var(--success); border-color: var(--success); color: #fff; }
.trade-step.current { background: #fff4e5; border-color: var(--warning); color: #b9770e; font-weight: bold; }
.trade-arrow { color: #b0bec5; font-size: 11px; }
.trade-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.trade-badge { font-size: 12px; padding: 2px 8px; border-radius: 8px; }
.trade-badge.ok { background: #e8f8ef; color: var(--success-700); }
.trade-badge.no { background: #fdecea; color: var(--danger-700); }
.trade-badge.na { background: #eef2f5; color: var(--muted); }
.trade-badge.unk { background: #fff8e1; color: #9a7d0a; }
.trade-edit-btn { margin-top: 8px; background: var(--primary-50); color: var(--primary-700); }
/* پنجرهٔ ثبت روال بازرگانی */
.trade-modal { max-width: 760px; padding: 24px 26px; }
.tm-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.tm-head-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-50); display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.tm-head-label { font-size: 12px; color: var(--muted); }
.trade-modal .tm-head h2 { margin: 2px 0; font-size: 19px; line-height: 1.6; }
.tm-head-code { font-size: 12px; color: var(--primary-700); direction: ltr; text-align: right; }
.tm-card { border: 1px solid #e3ebf2; border-radius: 14px; padding: 16px; margin-bottom: 14px; background: #fbfdff; }
.tm-card-h { font-weight: bold; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.tm-card-h span { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-700); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.tm-hint { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.tm-steps { display: flex; align-items: flex-start; }
.tm-step { flex: 1; position: relative; background: none; border: 0; padding: 0 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: inherit; }
.tm-step:not(:first-child)::before { content: ''; position: absolute; top: 17px; left: 50%; width: 100%; height: 3px; background: #dfe6ec; z-index: 0; }
.tm-step.done:not(:first-child)::before { background: var(--success); }
.tm-dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; background: #fff; border: 2px solid #cfd8e0; color: var(--muted-2); transition: .15s; }
.tm-step.done .tm-dot { background: var(--success); border-color: var(--success); color: #fff; }
.tm-step.current .tm-dot { border-color: var(--warning); color: #d68910; box-shadow: 0 0 0 4px #fdebd0; }
.tm-step:hover .tm-dot { transform: scale(1.08); }
.tm-step-name { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
.tm-step.done .tm-step-name { color: var(--success-700); font-weight: bold; }
.tm-step.current .tm-step-name { color: #b9770e; font-weight: bold; }
.tm-status { margin-top: 14px; font-size: 13px; color: var(--text-2); background: #fff; border: 1px dashed #d6dee6; border-radius: 10px; padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tm-status .ok { color: var(--success-700); }
.tm-reset { margin-right: auto; background: none; border: 0; color: var(--danger-700); font-size: 12px; cursor: pointer; font-family: inherit; }
.tm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf1f5; flex-wrap: wrap; }
.tm-row:last-child { border-bottom: 0; }
.tm-row-label { display: flex; align-items: center; gap: 8px; font-weight: bold; color: var(--text); font-size: 14px; }
.tm-row-icon { width: 30px; height: 30px; border-radius: 8px; background: #eef3f8; display: inline-flex; align-items: center; justify-content: center; }
.tm-seg { display: inline-flex; background: #eef2f5; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tm-seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 12px; color: #5d6d7e; cursor: pointer; font-family: inherit; white-space: nowrap; transition: .15s; }
.tm-seg button:hover { background: #e2e8ee; }
.tm-seg button.active { color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.tm-seg button.active.ok { background: var(--success); }
.tm-seg button.active.warn { background: var(--warning); }
.tm-seg button.active.muted { background: var(--muted); }
@media (max-width: 640px) {
  .trade-modal { padding: 18px 14px; }
  .tm-step-name { font-size: 10px; }
  .tm-dot { width: 30px; height: 30px; font-size: 12px; }
  .tm-step:not(:first-child)::before { top: 14px; }
  .tm-seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .tm-seg button { flex: 1; padding: 6px 6px; }
}
/* صفحه سطوح دسترسی: تب نقش‌ها و فهرست افراد */
.access-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.access-tab { border: 1px solid #d6e2ee; background: #f4f8fb; color: var(--text-2); padding: 8px 16px; border-radius: 20px; cursor: pointer; font-family: inherit; font-size: 14px; }
.access-tab span { background: #e2ebf3; border-radius: 10px; padding: 1px 8px; font-size: 12px; margin-right: 4px; }
.access-tab.active { background: var(--primary-700); border-color: var(--primary-700); color: #fff; }
.access-tab.active span { background: rgba(255,255,255,.25); }
.access-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.access-toolbar input { flex: 1; min-width: 220px; padding: 9px 12px; border: 2px solid var(--border); border-radius: 8px; font-family: inherit; }
.access-table td, .access-table th { white-space: nowrap; }
.access-unset { color: #b9770e; background: #fff4e5; padding: 2px 8px; border-radius: 8px; font-size: 12px; }
.access-count { background: var(--primary-50); color: var(--primary-700); padding: 2px 8px; border-radius: 8px; font-size: 12px; }
.access-modal { max-width: 900px; }
.permission-grid label.perm-locked { opacity: .5; cursor: not-allowed; }
/* چت و آپلود پروژه */
.btn-info { background: #16a085; color: #fff; }
.btn-info:hover { background: #138d75; }
.project-chat-modal { max-width: 820px; display: flex; flex-direction: column; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pc-head h2 { margin-bottom: 6px; }
.pc-tabs { display: flex; gap: 8px; margin: 6px 0 10px; }
.pc-messages, .pc-files { height: 46vh; overflow-y: auto; background: #f4f7fa; border: 1px solid #e3ebf2; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pc-files { display: block; }
.pc-msg { max-width: 78%; align-self: flex-start; background: #fff; border: 1px solid #e3ebf2; border-radius: 12px 12px 12px 4px; padding: 8px 12px; }
.pc-msg.mine { align-self: flex-end; background: #e8f6f1; border-color: #c4e8db; border-radius: 12px 12px 4px 12px; }
.pc-meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.pc-text { white-space: pre-wrap; word-break: break-word; line-height: 1.8; }
.pc-msg-files { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.pc-file { display: inline-block; background: var(--primary-50); color: var(--primary-700); border-radius: 8px; padding: 3px 9px; font-size: 13px; text-decoration: none; }
.pc-file small { color: var(--muted); margin-right: 4px; }
.pc-compose { margin-top: 10px; }
.pc-compose textarea { width: 100%; min-height: 64px; padding: 10px; border: 2px solid var(--border); border-radius: 10px; font-family: inherit; resize: vertical; }
.pc-compose-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pc-attach { cursor: pointer; }
.pc-pending { flex: 1; font-size: 12px; color: var(--primary-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ناظران چندگانه */
.observer-search { width: 100%; padding: 8px 10px; border: 2px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-family: inherit; }
.observer-selector { max-height: 180px; overflow-y: auto; }
#tasksTable .filter-row input#filterCreated { min-width: 95px; }
/* دسته‌بندی تسک و روال تولید */
.task-cat-chip { display: inline-block; margin-top: 3px; background: #f0f4ff; color: #3b4f8a; border-radius: 8px; padding: 1px 8px; font-size: 11px; white-space: nowrap; }
.task-category-row { background: #f7fafc; border: 1px dashed #d6e2ee; border-radius: 10px; padding: 10px 10px 0; margin-bottom: 12px; }
.production-panel { background: #f6fbf7; border-color: #d5ecdc; }
.task-created-time { color: var(--muted); font-size: 11px; }

/* فرم دستور پرداخت */
.payment-order-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff8e8; border: 1px solid #f3dca6; border-radius: 10px; padding: 8px 12px; margin: -4px 0 12px; font-size: 13px; color: #6b5414; }
.payment-order-overlay { z-index: 120; }
.payment-order-modal { max-width: 760px; border-top: 5px solid #d69e2e; }
.payment-order-modal h2 { margin-bottom: 12px; }
.po-kind-switch { display: flex; gap: 10px; margin-bottom: 8px; }
.po-kind { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: 2px solid #e2e8f0; border-radius: 10px; cursor: pointer; font-weight: 600; transition: all .15s; }
.po-kind.active { border-color: #d69e2e; background: #fffaf0; color: #975a16; }
.po-amount { display: flex; align-items: center; gap: 6px; }
.po-amount input { flex: 1; font-weight: 600; letter-spacing: .5px; }
.po-amount span { color: #718096; font-size: 13px; }
.po-divider { border: 0; border-top: 2px dashed #cbd5e0; margin: 14px 0; }
.payment-order-view { background: #fffdf6; border: 1px solid #f3dca6; border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.payment-order-view h4 { margin: 0 0 8px; color: #975a16; }
.po-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px 14px; font-size: 13px; }
.po-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; border-bottom: 1px solid #f5ecd4; }
.po-grid strong { color: #718096; font-weight: 500; font-size: 12px; }
.po-grid span { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 600px) { .po-kind-switch { flex-direction: column; } .payment-order-modal { padding: 18px; } }

/* فیلتر چندانتخابی (مثلاً دسته‌بندی پروژه) */
.multi-filter { position: relative; display: inline-block; }
.multi-filter > summary { list-style: none; cursor: pointer; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.multi-filter > summary::-webkit-details-marker { display: none; }
.multi-filter > summary::after { content: ' ▾'; color: var(--muted); }
.multi-filter.active > summary { border-color: var(--primary); background: #eef6fc; color: var(--primary-700); font-weight: 600; }
.multi-filter-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; background: #fff; border: 1px solid #dfe6ee; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px; min-width: 230px; }
.multi-filter-menu label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.multi-filter-menu label:hover { background: #f4f8fb; }
.multi-filter-menu input { width: auto; margin: 0; }

/* تسک چندمرحله‌ای */
.stage-chip { display: inline-block; background: var(--primary-50); color: var(--primary-700); border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.task-stages { background: #f7fafc; border: 1px solid #e3ebf2; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.task-stages-title { font-weight: bold; color: var(--text); margin-bottom: 8px; }
.stage-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; position: relative; }
.stage-row + .stage-row { border-top: 1px dashed #dfe6ee; }
.stage-no { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; background: #d5f5e3; color: var(--success-700); }
.stage-row.current .stage-no { background: #fdebd0; color: #b9770e; box-shadow: 0 0 0 3px #fef5e7; }
.stage-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stage-note { font-size: 12px; background: #fff; border: 1px solid #edf1f5; border-radius: 6px; padding: 4px 8px; margin-top: 4px; white-space: pre-wrap; }
.stage-guide { background: #eaf7f3; border: 1px solid #b7e4d6; color: #145a46; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.stage-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.stage-files a { font-size: 12px; background: var(--primary-50); color: var(--primary-700); border-radius: 8px; padding: 2px 8px; text-decoration: none; }

/* روند پرداخت */
.nav-badge { background: var(--danger); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; margin-right: 4px; }
.pay-box { background: #fffaf0; border: 1px solid #f3dca6; border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.pay-box-title { font-weight: bold; color: #975a16; margin-bottom: 8px; font-size: 15px; }
.pay-step { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px dashed #f0e0bc; }
.pay-step:first-of-type { border-top: 0; }
.pay-step-no { flex: 0 0 24px; height: 24px; border-radius: 50%; background: #d69e2e; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; }
.pay-step select { margin-top: 6px; }
.pay-team { margin-top: 8px; font-size: 12px; color: #5d4e37; line-height: 1.9; }
.pay-warn { color: var(--danger-700); font-weight: 600; }
.pay-form-sum { font-size: 13px; color: var(--text-2); margin: 6px 0; }
.req { color: var(--danger); }
.pay-panel { background: #fffdf6; border: 1px solid #f3dca6; border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.pay-panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pay-chip { display: inline-block; border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: 600; margin-left: 4px; }
.pay-chip.cur { background: #fdebd0; color: #9c640c; } .pay-chip.ok { background: #d5f5e3; color: var(--success-700); }
.pay-chip.no { background: #fadbd8; color: #a93226; } .pay-chip.wait { background: #ebdef0; color: #6c3483; }
.trade-step.pay-rej { background: #fadbd8; border-color: #e6b0aa; color: #a93226; }
.pay-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.pay-table th, .pay-table td { border-bottom: 1px solid #f2e6c9; padding: 6px 8px; text-align: right; vertical-align: top; }
.pay-table th { width: 32%; color: #7f6a3c; font-weight: 500; }
.pay-table td { white-space: pre-wrap; word-break: break-word; }
.pay-actions-box { background: #fff; border: 1px solid #f5cba7; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.pay-action-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pay-history { margin-top: 8px; } .pay-history summary { cursor: pointer; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.flow-chip { display: inline-block; background: #eef3f8; color: var(--text); border-radius: 12px; padding: 2px 10px; font-size: 12px; margin: 2px; }
.flow-team { margin: 6px 0 10px; }
.flow-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; }
.flow-file { background: var(--primary-50); border-radius: 8px; padding: 2px 8px; font-size: 12px; }
.flow-file a { color: var(--primary-700); text-decoration: none; }
.flow-x { border: 0; background: none; color: var(--danger-700); cursor: pointer; font-size: 12px; }
.flow-note { font-size: 12px; color: var(--muted); }
.flow-myturn { background: #fff4e5; border: 1px solid #f5cba7; color: #935116; border-radius: 10px; padding: 8px 12px; font-weight: bold; margin-bottom: 8px; }
.flow-wait { margin-top: 10px; background: #f4f6f8; border-radius: 8px; padding: 8px 12px; color: #5d6d7e; }
.flow-events { display: flex; flex-direction: column; gap: 8px; }
.flow-event { display: flex; gap: 10px; background: #f9fbfd; border: 1px solid #edf1f5; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.flow-event.return { background: #fdf2f1; border-color: #f5c6c0; }
.flow-event-meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.flow-row-mine { background: #fffaf0; }
.pay-step select { width: 100%; padding: 10px 12px; border: 2px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 14px; background: #fff; }
.payment-order-modal .po-kind-switch { margin-top: 6px; }

/* صفحهٔ پیام‌های پروژه‌ها */
.chat-feed { display: flex; flex-direction: column; gap: 10px; }
.chat-feed-item { background: #fff; border: 1px solid #e3ebf2; border-radius: 12px; padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.chat-feed-item.new { border-color: #f5b041; background: #fffaf0; box-shadow: 0 0 0 2px #fdebd0; }
.chat-feed-item.own { background: #f7fbff; }
.chat-feed-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chat-feed-project { border: 0; background: var(--primary-50); color: #1f4e79; border-radius: 10px; padding: 4px 10px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chat-feed-project:hover { background: #d6e6f7; }
.chat-feed-meta { font-size: 12px; color: var(--muted); }
.chat-new-dot { background: var(--orange); color: #fff; border-radius: 8px; padding: 1px 7px; font-size: 11px; margin-left: 6px; }
.chat-feed-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.8; color: var(--text); }
.chat-feed-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.chat-unread-toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.chat-unread-toggle input { width: auto; }
.multi-count { color: var(--muted-2); margin-right: auto; }
/* زیرمنو (مثلاً «پیام‌های پروژه‌ها» زیر «پروژه‌ها») */
.sidebar nav a.nav-sub { padding: 8px 20px 8px 20px; padding-right: 44px; font-size: 13px; color: #bdc3c7; background: rgba(0,0,0,0.08); }
.sidebar nav a.nav-sub:hover, .sidebar nav a.nav-sub.active { color: var(--border); }
.sale-term-switch { display: flex; gap: 8px; }
.sale-term { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; border: 2px solid #e2e8f0; border-radius: 8px; cursor: pointer; font-weight: 600; background: #fff; }
.sale-term:has(input:checked) { border-color: var(--success); background: #eafaf1; color: var(--success-700); }
.sale-term input { width: auto; margin: 0; }

/* =====================================================================
   ظاهر جدید (v45): رنگ‌بندی یکدست، فاصله‌های خلوت‌تر، آیکون‌های خطی
   ===================================================================== */
:root {
  --primary: #2f6fed; --primary-600: #2459d6; --primary-700: #1d47ad; --primary-50: #eef3fe; --primary-100: #dbe6fd;
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #f7f9fc; --border: #e4e8ef; --border-2: #d5dbe5;
  --text: #1e293b; --text-2: #334155; --muted: #64748b; --muted-2: #94a3b8;
  --success: #16a34a; --success-700: #15803d; --success-50: #e8f7ee;
  --warning: #f59e0b; --warning-700: #b45309; --warning-50: #fff6e5;
  --danger: #ef4444; --danger-700: #b91c1c; --danger-50: #fdeeee;
  --orange: #f97316; --info: #0d9488; --info-50: #e6f6f4; --purple: #7c3aed; --purple-50: #f3edfd;
  --sidebar: #0f172a; --sidebar-2: #16213a;
  --radius: 10px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-lg: 0 16px 40px rgba(15,23,42,.14);
  --ring: 0 0 0 3px rgba(47,111,237,.16);
}
* { font-family: Vazirmatn, 'Segoe UI', Tahoma, sans-serif; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
::selection { background: var(--primary-100); }
.ni { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.muted { color: var(--muted-2); }
a { color: var(--primary); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cbd3df; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: #aab4c3; }

/* ---------- ورود ---------- */
#loginScreen { background: radial-gradient(circle at 15% 18%, #1e3a8a 0, transparent 30%), linear-gradient(135deg, #0b1224, #111c38 55%, #0f2a5c); }
.login-mark { background: linear-gradient(135deg, #4f8cff, var(--primary-700)); box-shadow: 0 8px 24px rgba(47,111,237,.35); }
#loginScreen button { background: var(--primary); border-radius: 10px; }
#loginScreen button:hover { background: var(--primary-600); box-shadow: 0 10px 22px rgba(47,111,237,.3); }
#loginScreen input:focus, #loginScreen select:focus { border-color: var(--primary); box-shadow: var(--ring); }

/* ---------- منوی کناری ---------- */
.sidebar { width: 250px; flex: none; background: var(--sidebar); padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; color: #cbd5e1; z-index: 60; }
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; margin: 0; border: 0; }
.sidebar .logo h2 { font-size: 17px; font-weight: 800; color: #fff; margin: 0; line-height: 1.2; letter-spacing: .3px; }
.sidebar .logo small { color: #7c8aa5; font-size: 11px; letter-spacing: .4px; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #4f8cff, var(--primary-700)); color: #fff; font-weight: 800; font-size: 19px; box-shadow: 0 6px 16px rgba(47,111,237,.35); flex: none; }
.sidebar .user-info { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 0 0 6px; border: 0; border-radius: 12px; background: rgba(255,255,255,.05); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #22c1a0, #0d9488); color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.user-meta { min-width: 0; }
.sidebar .user-info strong { color: #f1f5f9; font-size: 13.5px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-info span#currentUserRole { color: #8fb3ff; font-size: 11.5px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 11px; font-weight: 700; color: #64748b; padding: 14px 12px 6px; letter-spacing: .3px; }
.nav-group:not(:has(a:not(.hidden))) { display: none; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #cbd5e1; font-size: 13.5px; border: 0; transition: background .15s, color .15s; }
.sidebar nav a .ni { color: #8794ab; transition: color .15s; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; border: 0; }
.sidebar nav a:hover .ni { color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; border: 0; box-shadow: 0 6px 16px rgba(47,111,237,.35); }
.sidebar nav a.active .ni { color: #fff; }
.sidebar nav a.nav-sub { padding: 7px 12px; padding-right: 34px; font-size: 12.5px; color: #a3b0c5; background: none; }
.sidebar nav a.nav-sub .ni { width: 16px; height: 16px; }
.sidebar nav a.nav-sub.active { background: rgba(47,111,237,.22); color: #fff; box-shadow: none; }
.sidebar nav a.nav-cta { justify-content: center; background: rgba(47,111,237,.16); color: #cfe0ff; border: 1px dashed rgba(143,179,255,.45); margin: 4px 0 2px; font-weight: 600; }
.sidebar nav a.nav-cta .ni { color: #cfe0ff; }
.sidebar nav a.nav-cta:hover { background: var(--primary); color: #fff; border-style: solid; }
.nav-badge { background: var(--danger); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; margin-right: auto; line-height: 18px; font-weight: 700; }
.sidebar .logout { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 10px; background: rgba(239,68,68,.1); color: #fca5a5; font-size: 13.5px; }
.sidebar .logout:hover { background: rgba(239,68,68,.22); color: #fff; }

/* ---------- نوار بالا و سرصفحه ---------- */
.main { padding: 0 28px 32px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; justify-content: flex-start; margin: 0 -28px 18px; padding: 12px 28px; background: rgba(243,245,249,.86); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(228,232,239,.7); }
.topbar-date { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.topbar-date .ni { width: 16px; height: 16px; }
.menu-btn { display: none !important; }
.notif-bell { margin-right: auto; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; font-size: 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--text-2); }
.notif-bell:hover { transform: none; border-color: var(--border-2); color: var(--primary); }
.notif-bell > .ni { width: 20px; height: 20px; }
.notif-badge { top: -5px; right: -5px; min-width: 19px; height: 19px; font-size: 10.5px; background: var(--danger); border: 2px solid var(--bg); }
.notif-dropdown { top: 48px; left: 0; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 14px; }
.notif-dropdown .header h3 { font-size: 14px; }
.notif-dropdown .header button { color: var(--primary); font-family: inherit; }
.notif-item.unread { background: var(--primary-50); border-right: 3px solid var(--primary); }
.notif-more { background: var(--surface-2); color: var(--primary); font-family: inherit; }

.page-header { margin-bottom: 18px; gap: 10px; justify-content: flex-start; }
.page-header h1 { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; color: var(--text); margin-left: auto; }
.h-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.h-icon .ni { width: 20px; height: 20px; }

/* ---------- دکمه‌ها ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius); font-size: 13.5px; font-weight: 600; font-family: inherit; line-height: 1.4; border: 1px solid transparent; background: var(--surface); color: var(--text-2); border-color: var(--border); transition: background .15s, border-color .15s, box-shadow .15s, color .15s; }
.btn:hover { transform: none; box-shadow: var(--shadow); border-color: var(--border-2); }
.btn:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn .ni { width: 17px; height: 17px; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-sm .ni { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); box-shadow: 0 6px 14px rgba(47,111,237,.25); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: var(--success-700); border-color: var(--success-700); box-shadow: 0 6px 14px rgba(22,163,74,.22); }
.btn-danger { background: var(--surface); color: var(--danger-700); border-color: #f6c9c9; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: 0 6px 14px rgba(239,68,68,.22); }
.btn-warning { background: var(--warning-50); color: var(--warning-700); border-color: #f8dca6; }
.btn-warning:hover { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-info { background: var(--info-50); color: var(--info); border-color: #b9e5df; }
.btn-info:hover { background: var(--info); color: #fff; border-color: var(--info); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface); color: var(--danger-700); box-shadow: none; border-color: var(--border); }
.export-excel-btn { background: var(--surface); color: var(--success-700); border-color: #bfe5cd; }
.export-excel-btn:hover { background: var(--success); color: #fff; border-color: var(--success); }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: .15s; padding: 0; }
.icon-btn:hover { background: var(--primary-50); color: var(--primary); }

/* ---------- کارت‌ها ---------- */
.card, .chart-card, .brand-card, .project-card, .kpi-card { border: 1px solid var(--border); box-shadow: var(--shadow-sm); border-radius: var(--radius-lg); }
.card { padding: 20px; }
.card h2 { font-size: 16px; font-weight: 700; color: var(--text); }
.chart-card h3 { font-size: 15px; font-weight: 700; }
.staff-note { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); border-radius: 10px; font-size: 12.5px; }
.empty { color: var(--muted-2); padding: 48px 20px; }
.kpi-card { padding: 18px 20px; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card .kpi-label { color: var(--muted); font-weight: 600; }
.kpi-card .kpi-value { font-size: 30px; font-weight: 800; color: var(--text); }
.kpi-card.blue { background: linear-gradient(135deg, #3b7bff, var(--primary-700)); border-color: transparent; }
.kpi-card.green { background: linear-gradient(135deg, #22b55f, var(--success-700)); border-color: transparent; }
.kpi-card.orange { background: linear-gradient(135deg, #fbb02d, #e8820c); border-color: transparent; }
.kpi-card.red { background: linear-gradient(135deg, #f87171, #dc2626); border-color: transparent; }
.kpi-card.blue .kpi-label, .kpi-card.green .kpi-label, .kpi-card.orange .kpi-label, .kpi-card.red .kpi-label { color: rgba(255,255,255,.85); }

/* ---------- نوار ابزار و فیلترها ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.search-box { position: relative; flex: 1; min-width: 240px; max-width: 460px; }
.search-box .ni { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 17px; height: 17px; pointer-events: none; }
.search-box input, .filter-bar .search-box input { width: 100%; padding: 9px 38px 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 13.5px; font-family: inherit; color: var(--text); transition: .15s; }
.search-box input:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.count-chip { background: var(--surface); border: 1px solid var(--border); color: var(--muted); border-radius: 20px; padding: 5px 12px; font-size: 12.5px; white-space: nowrap; }
.count-chip:empty { display: none; }
.filter-bar { align-items: center; gap: 8px; }
.filter-bar select, .filter-bar input { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font-size: 13.5px; font-family: inherit; background: var(--surface); color: var(--text); }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.multi-filter > summary { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font-size: 13.5px; }
.multi-filter.active > summary { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); }
.multi-filter-menu { border-color: var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.multi-filter-menu input[type=checkbox] { accent-color: var(--primary); }

/* تب‌ها (سگمنت) */
.access-tabs { gap: 6px; margin: 0 0 14px; }
.access-tab { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); padding: 7px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; transition: .15s; }
.access-tab:hover { border-color: var(--border-2); background: var(--surface-2); }
.access-tab span { background: var(--surface-2); color: var(--muted); border-radius: 8px; padding: 0 7px; font-size: 11.5px; margin: 0; }
.access-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.access-tab.active span { background: rgba(255,255,255,.22); color: #fff; }
.seg-tabs { display: inline-flex; background: #e8ecf3; padding: 3px; border-radius: 12px; margin: 0; gap: 2px; }
.seg-tabs .access-tab { border: 0; background: transparent; padding: 6px 14px; border-radius: 9px; color: var(--muted); }
.seg-tabs .access-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-tabs .access-tab.active span { background: var(--primary-50); color: var(--primary-700); }
.dashboard-task-tab { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 10px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; font-family: inherit; transition: .15s; }
.dashboard-task-tab:hover { border-color: var(--border-2); background: var(--surface-2); }
.dashboard-task-tab span { background: var(--surface-2); color: var(--muted); border-radius: 8px; padding: 0 7px; margin: 0 4px 0 0; font-size: 11.5px; }
.dashboard-task-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.dashboard-task-tab.active span { background: rgba(255,255,255,.22); color: #fff; }
.inbox-filters button { background: var(--surface); color: var(--text-2); }
.inbox-filters button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- جدول‌ها ---------- */
table { border-collapse: separate; border-spacing: 0; }
th, td { padding: 11px 12px; border-bottom: 1px solid #eef1f6; font-size: 13.5px; vertical-align: middle; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; border-bottom: 1px solid var(--border); }
thead tr:first-child th:first-child { border-top-right-radius: 10px; }
thead tr:first-child th:last-child { border-top-left-radius: 10px; }
tbody tr { transition: background .12s; }
tr:hover { background: transparent; }
tbody tr:hover { background: #f6f9ff; }
tbody tr:last-child td { border-bottom: 0; }
.row-click { cursor: pointer; }
.card.table-scroll { padding: 0; overflow: auto; }
.card.table-scroll table th:first-child, .card.table-scroll table td:first-child { padding-right: 18px; }
#tasksTable thead tr:first-child th { position: sticky; top: 0; z-index: 2; }
#tasksTable .filter-row th { background: var(--surface); padding: 8px 6px; border-bottom: 1px solid var(--border); }
#tasksTable .filter-row input, #tasksTable .filter-row select, #tasksTable .filter-row .multi-filter summary { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 12px; background: var(--surface-2); color: var(--text); }
#tasksTable .filter-row input:focus, #tasksTable .filter-row select:focus { border-color: var(--primary); background: var(--surface); box-shadow: var(--ring); outline: none; }
#tasksTable td { font-size: 13px; }
#tasksTable td:nth-child(2) { min-width: 220px; }
.cell-title strong { display: block; color: var(--text); font-weight: 700; }
.cell-title small { display: block; color: var(--muted-2); font-size: 12px; margin-top: 2px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-chip { display: inline-block; font-family: Consolas, 'Courier New', monospace; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.ack-chip { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
.ack-chip.ok { background: var(--success-50); color: var(--success-700); }
.ack-chip.part { background: var(--warning-50); color: var(--warning-700); }
.ack-chip.wait { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.mini-progress { width: 64px; height: 6px; border-radius: 6px; background: #e8ecf3; overflow: hidden; display: inline-block; vertical-align: middle; }
.mini-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #22c1a0); border-radius: 6px; }
.mini-progress-label { color: var(--muted); font-size: 11.5px; margin-right: 6px; }
.file-count { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; }
.file-count .ni { width: 14px; height: 14px; }
.task-cat-chip { background: var(--primary-50); color: var(--primary-700); border-radius: 6px; font-size: 11px; padding: 1px 7px; }
.stage-chip { background: var(--purple-50); color: var(--purple); }
.task-created-time { color: var(--muted-2); }

/* عملیات ردیف و منوی ⋯ */
.row-actions { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.row-menu-wrap { position: relative; }
.row-menu { display: none; position: fixed; z-index: 400; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.row-menu.open { display: block; animation: menuIn .12s ease; }
.row-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-family: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; text-align: right; }
.row-menu button .ni { width: 16px; height: 16px; color: var(--muted); }
.row-menu button:hover { background: var(--primary-50); color: var(--primary-700); }
.row-menu button:hover .ni { color: var(--primary); }
.row-menu button.danger { color: var(--danger-700); }
.row-menu button.danger .ni { color: var(--danger); }
.row-menu button.danger:hover { background: var(--danger-50); }
.row-menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- نشان‌ها (وضعیت و اولویت) ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-new { background: var(--primary-50); color: var(--primary-700); }
.badge-progress { background: var(--warning-50); color: var(--warning-700); }
.badge-done { background: var(--success-50); color: var(--success-700); }
.badge-rejected { background: var(--danger-50); color: var(--danger-700); }
.badge-new::before, .badge-progress::before, .badge-done::before, .badge-rejected::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-low { background: #f1f5f9; color: var(--muted); }
.badge-normal { background: #eef2ff; color: #4f46e5; }
.badge-high { background: #fff1e6; color: #c2410c; }
.badge-urgent { background: var(--danger); color: #fff; }

/* ---------- پنجره‌ها و فرم‌ها ---------- */
.modal-overlay { background: rgba(15,23,42,.5); backdrop-filter: blur(4px); padding: 16px; }
.modal { border-radius: 18px; padding: 26px 28px; box-shadow: var(--shadow-lg); animation: modalIn .18s ease; border: 1px solid var(--border); }
.modal h2 { font-size: 19px; font-weight: 800; color: var(--text); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.form-group label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.form-group input, .form-group select, .form-group textarea, .comment-form textarea, .pc-compose textarea, .observer-search, .assignee-search, .access-toolbar input, .pay-step select, .mention-picker {
  border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface); color: var(--text); font-family: inherit; }
.form-group input, .form-group select { padding: 9px 12px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .comment-form textarea:focus, .pc-compose textarea:focus, .observer-search:focus, .assignee-search:focus, .access-toolbar input:focus, .pay-step select:focus {
  border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.form-group input[type=checkbox], .form-group input[type=radio] { width: auto; accent-color: var(--primary); }
.modal-actions { padding-top: 16px; border-top: 1px solid var(--border); }
.task-detail-row { border-bottom: 1px solid #eef1f6; padding-bottom: 10px; margin-bottom: 10px; }
.task-detail-row strong { color: var(--muted); font-weight: 600; }
.task-category-row { background: var(--surface-2); border: 1px dashed var(--border-2); }
.assignee-selector { border: 1px solid var(--border-2); background: var(--surface-2); border-radius: var(--radius); }
.assignee-item:hover { background: var(--primary-50); }
.assignee-item input[type="checkbox"] { accent-color: var(--primary); }
.selected-tag { background: var(--primary-50); color: var(--primary-700); font-weight: 600; }
.jalali-input button { background: var(--primary-50); color: var(--primary); border-radius: var(--radius); }
.jalali-day.selected { background: var(--primary); }
.jalali-day.today { border-color: var(--primary); }
.upload-area { border: 2px dashed var(--border-2); background: var(--surface-2); }
.upload-area:hover, .upload-area.dragover { border-color: var(--primary); background: var(--primary-50); }
.attachment-item { background: var(--surface); border-color: var(--border); }
.attachment-item .actions a { background: var(--primary); }
.attachment-item .actions button { background: var(--danger-50); color: var(--danger-700); }
.comment { background: var(--surface-2); border: 1px solid #edf0f5; }
.comment-form button { background: var(--primary); border-radius: var(--radius); font-family: inherit; font-weight: 600; }
.comment-form button:hover { background: var(--primary-600); }
.progress-bar { background: #e8ecf3; }
.progress-fill { background: linear-gradient(90deg, var(--primary), #22c1a0); }
.toast { border: 1px solid var(--border); border-right: 4px solid var(--primary); border-radius: 12px; box-shadow: var(--shadow-lg); }
.toast.success { border-right-color: var(--success); }
.toast.warning { border-right-color: var(--warning); }
.toast.error { border-right-color: var(--danger); }

/* ---------- پروژه‌ها ---------- */
.project-card { padding: 18px; transition: box-shadow .15s, border-color .15s; }
.project-card:hover { box-shadow: var(--shadow); border-color: var(--border-2); }
.project-card h3 { color: var(--text); font-size: 16px; }
.project-card .btn-sm { padding: 5px 10px; }
.project-progress { background: #e8ecf3; height: 7px; }
.project-progress span { background: linear-gradient(90deg, var(--primary), #22c1a0); }
.project-group-title { color: var(--text); border-bottom: 1px solid var(--border); font-size: 16px; }
.project-code { background: var(--primary-50); color: var(--primary-700); }
.trade-panel, .task-stages { background: var(--surface-2); border-color: var(--border); }
.trade-step.done { background: var(--success); border-color: var(--success); }
.chat-feed-item { border-color: var(--border); }
.chat-feed-project { background: var(--primary-50); color: var(--primary-700); }

/* ---------- موبایل و تبلت ---------- */
.sidebar-backdrop { display: none; }
@media (max-width: 960px) {
  .sidebar { position: fixed; top: 0; right: 0; bottom: 0; height: 100vh; transform: translateX(105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 55; }
  .menu-btn { display: inline-grid !important; width: 40px; height: 40px; background: var(--surface); border: 1px solid var(--border); }
  .main { padding: 0 16px 24px; }
  .topbar { margin: 0 -16px 14px; padding: 10px 16px; }
  .charts-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar-date { display: none; }
  .page-header h1 { font-size: 18px; }
  .modal { padding: 20px 16px; }
  .search-box { min-width: 100%; }
}
.sidebar .user-info .avatar { color: #fff; font-size: 15px; }
.person { display: inline-flex; align-items: center; gap: 9px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12.5px; background: linear-gradient(135deg, #6d8dfd, var(--primary-700)); }
#dashboardTaskList td:nth-child(3) { white-space: nowrap; }
.chart-card h3, .card h2 { display: flex; align-items: center; gap: 8px; }
#tasksTable th, #tasksTable td { padding-left: 8px; padding-right: 8px; }
#tasksTable .filter-row input, #tasksTable .filter-row select { min-width: 64px; }
#tasksTable td:nth-child(2) { min-width: 200px; }
#tasksTable .cell-title small { max-width: 240px; }
#tasksTable .task-cat-chip { white-space: normal; max-width: 170px; line-height: 1.6; }
#tasksTable .filter-row input#filterCreated { min-width: 80px; }
#tasksTable td:nth-child(2) { min-width: 180px; }
.sidebar nav a { padding: 8px 12px; }
.nav-section { padding: 12px 12px 4px; }
/* عملیات ردیف: آیکون‌های رنگی کنار هم */
.row-actions { gap: 4px; }
.row-actions .icon-btn { width: 30px; height: 30px; border: 1px solid var(--border); background: var(--surface); }
.row-actions .icon-btn .ni { width: 16px; height: 16px; }
.row-actions .act-view { color: var(--primary); }
.row-actions .act-view:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.row-actions .act-edit { color: var(--warning-700); }
.row-actions .act-edit:hover { background: var(--warning); border-color: var(--warning); color: #fff; }
.row-actions .act-progress { color: var(--info); }
.row-actions .act-progress:hover { background: var(--info); border-color: var(--info); color: #fff; }
.row-actions .act-forward { color: var(--primary-700); }
.row-actions .act-forward:hover { background: var(--primary-700); border-color: var(--primary-700); color: #fff; }
.row-actions .act-copy { color: var(--purple); }
.row-actions .act-copy:hover { background: var(--purple); border-color: var(--purple); color: #fff; }
.row-actions .act-access { color: var(--text-2); }
.row-actions .act-access:hover { background: var(--text-2); border-color: var(--text-2); color: #fff; }
.row-actions .act-danger { color: var(--danger); }
.row-actions .act-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
/* در حال ثبت: جلوگیری از دوبار کلیک */
.btn.is-loading, .icon-btn.is-loading, .comment-form button.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading .ni, .icon-btn.is-loading .ni { opacity: 0; }
.btn.is-loading::after, .icon-btn.is-loading::after, .comment-form button.is-loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn:not(.btn-primary):not(.btn-success).is-loading::after, .icon-btn.is-loading::after { border-color: rgba(47,111,237,.25); border-top-color: var(--primary); }
body.is-saving .modal-actions button:not(.is-loading), body.is-saving .row-actions button:not(.is-loading), body.is-saving .pay-action-btns button:not(.is-loading) { opacity: .55; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
/* دکمه‌های پایین فرم همیشه دیده شوند (حتی در فرم‌های بلند) */
.modal > .modal-actions { position: sticky; bottom: -26px; z-index: 6; background: var(--surface); border-radius: 0 0 18px 18px; margin: 20px -28px -26px; padding: 14px 28px 18px; border-top: 1px solid var(--border); box-shadow: 0 -8px 16px -12px rgba(15,23,42,.18); }
@media (max-width: 560px) { .modal > .modal-actions { margin: 16px -16px -20px; padding: 12px 16px 14px; bottom: -20px; } }
/* روند پرداخت: انتخاب منبع پرداخت توسط خزانه‌دار */
.pay-source { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.pay-source-title { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.pay-accounts { margin-top: 10px; }
.pay-account-list { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.pay-account-list .mention-option { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; margin: 0; font-size: 13px; }
.pay-account-list .mention-option:has(input:checked) { border-color: var(--success); background: var(--success-50); color: var(--success-700); }

/* ===== v48: وضعیت مستقل هر مسئول + گفت‌وگوی تسک‌ها در پیام‌های پروژه‌ها ===== */
.assignee-states { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 10px 12px; margin: 10px 0; }
.assignee-states-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.assignee-state-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto 70px auto; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px dashed var(--border); }
.assignee-state-row:first-of-type { border-top: 0; }
.assignee-state-row.me .assignee-state-name { font-weight: 700; color: var(--primary-700); }
.assignee-state-row .mini-progress { width: 70px; }
.assignee-states .staff-note { display: block; margin-top: 6px; }
.my-status-panel { border: 1px solid var(--primary-100); background: var(--primary-50); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; }
.my-status-panel h4 { margin: 0 0 6px; font-size: 14px; }
.my-status-panel .form-group { margin-bottom: 8px; }
.my-status-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-feed-item.task-chat { border-right: 4px solid var(--purple); }
.chat-feed-task { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 2px; }
.chat-kind-chip { background: var(--purple-50); color: var(--purple); font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 2px 9px; }
.chat-feed-task-link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-2); font: inherit; font-weight: 600; }
.chat-feed-task-link:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 600px) { .assignee-state-row { grid-template-columns: 1fr auto; } .assignee-state-row .mini-progress, .assignee-state-row .mini-progress-label { display: none; } }
.pay-amount-edit { margin-inline-start: 8px; padding: 2px 10px; font-size: 12px; }
.pay-amount-box { background: var(--warning-50); border: 1px solid #fde3b0; border-radius: var(--radius); padding: 10px 12px; }
.pay-amount-box .form-group { margin-bottom: 8px; }

/* ===== v50: گزارش روزانهٔ پروژه‌ها ===== */
.report-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.report-day { margin-bottom: 18px; }
.report-day-head { font-weight: 700; color: var(--text-2); padding: 6px 2px; border-bottom: 2px solid var(--primary-100); margin-bottom: 10px; }
.report-day-head small { color: var(--muted); font-weight: 500; }
.report-item { background: var(--surface); border: 1px solid var(--border); border-right: 4px solid var(--info); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.report-item.new { border-color: #f5b041; border-right-color: var(--warning); background: #fffaf0; }
.report-item.own { background: #f7fbff; }
.report-text { white-space: pre-wrap; line-height: 1.9; margin: 8px 0; color: var(--text); }
.report-img { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.report-img img { max-width: 180px; max-height: 130px; border-radius: 8px; border: 1px solid var(--border); object-fit: cover; display: block; }

/* ===== v51: موجودی حساب‌ها در بررسی خزانه‌داری ===== */
.pay-account-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.pay-account-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(200px, 260px); gap: 10px; align-items: center; }
.pay-account-row .po-amount input { width: 100%; }
.pay-accounts + .pay-accounts { margin-top: 10px; }
.pay-balance-chip { background: var(--success-50); color: var(--success-700); border-radius: 12px; padding: 1px 8px; font-size: 12px; white-space: nowrap; }
@media (max-width: 600px) { .pay-account-row { grid-template-columns: 1fr; } }

/* ===== v52: فیلترهای پروژه/تسک در صفحه‌های پیام و گزارش ===== */
.ef-bar { background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; }
.ef-title { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* ===== v53: تابلو اعلانات فروش ===== */
.sales-tabs { margin: 6px 0 12px; }
.sales-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.sales-actions label.btn { cursor: pointer; }
.sales-table { width: 100%; font-size: 13px; }
.sales-table td, .sales-table th { white-space: nowrap; }
.sales-table td:nth-child(2), .sales-table td:nth-child(3) { white-space: normal; }
.sales-new-customer { background: #fffaf0; }
.sales-current { background: var(--success-50); }
.sales-adjust { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
.sales-skip { max-height: 260px; overflow: auto; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--warning-700); }
.modal.sales-wide { max-width: 1000px; width: 96%; }
.sales-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; background: var(--surface); }
.sales-section h4 { margin: 0 0 8px; }
.sales-item { border: 1px solid var(--primary-100); background: var(--primary-50); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.sales-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sales-item .form-group { margin-bottom: 6px; }
.sales-ref { background: var(--success-50) !important; }
.sales-line { padding: 9px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-weight: 700; direction: ltr; text-align: right; }
.sales-grand { margin-top: 8px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; font-size: 14px; }
.sales-total-row td { background: var(--surface-2); font-weight: 700; }
.sales-credit { align-items: flex-end; gap: 8px; margin-bottom: 4px; }
.sales-credit > * { flex: 1; }
.sales-credit .flow-x { flex: 0 0 auto; }
.sales-credit-group .sales-credit { grid-template-columns: 1fr 1fr auto; }
@media (max-width: 960px) { .sales-credit-group .sales-credit { grid-template-columns: 1fr; } }
.sales-sub-h { margin: 14px 0 6px; font-size: 15px; }
.sales-card-h { margin: 0 0 8px; font-size: 16px; }
.rb-hits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sales-bank-check { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 8px 0; border: 1px dashed #27ae60; border-radius: 10px; background: rgba(39, 174, 96, .06); cursor: pointer; }
.sales-bank-check input { width: 18px; height: 18px; }
.sales-auto { background: #f4f6f8 !important; font-weight: 700; }
.sales-cust-totals { margin: 8px 0 12px; } .sales-cust-totals summary { cursor: pointer; font-weight: 700; margin-bottom: 6px; }
.sales-cash-field label b { font-size: 15px; }
.sales-cash-field input { font-weight: 800; font-size: 17px; }
.sales-cash-amount { font-size: 16px; color: #1e8449; }
.lg-side { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.lg-side label { border: 1px solid #d5dbe1; border-radius: 10px; padding: 6px 14px; cursor: pointer; font-weight: 600; }
.lg-side label.on-debtor { background: rgba(231, 76, 60, .08); border-color: #e74c3c; color: #c0392b; }
.lg-side label.on-creditor { background: rgba(39, 174, 96, .08); border-color: #27ae60; color: #1e8449; }
.lg-neg input { color: #1e8449; }
.sales-cheque-card { border: 1px solid #d5dbe1; border-radius: 10px; padding: 6px 10px; margin: 6px 0; cursor: pointer; background: #fafcfd; }
.sales-cheque-card.active { border-color: rgba(52, 152, 219, 0.5); background: rgba(52, 152, 219, 0.06); }
.sales-cheque-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sales-cheque-card .flow-files img { max-height: 60px; }
.sales-credit-group { border: 1px dashed var(--border, #d5dbe1); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.sales-credit-title { font-weight: 700; margin-bottom: 8px; }
.sales-cheque { background: rgba(52, 152, 219, 0.06); border: 1px solid rgba(52, 152, 219, 0.25); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.sales-cheque .flow-files img { max-height: 70px; }
.sales-warn { color: var(--danger-700); font-weight: 600; }
.sales-num { white-space: nowrap; }
.jp-float { position: fixed; z-index: 10000; width: 290px; margin: 0; }
.pay-chip.mine { background: var(--warning-50); color: var(--warning-700); border: 1px solid #fde3b0; }

/* ---------- پیشنهاد فروش: کدهای نقد/اعتباری، بیجک باربری، پیام‌ها ---------- */
.sales-codes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; background: #f4f8fb; border: 1px dashed #c9d8e6; border-radius: 10px; padding: 8px 10px; }
.sales-waybill { border: 2px solid #2c3e9c; border-radius: 12px; padding: 12px 14px; background: #fbfcff; }
.sales-waybill h4 { color: #2c3e9c; }
.sales-waybill textarea { width: 100%; padding: 8px; border: 2px solid #ecf0f1; border-radius: 8px; font-family: inherit; }
.sales-comments .flow-comment-box textarea { min-height: 52px; }
.sales-comments { margin-top: 12px; }

/* ---------- تاریخ انجام، لاگ تسک، برگشت روند پرداخت، شناسهٔ پرسنلی ---------- */
.done-at { color: #1e8449; font-size: 11px; white-space: nowrap; margin-inline-start: 6px; }
.done-at-strong { color: #1e8449; font-weight: 600; }
.task-log-box { margin: 10px 0; border: 1px solid #e3ebf2; border-radius: 10px; padding: 8px 12px; background: #fbfdff; }
.task-log-box summary { cursor: pointer; font-weight: 600; color: var(--text, #2c3e50); }
.task-log-list { max-height: 280px; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.task-log-row { display: flex; gap: 10px; font-size: 12px; padding: 5px 8px; border-radius: 6px; background: #f6f8fb; }
.task-log-row.done { background: #e8f8ef; }
.task-log-time { color: #7f8c8d; white-space: nowrap; min-width: 150px; }
.pay-return-note { background: #fdf2f1; border: 1px solid #f5c6c0; border-right: 4px solid #c0392b; border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 13px; line-height: 1.9; }
.pay-return-note.mine { box-shadow: 0 0 0 3px #fadbd8; }
.pay-return-head { font-weight: 700; color: #a93226; }
.pay-return-text { white-space: pre-wrap; font-weight: 600; }
.personnel-code { font-weight: 600; }

/* ---------- پیشنهاد فروش: مراحل هم‌زمان، تصاویر پیش‌فاکتور/فاکتور ---------- */
.sales-parallel { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed #b7c9db; border-radius: 16px; padding: 2px 6px; background: #f7fafc; }
.sales-par-sep { font-size: 10px; color: #7f8c8d; }
.sales-part-h { margin: 10px 0 6px; color: #173753; font-size: 14px; border-bottom: 1px dashed #d6e2ee; padding-bottom: 4px; }
.sales-files-kind { margin: 6px 0; }
.flow-comment-box { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.flow-comment-box textarea { flex: 1; min-height: 44px; padding: 8px; border: 2px solid #ecf0f1; border-radius: 8px; font-family: inherit; }

/* v59: تخفیف کالاها، فرم دریافت نقدی، فاکتورهای مشتریان، دریافتی‌های اعتباری */
.sales-disc { display: flex; gap: 6px; }
.sales-disc select { flex: 0 0 auto; width: auto !important; }
.sales-disc input { flex: 1; min-width: 0; }
.sales-disc-row { border-top: 1px dashed var(--primary-100); padding-top: 6px; }
.sales-disc-all { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 4px; padding: 8px 10px; border: 1px dashed #e0b25c; background: #fffaf0; border-radius: 10px; font-size: 13px; }
.sales-disc-all select, .sales-disc-all input { padding: 7px 9px; border: 2px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; }
.sales-disc-all input { width: 160px; max-width: 100%; }
.sales-cash-receipt { background: #f4fbf6; border-color: #bfe3cb; }
.sales-sum-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.rc-credit { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin: 8px 0; background: var(--surface); }
.rc-credit.overdue { border-color: #f1a9a0; background: #fff6f5; }
.rc-credit-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.rc-add { margin-inline-start: auto; display: inline-flex; gap: 6px; }
.rc-line { border: 1px solid var(--primary-100); background: var(--primary-50); border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.rc-line.rc-cheque { background: #f5f3ff; border-color: #d9d2fb; }
.rc-line .form-group { margin-bottom: 6px; }
.rc-files-row td { padding-top: 0; border-bottom-width: 2px; }
.rc-files-row .flow-file img { max-height: 70px; }
@media (max-width: 640px) { .rc-add { margin-inline-start: 0; } .sales-disc-all input { width: 100%; } }

/* v60: فیلترهای روند پرداخت، نوار Administrator مشتریان */
.pay-filters { flex-wrap: wrap; align-items: center; gap: 8px; }
.pay-f-group { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted, #5d6d7e); }
.pay-date-f { display: inline-flex; align-items: center; gap: 2px; }
.pay-date-f input { width: 120px; cursor: pointer; padding: 7px 9px; border: 2px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; }
.pay-date-f button { border: 0; background: transparent; color: #c0392b; cursor: pointer; }
.pay-dt { white-space: nowrap; font-size: 13px; }
.sales-admin-bar { align-items: center; gap: 8px; padding: 8px 10px; background: #fff6f5; border: 1px dashed #f1a9a0; border-radius: 10px; margin-bottom: 8px; }

/* v76: مدیریت نود، پنل Administrator، تابلو خرید */
.node-role { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0; }
.node-role + .node-role { border-top: 1px dashed var(--border, #e2e8f0); }
.node-role-name { font-weight: 600; margin-inline-end: 4px; }
.node-table td { vertical-align: top; }
.sales-admin-box { border: 1px dashed #f59e0b; background: rgba(245, 158, 11, .06); border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.sales-admin-box > summary { cursor: pointer; font-weight: 600; }
#nodeUsers { max-height: 260px; overflow: auto; }
.tab-access-sel { min-width: 118px; font-size: 12px; }
.tab-access-sel.edit { border-color: #16a34a; background: rgba(22, 163, 74, .08); }
.tab-access-sel.view { border-color: #2f6fed; background: rgba(47, 111, 237, .07); }
.tab-access-sel.none { border-color: #ef4444; background: rgba(239, 68, 68, .06); }

.lg-sellers { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-sellers .sales-bank-check { margin: 0; padding: 6px 10px; }

/* ===== v102: فرم پیشنهاد خرید پهن‌تر و ویرایشگر ردیف‌های کالا / خدمت ===== */
.modal.purchase-form { max-width: 1320px; width: 96%; }
.pp-steps-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 4px 18px; align-items: start; }
.pp-steps-top .pay-step { border-top: 0; }
.pp-brand-row > .form-group:first-child { flex: 0 0 260px; }
.pp-desc-row > .form-group { flex: 1; }
.pi-editor .pi-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.pi-editor .pi-head h4 { margin: 0; }
.pi-editor .pi-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pi-editor .pi-filter select { width: auto; min-width: 180px; }
.pi-table { table-layout: fixed; min-width: 1060px; }
.pi-table th { background: var(--surface-2); font-size: 12.5px; }
.pi-table td { white-space: normal !important; vertical-align: top; padding: 8px 6px; }
.pi-table col.pi-c-no { width: 34px; } .pi-table col.pi-c-item { width: auto; } .pi-table col.pi-c-sub { width: 150px; }
.pi-table col.pi-c-unit { width: 110px; } .pi-table col.pi-c-qty { width: 105px; } .pi-table col.pi-c-price { width: 160px; }
.pi-table col.pi-c-disc { width: 85px; } .pi-table col.pi-c-amt { width: 150px; } .pi-table col.pi-c-del { width: 44px; }
.pi-editor input:not([type=checkbox]), .pi-editor select { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; background: #fff; color: inherit; }
.pi-editor input:not([type=checkbox]):focus, .pi-editor select:focus { outline: none; border-color: var(--primary, #2f6fed); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.pi-editor .pi-manual { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 6px; }
.pi-editor .pi-toggle { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-2, #555); cursor: pointer; }
.pi-editor .pi-hint { margin-top: 4px; font-size: 12px; }
.pi-editor .pi-text { display: inline-block; padding-top: 8px; font-size: 12.5px; color: var(--text-2, #555); }
.pi-editor .pi-rowno { color: #94a3b8; font-size: 12px; padding-top: 14px !important; text-align: center; }
.pi-editor .pi-amount { font-weight: 700; padding-top: 14px !important; }
.pi-editor .pi-del, .imp-item .pi-del { border: 1px solid #f5c6c0; background: #fdf2f1; color: #c0392b; border-radius: 8px; width: 32px; height: 34px; cursor: pointer; font-size: 14px; }
.pi-editor .pi-del:hover, .imp-item .pi-del:hover { background: #fadbd8; }
.pi-editor .pi-total { margin-top: 4px; font-size: 14px; }
@media (max-width: 760px) { .pp-brand-row > .form-group:first-child { flex: 1 1 100%; } .pi-table { min-width: 900px; } }
.payment-order-modal:has(.pi-editor) { max-width: 1320px; width: 96%; }  /* دستور پرداخت با فاکتور: همان ویرایشگر کالا */
/* ===== v104: دیتای انبار کامل در عرض صفحه (بدون اسکرول افقی) ===== */
.wh-table-wrap { width: 100%; overflow-x: hidden; }
.wh-table { table-layout: fixed; width: 100%; font-size: 12px; }
.wh-table th, .wh-table td { white-space: normal !important; overflow-wrap: anywhere; padding: 6px 5px; vertical-align: top; line-height: 1.6; }
.wh-table th { font-size: 11.5px; }
.wh-table .wh-c-doc_date { width: 84px; } .wh-table .wh-c-wh_code { width: 48px; } .wh-table .wh-c-wh_name { width: 11%; }
.wh-table .wh-c-doc_kind { width: 52px; } .wh-table .wh-c-move_type { width: 7%; } .wh-table .wh-c-dest_code { width: 56px; }
.wh-table .wh-c-party_code { width: 60px; } .wh-table .wh-c-party_name { width: 12%; } .wh-table .wh-c-base_doc { width: 66px; }
.wh-table .wh-c-item_code { width: 56px; } .wh-table .wh-c-item_name { width: auto; } .wh-table .wh-c-qty { width: 70px; }
.wh-table .wh-c-notes { width: 13%; }
.wh-brand-sel { padding: 6px 8px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; background: #fff; min-width: 140px; }
@media (max-width: 900px) { .wh-table-wrap { overflow-x: auto; } .wh-table { min-width: 900px; } }
/* ===== v105: موجودی انبار ===== */
.wh-stock-row.open td { background: var(--primary-50, #eef4ff); }
.wh-stock-detail > td { background: var(--surface-2); padding: 8px 14px !important; }
.wh-stock-detail .sales-table { background: var(--surface, #fff); }
.wh-stock .wh-in { color: #15803d; } .wh-stock .wh-out { color: #b91c1c; } .wh-stock .wh-neg { color: #b91c1c; }
/* ===== v107: مرتب‌سازی ستون‌ها ===== */
th.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable-th:hover { background: var(--primary-50, #eef4ff); }
th.sortable-th .sort-ic { color: #94a3b8; font-size: 11px; }
th.sortable-th.sorted .sort-ic { color: var(--primary, #2f6fed); }
/* ===== v121: تفصیل طرف حساب — ستون‌های نقد / اعتباری / چک و کارت حساب ===== */
.pmix { white-space: nowrap; line-height: 1.5; }
.pmix small { display: inline-block; min-width: 30px; font-size: 10.5px; border-radius: 6px; padding: 0 5px; text-align: center; }
.pmix-s small { background: var(--success-50); color: var(--success-700); }
.pmix-p small { background: var(--warning-50); color: var(--warning-700); }
.pc-link { color: var(--text); border-bottom: 1px dashed var(--muted-2); }
.pc-actions { white-space: nowrap; }
/* کارت حساب کشویی زیر ردیف */
tr.pc-row { cursor: pointer; } tr.pc-row:hover td { background: var(--primary-50); }
tr.pc-row:hover .pc-link { color: var(--primary); border-color: var(--primary); }
tr.pc-open td { background: var(--primary-50); border-bottom: 0; } tr.pc-open .pc-link { color: var(--primary); }
.pc-code { white-space: nowrap; } .pc-chev { display: inline-block; color: var(--primary); font-size: 12px; width: 12px; }
tr.pc-expand > td { padding: 0 0 14px !important; background: var(--primary-50); }
.pc-inline { position: sticky; right: 12px; margin: 0 12px; background: var(--surface); border: 1.5px solid var(--primary-100); border-radius: 14px;
  box-shadow: 0 8px 22px rgba(15,23,42,.10); padding: 16px 18px; white-space: normal; cursor: default; animation: modalIn .18s ease; }
.pc-close { display: flex; justify-content: center; margin-top: 12px; }
/* فهرست تفصیل: جعبهٔ اسکرول با ارتفاع صفحه (نوار اسکرول افقی همیشه پیداست)، سرستون ثابت و ستون‌های انتخاب / کد / نام ثابت */
.party-scroll { max-height: calc(100vh - 190px); overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.party-scroll::-webkit-scrollbar { width: 14px; height: 14px; }
.party-scroll::-webkit-scrollbar-thumb { background-color: #b4bfcf; }
.party-table { margin: 0; }
.party-hscroll { overflow-x: auto; overflow-y: hidden; height: 16px; margin-bottom: 4px; border-radius: 8px; background: var(--surface-2); }
.party-hscroll > div { height: 1px; }
.party-hscroll::-webkit-scrollbar { height: 14px; } .party-hscroll::-webkit-scrollbar-thumb { background-color: #b4bfcf; }
.party-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border); }
.party-table .stk { position: sticky; z-index: 2; background: var(--surface); }
.party-table thead th.stk { z-index: 4; background: var(--surface-2); }
.party-table .st0 { right: var(--st0, 0); } .party-table .st1 { right: var(--st1, 0); } .party-table .st2 { right: var(--st2, 0); }
.party-table .stk-last { box-shadow: -6px 0 8px -6px rgba(15,23,42,.22); }
.party-table thead th.stk-last { box-shadow: -6px 0 8px -6px rgba(15,23,42,.22), inset 0 -1px 0 var(--border); }
.party-table tr.pc-row:hover td.stk, .party-table tr.pc-open td.stk { background: var(--primary-50); }
.party-table tr.sales-new-customer td.stk { background: inherit; }
.pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.pc-head h2 { margin-bottom: 4px; }
.pc-sub { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-scope { margin-top: 10px; }
.pc-net { min-width: 240px; border-radius: 14px; padding: 10px 16px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); }
.pc-net small { color: var(--muted); font-size: 12px; } .pc-net b { font-size: 22px; } .pc-net b small { font-size: 12px; }
.pc-net span { font-size: 12.5px; font-weight: 700; }
.pc-net.deb { background: var(--danger-50); border-color: #f6c9c9; } .pc-net.deb span, .pc-net.deb b { color: var(--danger-700); }
.pc-net.cred { background: var(--success-50); border-color: #bfe8cf; } .pc-net.cred span, .pc-net.cred b { color: var(--success-700); }
.pc-net.zero { background: var(--surface-2); }
.pc-tabs { margin: 8px 0 12px; } .pc-tabs .count-chip { font-size: 11px; padding: 0 7px; margin-inline-start: 4px; }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .pc-grid { grid-template-columns: 1fr; } .pc-net { min-width: 0; width: 100%; } }
.pc-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--surface); }
.pc-card.empty { background: var(--surface-2); }
.pc-card h3 { font-size: 15.5px; font-weight: 800; margin: 0 0 10px; } .pc-card h3 small { color: var(--muted); font-weight: 500; font-size: 12px; }
.pc-group { border-top: 1px dashed var(--border); padding: 8px 0 4px; }
.pc-group h4 { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 0 0 4px; }
.pc-kv { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 13px; }
.pc-kv b { font-variant-numeric: tabular-nums; } .pc-kv.sub { padding-inline-start: 16px; color: var(--text-2); } .pc-kv.sub b { font-weight: 600; }
.pc-kv.sub span::before { content: '— '; color: var(--muted-2); } .pc-kv.strong { font-weight: 700; }
.pc-kv.none { color: var(--muted-2); font-size: 12.5px; }
.pc-total { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-weight: 700; }
.pc-total span:first-child { flex: 1; } .pc-total b { font-size: 16px; }
.pc-final { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: var(--primary-50); border: 1px solid var(--primary-100); font-weight: 700; }
.pc-final span:first-child { flex: 1; } .pc-final b { font-size: 18px; }
.pc-tag { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.pc-tag small { font-weight: 500; } .pc-tag.deb { background: var(--danger-50); color: var(--danger-700); }
.pc-tag.cred { background: var(--success-50); color: var(--success-700); } .pc-tag.zero { background: #e2e8f0; color: var(--text-2); }
.pc-mix { margin-bottom: 8px; } .pc-mix-title { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pc-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #e2e8f0; }
.pc-bar span { display: block; height: 100%; } .pc-bar .empty-bar { width: 100%; }
.pc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12.5px; }
.pc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }
.pc-bar .c1, .pc-legend .c1 { background: #22a06b; } .pc-bar .c2, .pc-legend .c2 { background: #2f6fed; } .pc-bar .c3, .pc-legend .c3 { background: #f59e0b; }
.pc-table td, .pc-table th { white-space: nowrap; } .pc-table td:nth-child(3) { white-space: normal; min-width: 160px; }
.pc-table .pc-deb { color: var(--danger-700); } .pc-table .pc-cred { color: var(--success-700); }
.pc-table tr.pc-opening td { background: #fbf7ec; } .pc-table tr.pc-sep td { border-top: 2px solid var(--border-2); }
.pc-table tfoot .pc-foot td { background: var(--surface-2); font-weight: 800; border-top: 2px solid var(--border-2); }
.pc-who { font-size: 12px; border-radius: 6px; padding: 1px 6px; } .pc-who.c { background: var(--success-50); color: var(--success-700); }
.pc-who.s { background: var(--warning-50); color: var(--warning-700); }
/* v128: مانده اعتبار باز در کارت حساب — کم شده (✅) / هنوز کم نشده (⏳) */
.pc-openbox { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--primary-100); background: var(--primary-50); }
.pc-openbox h4 { margin: 0 0 6px; font-size: 13.5px; }
.pc-openbox .pc-kv.strong b { font-size: 16px; }
.pc-await { margin: 8px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--warning-50); color: var(--warning-700); font-size: 12.5px; }
.pc-table .pc-ok { color: var(--success-700); } .pc-table .pc-wait { color: var(--warning-700); }
.pc-ledger-help { margin-bottom: 10px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.9; }
.pc-ledger-help p { margin: 0 0 4px; } .pc-ledger-help ul { margin: 0; padding-inline-start: 18px; }
.pc-ledger-help .pc-deb { color: var(--danger-700); } .pc-ledger-help .pc-cred { color: var(--success-700); }
/* v130: دستور پرداخت — کد تفصیل تأمین‌کننده / مشتری در خرج چک */
.pay-code { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--primary-50); color: var(--primary); white-space: nowrap; }
.pay-code.none { background: var(--warning-50); color: var(--warning-700); }
.pay-spend-sup { margin-bottom: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }

/* v141: منوی «خرید» (کشویی) ← خرید داخلی / خرید وارداتی */
.sidebar nav a.nav-parent .nav-caret { margin-right: auto; width: 16px; height: 16px; transition: transform .2s; }
.sidebar nav a.nav-parent.open .nav-caret { transform: rotate(180deg); }
.nav-children { display: none; }
.nav-children.open { display: block; }
/* v141: خرید وارداتی — صفحه و فرم */
.imp-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, var(--primary-50), var(--surface)); }
.imp-hero h3 { margin-bottom: 4px; } .imp-hero p { max-width: 720px; font-size: 13px; }
.imp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0 0 14px; }
.imp-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow-sm); }
.imp-kpi span { display: block; font-size: 12px; color: var(--muted); } .imp-kpi b { font-size: 17px; color: var(--text); }
.imp-tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); margin-inline-start: 4px; white-space: nowrap; }
.imp-item-chip { display: inline-block; font-size: 12px; padding: 2px 8px; margin: 2px; border-radius: 8px; background: var(--primary-50); color: var(--text-2); }
.imp-modal { max-width: 900px; }
.imp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; } .imp-head h2 { margin: 0; }
.imp-step { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
.imp-step.bad { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.imp-step-h { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.imp-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary-100); color: var(--primary-700); font-size: 13px; }
.imp-num.done { background: var(--success); color: #fff; }
.imp-sum { margin-right: auto; font-size: 12px; font-weight: 600; color: var(--primary-700); background: var(--primary-50); padding: 2px 10px; border-radius: 10px; }
.imp-sum:empty { display: none; }
.imp-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--radius); background: var(--success-50); color: var(--success-700); font-size: 13.5px; }
.imp-help { font-size: 12.5px; }
.imp-items { display: flex; flex-direction: column; gap: 8px; }
.imp-item { display: grid; grid-template-columns: 30px 1fr 190px 32px; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.imp-step .form-group { margin-bottom: 8px; }
.imp-step .form-row { align-items: end; }
.imp-item .form-group { margin-bottom: 0; }
.imp-step textarea { min-height: 64px; }
.imp-item.bad { border-color: var(--danger); background: var(--danger-50); }
.imp-idx { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-top: 30px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-2); font-size: 12px; color: var(--muted); }
.imp-item-main input, .imp-qty input { width: 100%; }
.imp-item-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; font-size: 12px; }
.imp-item-meta .imp-tag { margin: 0; }
.imp-item-qty input { text-align: left; }
.imp-qty { display: flex; align-items: center; gap: 6px; } .imp-qty span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.imp-item .pi-del { margin-top: 30px; }
.imp-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.imp-np { margin-top: 10px; }
.imp-step textarea { width: 100%; resize: vertical; }
@media (max-width: 640px) {
  .imp-item { grid-template-columns: 26px 1fr 28px; }
  .imp-item-qty { grid-column: 2 / 3; }
  .imp-item .pi-del { grid-column: 3; grid-row: 1; }
  .imp-step .form-row { grid-template-columns: 1fr; }
}

/* v151: چرخاندن عکس پیش از آپلود */
.rot-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.rot-item { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.rot-item img { width: 76px; height: 76px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 8px; transition: transform .2s; }
.rot-item img.big { width: 160px; height: 160px; }
.rot-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 6px; padding: 2px 10px; cursor: pointer; font-family: inherit; font-size: 13px; }
.rot-btn:hover { background: #e8f0fe; }
.rot-dlg { position: fixed; inset: 0; z-index: 6000; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.rot-card { background: #fff; border-radius: 14px; padding: 18px; width: 100%; max-width: 760px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.rot-card h3 { margin: 0 0 12px; font-size: 16px; }
.rot-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.rot-actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 14px; }
/* v158: مدیریت بابت پرداخت */
.pcat-top { display: flex; align-items: center; gap: 12px; }
.pcat-top h3 { margin: 0; font-size: 16px; }
.pcat-dirty { color: #b45309; font-size: 12px; font-weight: 600; }
.pcat-type { border: 1px solid var(--border); border-radius: 10px; margin: 8px 0; background: #fff; }
.pcat-type.open { border-color: var(--primary); }
.pcat-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.pcat-toggle { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px 4px; color: inherit; }
.pcat-tools { margin-inline-start: auto; display: inline-flex; gap: 4px; }
.pcat-body { padding: 4px 12px 12px; border-top: 1px dashed var(--border); }
.pcat-desc { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.pcat-dname { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pcat-items { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding-inline-start: 14px; }
.pcat-chip { display: inline-flex; align-items: center; gap: 2px; background: #eef2ff; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12px; }
.pcat-chip button { background: none; border: none; cursor: pointer; font-size: 11px; padding: 0 3px; opacity: .7; }
.pcat-chip button:hover { opacity: 1; }
.pcat-add { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; }
.pcat-add input { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; min-width: 180px; }
.pcat-add-type { display: flex; margin: 12px 0; }
@media (max-width: 600px) { .pcat-add, .pcat-add-type { display: flex; flex-wrap: wrap; width: 100%; } .pcat-add input { flex: 1; min-width: 0; } }/* v160: «جمع کل مانده اعتباری باز هر مشتری» — مثل فهرست تفصیل: جعبهٔ اسکرول با ارتفاع صفحه، نوار اسکرول افقی بالا، سرستون و ستون مشتری ثابت */
.ct-scroll { max-height: calc(100vh - 170px); overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.ct-scroll::-webkit-scrollbar, .ct-hscroll::-webkit-scrollbar { width: 14px; height: 14px; }
.ct-scroll::-webkit-scrollbar-thumb, .ct-hscroll::-webkit-scrollbar-thumb { background-color: #b4bfcf; }
.ct-hscroll { overflow-x: auto; overflow-y: hidden; height: 16px; margin-bottom: 4px; border-radius: 8px; background: var(--surface-2); }
.ct-hscroll > div { height: 1px; }
.ct-table { margin: 0; }
.ct-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border); }
.ct-table thead th:first-child, .ct-table td.ct-stk { position: sticky; right: 0; box-shadow: -6px 0 8px -6px rgba(15,23,42,.22); }
.ct-table thead th:first-child { z-index: 4; }
.ct-table td.ct-stk { z-index: 2; background: var(--surface); }
.ct-table tr.row-click:hover td.ct-stk, .ct-table tr.flow-row-mine td.ct-stk { background: var(--primary-50); }/* v161: خرید وارداتی — مبلغ کل ردیف (سرپرست مالی) و هزینهٔ تمام‌شدهٔ هر کالا */
.imp-cost { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.imp-cost .form-group { margin-bottom: 0; }
.imp-unit-cost { min-height: 40px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border); }
@media (max-width: 600px) { .imp-cost { grid-template-columns: 1fr; } }/* v165: زیرمجموعهٔ ریز شرح در «مدیریت بابت پرداخت» */
.pcat-igroup { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pcat-igroup:has(.pcat-subs) { flex-basis: 100%; padding: 4px 6px; border: 1px dashed var(--border); border-radius: 10px; }
.pcat-subs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding-inline-start: 8px; border-inline-start: 2px solid var(--primary-100); }
.pcat-sub { background: #f1f5f9; font-size: 11.5px; }/* v166: خروج واقعی کالا در فرم بیجک + بیجک مانده */
.sales-exit-h { margin: 12px 0 6px; font-size: 14px; }
.sales-exit-table .sales-exit-in { width: 110px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; text-align: left; }
.sales-exit-table .sales-exit-in.bad { border-color: #dc2626; background: #fef2f2; }
.sales-rem-box { border: 1px dashed #f59e0b; border-radius: 12px; padding: 8px 12px; margin-top: 10px; background: #fffbeb; }
.sales-rem-box > summary { cursor: pointer; font-weight: 600; }
.sales-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sales-inline input { flex: 1; min-width: 140px; }
/* v200: فرم «فاکتور بدون کالا» — کارت هر کالا */
.ni-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 10px 12px; }
.ni-item.bad { border-color: var(--danger); background: var(--danger-50); }
.ni-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ni-item-head .imp-idx { margin-top: 0; }
.ni-item-head .flow-x { margin-inline-start: auto; }
.ni-grid { display: grid; gap: 10px; align-items: end; }
.ni-grid .form-group { margin-bottom: 6px; min-width: 0; }
.ni-grid input, .ni-grid select { width: 100%; }
.ni-grid-2 { grid-template-columns: 1fr 1.6fr; }
.ni-grid-2b { grid-template-columns: 1fr 2.4fr; }
.ni-grid-4 { grid-template-columns: 1fr 1.4fr 1.4fr 1.3fr; margin-top: 6px; }
.ni-item .imp-item-meta { margin: 0 0 4px; }
.ni-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: var(--radius); background: var(--primary-50); border: 1px solid var(--primary-100); font-weight: 700; margin-bottom: 8px; }
.ni-total b { font-size: 18px; color: var(--primary-700); direction: ltr; }
@media (max-width: 760px) { .ni-grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .ni-grid-2, .ni-grid-2b, .ni-grid-4 { grid-template-columns: 1fr; } }