/* ── عناصر مشتركة في لوحة التحكم ───────────────────────────── */
.side-nav { overflow-y: auto; flex: 1; }
.badge { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold-500); color: var(--green-950); font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.align-start { align-items: start; }
.form-narrow { max-width: 820px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--ink-2); font-size: .9rem; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--green-900); border-bottom-color: var(--gold-500); font-weight: 700; }
.tabs .count { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--cream); color: var(--ink-2); border: 1px solid var(--line); }
.danger { color: var(--danger) !important; }
.inline { display: inline; }
.num-input { width: 90px; }
.cur-input { width: 80px; text-transform: uppercase; }
.file-input { max-width: 230px; padding: 6px; min-height: 38px; }
.code-cell { color: var(--gold-600); font-weight: 700; }
.ch-num { font-weight: 700; color: var(--gold-600); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stage-form { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel > summary.panel-head { cursor: pointer; list-style: none; }
.panel > summary.panel-head::-webkit-details-marker { display: none; }
.table td audio { height: 32px; max-width: 220px; vertical-align: middle; }
.price-rows { display: grid; gap: 6px; }

/* حقل النص المترجم */
.ltext .tr { font-size: .85rem; }
.ltext .tr summary { cursor: pointer; color: var(--muted); padding-block: 4px; }
/* أسهم «تفاصيل» موحّدة بدل علامة المتصفح (◄). */
:is(.tr, .ed-raw, .ed-more) > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
:is(.tr, .ed-raw, .ed-more) > summary::-webkit-details-marker { display: none; }
:is(.tr, .ed-raw, .ed-more) > summary::before { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform var(--t-med) var(--ease); }
[dir="rtl"] :is(.tr, .ed-raw, .ed-more) > summary::before { transform: rotate(135deg); }
:is(.tr, .ed-raw, .ed-more)[open] > summary::before { transform: rotate(45deg); }
.tr-count { font-size: .75rem; padding: 0 6px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); }
.tr-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.tr-lang { font-size: .72rem; font-weight: 700; color: var(--muted); padding-top: 12px; min-width: 22px; }

/* ── محرر الدرس ─────────────────────────────────────────────── */
.ed-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: var(--header-h); z-index: 5; background: var(--cream); padding-block: 8px; border-bottom: 1px solid var(--line); }
.ed-top .end { margin-inline-start: auto; }
.editor { display: grid; gap: 18px; }
.ed-sections { display: grid; gap: 18px; }
.ed-section { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 10px; }
.ed-sec-head { display: flex; align-items: center; gap: 10px; }
.ed-sec-head h3 { font-size: 1.02rem; flex: 1; min-width: 0; }
.ed-sec-num { font-weight: 700; color: var(--gold-600); font-variant-numeric: tabular-nums; }
.ed-actions { display: inline-flex; gap: 2px; margin-inline-start: auto; }
.ed-actions .btn { min-height: 30px; padding: 4px 8px; }
.ed-blocks { display: grid; gap: 8px; }
.ed-block { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); }
.ed-block.review { border-color: #EACB9A; }
.ed-block-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.ed-type { font-size: .75rem; font-weight: 700; color: var(--green-900); background: var(--green-50); border: 1px solid var(--green-100); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.ed-sum { flex: 1; min-width: 0; font-size: .86rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-form { display: grid; gap: 12px; padding: 12px 14px 14px; border-top: 1px solid var(--line); background: #FDFCFA; }
.ed-sec-form { border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.ed-adder { display: flex; gap: 8px; align-items: center; }
.select-sm { min-height: 34px; padding: 4px 10px; width: auto; font-size: .88rem; }
.ed-list { display: grid; gap: 8px; }
.ed-items { display: grid; gap: 8px; }
.ed-item { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; background: var(--white); display: grid; gap: 8px; }
.ed-item .ed-item { background: var(--paper); }
.ed-item-head { display: flex; align-items: center; gap: 8px; }
.ed-item-num { font-size: .75rem; font-weight: 700; color: var(--muted); min-width: 18px; }
.narrow-field { max-width: 260px; }
.ed-table { display: grid; gap: 6px; }
.ed-table-row { display: flex; gap: 6px; align-items: flex-start; }
.ed-table-row textarea { min-height: 38px; resize: vertical; }
.ed-results { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-result { border: 1px solid var(--line-2); border-radius: 999px; background: var(--white); padding: 4px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.ed-result:hover { border-color: var(--green-900); }
.ed-new-word { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-new-word .input { flex: 1; min-width: 140px; }
.word-chip.passive { opacity: .65; }
.chip-btn { border: 0; background: none; cursor: pointer; font-size: .8rem; padding: 0 2px; color: var(--muted); }
.ed-raw summary, .ed-more summary { cursor: pointer; font-size: .82rem; color: var(--muted); }
.ed-raw pre { max-height: 240px; overflow: auto; font-size: .75rem; background: var(--cream); padding: 8px; border-radius: 6px; white-space: pre-wrap; }
.ed-question { border-inline-start: 3px solid var(--gold-500); }
.ed-toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--green-900); color: var(--cream); padding: 10px 16px; border-radius: var(--r-md); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; font-size: .9rem; }
.ed-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ed-toast.bad { background: var(--danger); }

.admin-body > *, .editor > *, .ed-sections > *, .ed-blocks > * { min-width: 0; }

/* ── المرحلة 5 ─────────────────────────────────────────────── */
.lesson-tools { justify-content: flex-end; margin-top: 12px; }
.hw-send { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.recorder { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.recorder audio { width: 100%; }
.hw-status { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--cream); padding: 10px 12px; display: grid; gap: 8px; }
.hw-status.reviewed { border-color: #BFD9C6; background: #F6FAF7; }
.hw-status-head { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.hw-sent { white-space: pre-wrap; font-size: .93rem; color: var(--ink-2); }
.hw-status audio { width: 100%; }
.hw-feedback { border-inline-start: 3px solid var(--green-900); padding-inline-start: 10px; display: grid; gap: 4px; }
.hw-answer { white-space: pre-wrap; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; font-size: 1.02rem; }
.hw-upsell { font-size: .85rem; }
audio.block { width: 100%; }

/* منتقي الأيقونات في المحرر */
.btn-icon .icon { width: 16px; height: 16px; }
.icon-pick { position: relative; }
.icon-pick summary { list-style: none; gap: 8px; }
.icon-pick summary::-webkit-details-marker { display: none; }
.icon-pick-current { display: inline-grid; place-items: center; width: 22px; height: 22px; color: var(--gold-600); }
.icon-pick-current .icon { width: 20px; height: 20px; }
.icon-pick-name { font-family: var(--font-ru); font-size: .8rem; font-weight: 500; color: var(--muted); direction: ltr; }
.icon-pop { position: absolute; z-index: 30; top: calc(100% + 6px); inset-inline-start: 0; width: min(360px, 86vw); padding: 10px; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-md); display: grid; gap: 8px; animation: menu-in .18s var(--ease-out); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; max-height: 240px; overflow: auto; }
.icon-cell { display: grid; place-items: center; height: 38px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--ink-2); cursor: pointer; }
.icon-cell:hover { border-color: var(--line-2); color: var(--green-900); }
.icon-cell.sel { border-color: var(--green-900); background: var(--green-50); color: var(--green-900); }
.icon-cell .icon { width: 19px; height: 19px; }
.chip-btn .icon { width: 12px; height: 12px; }
