/* Digitool RentTrack: Mobile Booking Details Screen Stylesheet
 * Incorporates approved interactive mobile UI/UX design prototype.
 * Full light/dark mode support, responsive safe-area padding, and compact card layout.
 */
body.rt-booking-detail-open {
  overflow: hidden !important;
}

#rt-booking-detail-screen {
  --rt-detail-bg: #07131c;
  --rt-detail-card: #192632;
  --rt-detail-panel: #192632;
  --rt-detail-text: #f5f8fa;
  --rt-detail-muted: #b2c2cf;
  --rt-detail-line: #304351;
  --rt-detail-border: #263746;
  --rt-detail-action: #16aa9e;
  --rt-detail-action-hover: #13978d;
  --rt-detail-summary: #64e5d2;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: var(--rt-detail-bg);
  color: var(--rt-detail-text);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
}

html[data-theme="light"] #rt-booking-detail-screen {
  --rt-detail-bg: #f3f6f9;
  --rt-detail-card: #ffffff;
  --rt-detail-panel: #ffffff;
  --rt-detail-text: #0f172a;
  --rt-detail-muted: #64748b;
  --rt-detail-line: #e2e8f0;
  --rt-detail-border: #e2e8f0;
  --rt-detail-action: #0f766e;
  --rt-detail-action-hover: #0d655e;
  --rt-detail-summary: #0f766e;
}

#rt-booking-detail-screen * {
  box-sizing: border-box;
}

#rt-booking-detail-screen [hidden] {
  display: none !important;
}

#rt-booking-detail-screen .rt-detail-page {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 16px 14px max(36px, env(safe-area-inset-bottom, 36px));
  color: var(--rt-detail-text);
}

/* Header */
#rt-booking-detail-screen .rt-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#rt-booking-detail-screen h2 {
  flex: 1;
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  color: var(--rt-detail-text) !important;
}

#rt-booking-detail-screen h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--rt-detail-text) !important;
}

#rt-booking-detail-screen .rt-detail-header button {
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--rt-detail-line);
  border-radius: 10px;
  background: var(--rt-detail-panel);
  color: var(--rt-detail-text) !important;
  -webkit-text-fill-color: var(--rt-detail-text) !important;
  font-size: 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

#rt-booking-detail-screen .rt-detail-header button:active {
  transform: scale(0.96);
}

/* Cards & Sections */
#rt-booking-detail-screen .rt-detail-hero,
#rt-booking-detail-screen .rt-detail-section {
  padding: 16px;
  border: 1px solid var(--rt-detail-border);
  border-radius: 16px;
  background: var(--rt-detail-card);
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#rt-booking-detail-screen .rt-detail-hero > small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--rt-detail-muted) !important;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#rt-booking-detail-screen .rt-detail-hero > strong {
  display: block;
  font-size: 18px;
  font-weight: 750;
  color: var(--rt-detail-text) !important;
  overflow-wrap: anywhere;
  margin: 6px 0 10px;
}

/* Badges */
#rt-booking-detail-screen .rt-detail-badge {
  display: inline-block;
  background: transparent;
  border: 1px solid #99783d;
  color: #ffcc73;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

html[data-theme="light"] #rt-booking-detail-screen .rt-detail-badge {
  border-color: #d97706;
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
}

#rt-booking-detail-screen .rt-detail-badge.source,
#rt-booking-detail-screen .rt-detail-badge.blue {
  border-color: #357aa4;
  color: #9ad8ff;
}

html[data-theme="light"] #rt-booking-detail-screen .rt-detail-badge.source,
html[data-theme="light"] #rt-booking-detail-screen .rt-detail-badge.blue {
  border-color: #0284c7;
  color: #0369a1;
  background: rgba(2, 132, 199, 0.08);
}

#rt-booking-detail-screen .rt-detail-badge.green {
  border-color: #248d7c;
  color: #79e4d4;
}

html[data-theme="light"] #rt-booking-detail-screen .rt-detail-badge.green {
  border-color: #059669;
  color: #047857;
  background: rgba(5, 150, 105, 0.08);
}

/* Vehicle preview */
#rt-booking-detail-screen .rt-detail-vehicle {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #102b3b;
  border: 1px solid #234358;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

html[data-theme="light"] #rt-booking-detail-screen .rt-detail-vehicle {
  background: #f0fdfa;
  border-color: #ccfbf1;
}

#rt-booking-detail-screen .rt-detail-vehicle-visual {
  width: 90px;
  max-width: 32%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#rt-booking-detail-screen .rt-detail-vehicle-img {
  width: 100%;
  height: 52px;
  border-radius: 8px;
  object-fit: contain;
  background: #061726;
  border: 1px solid #1e3a5f;
}

