/* admin-tidy.css — ص87 (تخفيف ازدحام اللوحة): أنماط خاصة بصفحات الإعدادات والمساعد والسائقين/التجهيز/الفنيين.
   كل المحددات هنا مسبوقة بصنف الصفحة (st- / ai2- / cx2-) كي لا تتداخل مع admin.css المشترك. */

/* ═══ رأس الصفحة: عنوان + زر واحد بسطر واحد + «كيف يعمل؟» صغيرة ═══ */
.cx2-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cx2-head h1 { margin: 0; min-width: 0; }
.cx2-head .btn { flex-shrink: 0; }
.cx2-ttl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.st-info { position: static; }
.st-info > summary { list-style: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  color: var(--text-3); -webkit-tap-highlight-color: transparent; transition: background-color .15s, color .15s; }
.st-info > summary::-webkit-details-marker { display: none; }
.st-info > summary:hover, .st-info[open] > summary { color: var(--text); background: transparent; background: color-mix(in srgb, var(--text) 7%, transparent); }
.st-info > summary:focus-visible { outline: 2px solid var(--volt); outline-offset: 1px; }
.st-info > summary .mi { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.st-info-pop { position: absolute; z-index: 30; top: calc(100% + 6px); inset-inline-start: 0; inset-inline-end: 0; max-width: 440px;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-size: 13.5px; line-height: 1.8; box-shadow: 0 14px 34px -18px rgba(20, 14, 4, .55); }
.st-info-pop b { color: var(--text); }
.st-info-pop p { margin: 0; }
.st-info-pop p + p { margin-top: 6px; }

/* ═══ الإعدادات: تبويبات مقطّعة متساوية بلا تمرير أفقي على الهاتف ═══ */
body.admin .pv-tabs.st-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0 0 14px; padding: 4px; overflow: visible;
  border-radius: 16px; border: 1px solid var(--line); background: transparent; background: color-mix(in srgb, var(--text) 5%, transparent); }
body.admin .pv-tabs.st-tabs button { justify-content: center; min-width: 0; min-height: 42px; padding: 0 6px; border: 0; border-radius: 12px;
  background: none; color: var(--text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.admin .pv-tabs.st-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 6px 16px -10px rgba(40, 30, 10, .45); }
@media (min-width: 700px) { body.admin .pv-tabs.st-tabs { display: inline-grid; grid-template-columns: repeat(4, auto); } body.admin .pv-tabs.st-tabs button { padding: 0 20px; } }

/* أقسام الصفحة: عمود واحد مرتّب (بدل عمودين غير متوازنين) */
.st-stack { display: grid; gap: 12px; max-width: 760px; }
.st-stack > .panel { margin: 0; }
.st-lead { margin: 0 0 12px; font-size: 13px; color: var(--text-3); line-height: 1.7; }
.st-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.st-row2 > .field { min-width: 0; }
.st-row2 > .field :is(input, select) { width: 100%; box-sizing: border-box; }
.st-row2 .fl-hint { grid-column: 1 / -1; margin: -4px 0 6px; font-size: 12.5px; color: var(--text-3); }
.st-chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.6; margin: 0 0 12px; cursor: pointer; }
.st-chk input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--volt); flex-shrink: 0; }
.st-chk small { display: block; color: var(--text-3); font-size: 12.5px; }
.st-sub { padding: 12px 14px 2px; margin: 0 0 12px; border-radius: 12px; background: transparent; background: color-mix(in srgb, var(--text) 4%, transparent); }
.st-qr { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.st-qr img { width: 88px; height: 88px; object-fit: contain; display: block; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.st-qr small { font-size: 12.5px; color: var(--text-3); flex: 1 1 140px; }

/* «خيارات متقدمة»: زر نصي هادئ يكشف مجموعة أقسام نادرة الاستعمال */
.st-more { margin-top: 4px; }
.st-more > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  border: 1px dashed var(--line);
  border: 1px dashed color-mix(in srgb, var(--text) 22%, transparent); color: var(--text-2); font: 700 14.5px var(--font-head);
  -webkit-tap-highlight-color: transparent; transition: background-color .15s, color .15s; }
.st-more > summary::-webkit-details-marker { display: none; }
.st-more > summary::after { content: ''; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--chev) center / 18px no-repeat; mask: var(--chev) center / 18px no-repeat; transition: transform .2s; }
.st-more[open] > summary::after { transform: rotate(180deg); }
.st-more > summary span { flex: 1; }
.st-more > summary small { font: 600 12.5px var(--font-body); color: var(--text-3); }
.st-more > summary:hover { color: var(--text); background: transparent; background: color-mix(in srgb, var(--text) 4%, transparent); }
.st-more > summary:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
.st-more[open] > summary { margin-bottom: 12px; }
.st-more > .st-stack { max-width: none; }
@media (prefers-reduced-motion: reduce) { .st-more > summary::after { transition: none; } }

