/* Shared palette for New Reservation and the existing rental workflow portals.
   Keep their DOM, values, validation and handlers; color tokens also update while open. */
#rt-workflow-modal-back {
 --rt-wf-panel:#ffffff; --rt-wf-soft:#f5f7f9; --rt-wf-text:#172735;
 --rt-wf-muted:#526170; --rt-wf-border:#cbd5e1; --rt-wf-primary:#076f69;
 --rt-wf-action-blue:#0369a1; --rt-wf-partner:#6d28d9; --rt-wf-positive:#076f69; --rt-wf-accent:#075985; --rt-wf-note:#eaf5f7; --rt-wf-note-text:#205367;
 color:var(--rt-wf-text); color-scheme:light;
}
html[data-theme="dark"] #rt-workflow-modal-back {
 --rt-wf-panel:#18232e; --rt-wf-soft:#101822; --rt-wf-text:#eef4f7;
 --rt-wf-muted:#b1c0cd; --rt-wf-border:#526575; --rt-wf-primary:#087970;
 --rt-wf-partner:#c4b5fd; --rt-wf-positive:#6ee7b7; --rt-wf-accent:#7dd3fc; --rt-wf-note:#1c3445; --rt-wf-note-text:#b4dcf2;
 color-scheme:dark;
}
#rt-workflow-modal-back #rt-workflow-modal-card,
#rt-workflow-modal-back .rt-wf-body {
 background:var(--rt-wf-panel)!important; color:var(--rt-wf-text)!important;
 border-color:var(--rt-wf-border)!important;
}
#rt-workflow-modal-back :is(.rt-wf-head,.rt-wf-foot) {
 background:var(--rt-wf-soft)!important; border-color:var(--rt-wf-border)!important;
}
#rt-workflow-modal-back, #rt-workflow-modal-back * {transition-property:border-color,box-shadow!important}
#rt-workflow-modal-back [style*="color:var(--rt-wf-positive"] {color:var(--rt-wf-positive)!important}
/* Unstyled nested text inherits the surface's color, including dynamically updated totals.
   currentColor avoids inherited WebKit text-fill overriding an inline heading color. */
