/* ==========================================================================
   DIGITOOL RENTTRACK — FLEET GPS TRACKING & CUSTOMER DIRECTORY UI
   Authoritative Reference: Digitool_RentTrack_Interactive_Preview_v2.html
   Scope: #rt-gps-screen, #rt-customers-screen
   ========================================================================== */

#rt-gps-screen,
#rt-customers-screen {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --bg: #07121f;
  --panel: #10283b;
  --panel2: #0c2031;
  --text: #eef5fa;
  --muted: #94a9ba;
  --line: #244459;
  --teal: #13b9ad;
  --soft: #103d42;
  --shadow: rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  background-color: var(--bg) !important;
  color: var(--text) !important;
  width: 100%;
  flex: 1;
  min-height: 100%;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 95px;
}

/* Light Theme Support */
html[data-theme='light'] #rt-gps-screen,
html[data-theme='light'] #rt-customers-screen,
body.light-theme #rt-gps-screen,
body.light-theme #rt-customers-screen,
body.light #rt-gps-screen,
body.light #rt-customers-screen,
#rt-gps-screen.light,
#rt-customers-screen.light {
  --bg: #f5f8fa;
  --panel: #ffffff;
  --panel2: #f0f6f8;
  --text: #162a39;
  --muted: #607787;
  --line: #dce8ec;
  --teal: #13b9ad;
  --soft: #e0f6f3;
  --shadow: rgba(20, 40, 60, 0.08);
}

#rt-gps-screen *,
#rt-customers-screen * {
  box-sizing: border-box;
}

#rt-gps-screen .wrap,
#rt-customers-screen .wrap {
  max-width: 480px;
  margin: 0 auto;
}

/* Header & Top Navigation */
#rt-gps-screen .top,
#rt-customers-screen .top {
  padding: 16px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#rt-gps-screen .back,
#rt-customers-screen .back {
  font-size: 13px;
  color: var(--teal);
  font-weight: 650;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

#rt-gps-screen .back:active,
#rt-customers-screen .back:active {
  opacity: 0.75;
}

/* Content Container */
#rt-gps-screen .content,
#rt-customers-screen .content {
  padding: 8px 18px 24px;
}

/* Headings */
#rt-gps-screen .heading,
#rt-customers-screen .heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#rt-gps-screen .heading h1,
#rt-customers-screen .heading h1 {
  font-size: 23px;
  letter-spacing: -0.6px;
  margin: 4px 0 3px;
  font-weight: 750;
  color: var(--text);
  line-height: 1.2;
}

#rt-gps-screen .subtitle,
#rt-customers-screen .subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
  line-height: 1.4;
}

/* Primary Action Button (Add customer) */
#rt-gps-screen .action,
#rt-customers-screen .action {
  border: 0;
  background: var(--teal);
  color: #052627;
  border-radius: 11px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

#rt-gps-screen .action:active,
#rt-customers-screen .action:active {
  opacity: 0.85;
}

/* Section Subheadings */
#rt-gps-screen .section,
#rt-customers-screen .section {
  font-size: 16px;
  font-weight: 730;
  letter-spacing: -0.2px;
  margin: 22px 0 12px;
  color: var(--text);
}

/* ==========================================================================
   FLEET GPS TRACKING SPECIFIC
   ========================================================================== */

/* Compact Summary Stats Cards */
#rt-gps-screen .stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

#rt-gps-screen .stat {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  padding: 13px 10px;
  box-shadow: var(--shadow);
}

#rt-gps-screen .stat .label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

#rt-gps-screen .dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: var(--teal);
  display: inline-block;
  flex-shrink: 0;
}

#rt-gps-screen .dot.red {
  background: #f36b72;
}

#rt-gps-screen .dot.amber {
  background: #f5b54c;
}

#rt-gps-screen .stat strong {
  display: block;
  font-size: 23px;
  margin-top: 8px;
  color: var(--text);
  font-weight: 800;
}

/* Simulation Notice (Subtle, clearly identifiable) */
#rt-gps-screen .notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 13px;
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

#rt-gps-screen .notice b {
  color: var(--text);
}

#rt-gps-screen .notice button {
  border: 0;
  background: none;
  color: var(--teal);
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

/* Map Container with Leaflet */
#rt-gps-screen .map {
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 17px;
  position: relative;
  overflow: hidden;
  background: var(--panel2);
  box-shadow: var(--shadow);
}

#rt-gps-screen .map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

#rt-gps-screen .maptag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(16, 40, 59, 0.92);
  color: #fff;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 750;
  z-index: 500;
  pointer-events: none;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#rt-gps-screen .mapbottom {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(16, 40, 59, 0.92);
  color: white;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 500;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Vehicle Status Cards */
#rt-gps-screen .vehicle {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 9px;
  box-shadow: var(--shadow);
}

#rt-gps-screen .vtop {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

#rt-gps-screen .vtitle {
  font-size: 14px;
  font-weight: 720;
  color: var(--text);
}

#rt-gps-screen .vplate {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

#rt-gps-screen .badge {
  font-size: 10px;
  font-weight: 750;
  border-radius: 100px;
  padding: 5px 9px;
  border: 1px solid #6a4049;
  color: #ff8389;
  background: rgba(255, 131, 137, 0.1);
  white-space: nowrap;
}

#rt-gps-screen .badge.live {
  border-color: #16564e;
  color: #19c6a3;
  background: rgba(25, 198, 163, 0.1);
}