/* لون مخصّص: مطوي داخل مكتبة الهوية */
.st-acc { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 4px; }
.st-acc > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; font: 700 14px var(--font-head); color: var(--text-2); }
.st-acc > summary::-webkit-details-marker { display: none; }
.st-acc > summary::after { content: ''; width: 16px; height: 16px; margin-inline-start: auto; background: currentColor; -webkit-mask: var(--chev) center / 16px no-repeat; mask: var(--chev) center / 16px no-repeat; transition: transform .2s; }
.st-acc[open] > summary::after { transform: rotate(180deg); }
.st-acc > summary i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); border: 1px solid color-mix(in srgb, var(--text) 20%, transparent); }
.st-acc .acc-box { margin-top: 0; padding: 0; border: 0; }

/* مكتبة الهوية على الهاتف: بطاقتان بالسطر، بلا وصف طويل */
@media (max-width: 600px) {
  .st-page .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .st-page .lib-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mini" "txt" "act"; gap: 8px; padding: 10px; }
  .st-page .lib-card .mini { width: 100%; height: 64px; }
  .st-page .lib-card h3 { font-size: 14.5px; }
  .st-page .lib-card .lib-txt p, .st-page .lib-card .lib-tags { display: none; }
  .st-page .lib-act { padding-top: 8px; gap: 6px; flex-wrap: nowrap; }
  .st-page .lib-act .btn { min-width: 0; padding: 0 8px; font-size: 13px; }
  .st-page .lib-act .btn svg { display: none; }
  .st-page .lib-act .pk-on { font-size: 12.5px; flex: 1 1 auto; }
  .st-page .lib-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}

/* مناطق الشحن: سطر واحد لكل محافظة حتى على الهاتف */
.st-page .zone-row { grid-template-columns: minmax(64px, 1fr) 96px minmax(0, 1fr) 28px; gap: 8px; margin-bottom: 6px; }
.st-page .zone-row > b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-page .zone-row input:not([type=checkbox]) { min-height: 40px; padding: 0 10px; font-size: 14px; }
.st-page .zone-row.zone-head { margin-bottom: 4px; font-size: 12px; color: var(--text-3); }
.st-page .zone-row.zone-head > * { font-weight: 600; }
.st-page .zone-on { display: grid; place-items: center; }
.st-page .zone-on input { width: 20px; height: 20px; accent-color: var(--volt); }
@media (max-width: 600px) {
  .st-page .zone-row { grid-template-columns: minmax(56px, .9fr) 78px minmax(0, 1fr) 24px; gap: 6px; }
  .st-page .zone-row > b { grid-column: auto; }
}
@media (max-width: 960px) {
  .st-page .zone-row.zone-head { display: grid; }
}

/* المحفظة: حقول الأرقام بعمودين حتى على الهاتف */
.st-page .st-wallet .fx-form { display: block; }
.st-page .st-wallet .field.chk { margin-bottom: 10px; }

/* ═══ المساعد الذكي ═══ */
.ai2-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ai2-head h1 { margin: 0; min-width: 0; }
.ai2-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ai2-acts .more-menu > summary { min-width: 40px; justify-content: center; }
.ai2-chat .ai-hello p { margin: 0 0 12px; color: var(--text-2); font-size: 14px; }
.ai2-sugs { display: flex; flex-wrap: wrap; gap: 8px; }
.ai2-chat > .pb { padding-top: 12px; }
.ai2-chat .ai-hint:empty { display: none; }
.ai2-panel .ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai2-x { border: 0; background: none; color: var(--text-3); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.ai2-x:hover { background: transparent; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }

/* طريقة تأكيد الرقم: خياران كبطاقتين قابلتين للضغط */
.st-radios { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-bottom: 14px; }
.st-radios .wa-switch { padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.st-radios .wa-switch:has(input:checked) { border-color: var(--volt); background: transparent; background: color-mix(in srgb, var(--volt) 7%, transparent); }
body.admin .cx2-head h1, body.admin .ai2-head h1 { font-size: clamp(20px, 5.6vw, 30px); line-height: 1.25; text-wrap: nowrap; white-space: nowrap; }
.cx2-head .btn { min-height: 40px; padding: 0 14px; gap: 6px; }