#rt-workflow-modal-back :is(h1,h2,h3,h4,p,span,strong,b,label,small,td,th,li) {
 color:inherit!important; -webkit-text-fill-color:currentColor!important;
}
#rt-workflow-modal-back [style*="color:var(--rt-wf-text"],
#rt-workflow-modal-back [style*="color: var(--rt-wf-text"] {color:var(--rt-wf-text)!important}
#rt-workflow-modal-back [style*="color:var(--rt-wf-muted"],
#rt-workflow-modal-back [style*="color: var(--rt-wf-muted"] {color:var(--rt-wf-muted)!important}
#rt-workflow-modal-back [style*="color:var(--rt-wf-accent"],
#rt-workflow-modal-back [style*="color: var(--rt-wf-accent"] {color:var(--rt-wf-accent)!important}
#rt-workflow-modal-back :is(input,select,textarea,option) {
 background:var(--rt-wf-panel)!important; color:var(--rt-wf-text)!important;
 -webkit-text-fill-color:currentColor!important; border-color:var(--rt-wf-border)!important;
 color-scheme:inherit;
}
#rt-workflow-modal-back :is(input,textarea)::placeholder {
 color:var(--rt-wf-muted)!important; -webkit-text-fill-color:var(--rt-wf-muted)!important; opacity:1!important;
}
#rt-workflow-modal-back :is(input[type="checkbox"],input[type="radio"]) {accent-color:var(--rt-wf-primary)}
#rt-workflow-modal-back .note {
 background:var(--rt-wf-note)!important; border-color:var(--rt-wf-border)!important;
 color:var(--rt-wf-note-text)!important;
}
#rt-workflow-modal-back .note :is(span,strong,b,small) {color:inherit!important}
#rt-workflow-modal-back :is(.btn-soft,.close-btn) {
 background:var(--rt-wf-soft)!important; color:var(--rt-wf-text)!important;
 -webkit-text-fill-color:currentColor!important; border-color:var(--rt-wf-border)!important;
}
#rt-workflow-modal-back :is(.btn-primary,#nbConfirmSubmitBtn) {
 background:var(--rt-wf-primary)!important; color:#fff!important; -webkit-text-fill-color:#fff!important;
}
#rt-workflow-modal-back :is(.btn-primary,#nbConfirmSubmitBtn) * {color:#fff!important;-webkit-text-fill-color:#fff!important}
#rt-workflow-modal-back :is(.btn-danger,.danger) {background:#ad3333!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
#rt-workflow-modal-back :is(.btn-danger,.danger) * {color:#fff!important;-webkit-text-fill-color:#fff!important}
/* Keep semantic fuel badges dark on their deliberately pale green/amber/red fills. */
#rt-workflow-modal-back .rt-fuel-level-label {color:#047857!important;-webkit-text-fill-color:currentColor!important}
#rt-workflow-modal-back .rt-fuel-level-label[style*="185, 28, 28"] {color:#b91c1c!important}
#rt-workflow-modal-back .rt-fuel-level-label[style*="154, 52, 18"] {color:#9a3412!important}
#rt-workflow-modal-back .rt-fuel-level-label[style*="146, 64, 14"] {color:#92400e!important}
/* Payment logos stay on white tiles; labels follow the surrounding theme. */
#rt-workflow-modal-back .rt-payment-picker {--rt-payment-selected-label:var(--rt-wf-accent)!important;color:var(--rt-wf-text)!important}
#rt-workflow-modal-back .rt-payment-choice:not([aria-pressed="true"]) .rt-payment-label {color:var(--rt-wf-text)!important}
#rt-workflow-modal-back .rt-payment-choice[aria-pressed="true"] .rt-payment-label {color:var(--rt-wf-accent)!important}
#rt-workflow-modal-back .rt-payment-art {background:#fff!important}
/* Existing native Extend form: identifiers and palette only. */
#rt-booking-extension-form{--rt-ext-bg:#101822;--rt-ext-panel:#18232e;--rt-ext-text:#eef4f7;--rt-ext-muted:#b1c0cd;--rt-ext-border:#526575;background:var(--rt-ext-bg)!important;color:var(--rt-ext-text)!important}
html[data-theme="light"] #rt-booking-extension-form{--rt-ext-bg:#f5f7f9;--rt-ext-panel:#fff;--rt-ext-text:#172735;--rt-ext-muted:#526170;--rt-ext-border:#cbd5e1}
#rt-booking-extension-form div:not([role="button"]):not([data-rtclass*="action"])[dir="auto"]{color:var(--rt-ext-text)!important;-webkit-text-fill-color:var(--rt-ext-text)!important}
#rt-booking-extension-form div:not([role="button"]):not([tabindex])[style*="background-color"]{background-color:var(--rt-ext-panel)!important;border-color:var(--rt-ext-border)!important}
#rt-booking-extension-form :is(input,select,textarea,option){background:var(--rt-ext-panel)!important;color:var(--rt-ext-text)!important;-webkit-text-fill-color:var(--rt-ext-text)!important;border-color:var(--rt-ext-border)!important;box-sizing:border-box!important;max-width:100%!important;min-height:44px!important}
#rt-booking-extension-form :is(input,textarea)::placeholder{color:var(--rt-ext-muted)!important;-webkit-text-fill-color:var(--rt-ext-muted)!important;opacity:1!important}

/* Solid primary action: strictly white text in both light and dark mode */
#rt-booking-extension-form #rt-extend-submit-btn,
#rt-booking-extension-form #rt-extend-submit-btn div[dir="auto"],
#rt-booking-extension-form #rt-extend-submit-btn *,
#rt-booking-extension-form [data-rtclass~="rt-solid-primary-action"],
#rt-booking-extension-form [data-rtclass~="rt-solid-primary-action"] div[dir="auto"],
#rt-booking-extension-form [data-rtclass~="rt-solid-primary-action"] *,
#rt-booking-extension-form [role="button"][style*="background-color: rgb(8, 184, 174)"] *,
#rt-booking-extension-form [role="button"][style*="background-color: #08b8ae"] *,
#rt-booking-extension-form [role="button"][style*="background-color: #08B8AE"] * {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  font-weight: 800 !important;
}

