/* ==========================================================================
   ویرایشگر متن غنی (RTE) — مشترک بین «ثبت نامه» و «ویرایش پیش‌نویس»
   ========================================================================== */
.rte{margin-bottom:var(--gap-md);}

.rte-toolbar{
  display:flex; flex-wrap:wrap; gap:var(--gap-xs); align-items:center;
  background:#f4f6f8; border:1px solid var(--border); border-bottom:none;
  border-radius:var(--radius) var(--radius) 0 0; padding:6px 8px;
}
.rte-toolbar.secondary{border-top:none; border-radius:0; margin-top:-1px;}
.rte-toolbar button{
  background:#fff; border:1px solid var(--border); border-radius:5px;
  min-width:30px; height:30px; font-size:13px; cursor:pointer; color:var(--dark);
  display:flex; align-items:center; justify-content:center; padding:0 8px;
}
.rte-toolbar button:hover{background:#eef1f4;}
.rte-toolbar button.danger{color:var(--red);}
.rte-toolbar select{
  height:30px; border:1px solid var(--border); border-radius:5px;
  font-size:12px; font-family:inherit;
}
.rte-toolbar .rte-group-label{font-size:11px; color:var(--muted); padding:0 4px;}
.rte-sep{width:1px; height:22px; background:var(--border); margin:0 var(--gap-xs);}

.richtext-editor{
  min-height:200px; max-height:500px; overflow-y:auto;
  border:1px solid var(--border); border-radius:0 0 var(--radius) var(--radius);
  padding:12px 14px; font-family:inherit; font-size:var(--fs-base); background:var(--surface-alt);
  text-align:right; direction:rtl; line-height:1.9;
}
.richtext-editor:focus{outline:none; background:#fff; border-color:var(--steel);}
.richtext-editor:empty:before{content:attr(data-placeholder); color:#aaa;}
.richtext-editor table{border-collapse:collapse; margin:8px 0;}
/* min-width عمداً حذف شد: با table-layout:fixed (در کلاس rich-content) عرض
   ستون‌ها خودکار تقسیم می‌شود و min-width فقط باعث سرریز افقی می‌شد. */
.richtext-editor table td{border:1px solid #999; padding:6px;}

/* پیش‌نمایش امضا در «امضای من» */
.sig-preview img{
  max-width:220px; max-height:110px;
  background:repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 14px 14px;
  border:1px solid var(--border); border-radius:var(--radius); padding:8px;
}
.photo-preview img{
  width:25mm; height:32mm; object-fit:cover;
  border:1px solid var(--border); border-radius:4px;
}
