/* =============================================================================
   صفحات الطلبات والإشعارات والإعدادات والتواصل وحذف الحساب
   -----------------------------------------------------------------------------
   بطاقة الطلب = Card(elevation 3, radius 15) في buildlistorders.dart،
   الإعدادات = مجموعات ListTile بيضاء على خلفية Scaffold (grey 50).
   ========================================================================== */

/* ---- قائمة الطلبات --------------------------------------------------------- */

.orders-tabs { top: 68px; }
.orders-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.orders-tabs button .mi { color: rgba(0, 0, 0, .87); }
.orders-tabs button.active .mi { color: var(--primary); }
.orders-list { padding: 0 10px; }
.day-head {
  margin: 10px 0; background: var(--primary); color: #fff;
  text-align: center; font-weight: 700; direction: ltr;
}

/* بطاقة الطلب */
.oc {
  background: #fff; border-radius: 15px; overflow: hidden;
  margin: 8px 10px;
  box-shadow: 0 3px 3px -2px rgba(0,0,0,.2), 0 3px 4px 0 rgba(0,0,0,.14), 0 1px 8px 0 rgba(0,0,0,.12);
}
.oc-head { display: flex; align-items: center; gap: 5px; padding: 10px 12px; background: var(--g100); }
.oc-head > .mi { color: var(--g500); }
.oc-head .ago { font-size: 12px; font-weight: 700; color: var(--primary); }
.oc-circle {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.oc-circle .mi { font-size: 18px; }
.oc-circle.green { background: rgba(76, 175, 80, .1); color: #4CAF50; }
.oc-circle.teal { background: rgba(0, 150, 136, .1); color: #009688; }
.oc-head .oc-circle + .oc-circle { margin-inline-start: 5px; }

.oc-body { padding: 15px; }
.oc-row { display: flex; align-items: flex-start; margin-bottom: 8px; line-height: 1.5; }
.oc-row .k { width: 100px; flex: none; color: var(--g600); font-size: 13px; }
.oc-row .sep { color: var(--g500); white-space: pre; }
.oc-row .v { flex: 1; min-width: 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.oc-row .v.bold { font-weight: 700; }
.oc-row .v.big { font-size: 15px; }
.oc-row .v.ltr-val { direction: ltr; text-align: left; unicode-bidi: plaintext; }
[dir="rtl"] .oc-row .v.ltr-val { text-align: right; }

.oc-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 10px; }
.oc-btn {
  padding: 8px 20px; border-radius: 20px; color: #fff; font-weight: 700;
  background: var(--primary); border: 1px solid transparent; line-height: 1.4;
}
.oc-btn.outlined { background: transparent; color: var(--primary); border-color: var(--primary); }
.oc-btn:active { filter: brightness(.92); }

/* ---- حوارات البطاقة (سبب الإلغاء / السداد / التقييم) ------------------------ */

.oc-dlg { position: relative; max-width: 380px; }
.oc-dlg .input { height: auto; }
.oc-dlg textarea.input { min-height: 80px; }
.oc-hint { font-size: 13px; color: #616161; margin-bottom: 12px; }
.field-err { color: var(--red); font-size: 12px; min-height: 4px; margin: 2px 4px 4px; }
.oc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.oc-chips .chip { cursor: pointer; padding: 4px 12px; font-weight: 400; border: 1px solid var(--g300); background: var(--g100); }
.dlg-actions.between { justify-content: space-between; }
.dlg-actions.evenly { justify-content: space-evenly; }
.dlg-actions .btn-elev { display: inline-flex; align-items: center; gap: 4px; }
.dlg-title.center { justify-content: center; }
.center { text-align: center; }
.pay-due { margin: 15px 0; padding: 15px; border-radius: 10px; background: rgba(244, 67, 54, .08); text-align: center; color: #F44336; }
.pay-due b { display: block; }
.pay-due span { font-size: 22px; font-weight: 700; margin-top: 5px; }
.pay-note { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; border-radius: 10px; background: rgba(98, 0, 238, .1); color: #6200EE; font-weight: 700; font-size: 13px; }
.oc-x { position: absolute; top: 8px; inset-inline-end: 8px; width: 36px; height: 36px; border-radius: 50%; color: var(--g600); display: flex; align-items: center; justify-content: center; }
.rate-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 8px; }
.rate-box img { border-radius: 12px; object-fit: cover; }
.rate-box h3 { font-size: 20px; font-weight: 700; }
.rate-box p { color: var(--text-2); font-size: 14px; }
.stars { display: flex; gap: 2px; }
.stars button .mi { font-size: 40px; color: var(--g300); transition: color .1s; }
.stars button.on .mi { color: #FFC107; }
.rate-box textarea.input { min-height: 60px; }
.rate-box .btn-text { font-size: 16px; }

/* ---- تفاصيل الطلب (الفاتورة) ------------------------------------------------ */

.od-wrap { padding: 10px; }
.od-card { margin: 0; }
.od-title { padding: 10px; font-size: 18px; font-weight: 700; text-align: center; }
.od-table { width: calc(100% - 20px); margin: 10px 10px 0; border-collapse: collapse; table-layout: fixed; }
.od-table th { font-weight: 400; text-align: center; padding: 0 4px 6px; }
.od-table td { text-align: center; height: 60px; padding: 4px; overflow-wrap: anywhere; }
.od-table td.na { background: var(--primary); color: #fff; }
.od-divider { height: 1px; background: rgba(0,0,0,.12); margin: 8px; }
.od-line { padding: 0 10px 10px; font-weight: 700; }
.od-line.green { color: #4CAF50; }
.od-line.blue { color: var(--primary); }

/* ---- التتبع ----------------------------------------------------------------- */

.map-box { position: relative; height: min(55vh, 420px); background: var(--g200); }
.map-box iframe { width: 100%; height: 100%; border: 0; display: block; }
/* بديل mapstyle الليلي: قلب الألوان مع إعادة تدوير الصبغة */
.map-box.dark iframe { filter: invert(.92) hue-rotate(180deg) saturate(.8); }
.map-none { height: 100%; display: flex; align-items: center; justify-content: center; }
.map-none .mi { font-size: 64px; color: var(--g400); }
.map-mode {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px; font-weight: 700; font-size: 14px;
  background: var(--primary); color: #fff;
}
.map-box.dark .map-mode { background: #fff; color: rgba(0, 0, 0, .45); }
.track-legend { display: flex; gap: 8px; padding: 10px 10px 0; flex-wrap: wrap; }
.track-legend .leg { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 16px; background: var(--primary-10); color: var(--primary); font-weight: 600; font-size: 13px; }
.track-route { margin: 10px; width: calc(100% - 20px); justify-content: center; }
.track-card { margin: 10px; border-radius: 10px; }
.track-now { font-size: 18px; font-weight: 700; text-align: center; padding: 12px 10px 4px; }
.timeline { list-style: none; margin: 0; padding: 8px 20px 12px; }
.timeline li { --c: var(--g400); position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--g500); }
.timeline li::before {
  content: ""; position: absolute; top: 50%; bottom: -50%; inset-inline-start: 11px;
  width: 2px; background: var(--g300);
}
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--c); }
.timeline .dot {
  position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; flex: none;
  border: 2px solid var(--c); background: #fff; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.timeline li.done .dot, .timeline li.now .dot { background: var(--c); }
.timeline li.done, .timeline li.now { color: var(--text); }
.timeline li.now .lbl { font-weight: 700; color: var(--c); }
.timeline .lbl { flex: 1; }
.timeline .tm { font-size: 12px; color: var(--g600); }
.track-captain { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.track-captain > .mi { color: var(--primary); font-size: 32px; }
.track-note { text-align: center; font-size: 12px; padding: 0 10px; }

/* ---- الإشعارات (ListTile + Divider) ----------------------------------------- */

.msg { padding: 8px 16px; }
.msg-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.msg-title { font-size: 16px; color: var(--text); }
.msg-time { font-size: 12px; color: var(--primary); white-space: nowrap; flex: none; }
.msg-body { font-size: 14px; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.msg-list .divider { margin: 8px 0; }

/* ---- اتصل بنا (buildTextFormGlobal: حقل مملوء أبيض بخط سفلي أزرق) ------------ */

.contact-form { padding: 0 10px; }
.uline {
  display: flex; align-items: flex-start; gap: 12px; padding: 8px 12px 4px;
  background: #fff; border-bottom: 1px solid var(--primary);
}
.uline:focus-within { border-bottom-width: 2px; padding-bottom: 3px; }
.uline > .mi { color: var(--primary); margin-top: 12px; }
.uline label span { display: block; font-size: 12px; color: var(--primary); }
.uline textarea {
  width: 100%; border: 0; outline: none; resize: none; background: transparent;
  padding: 2px 0; min-height: 28px; max-height: 84px; line-height: 1.5;
}
.uline.bad { border-bottom-color: var(--red); }
.uline.bad > .mi, .uline.bad label span { color: var(--red); }
.uline-err { color: var(--red); font-size: 12px; padding: 2px 12px 0; min-height: 18px; }
.center-btn { display: flex; justify-content: center; margin-top: 20px; }

/* ---- الإعدادات -------------------------------------------------------------- */

.settings-page { background: var(--g50); }
.set-gap { height: 40px; }
.set-group { background: #fff; }
.set-tile, .xtile summary {
  display: flex; align-items: center; gap: 16px; width: 100%;
  min-height: 56px; padding: 0 16px; text-align: start; font-size: 14px; color: var(--text);
  cursor: pointer;
}
.set-tile .mi, .xtile summary .mi { color: rgba(0, 0, 0, .54); }
.set-tile:active, .xtile summary:active { background: rgba(0, 0, 0, .04); }
.xtile summary { list-style: none; }
.xtile summary::-webkit-details-marker { display: none; }
.xtile summary .mi { transition: transform .2s; }
.xtile[open] summary { color: var(--primary); }
.xtile[open] summary .mi { transform: rotate(180deg); color: var(--primary); }
.xbody { padding: 0 16px 8px; }
.set-kv { min-height: 48px; display: flex; align-items: center; color: #000; }
.uline-in { display: flex; align-items: center; background: #FAFAFA; border-bottom: 1px solid var(--primary); }
.uline-in input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; height: 48px; padding: 0 12px; }
.uline-in .icon-btn { color: #000; }
.uline-in:focus-within { border-bottom-width: 2px; }

/* شاشة التحقق فوق الصفحة (Navigator.push في التطبيق) */
.vf-screen {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto;
  width: 100%; max-width: var(--maxw); margin: 0 auto; background: #fff;
}
.vf-bar { background: #1976D2; } /* Colors.blue[700] */
.vf-body { padding: 20px; }
.vf-body h2 { font-size: 22px; font-weight: 700; margin-top: 30px; }
.vf-body > p.muted { font-size: 16px; margin: 10px 0 30px; }
.vf-body .input-icon { display: block; }
.vf-body .field { margin: 12px 0 0; }
.vf-body .field .lbl { display: block; font-size: 13px; color: var(--g600); margin-bottom: 4px; }
.vf-body .btn-primary { margin-top: 20px; height: 52px; border-radius: 10px; font-size: 18px; }
.input.bad { border-color: var(--red); }
.input.ltr-in { direction: ltr; text-align: left; }
.btn-primary.danger { background: #E53935; }
.btn-text.block { display: block; width: 100%; text-align: center; margin-top: 8px; }

/* ---- حذف الحساب ------------------------------------------------------------- */

.del-card { margin: 24px 16px; padding: 24px 20px; border-radius: 15px; background: #FFF5F5; border: 1px solid #FFCDD2; text-align: center; }
.del-icon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; background: #FFEBEE; color: #E53935; display: flex; align-items: center; justify-content: center; }
.del-icon .mi { font-size: 40px; }
.del-card h2 { font-size: 18px; font-weight: 700; color: #C62828; margin-bottom: 12px; }
.del-card ul { text-align: start; margin: 0 0 20px; padding-inline-start: 20px; color: var(--text-2); }
.del-card li { margin-bottom: 6px; }

/* ---- غير موجودة ------------------------------------------------------------- */

.notfound { display: flex; flex-direction: column; align-items: center; padding-bottom: 40px; }