/* Preset quick extension chips: equal width, 44px min touch target, theme adaptation */
#rt-booking-extension-form [role="button"][style*="border-radius: 12px"],
#rt-booking-extension-form [role="button"][style*="border-radius: 13px"] {
  min-height: 44px !important;
  box-sizing: border-box !important;
}
html[data-theme="light"] #rt-booking-extension-form [role="button"][style*="border-radius: 12px"],
html[data-theme="light"] #rt-booking-extension-form [role="button"][style*="border-radius: 13px"] {
  background-color: #FFFFFF !important;
  border-color: #CBD5E1 !important;
}
html[data-theme="light"] #rt-booking-extension-form [role="button"][style*="border-radius: 12px"] div[dir="auto"],
html[data-theme="light"] #rt-booking-extension-form [role="button"][style*="border-radius: 13px"] div[dir="auto"] {
  color: #0F172A !important;
  -webkit-text-fill-color: #0F172A !important;
  font-weight: 700 !important;
}
html[data-theme="dark"] #rt-booking-extension-form [role="button"][style*="border-radius: 12px"],
html[data-theme="dark"] #rt-booking-extension-form [role="button"][style*="border-radius: 13px"] {
  background-color: #0E1E2E !important;
  border-color: #1E3A56 !important;
}
html[data-theme="dark"] #rt-booking-extension-form [role="button"][style*="border-radius: 12px"] div[dir="auto"],
html[data-theme="dark"] #rt-booking-extension-form [role="button"][style*="border-radius: 13px"] div[dir="auto"] {
  color: #F8FAFC !important;
  -webkit-text-fill-color: #F8FAFC !important;
  font-weight: 700 !important;
}

/* Booking History Screen & Detail Screen Theming */
#rt-booking-history-screen,
#rt-booking-history-detail-screen {
  --rt-hist-bg: #070D18;
  --rt-hist-card: #09243A;
  --rt-hist-border: #1A4058;
  --rt-hist-text: #F7FBFF;
  --rt-hist-muted: #9BB0C2;
  --rt-hist-divider: rgba(255, 255, 255, 0.08);
  background: var(--rt-hist-bg) !important;
  color: var(--rt-hist-text) !important;
}

html[data-theme="light"] #rt-booking-history-screen,
html[data-theme="light"] #rt-booking-history-detail-screen {
  --rt-hist-bg: #F8FAFC;
  --rt-hist-card: #FFFFFF;
  --rt-hist-border: #E2E8F0;
  --rt-hist-text: #0F172A;
  --rt-hist-muted: #64748B;
  --rt-hist-divider: #E2E8F0;
}

#rt-booking-history-screen div:not([data-rtclass*="pill"]):not([data-rtclass*="action"])[dir="auto"],
#rt-booking-history-detail-screen div:not([data-rtclass*="pill"]):not([data-rtclass*="action"])[dir="auto"] {
  color: var(--rt-hist-text) !important;
  -webkit-text-fill-color: var(--rt-hist-text) !important;
}

/* Secondary & Meta text in History */
#rt-booking-history-screen [style*="color: rgb(155, 176, 194)"],
#rt-booking-history-detail-screen [style*="color: rgb(155, 176, 194)"] {
  color: var(--rt-hist-muted) !important;
  -webkit-text-fill-color: var(--rt-hist-muted) !important;
}