#rt-gps-screen .badge.delayed,
#rt-gps-screen .badge.simulated {
  border-color: #6b5327;
  color: #f5b54c;
  background: rgba(245, 181, 76, 0.1);
}

#rt-gps-screen .vfoot {
  border-top: 1px solid var(--line);
  padding-top: 11px;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

/* ==========================================================================
   CUSTOMER DIRECTORY SPECIFIC
   ========================================================================== */

/* Search Input */
#rt-customers-screen .search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 11px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

#rt-customers-screen .search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
  font-size: 13px;
}

#rt-customers-screen .search input::placeholder {
  color: var(--muted);
}

/* Filter & Sort Bar */
#rt-customers-screen .filterbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

#rt-customers-screen .filterbar button {
  background: none;
  border: 0;
  color: var(--teal);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 6px;
}

/* Compact Professional Customer Row */
#rt-customers-screen .customer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 9px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#rt-customers-screen .customer:active {
  opacity: 0.85;
}

#rt-customers-screen .avatar {
  height: 39px;
  width: 39px;
  min-width: 39px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--teal);
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
}

#rt-customers-screen .customer .name {
  font-size: 14px;
  font-weight: 720;
  color: var(--text);
}

#rt-customers-screen .customer .detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

#rt-customers-screen .chev {
  margin-left: auto;
  color: var(--muted);
  font-size: 17px;
  font-weight: 600;
}

/* ==========================================================================
   CUSTOMER DETAILS MODAL / PROFILE SHEET
   ========================================================================== */

.rt-customer-modalwrap {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 999999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.rt-customer-modal {
  width: min(480px, 100%);
  background: var(--panel, #10283b);
  border: 1px solid var(--line, #244459);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  color: var(--text, #eef5fa);
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
  animation: rtModalSlideUp 0.25s ease-out;
}

/* Light Mode Overrides for Modal */
html[data-theme='light'] .rt-customer-modal,
body.light-theme .rt-customer-modal,
body.light .rt-customer-modal {
  background: #ffffff;
  border-color: #dce8ec;
  color: #162a39;
}

@keyframes rtModalSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.rt-customer-modal h2 {
  font-size: 18px;
  margin: 0 0 15px;
  color: var(--text, #eef5fa);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 750;
}

html[data-theme='light'] .rt-customer-modal h2,
body.light-theme .rt-customer-modal h2 {
  color: #162a39;
}

.rt-customer-modal .mutebtn {
  background: transparent;
  color: var(--text, #eef5fa);
  border: 1px solid var(--line, #244459);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

html[data-theme='light'] .rt-customer-modal .mutebtn,
body.light-theme .rt-customer-modal .mutebtn {
  color: #162a39;
  border-color: #dce8ec;
}

.rt-customer-modal .profilehero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 14px;
}

.rt-customer-modal .profilehero .avatar {
  height: 48px;
  width: 48px;
  min-width: 48px;
  font-size: 19px;
  border-radius: 14px;
}

.rt-customer-modal .profilehero strong {
  display: block;
  font-size: 17px;
  color: var(--text, #eef5fa);
}

html[data-theme='light'] .rt-customer-modal .profilehero strong,
body.light-theme .rt-customer-modal .profilehero strong {
  color: #162a39;
}

.rt-customer-modal .profilehero small {
  display: block;
  color: var(--muted, #94a9ba);
  font-size: 12px;
  margin-top: 3px;
}

.rt-customer-modal .profileheading {
  font-size: 13px;
  font-weight: 750;
  margin: 14px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line, #244459);
  color: var(--text, #eef5fa);
}

html[data-theme='light'] .rt-customer-modal .profileheading,
body.light-theme .rt-customer-modal .profileheading {
  color: #162a39;
  border-color: #dce8ec;
}

.rt-customer-modal .profileline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  font-size: 12px;
  align-items: flex-start;
}

.rt-customer-modal .profileline span {
  color: var(--muted, #94a9ba);
  flex: 0 0 42%;
}

.rt-customer-modal .profileline b {
  text-align: right;
  overflow-wrap: anywhere;
  font-size: 12px;
  color: var(--text, #eef5fa);
  font-weight: 650;
}

html[data-theme='light'] .rt-customer-modal .profileline b,
body.light-theme .rt-customer-modal .profileline b {
  color: #162a39;
}

.rt-customer-modal .verified {
  color: #19c6a3;
  font-weight: 700;
}

.rt-customer-modal .pending {
  color: #f3b54c;
  font-weight: 700;
}

.rt-customer-modal .transaction {
  border: 1px solid var(--line, #244459);
  border-radius: 10px;
  padding: 11px 12px;
  margin: 8px 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
  background: var(--panel2, #0c2031);
}

html[data-theme='light'] .rt-customer-modal .transaction,
body.light-theme .rt-customer-modal .transaction {
  background: #f0f6f8;
  border-color: #dce8ec;
}

.rt-customer-modal .transaction strong {
  color: var(--text, #eef5fa);
  font-size: 13px;
}

html[data-theme='light'] .rt-customer-modal .transaction strong,
body.light-theme .rt-customer-modal .transaction strong {
  color: #162a39;
}

.rt-customer-modal .transaction span,
.rt-customer-modal .helper {
  color: var(--muted, #94a9ba);
  font-size: 12px;
  line-height: 1.5;
}

.rt-customer-modal .helper {
  padding: 6px 0;
}

.empty {
  text-align: center;
  color: var(--muted, #94a9ba);
  padding: 28px 10px;
  font-size: 13px;
}
