/* Digitool RentTrack — Smart Fleet Calendar v1.4 Stylesheet
 * Refined to strictly match Bookings tab design baseline, typography, tokens, and components.
 */
:root {
  --cal-bg: #101822;
  --cal-surface: #18232e;
  --cal-ink: #eef4f7;
  --cal-muted: #b1c0cd;
  --cal-line: #334553;
  --cal-teal: #087970;
  --cal-soft: #123838;
}

#rt-smart-calendar-root {
  flex: 1 1 0% !important;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  background: var(--cal-bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#rt-mobile-bottom-nav {
  flex-shrink: 0 !important;
  z-index: 100 !important;
}

html[data-theme="light"] #rt-smart-calendar-root,
body.light-theme #rt-smart-calendar-root,
body.light #rt-smart-calendar-root {
  --cal-bg: #f5f7f9;
  --cal-surface: #ffffff;
  --cal-ink: #172735;
  --cal-muted: #526170;
  --cal-line: #d6e0e7;
  --cal-teal: #076f69;
  --cal-soft: #daf1ee;
  background: var(--cal-bg);
}

.rt-fleet-cal-app {
  --bg: #101822;
  --surface: #18232e;
  --ink: #eef4f7;
  --muted: #b1c0cd;
  --line: #334553;
  --teal: #087970;
  --soft: #123838;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
  color: var(--ink);
  background: var(--bg);
  box-sizing: border-box;
  width: 100%;
  max-width: 500px;
  min-height: 100%;
  margin: 0 auto;
  padding: 14px 12px 76px;
  overflow-x: hidden;
}

html[data-theme="light"] .rt-fleet-cal-app,
body.light-theme .rt-fleet-cal-app,
body.light .rt-fleet-cal-app,
.rt-fleet-cal-app.light {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --ink: #172735;
  --muted: #526170;
  --line: #d6e0e7;
  --teal: #076f69;
  --soft: #daf1ee;
  color-scheme: light;
  color: var(--ink);
  background: var(--bg);
}

.rt-fleet-cal-app * {
  box-sizing: border-box;
}

.rt-fleet-cal-app button,
.rt-fleet-cal-app input,
.rt-fleet-cal-app select {
  font: 500 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}

.rt-fleet-cal-app button {
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rt-fleet-cal-app button.active,
.rt-fleet-cal-app button.primary {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: #fff !important;
}

.rt-fleet-cal-app button:focus-visible,
.rt-fleet-cal-app [role="button"]:focus-visible,
.rt-fleet-cal-app input:focus-visible,
.rt-fleet-cal-app select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.rt-fleet-cal-app button:disabled { opacity: 0.5; cursor: default; }

.rt-fleet-cal-app button:hover {
  border-color: var(--teal);
}

.rt-fleet-cal-app .head,
.rt-fleet-cal-app .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rt-fleet-cal-app .head {
  margin-bottom: 12px;
}

.rt-fleet-cal-app .head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.rt-fleet-cal-app .head .row {
  flex-shrink: 0;
  gap: 6px;
}

.rt-fleet-cal-app .head h1 {
  font: 700 20px/1.25 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.3px;
  margin: 0 0 2px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rt-fleet-cal-app .sub,
.rt-fleet-cal-app .muted,
.rt-fleet-cal-app small {
  color: var(--muted);
}

.rt-fleet-cal-app .sub {
  font: 400 12px/1.4 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rt-fleet-cal-app .iconbtn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.rt-fleet-cal-app .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 10px;
  margin-bottom: 10px;
  max-width: 100%;
  overflow-x: hidden;
}

.rt-fleet-cal-app .toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.rt-fleet-cal-app .toolbar.row {
  width: 100%;
  flex-wrap: wrap;
}

.rt-fleet-cal-app .toolbar.row > .toolbar:first-child {
  flex: 1 1 auto;
  justify-content: space-between;
  min-width: 0;
}

.rt-fleet-cal-app .toolbar strong {
  font: 600 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
  color: var(--ink);
}

.rt-fleet-cal-app .toolbar button {
  padding: 6px 10px;
  min-height: 44px;
  min-width: 44px;
  font: 500 13px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border-radius: 8px;
}

/* 4 Views Tabs */
.rt-fleet-cal-app .tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 10px 0 9px;
  width: 100%;
}

.rt-fleet-cal-app .tabs button {
  font: 600 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 44px;
  padding: 8px 2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 8px;
}

.rt-fleet-cal-app .controls-area {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
  width: 100%;
}

.rt-fleet-cal-app .controls-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

/* Display Modes Group: Coverage / Dots / Count */
.rt-fleet-cal-app .group {
  display: flex;
  gap: 4px;
  width: 100%;
}

.rt-fleet-cal-app .group button {
  font: 500 13px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 7px 8px;
  min-height: 44px;
  flex: 1 1 0;
  text-align: center;
  border-radius: 8px;
}

.rt-fleet-cal-app .group button.active {
  background: var(--soft) !important;
  color: var(--ink) !important;
  border-color: var(--teal) !important;
  font-weight: 600;
}

/* Dropdown Filters matching Bookings tab */
.rt-fleet-cal-app .fleet-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.rt-fleet-cal-app .filter-select,
.rt-fleet-cal-app select {
  font: 500 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  padding: 8px 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface) !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
}