#rt-booking-detail-screen .rt-detail-vehicle-no-photo {
  width: 100%;
  height: 52px;
  border-radius: 8px;
  background: #061726;
  border: 1px solid #1e3a5f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--rt-detail-muted, #94a3b8);
  gap: 2px;
}

html[data-theme="light"] #rt-booking-detail-screen .rt-detail-vehicle-no-photo {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #64748b;
}

#rt-booking-detail-screen .rt-detail-vehicle-svg {
  display: none !important;
}

#rt-booking-detail-screen .rt-detail-vehicle-info {
  min-width: 0;
  flex: 1;
}

#rt-booking-detail-screen .rt-detail-vehicle-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--rt-detail-text);
  overflow-wrap: anywhere;
}

#rt-booking-detail-screen .rt-detail-vehicle-info p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--rt-detail-muted);
}

/* Rows / Lines */
#rt-booking-detail-screen .rt-detail-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rt-detail-line);
  font-size: 13px;
}

#rt-booking-detail-screen .rt-detail-line:last-child {
  border-bottom: 0;
}

#rt-booking-detail-screen .rt-detail-line > span {
  flex: 0 0 42%;
  min-width: 0;
  color: var(--rt-detail-muted) !important;
  overflow-wrap: anywhere;
}

#rt-booking-detail-screen .rt-detail-line > strong {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-weight: 600;
  color: var(--rt-detail-text) !important;
  overflow-wrap: anywhere;
}

#rt-booking-detail-screen .rt-detail-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--rt-detail-muted) !important;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}

#rt-booking-detail-screen .rt-detail-remarks {
  white-space: pre-wrap;
  color: var(--rt-detail-text) !important;
}

/* Summary Row */
#rt-booking-detail-screen .rt-detail-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rt-detail-line);
}

#rt-booking-detail-screen .rt-detail-summary-row > strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--rt-detail-text);
}

#rt-booking-detail-screen .summary {
  color: var(--rt-detail-summary);
  font-size: 20px;
  font-weight: 800;
}

/* Tabs */
#rt-booking-detail-screen .rt-detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rt-detail-line);
  margin: 14px 0;
}

#rt-booking-detail-screen .rt-detail-tabs button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 12px 2px;
  font-size: 13px;
  font-weight: 500;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--rt-detail-muted) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

#rt-booking-detail-screen .rt-detail-tabs [aria-selected="true"] {
  color: var(--rt-detail-summary) !important;
  border-bottom-color: var(--rt-detail-action);
  font-weight: 700;
}

/* Actions Grid & Buttons */
#rt-booking-detail-screen .rt-detail-actions-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

#rt-booking-detail-screen .rt-detail-actions-grid > * {
  flex: 1;
}

#rt-booking-detail-screen .rt-btn-detail-action {
  flex: 1;
  min-width: 120px;
  min-height: 44px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  background: var(--rt-detail-action);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#rt-booking-detail-screen .rt-btn-detail-action:active {
  transform: scale(0.97);
}

#rt-booking-detail-screen .rt-btn-detail-action.secondary {
  background: #293b4a;
  border: 1px solid var(--rt-detail-line);
  color: var(--rt-detail-text) !important;
  -webkit-text-fill-color: var(--rt-detail-text) !important;
}

html[data-theme="light"] #rt-booking-detail-screen .rt-btn-detail-action.secondary {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

#rt-booking-detail-screen .rt-btn-detail-action.danger {
  background: transparent;
  color: #ff9a9a !important;
  -webkit-text-fill-color: #ff9a9a !important;
  border: 1px solid #965c5c;
}

html[data-theme="light"] #rt-booking-detail-screen .rt-btn-detail-action.danger {
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
  border-color: #fca5a5;
}

#rt-booking-detail-screen .rt-btn-detail-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#rt-booking-detail-screen .rt-detail-back {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--rt-detail-line);
  border-radius: 10px;
  background: var(--rt-detail-panel);
  color: var(--rt-detail-text) !important;
  -webkit-text-fill-color: var(--rt-detail-text) !important;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.15s ease;
}

#rt-booking-detail-screen #rt-detail-menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--rt-detail-line);
  border-radius: 12px;
  background: var(--rt-detail-panel);
  margin-bottom: 12px;
}

#rt-booking-detail-screen #rt-detail-action-error {
  color: #ffabab;
  margin: 10px 0 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

html[data-theme="light"] #rt-booking-detail-screen #rt-detail-action-error {
  color: #dc2626;
}

@media (max-width: 340px) {
  #rt-booking-detail-screen .rt-detail-page {
    padding: 12px 10px 28px;
  }
  #rt-booking-detail-screen .rt-detail-hero,
  #rt-booking-detail-screen .rt-detail-section {
    padding: 12px;
    border-radius: 12px;
  }
  #rt-booking-detail-screen .rt-detail-tabs button {
    font-size: 11.5px;
  }
}
