/* TBP Order Tracking - تنسيق الميزات الإضافية (1.4.0) */
.tbp-ot-x-wa-link { background: #25d366 !important; }
.tbp-ot-x [hidden], .tbp-ot-x-flags [hidden], #tbp-ot-x-chats [hidden] { display: none !important; }
.tbp-ot-x { direction: rtl; margin-top: 14px; }
.tbp-ot-x-card { border: 1px solid #e4e4e4; border-radius: 8px; background: #fafafa; padding: 14px; margin-top: 12px; text-align: right; }
.tbp-ot-x-card h4 { margin: 0 0 10px; font-size: 15px; color: #333; }
.tbp-ot-x-card p { margin: 8px 0; font-size: 14px; color: #444; }

/* التكلفة */
.tbp-ot-x-amount { font-size: 26px; font-weight: bold; color: var(--tbp-ot-accent, #0073aa); text-align: center; margin: 4px 0 8px; }
.tbp-ot-x-note { text-align: center; color: #666 !important; }
.tbp-ot-x-costcard.is-accepted { border-color: #00a32a; background: #f0f9f3; }
.tbp-ot-x-costcard.is-rejected { border-color: #d63638; background: #fff5f5; }
.tbp-ot-x-costcard.is-pending { border-color: #dba617; background: #fffbea; }
.tbp-ot-x-ok { color: #00a32a !important; font-weight: bold; text-align: center; }
.tbp-ot-x-bad { color: #d63638 !important; font-weight: bold; text-align: center; }
.tbp-ot-x-hint { margin-top: 8px; color: #666; font-size: 13px; text-align: center; }
.tbp-ot-x-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tbp-ot-x-row > * { flex: 1; min-width: 120px; }
.tbp-ot-x-yes, .tbp-ot-x-no, .tbp-ot-x-b, .tbp-ot-x-sugg-ask { border: none; border-radius: 5px; padding: 11px 12px; cursor: pointer; font-weight: bold; font-size: 14px; font-family: inherit; text-align: center; text-decoration: none; display: inline-block; }
.tbp-ot-x-yes { background: #00a32a; color: #fff; }
.tbp-ot-x-no { background: #d63638; color: #fff; }
.tbp-ot-x-b, .tbp-ot-x-sugg-ask { background: var(--tbp-ot-accent, #0073aa); color: #fff !important; }
.tbp-ot-x-yes:disabled, .tbp-ot-x-no:disabled, .tbp-ot-x-b:disabled, .tbp-ot-x-sugg-ask:disabled { opacity: .55; cursor: default; }
.tbp-ot-x-link { background: none; border: none; color: var(--tbp-ot-accent, #0073aa); cursor: pointer; padding: 4px 0; font-size: 13px; text-decoration: underline; font-family: inherit; }
.tbp-ot-x-capsum { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 6px; background: #fff; border: 1px solid #ddd; }
.tbp-ot-x-capsum strong { font-size: 18px; }
.tbp-ot-x-capsum span { font-size: 13px; color: #555; }
.tbp-ot-x-capsum.is-accepted { border-color: #00a32a; } .tbp-ot-x-capsum.is-accepted span { color: #00a32a; }
.tbp-ot-x-capsum.is-rejected { border-color: #d63638; } .tbp-ot-x-capsum.is-rejected span { color: #d63638; }
.tbp-ot-x-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.tbp-ot-x-form input, .tbp-ot-x-phone input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 14px; font-family: inherit; }
.tbp-ot-x-form .tbp-ot-btn { margin-top: 0; }

/* المحادثة */
.tbp-ot-x-badge { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 10px; background: #d63638; color: #fff; font-size: 12px; line-height: 18px; margin-right: 4px; }
.tbp-ot-x-chat { border: 1px solid #ddd; border-radius: 8px; background: #fff; margin-top: 10px; overflow: hidden; }
.tbp-ot-x-chat-list { max-height: 260px; min-height: 110px; overflow-y: auto; padding: 10px; background: #f5f7f9; display: flex; flex-direction: column; gap: 6px; }
.tbp-ot-x-chat-row { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #eee; background: #fff; }
.tbp-ot-x-chat-input { flex: 1; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 14px; font-family: inherit; min-width: 0; }
.tbp-ot-x-chat-send { background: var(--tbp-ot-accent, #0073aa); color: #fff; border: none; border-radius: 5px; padding: 0 16px; cursor: pointer; font-weight: bold; font-family: inherit; }
.tbp-ot-x-chat-send:disabled { opacity: .55; }
.tbp-ot-x-chat-end { padding: 8px; text-align: center; color: #888; font-size: 13px; background: #fff; border-top: 1px solid #eee; }
.tbp-ot-x-msg { max-width: 82%; padding: 7px 11px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-wrap: break-word; display: flex; flex-direction: column; gap: 2px; }
.tbp-ot-x-msg small { font-size: 11px; opacity: .7; }
.tbp-ot-x-msg.is-me { align-self: flex-start; background: var(--tbp-ot-accent, #0073aa); color: #fff; border-bottom-right-radius: 3px; }
.tbp-ot-x-msg.is-them { align-self: flex-end; background: #fff; color: #222; border: 1px solid #e2e2e2; border-bottom-left-radius: 3px; }

/* الكباتن المقترحون والطلبات القريبة */
.tbp-ot-x-sg { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px dashed #ddd; }
.tbp-ot-x-sg:first-of-type { border-top: none; padding-top: 0; }
.tbp-ot-x-sg > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tbp-ot-x-sg small { color: #666; font-size: 12px; }
.tbp-ot-x-sg .tbp-ot-x-sugg-ask, .tbp-ot-x-sg .tbp-ot-x-b { flex-shrink: 0; padding: 8px 12px; font-size: 13px; }
.tbp-ot-x-near .tbp-ot-btn { margin-top: 12px; }

/* موقع الكابتن */
.tbp-ot-x-locline { margin-bottom: 10px; font-size: 14px; color: #444; }
.tbp-ot-x-pick { margin-top: 10px; }
.tbp-ot-x-pickmap { height: 240px; border-radius: 6px; margin-bottom: 8px; z-index: 1; }
.tbp-ot-x-phone { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #ddd; }
.tbp-ot-x-phone label { display: block; margin-bottom: 6px; font-weight: bold; font-size: 14px; }
.tbp-ot-x-phone .tbp-ot-x-row > input { flex: 3; }

/* لوحة الإدارة */
.tbp-ot-x-flags { display: flex; flex-direction: column; gap: 6px; }
.tbp-ot-x-flags label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #555; }
.tbp-ot-x-flags select { max-width: 100%; }
.tbp-ot-x-flags .tbp-ot-x-badge { background: #dba617; color: #fff; padding: 3px 8px; border-radius: 10px; margin: 0; width: fit-content; }
#tbp-ot-x-chatview { margin-top: 20px; border: 1px solid #ddd; border-radius: 8px; padding: 14px; background: #f9f9f9; }
#tbp-ot-x-chatview .tbp-ot-x-msg { max-width: 70%; margin-bottom: 6px; }
#tbp-ot-x-chatview-body { display: flex; flex-direction: column; max-height: 380px; overflow-y: auto; }
#tbp-ot-x-chatview .tbp-ot-x-msg b { font-size: 11px; opacity: .85; }

.tbp-ot-x-wa-link:hover { background: #1ebe5a !important; }

/* واتساب للكابتن المقترح + المؤقت + اسم الطلب */
.tbp-ot-x-sgbtns { display: flex; flex-direction: row !important; gap: 6px; align-items: center; flex-shrink: 0; }
.tbp-ot-x-wa-sg { background: #25d366 !important; }
.tbp-ot-x-timer { background: #fff8e1; border: 1px dashed #dba617; border-radius: 6px; padding: 8px 10px; text-align: center; color: #6b5200 !important; }
.tbp-ot-x-count { font-family: monospace; font-size: 16px; color: #b45309; direction: ltr; display: inline-block; min-width: 42px; }
.tbp-ot-x-seq { display: inline-block; background: #fff3cd; color: #7a5b00; border: 1px solid #f0d78c; border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: bold; margin: 0 8px; white-space: nowrap; }
.tbp-ot-x-sumrow { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.tbp-ot-x-tile { flex: 1; min-width: 140px; background: #f6f7f7; border: 1px solid #dcdcde; border-radius: 8px; padding: 12px; text-align: center; }
.tbp-ot-x-tile b { display: block; font-size: 26px; color: #2271b1; line-height: 1.2; }
.tbp-ot-x-tile span { font-size: 13px; color: #50575e; }