.rt-fleet-cal-app select option {
  background: var(--surface) !important;
  color: var(--ink) !important;
}

.rt-fleet-cal-app input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 44px;
  max-width: 100%;
  font: 400 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}

.rt-fleet-cal-app input::placeholder {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}

/* Weekday header */
.rt-fleet-cal-app .weekday,
.rt-fleet-cal-app .days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2.5px;
  width: 100%;
}

.rt-fleet-cal-app .weekday span {
  text-align: center;
  font: 600 10.5px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--muted);
  padding: 5px 0 3px;
  text-transform: uppercase;
}

/* Month Week Card */
.rt-fleet-cal-app .week {
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 4px;
  width: 100%;
}

/* Month Day Cell */
.rt-fleet-cal-app .day {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface);
  padding: 3px 1px;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  line-height: 1;
  min-width: 0;
  transition: background 0.12s ease;
}

/* Date Number Circle Indicator (Phase 2 Requirement) */
.rt-fleet-cal-app .day .day-num {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font: 600 12.5px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
  color: var(--ink);
}

/* Selected Date Highlight: Small solid teal circular background behind date number with white high-contrast text */
.rt-fleet-cal-app .day.selected .day-num {
  background: var(--teal) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 700 !important;
}

/* Today's Date: Distinct indicator */
.rt-fleet-cal-app .day.today:not(.selected) .day-num {
  color: var(--ink) !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1.5px var(--teal);
}

.rt-fleet-cal-app .day.out {
  opacity: 0.15;
  pointer-events: none;
}

.rt-fleet-cal-app .day .dots {
  display: flex;
  justify-content: center;
  gap: 1.5px;
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
}

.rt-fleet-cal-app .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.rt-fleet-cal-app .day .count {
  color: var(--muted);
  font: 600 9.5px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin-top: 2px;
}

.rt-fleet-cal-app .coverage-overflow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2.5px;
  margin-top: 3px;
}
.rt-fleet-cal-app .coverage-overflow button {
  padding: 4px 0;
  min-height: 28px;
  font-size: 12px;
  color: var(--ink);
  background: var(--soft);
}

/* Coverage Bars */
.rt-fleet-cal-app .coverage-row {
  position: relative;
  height: var(--rt-cal-slot-height, 7px);
  margin-top: 2.5px;
  width: 100%;
  overflow: hidden;
}

.rt-fleet-cal-app .bar {
  height: 100%;
  position: absolute;
  border-radius: 2px;
}

.rt-fleet-cal-app .bar.continues-before { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.rt-fleet-cal-app .bar.continues-after { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.rt-fleet-cal-app .hint {
  font: 400 11px/1.4 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--muted);
  margin: 8px 0 2px;
}

.rt-fleet-cal-app .sectiontitle {
  font: 700 15px/1.3 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  color: var(--ink);
}

/* Booking Entry matching Bookings tab compact card */
.rt-fleet-cal-app .entry {
  background: var(--bg);
  border-radius: 8px;
  padding: 9px 10px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  max-width: 100%;
  border: 1px solid var(--line);
}

.rt-fleet-cal-app .entry .stripe {
  height: 34px;
  width: 3.5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.rt-fleet-cal-app .entry .body {
  flex: 1 1 0;
  min-width: 0;
}

.rt-fleet-cal-app .entry strong {
  display: block;
  font: 600 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}

.rt-fleet-cal-app .entry small {
  display: block;
  font: 400 12px/1.45 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin-top: 2px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rt-fleet-cal-app #rtCalDayCard > .row {
  flex-wrap: wrap;
  align-items: flex-start;
}

.rt-fleet-cal-app .pill {
  font: 500 10.5px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 3px 6px;
  white-space: nowrap;
  color: var(--ink);
  flex-shrink: 0;
  background: var(--surface);
}

.rt-fleet-cal-app .actions {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  gap: 6px;
}

.rt-fleet-cal-app .actions button {
  font: 500 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 44px;
  flex: 1;
}

.rt-fleet-cal-app .hidden {
  display: none !important;
}

.rt-fleet-cal-app .line {
  border-top: 1px solid var(--line);
  margin: 10px 0;
}

.rt-fleet-cal-app .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 8px 0;
  font: 500 13px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  width: 100%;
}

.rt-fleet-cal-app .field input,
.rt-fleet-cal-app .field select {
  width: 100%;
}

.rt-fleet-cal-app .custom-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.rt-fleet-cal-app .custom-color-row input[type="color"] {
  width: 48px;
  height: 38px;
  min-height: 38px;
  padding: 1px 2px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 8px;
}

.rt-fleet-cal-app .custom-color-row .hex-text-input {
  flex: 1 1 0;
  min-width: 0;
  font-family: monospace;
  font-size: 13px;
  text-transform: uppercase;
}

.rt-fleet-cal-app .swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.rt-fleet-cal-app .swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.rt-fleet-cal-app .swatch.active {
  outline: 2px solid var(--ink);
}

.rt-fleet-cal-app .fleetrow {
  padding: 9px 10px;
  background: var(--bg);
  border-radius: 8px;
  margin: 6px 0;
  max-width: 100%;
  border: 1px solid var(--line);
}

.rt-fleet-cal-app .fleetrow.empty-week-row {
  padding: 6px 10px;
  opacity: 0.85;
}

.rt-fleet-cal-app .fleetrow.week-row-selected {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.rt-fleet-cal-app .fleet-unit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.rt-fleet-cal-app .fleet-unit-title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font: 600 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.rt-fleet-cal-app .fleet-unit-dot {
  flex-shrink: 0;
  font-size: 12px;
}

.rt-fleet-cal-app .fleet-unit-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.rt-fleet-cal-app .fleet-unit-plate {
  flex-shrink: 0;
  white-space: nowrap;
  font: 500 12px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--muted);
}

/* Fleet View: Synchronized Header & Swipe Timeline (Phase 3 Requirement) */
.rt-fleet-cal-app .fleet-timeline-wrap {
  width: 100%;
  touch-action: pan-y;
  user-select: none;
}

.rt-fleet-cal-app .fleet-timeline-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
}

