/* ===== کانبان پژوهش: کارت‌ها و پنجره‌ی جزئیات ===== */
[hidden] { display: none !important; }
body.kb-open { overflow: hidden; }

.kb-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }

.kb-card { font-weight: 400; cursor: pointer; }
.kb-card[draggable="true"] { cursor: grab; }
.kb-card.kb-ro:hover { transform: translateY(-3px); }
.kb-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.kb-card-top { display: flex; align-items: flex-start; gap: 4px; font-weight: 900; line-height: 1.7; }
.kb-card-title { flex: 1; word-break: break-word; }
.kb-lock { color: var(--ink-mute); flex: none; }
.kb-due { margin-top: 8px; font-size: .82rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: #f1f2fa; color: var(--ink-soft); }
.kb-due-soon { background: var(--amber-soft); color: #a16207; }
.kb-due-late { background: var(--rose-soft); color: var(--rose); }
.kb-progress { margin-top: 10px; display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--ink-soft); }
.kb-bar { flex: 1; height: 8px; border-radius: 99px; background: #e9ebf6; overflow: hidden; }
.kb-bar span { display: block; height: 100%; border-radius: 99px; background: var(--grad-brand); transition: width .4s var(--ease); }
.col-done .kb-bar span { background: var(--grad-green); }
.kb-tcomment { margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; padding: 8px 10px; border-radius: 10px; background: var(--green-soft); color: #14532d; }
.kb-tcomment .bi { margin-top: 3px; flex: none; }
.kb-tcomment div { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.kb-empty { text-align: center; color: var(--ink-mute); padding: 26px 8px; font-size: .9rem; }

/* پنجره */
.kb-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1000; background: rgba(30, 35, 64, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 12px; }
.kb-modal { width: 100%; max-width: 720px; max-height: 100%; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; animation: kbPop .3s var(--ease) both; }
@keyframes kbPop { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.kb-modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--brand-soft); }
.kb-modal-head h5 { margin: 0; font-weight: 900; }
.kb-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 20px 22px; }
.kb-modal-foot { flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); background: #fafbff; }
.kb-field { margin-bottom: 16px; }
.kb-field > label { display: block; font-weight: 800; margin-bottom: 6px; }
.kb-field textarea { min-height: 70px; }
.kb-field input:disabled, .kb-field textarea:disabled, .kb-field select:disabled { background: #f3f4fa; color: var(--ink-soft); cursor: not-allowed; }
.kb-hint { display: block; margin-top: 6px; color: var(--ink-mute); }
.kb-hint.bad { color: var(--rose); }
.kb-notice { margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; background: var(--amber-soft); color: #7c4a03; font-size: .92rem; }
input[type="range"] { width: 100%; accent-color: #4f46e5; }
input[type="range"]:disabled { opacity: .6; }

.kb-section { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }
.kb-section h6 { font-weight: 900; margin: 0 0 10px; font-size: 1rem; }
.kb-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.kb-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f6f7fd; border: 1px solid var(--line); }
.kb-list li.kb-comment { background: var(--green-soft); border-color: #bfe9cd; }
.kb-list li.kb-none { background: transparent; border: 0; color: var(--ink-mute); padding: 4px 0; }
.kb-li-body { flex: 1; min-width: 0; word-break: break-word; white-space: pre-line; }
.kb-li-body small { display: block; color: var(--ink-mute); margin-top: 4px; }
.kb-x { border: 0; background: transparent; color: var(--ink-mute); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 6px; }
.kb-x:hover { color: var(--rose); background: var(--rose-soft); }
.kb-add { display: flex; gap: 8px; align-items: stretch; }
.kb-add-col { flex-direction: column; align-items: flex-start; }
.kb-add-col textarea { width: 100%; }
.kb-btn-danger { border: 1px solid var(--rose); background: #fff; color: var(--rose); border-radius: 12px; padding: .5rem 1rem; font-weight: 700; cursor: pointer; }
.kb-btn-danger:hover { background: var(--rose-soft); }
.kb-msg { font-weight: 700; }
.kb-msg.good { color: var(--green); }
.kb-msg.bad { color: var(--rose); }

@media (max-width: 600px) {
        .kb-modal-body, .kb-modal-head, .kb-modal-foot { padding-inline: 14px; }
}

/* ===== مهلت اتمام: تعداد روز / تقویم شمسی ===== */
.kb-mode { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.kb-mode label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; }
.kb-mode input { accent-color: #4f46e5; }
.kb-daysbox { display: flex; align-items: center; gap: 10px; }
.kb-daysbox input { max-width: 140px; text-align: center; }
.kb-calbtn { display: flex; align-items: center; gap: 8px; text-align: right; cursor: pointer; background: #fff; }
.kb-calbtn:disabled { cursor: not-allowed; }
.kb-cal { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); max-width: 340px; }
.kb-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kb-cal-head button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.kb-cal-head button:hover { background: #dedbfd; }
.kb-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.kb-cal-wd { font-size: .8rem; font-weight: 900; color: var(--ink-mute); padding: 4px 0; }
.kb-cal-day { border: 0; background: transparent; height: 36px; border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--ink); }
.kb-cal-day:hover { background: var(--brand-soft); }
.kb-cal-day.fri { color: var(--rose); }
.kb-cal-day.today { box-shadow: inset 0 0 0 2px var(--teal); }
.kb-cal-day.sel { background: var(--grad-brand); color: #fff; }
.kb-cal-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.kb-cal-foot button { border: 0; background: transparent; color: var(--brand); font-weight: 800; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.kb-cal-foot button:hover { background: var(--brand-soft); }

/* ===== موضوع پژوهش (صفحه‌ی دبیر) ===== */
.topic-current { padding: 14px 16px; border-radius: 14px; background: var(--brand-soft); margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.topic-current strong { font-size: 1.1rem; word-break: break-word; }
.topic-current small { color: var(--ink-mute); }
.topic-form { margin-bottom: 18px; }
.topic-form small { display: block; margin-top: 6px; }
.topic-prev { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.topic-prev h6 { font-weight: 900; margin: 0 0 10px; }
.topic-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.topic-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: #f6f7fd; border: 1px solid var(--line); }
.topic-list small { color: var(--ink-mute); }

/* ===== فرم بررسی هفتگی ===== */
.rv-field { margin-bottom: 20px; }
.rv-label { font-weight: 900; margin-bottom: 8px; display: block; }
.rv-label small { color: var(--ink-mute); font-weight: 600; }
.score-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.score-end { font-size: .8rem; color: var(--ink-mute); }
.score-row input, .seg-row input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.score-chip { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer; font-weight: 900; user-select: none;
    background: hsl(var(--h) 80% 95%); color: hsl(var(--h) 60% 30%); border: 2px solid hsl(var(--h) 60% 82%); transition: transform .12s, background .12s; }
.score-chip:hover { transform: translateY(-2px); background: hsl(var(--h) 80% 90%); }
.score-row input:checked + .score-chip { background: hsl(var(--h) 65% 42%); color: #fff; border-color: hsl(var(--h) 65% 32%); transform: scale(1.08); }
.score-row input:focus-visible + .score-chip, .seg-row input:focus-visible + .seg-chip { outline: 3px solid var(--brand); outline-offset: 2px; }
.seg-row { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-chip { flex: 1 1 110px; text-align: center; padding: 12px 10px; border-radius: 12px; cursor: pointer; font-weight: 900; background: #f3f4fa; border: 2px solid var(--line); color: var(--ink-soft); user-select: none; }
.seg-chip:hover { background: var(--brand-soft); }
.seg-row input:checked + .seg-yes { background: var(--green-soft); border-color: #22c55e; color: #166534; }
.seg-row input:checked + .seg-no { background: var(--rose-soft); border-color: #f43f5e; color: #9f1239; }
.seg-row input:checked + .seg-no_topic { background: var(--amber-soft); border-color: #f59e0b; color: #92400e; }
.rv-history { margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--line); }
.rv-history h6 { font-weight: 900; margin: 0 0 12px; }
.rv-item { padding: 12px 14px; border-radius: 14px; background: #f6f7fd; border: 1px solid var(--line); margin-bottom: 10px; }
.rv-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-item-top small { color: var(--ink-mute); margin-inline-end: auto; }
.rv-pill { padding: 3px 10px; border-radius: 99px; font-size: .82rem; font-weight: 800; background: hsl(var(--h) 80% 92%); color: hsl(var(--h) 60% 26%); }
.rv-pill.rv-neutral { background: #e9ebf6; color: var(--ink-soft); }
.rv-obst { margin-top: 8px; white-space: pre-line; word-break: break-word; }
@media (max-width: 600px) { .score-chip { min-width: 38px; height: 40px; } }