/* History Cards */
html[data-theme="light"] #rt-booking-history-screen [style*="background-color: rgb(9, 36, 58)"],
html[data-theme="light"] #rt-booking-history-detail-screen [style*="background-color: rgb(9, 36, 58)"],
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="border-radius: 18px"],
html[data-theme="light"] #rt-booking-history-detail-screen [style*="border-radius: 18px"],
html[data-theme="light"] #rt-booking-history-detail-screen [style*="border-radius: 16px"],
html[data-theme="light"] #rt-booking-history-detail-screen [style*="border-radius: 15px"] {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Filter chips */
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="border-radius: 9999px"],
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="border-radius: 999px"] {
  background-color: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
}
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="border-radius: 9999px"] div[dir="auto"],
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="border-radius: 999px"] div[dir="auto"] {
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
}

/* Active filter chip & sort chip */
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="background-color: rgb(8, 184, 174)"],
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="background-color: #08b8ae"],
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="background-color: #08B8AE"] {
  background-color: #08B8AE !important;
  border-color: #08B8AE !important;
}
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="background-color: rgb(8, 184, 174)"] div[dir="auto"],
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="background-color: #08b8ae"] div[dir="auto"],
html[data-theme="light"] #rt-booking-history-screen [role="button"][style*="background-color: #08B8AE"] div[dir="auto"] {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  font-weight: 700 !important;
}

/* Status badges: MUST use white background with colored border and text */
.rt-booking-status-pill,
[data-rtclass="rt-booking-status-pill"],
[data-rt-class="rt-booking-status-pill"],
#rt-booking-history-screen [data-rtclass="rt-booking-status-pill"],
#rt-booking-history-detail-screen [data-rtclass="rt-booking-status-pill"] {
  background-color: #FFFFFF !important;
  background: #FFFFFF !important;
}

/* Ensure vehicle images are never dimmed or tinted */
#rt-booking-extension-form img,
#rt-booking-history-screen img,
#rt-booking-history-detail-screen img,
.rt-booking-vehicle-photo,
[data-rtclass="rt-booking-thumb"] img {
  opacity: 1 !important;
  filter: none !important;
  -webkit-filter: none !important;
}

#rt-workflow-modal-back .rt-wf-success-badge,
#rt-workflow-modal-back .rt-wf-success-badge :is(span,strong,b) {color:#065f46!important;-webkit-text-fill-color:currentColor!important}
#rt-workflow-modal-back .rt-wf-warning-badge,
#rt-workflow-modal-back .rt-wf-warning-badge :is(span,strong,b) {color:#92400e!important;-webkit-text-fill-color:currentColor!important}

/* Long payment descriptions wrap before the right-aligned amount. */
#rt-workflow-modal-back .rt-wf-receipt [style*="justify-content:space-between"] {gap:12px}
#rt-workflow-modal-back .rt-wf-receipt [style*="justify-content:space-between"] > :first-child {min-width:0;overflow-wrap:anywhere}
#rt-workflow-modal-back .rt-wf-receipt [style*="justify-content:space-between"] > b:last-child {flex-shrink:0;white-space:nowrap}

#rt-workflow-modal-back [style*="color:var(--rt-wf-partner"] {color:var(--rt-wf-partner)!important}

/* Handover Modal layout refinements & status badges */
#rt-workflow-modal-back .rt-handover-primary-btn {
  background: var(--rt-wf-primary) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
#rt-workflow-modal-back .rt-handover-primary-btn * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
#rt-workflow-modal-back .rt-handover-status-badge {
  background: rgba(7, 111, 105, 0.12) !important;
  color: var(--rt-wf-primary) !important;
  border: 1px solid rgba(7, 111, 105, 0.25) !important;
}
html[data-theme="dark"] #rt-workflow-modal-back .rt-handover-status-badge {
  background: rgba(8, 121, 112, 0.25) !important;
  color: #5eead4 !important;
  border-color: rgba(94, 234, 212, 0.35) !important;
}
#rt-workflow-modal-back .rt-handover-schedule-col,
#rt-workflow-modal-back .rt-handover-status-row {
  background: var(--rt-wf-panel) !important;
  border-color: var(--rt-wf-border) !important;
}