.rt-fleet-cal-app .fleet-timeline-nav-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.rt-fleet-cal-app .fleet-timeline-nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.rt-fleet-cal-app .fleet-timeline-range {
  font: 600 14px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}

.rt-fleet-cal-app .fleet-timeline-hint {
  font: 400 12px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--muted);
}

.rt-fleet-cal-app .fleet-timeline-header-row {
  padding: 4px 10px 8px;
  width: 100%;
  box-sizing: border-box;
}

.rt-fleet-cal-app .fleet-col-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2.5px;
  width: 100%;
}

.rt-fleet-cal-app .fleet-header-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  padding: 6px 1px;
  min-height: 44px;
  border-radius: 6px;
  color: var(--muted);
  line-height: 1.1;
  transition: background 0.15s ease, color 0.15s ease;
}

.rt-fleet-cal-app .fleet-header-cell:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rt-fleet-cal-app .fleet-header-cell.timeline-col-selected {
  color: var(--ink) !important;
  background: var(--soft);
  font-weight: 700;
}

.rt-fleet-cal-app .fleet-header-weekday {
  font: 600 11px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.rt-fleet-cal-app .fleet-header-day {
  font: 600 13px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}

.rt-fleet-cal-app .fleet-header-cell.timeline-col-selected .fleet-header-day {
  color: var(--ink) !important;
}

.rt-fleet-cal-app .fleet-timeline-unit-row {
  padding: 8px 10px;
  margin-bottom: 6px;
}

.rt-fleet-cal-app .timeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2.5px;
  margin-top: 7px;
  width: 100%;
}

.rt-fleet-cal-app .timeline div {
  text-align: center;
  cursor: pointer;
  min-width: 0;
  padding: 2px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 4px;
}

.rt-fleet-cal-app .timeline div.timeline-col-selected {
  background: rgba(8, 121, 112, 0.14);
}

.rt-fleet-cal-app .timeline i {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 3px;
  background: var(--line);
  transition: transform 0.1s ease;
}

/* Dispatch */
.rt-fleet-cal-app .dispatchgroup {
  margin-top: 10px;
}

.rt-fleet-cal-app .dispatchgroup h3 {
  font: 700 13px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0 0 6px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rt-fleet-cal-app .dispatchgroup p {
  font: 400 12px/1.45 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--muted);
  margin: 3px 0;
}

.rt-fleet-cal-app .mini {
  font-size: 12px;
}

.rt-fleet-cal-app .detail {
  border-color: var(--teal);
}

.rt-fleet-cal-app .detail p {
  font: 400 12px/1.4 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--muted);
  margin: 5px 0;
}

/* Extra small mobile screens (320px - 360px) */
@media (max-width: 360px) {
  .rt-fleet-cal-app {
    padding: 10px 8px 76px;
  }
  .rt-fleet-cal-app .head h1 {
    font-size: 18px;
  }
  .rt-fleet-cal-app .sub {
    font-size: 11px;
  }
  .rt-fleet-cal-app .tabs button {
    font-size: 13px;
    padding: 6px 1px;
  }
  .rt-fleet-cal-app .group button {
    font-size: 12px;
    padding: 6px 4px;
  }
  .rt-fleet-cal-app .toolbar strong {
    font-size: 13px;
  }
}

@media (min-width: 550px) {
  .rt-fleet-cal-app {
    margin: 20px auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    min-height: 850px;
  }
}


