:root {
  --bg: #0b0f14;
  --card: #111826;
  --text: #e8eef7;
  --muted: #9fb0c7;
  --border: rgba(255,255,255,0.08);
  --accent: #4da3ff;
  --planner-personal: #29d7ff;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: #0b0f14;
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  opacity: 1;
  transition: opacity 90ms ease;
}

body.app-loading {
  opacity: 0;
}

body.app-leaving {
  opacity: 0.35;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11,15,20,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 12px 10px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 10px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 16px; /* stops iOS zoom */
}

.container {
  padding: 12px;
}

#calendar {
  --fc-border-color: rgba(60, 80, 110, 0.35);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  overflow: hidden;
}

/* FullCalendar tuning */
.fc .fc-toolbar-title { font-size: 18px; }
.fc .fc-button { border-radius: 12px; }
.fc .fc-scrollgrid, .fc .fc-scrollgrid-section > td { border-color: var(--border); }
.fc .fc-daygrid-day-number { color: var(--muted); text-decoration: none; }

.fc .fc-daygrid-day.fc-day-today {
  background: rgba(255, 199, 71, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(255, 211, 94, 0.85),
    inset 0 0 24px rgba(255, 199, 71, 0.26);
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  color: #fff4c2;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.fc .fc-daygrid-day.sunday-week-hold {
  box-shadow: inset 0 0 0 2px rgba(255,211,94,0.9);
  background: rgba(255,199,71,0.18);
}

.dayTotals {
  margin-top: 6px;
  display: grid;
  gap: 3px;
  font-size: 11px;
  line-height: 1.1;
}

.dayTotals .income { color: #a8ffbf; }
.dayTotals .expense { color: #ffb1b1; }
.dayTotals .net { color: #cfe2ff; }

@media (min-width: 900px) {
  .container { max-width: 900px; margin: 0 auto; }
  .filters { grid-template-columns: 240px 240px; justify-content: center; }
}

.dot{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin: 4px auto 0;
  background: #3ddc97; /* income */
}

.dot.expense{
  background: #ff6b6b;
}

.dot.both{
  background: linear-gradient(45deg, #3ddc97, #ff6b6b);
}

.fc-daygrid-day-frame {
  position: relative;
}

.planner-day-markers {
  position: absolute;
  left: 50%;
  bottom: 3px;
  display: flex;
  gap: 3px;
  transform: translateX(-50%);
  pointer-events: none;
}

.planner-day-marker {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.planner-day-marker.shared {
  background: #4dff88;
}

.planner-day-marker.personal {
  background: var(--planner-personal);
}

/* Fare calculator */
.app-shell[data-route="fare"] {
  display: flex;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.app-shell[data-route="fare"] > .topbar {
  position: relative;
  flex: 0 0 auto;
}

.app-shell[data-route="fare"] .container {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  max-width: none;
  padding: 0;
}

#app[data-route="fare"] #topbarTitle {
  min-width: 0;
}

#app[data-route="fare"] .topbar-row {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  margin-bottom: 0;
}

.fare-page {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #d9dedf;
}

.fare-map-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #d9dedf;
}

.fare-map {
  width: 100%;
  height: 100%;
}

.fare-map-ui {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  right: 12px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.fare-map-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 7px;
}

.fare-map-toolbar button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  color: #e8eef7;
  background: rgba(11, 15, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.fare-map-toolbar button.active {
  color: #111;
  background: #ffd447;
  border-color: #ffd447;
  font-weight: 750;
}

.fare-location-button {
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0 !important;
}

.fare-location-button svg {
  display: block;
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.fare-location-button .fare-location-centre {
  fill: currentColor;
  stroke: none;
}

.fare-search-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fare-map-message {
  position: absolute;
  z-index: 6;
  left: 16px;
  right: 16px;
  bottom: calc(var(--fare-bottom-panel-height, 130px) + 12px);
  padding: 11px 13px;
  color: #f4f7fb;
  background: rgba(11, 15, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  text-align: center;
}

.fare-address-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 9px;
  background: rgba(11, 15, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  backdrop-filter: blur(9px);
}

.fare-address-field label {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.fare-address-field input {
  flex: 1 1 auto;
  width: auto;
  height: 24px;
  min-width: 0;
  padding: 0;
  color: var(--text);
  caret-color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 16px;
  line-height: 24px;
  text-overflow: ellipsis;
  transform: translateY(-3px);
}

.fare-address-field input:focus::placeholder {
  color: transparent;
  opacity: 0;
}

.fare-address-field input::placeholder {
  font-size: 13px;
}

.fare-address-field input:focus:placeholder-shown {
  caret-color: transparent;
}

.fare-empty-caret {
  position: absolute;
  bottom: 13px;
  left: 28px;
  display: none;
  width: 1px;
  height: 18px;
  background: var(--text);
  pointer-events: none;
  animation: fare-empty-caret-blink 1s step-end infinite;
}

.fare-address-field input:focus:placeholder-shown + .fare-empty-caret {
  display: block;
}

@keyframes fare-empty-caret-blink {
  0%, 45% {
    opacity: 1;
  }

  46%, 100% {
    opacity: 0;
  }
}

.fare-point {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.fare-point.pickup,
.fare-marker.pickup {
  background: #39d98a;
}

.fare-point.destination,
.fare-marker.destination {
  background: #ff5c6c;
}

.fare-marker {
  width: 22px;
  height: 22px;
  border: 4px solid #fff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
  transform: rotate(-45deg);
}

.fare-suggestions {
  position: absolute;
  z-index: 9;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: min(42dvh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  background: #141c2b;
  border: 1px solid rgba(120, 160, 220, 0.35);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.52);
}

.fare-suggestions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 15px;
}

.fare-suggestions button span {
  min-width: 0;
}

.fare-suggestions button small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  text-transform: capitalize;
}

.fare-suggestions button:last-child {
  border-bottom: 0;
}

.fare-route-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  background: rgba(5, 10, 17, 0.55);
  border-radius: 13px;
}

.fare-route-options button {
  padding: 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-weight: 650;
}

.fare-route-options button.active {
  color: #111;
  background: #ffd447;
}

.fare-options {
  padding: 1px 0;
}

.fare-options summary {
  color: #c7d7eb;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.fare-options[open] summary {
  margin-bottom: 12px;
}

.fare-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fare-options-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.fare-options-grid input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(5, 10, 17, 0.66);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
}

.fare-options-grid label > span {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 5px;
}

.fare-options-grid .fare-check {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 9px;
}

.fare-options-grid .fare-check input {
  width: 18px;
  height: 18px;
}

.fare-status {
  margin: 0;
  text-align: center;
  font-size: 13px;
}

.fare-status.fare-success {
  color: #9ff2c5;
}

.fare-status.fare-error {
  color: #ffacb4;
}

.fare-routing-credit {
  margin: 2px 0 0;
  text-align: center;
  font-size: 11px;
}

.fare-routing-credit a {
  color: #a9cfff;
}

.fare-result {
  padding: 4px 0 2px;
  text-align: center;
}

.fare-result-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fare-result-price {
  color: #ffe16b;
  font-size: clamp(30px, 9vw, 46px);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.fare-result-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
}

.fare-result-meta span {
  padding: 5px 9px;
  color: #cbd9ea;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  font-size: 12px;
}

.fare-bottom-panel {
  position: absolute;
  z-index: 7;
  bottom: 0;
  left: 50%;
  width: min(760px, 100%);
  pointer-events: none;
  transform: translate(-50%, 100%);
  transition: transform 260ms cubic-bezier(0.22, 0.75, 0.25, 1);
  will-change: transform;
}

.fare-bottom-panel.is-open {
  transform: translate(-50%, 0);
}

.fare-drawer-handle {
  position: absolute;
  top: -38px;
  left: 50%;
  width: 84px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--text);
  background: rgba(16, 23, 36, 0.98);
  border: 1px solid rgba(120, 160, 220, 0.38);
  border-bottom: 0;
  border-radius: 17px 17px 0 0;
  box-shadow: 0 -7px 18px rgba(0, 0, 0, 0.38);
  transform: translateX(-50%);
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
}

.fare-drawer-grip {
  width: 40px;
  height: 5px;
  background: #91a5bd;
  border-radius: 999px;
  transition: background 160ms ease;
}

.fare-drawer-handle:hover .fare-drawer-grip,
.fare-drawer-handle:focus-visible .fare-drawer-grip {
  background: #ffd447;
}

.fare-drawer-content {
  max-height: min(72dvh, 680px);
  display: grid;
  gap: 13px;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text);
  background: linear-gradient(180deg, rgba(20, 28, 43, 0.98), rgba(11, 16, 26, 0.99));
  border: 1px solid rgba(120, 160, 220, 0.32);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -14px 38px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.fare-map-card .maplibregl-ctrl-bottom-right {
  bottom: calc(var(--fare-bottom-panel-height, 130px) + 8px);
}

@media (max-width: 540px) {
  .fare-map-ui {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
  }

  .fare-map-toolbar {
    gap: 5px;
  }

  .fare-map-toolbar button {
    min-height: 40px;
    padding: 7px 6px;
    font-size: 13px;
  }

  .fare-location-button {
    width: 44px;
  }

  .fare-search-row {
    gap: 6px;
  }

  .fare-suggestions {
    width: calc(200% + 6px);
  }

  #farePickupSuggestions {
    right: auto;
  }

  #fareDestinationSuggestions {
    right: 0;
    left: auto;
  }

  .fare-address-field {
    padding: 6px 7px;
  }

  .fare-empty-caret {
    bottom: 12px;
    left: 26px;
  }

  .fare-address-field input {
    font-size: 16px;
  }

  .fare-drawer-content {
    border-right: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .fare-options-grid {
    grid-template-columns: 1fr;
  }

  .fare-options-grid .fare-check {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fare-bottom-panel {
    transition-duration: 1ms;
  }
}

.topbar{
  background: linear-gradient(135deg, #0f2a34, #122b33);
  border-bottom: none;
}

.brand{
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

/* Top header row (brand + auth buttons) */
.topbar-row{
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* left | center | right */
  align-items: center;
  margin-bottom: 10px;
}

/* Brand stays centered */
.brand{
  justify-self: center;
  margin-bottom: 0;
}

/*-------------------Menu wrapper-------------------------*/
.auth-menu {
  justify-self: end;
  position: relative;
}

/* Menu button ONLY */
.menu-btn {
  background: transparent;
  border: 0px solid rgba(255,255,255,0.2);
  color: #9fc3ff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
}

/*.menu-btn:hover {
  background: rgba(255,255,255,0.18);
}*/

/* Dropdown */
.menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 245px;
  background: linear-gradient(180deg, #141c2b, #0f1624);
  border: 1px solid rgba(120,160,220,0.22);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  display: none;
  overflow: hidden;
  z-index: 50;
}

/* Dropdown items */
.menu-dropdown a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  color: #e8eef7;
  text-decoration: none;
  font-size: 16px;
}

.menu-dropdown a:hover {
  background: rgba(255,255,255,0.08);
}

/* Logout emphasis */
.menu-dropdown .logout {
  color: #ffb1b1;
}

/*------------------------------------------------------------------------------------------*/

.month-nav {
  grid-template-columns: auto 1fr 1fr auto;
  align-items: center;
}

.navBtn {
  background: transparent;
  border: 0px solid rgba(255,255,255,0.2);
  color: #9fc3ff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 18px;
  cursor: pointer;
}

/*.navBtn:hover {
  background: rgba(255,255,255,0.15);
}*/

.day-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile-safe 3-zone header */
.day-nav{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin-bottom: 0;
}

/* Left cluster */
.day-nav .left{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Center date */
#dateTitle{
  justify-self: center;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-date-link {
  border: 0;
  padding: 4px 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.topbar-date-link:focus-visible {
  outline: 2px solid #9fc3ff;
  outline-offset: 3px;
  border-radius: 8px;
}

.topbar-date-link.planner-date-alert {
  color: #ffd35e;
  text-shadow: 0 0 12px rgba(255,211,94,0.65);
}

/* Right arrow */
#nextDay{
  justify-self: end;
}

.backLink{
  font-size: 20px;
  padding: 8px 10px;
  border-radius: 10px;
  /*background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);*/
  text-decoration: none;
  display: flex;
  align-items: center;
  width: fit-content;
}

/* =========================
   Calendar weekday header fix
   ========================= */

.fc .fc-col-header-cell {
  background: linear-gradient(180deg, #1a2533, #121a26);
  border-color: var(--border);
}

.fc .fc-col-header-cell-cushion {
  color: #b9d7ff !important;   /* readable light blue */
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
}

/* Weekend tint */
.fc .fc-col-header-cell:nth-child(6) .fc-col-header-cell-cushion,
.fc .fc-col-header-cell:nth-child(7) .fc-col-header-cell-cushion {
  color: #ffd27d !important;
}

/*----------------------------------------------------------------------------*/

.footer-link {
  text-align: center;
  margin-top: 0px;
  padding-bottom: 30px;
}

.footer-link a {
  color: #6fb1ff;
  text-decoration: none;
  font-size: 16px;
  opacity: 0.85;
}

.footer-link a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* =========================
   Commission editor styling
   ========================= */

#c_source {
  margin-bottom: 12px;
}   

#percentRow,
#fixedRow,
#capRow,
#c_date {
  margin-bottom: 12px;
}

#percentRow label,
#fixedRow label,
#capRow label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #b9d7ff;
}

#percentRow input,
#fixedRow input,
#capRow input,
#c_date {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  color: #fff;
  outline: none;
}

#percentRow input:focus,
#fixedRow input:focus,
#capRow input:focus,
#c_date:focus {
  border-color: #6fb1ff;
  box-shadow: 0 0 0 2px rgba(111,177,255,0.2);
}

/* Label text */
#fixedLabel {
  font-weight: 600;
}

/* Save button */
#saveCommission,
#saveCardFee,
#saveAppCommission,
#saveRentBtn,
#saveTaxBtn {
  background: linear-gradient(135deg,#3a8bfd,#1e4fd8);
  border: none;
  color: #fff;
}

#saveCommission:hover,
#saveCardFee:hover,
#saveAppCommission:hover,
#saveRentBtn:hover,
#saveTaxBtn:hover {
  filter: brightness(1.1);
}

#recalcBtn {
  margin-top: 12px;
  background: rgba(163,75,75,0.25);
  border: 1px solid rgba(255,120,120,0.4);
  color: #ffb1b1;
}

#recalcBtn:hover {
  background: rgba(163,75,75,0.45);
}

/* ---------- WEEK VIEW ---------- */

.week-report {
  display: flex;
  justify-content: center;
}

.week-grid {
  display: grid;
  grid-template-columns: 1fr;   /* single column */
  row-gap: 28px;
  width: 100%;
  max-width: 420px;            /* nice centered card width */
  text-align: center;
}

.week-grid .big {
  font-size: 2.6rem;
  font-weight: 600;
}

.week-grid .label {
  font-size: 0.9rem;
  opacity: 0.7;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

/* Make Take Home stand out */
.week-grid #wkTake {
  font-size: 3.4rem;
  font-weight: 700;
}

/*----------------------------------------------------------------------------*/

/* Narrow only the Commissions page */
.commissions-page {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* Desktop breathing room */
@media (min-width: 700px) {
  .commissions-page {
    padding-left: 24px;
    padding-right: 24px;
  }
}

.btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #9fc3ff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s ease, border 0.15s ease;
}

.btn:hover {
  background: rgba(255,255,255,0.18);
}

/*--------------------------------------------------------------------------------------------*/

.card {
  background: linear-gradient(180deg, #141c2b, #0f1624);
  border: 1px solid rgba(120,160,220,0.22);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 18px 40px rgba(0,0,0,0.45);
}

/*--------------------------------------------------------------------------------------------*/

/* Make commissions cards match Earnings / Expenses cards */
.commissions-page > .card {
  background: linear-gradient(180deg, #141c2b, #0f1624);
  border: 1px solid rgba(120,160,220,0.22);
  border-radius: 22px;
  padding: 0px 18px 18px 18px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 18px 40px rgba(0,0,0,0.6);
}

/* Space between stacked cards (like Earnings / Expenses) */
.commissions-page > .card {
  margin-bottom: 18px;
}

.commissions-page > .card:last-child {
  margin-bottom: 0;
}

/*--------------------------------------------------------------------------------------------*/

.commissions-page > .card > h2 {
  margin: 0.83em 0;
  font-size: 1.5em;
  font-weight: 700;
}

.commissions-page input,
.commissions-page select {
  margin-top: 0;
}

.commissions-page .btn {
  margin-top: 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
}

.commissions-page #saveRentBtn,
.commissions-page #saveTaxBtn {
  margin-top: 12px;
}

.commissions-page .card > label,
.commissions-page .card > div > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: #b9d7ff;
  font-size: 13px;
}

.commissions-page .card > select {
  display: block;
  margin-bottom: 12px;
}

/*--------------------------------------------------------------------------------------------*/

/* Weekly Rent inputs – match commission form style */
#rent_amount,
#rent_date,
#tax_percent,
#tax_date,
#card_percent,
#card_fixed,
#card_cap,
#card_date,
#app_source,
#app_percent,
#app_fixed,
#app_date {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  color: #fff;
  outline: none;
}

/* Focus glow */
#rent_amount:focus,
#rent_date:focus,
#card_percent:focus,
#card_fixed:focus,
#card_cap:focus,
#card_date:focus,
#app_source:focus,
#app_percent:focus,
#app_fixed:focus,
#app_date:focus {
  border-color: #6fb1ff;
  box-shadow: 0 0 0 2px rgba(111,177,255,0.2);
}

/*-------------------------------------------------------------------------------*/

/* Keep form columns compact like Earnings */
#card_percent,
#card_fixed,
#card_cap,
#card_date,
#app_source,
#app_percent,
#app_fixed,
#app_date {
  max-width: 260px;
}

/*---------------------------Fees and Rules---------------------------------------*/

.rulesList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rulesHeading {
  margin: 18px 0 10px;
  font-size: 16px;
  color: var(--muted);
}

.ruleRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0e1522;
}

.ruleMain {
  font-weight: 600;
}

.ruleMeta {
  font-size: 12px;
  opacity: 0.65;
  margin-top: 2px;
}

.ruleEmpty {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 13px;
}

.feesStatus {
  margin-top: 12px;
  color: var(--muted);
}

@media (min-width: 700px) {
  #app[data-route="fees"] #viewRoot {
    max-width: 620px;
    padding-left: 24px;
    padding-right: 24px;
  }

  #app[data-route="fees"] .commissions-page {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }
}

/* Rule action buttons (❌ like Jobs) */
.ruleActions {
  display: flex;
  gap: 6px;
}

.iconBtn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #000000;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iconBtn:hover {
  background: #f0f0f0;
}

/*----------------------Type------------------------------------*/

.methodRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.methodBtn {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0e1522;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.methodBtn.active {
  background: var(--accent);
  color: #000;
}

/* =========================
   Account and admin pages
   ========================= */

.account-page,
.help-page {
  max-width: 920px;
}

.admin-page {
  max-width: 1080px;
}

.account-page h1,
.help-page h1,
.admin-page h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.15;
}

.account-page h2,
.help-page h2,
.admin-page h2 {
  margin-top: 0;
}

.account-page > .card,
.help-page > .card,
.help-card-grid > .card {
  background: linear-gradient(180deg, #141c2b, #0f1624);
  border: 1px solid rgba(120,160,220,0.22);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 18px 40px rgba(0,0,0,0.45);
}

.admin-page > .card {
  background: linear-gradient(180deg, #141c2b, #0f1624);
  border: 1px solid rgba(120,160,220,0.22);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 18px 40px rgba(0,0,0,0.45);
}

.account-page > .card > h2,
.help-page > .card > h2,
.help-card-grid > .card > h2 {
  margin: 0 0 0.83em;
  font-size: 1.5em;
  font-weight: 700;
}

.admin-page > .card > h2 {
  margin: 0 0 0.83em;
  font-size: 1.5em;
  font-weight: 700;
}

.account-page .btn,
.help-page .btn {
  margin-top: 0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
}

.admin-page .btn {
  margin-top: 0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
}

.admin-page .account-form input,
.admin-page .account-form select {
  margin-top: 0;
}

.admin-collapsible {
  padding: 0 !important;
  overflow: hidden;
}

.admin-collapse-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.5em;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.admin-collapse-toggle:hover,
.admin-collapse-toggle:focus-visible {
  background: rgba(77,163,255,0.08);
  outline: none;
}

.admin-collapse-chevron {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-right: 3px solid #9fc3ff;
  border-bottom: 3px solid #9fc3ff;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.admin-collapse-toggle[aria-expanded="true"] .admin-collapse-chevron {
  transform: rotate(225deg);
}

.admin-collapse-body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(120,160,220,0.16);
}

.admin-collapse-body > .muted {
  margin-top: 14px;
}

.admin-collapse-body > .account-form:first-child {
  margin-top: 16px;
}

@media (min-width: 900px) {
  #app[data-route="account"] #viewRoot {
    max-width: 920px;
  }

  #app[data-route="help"] #viewRoot {
    max-width: 920px;
  }

  #app[data-route="admin"] #viewRoot {
    max-width: 1080px;
  }

  #app[data-route="account"] .account-page,
  #app[data-route="help"] .help-page,
  #app[data-route="admin"] .admin-page {
    max-width: none;
  }
}

.account-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.account-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.account-inline-btn {
  width: auto;
  min-width: 150px;
  text-decoration: none;
  text-align: center;
}

.help-hero {
  display: grid;
  gap: 8px;
}

.help-card-grid {
  display: grid;
  gap: 14px;
}

.help-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.help-card p {
  margin: 0;
}

.manual-section ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.manual-section li + li {
  margin-top: 8px;
}

.licence-section {
  display: grid;
  gap: 10px;
  line-height: 1.5;
}

.licence-section h2,
.licence-section p {
  margin: 0;
}

.licence-section p,
.licence-section li {
  color: var(--muted);
}

.licence-section a,
.fare-routing-credit a {
  color: #a9cfff;
}

.contact-list {
  display: grid;
  gap: 10px;
}

.contact-link {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0e1522;
  color: var(--text);
  text-decoration: none;
}

.contact-link:hover,
.contact-link:focus-visible {
  border-color: rgba(77,163,255,0.8);
  outline: none;
}

.contact-link span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-link strong {
  overflow-wrap: anywhere;
}

@media (min-width: 760px) {
  .help-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.muted,
.meta,
.label {
  color: var(--muted);
}

.account-info-grid,
.account-stat-grid {
  display: grid;
  gap: 12px;
}

.account-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: center;
}

.info-tile {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0e1522;
}

.info-tile span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-tile strong {
  overflow-wrap: anywhere;
}

.account-form {
  display: grid;
  gap: 12px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.account-form label {
  display: grid;
  gap: 7px;
  color: #b9d7ff;
  font-size: 14px;
  font-weight: 600;
}

.account-form [hidden] {
  display: none !important;
}

.account-form input,
.account-form select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 16px;
  color: #fff;
  outline: none;
  margin-top: 0;
}

.account-form input:focus,
.account-form select:focus {
  border-color: #6fb1ff;
  box-shadow: 0 0 0 2px rgba(111,177,255,0.2);
}

.account-form select option {
  background: #ffffff;
  color: #000000;
}

.account-message {
  padding: 12px 14px;
  border-radius: 12px;
  text-align: center;
}

.account-message.success {
  background: rgba(61,220,151,0.16);
  color: #a8ffbf;
}

.account-message.error {
  background: rgba(255,107,107,0.16);
  color: #ffb1b1;
}

.auth-page {
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 0%, rgba(77,163,255,0.16), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(61,220,151,0.12), transparent 34%),
    var(--bg);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  border: 1px solid rgba(111,177,255,0.22);
  border-radius: 16px;
  background: rgba(17,24,38,0.96);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

.auth-hero {
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(77,163,255,0.14), rgba(61,220,151,0.08));
}

.auth-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 8vw, 40px);
  line-height: 1.06;
}

.auth-hero p {
  margin: 0;
  color: #c7d9ef;
  font-size: 18px;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 22px 24px 0;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #b9d7ff;
  font-weight: 700;
}

.auth-form [hidden] {
  display: none !important;
}

.auth-form input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 16px;
  outline: none;
  padding: 13px 14px;
}

.auth-form input:focus {
  border-color: #6fb1ff;
  box-shadow: 0 0 0 2px rgba(111,177,255,0.2);
}

.auth-submit {
  min-height: 48px;
}

.legal-note {
  margin: 16px 24px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.legal-note a {
  color: #cfe2ff;
  font-weight: 700;
}

.auth-secondary-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin: 16px 24px 24px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  color: #cfe2ff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.privacy-copy {
  display: grid;
  gap: 10px;
  line-height: 1.55;
}

.privacy-copy h2 {
  margin: 10px 0 0;
}

.account-page > .privacy-copy > h2 {
  margin: 10px 0 0;
}

.privacy-copy p {
  margin: 0;
  color: var(--muted);
}

.admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.search-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.search-input-wrap {
  position: relative;
  display: block;
}

.search-input-wrap input {
  padding-right: 42px;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  display: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #cfe2ff;
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}

.search-clear.is-visible {
  display: grid;
  place-items: center;
}

.search-clear:hover,
.search-clear:focus {
  background: rgba(255,255,255,0.1);
  outline: none;
}

.checkbox-row.admin-checkbox {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
}

.checkbox-row.admin-checkbox input {
  width: auto;
}

.admin-user-list {
  display: grid;
  gap: 10px;
}

.admin-source-add {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 12px;
}

.admin-source-list {
  display: grid;
  gap: 8px;
}

.admin-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(120,160,220,0.22);
  border-radius: 12px;
  background: #0e1522;
}

.admin-source-row.protected {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 46px;
  padding: 9px 12px;
}

.admin-source-row input {
  margin: 0;
}

.admin-source-row .btn {
  width: auto;
  white-space: nowrap;
}

.admin-user-card {
  border: 1px solid rgba(120,160,220,0.22);
  border-radius: 14px;
  background: #0e1522;
  overflow: hidden;
}

.admin-user-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.admin-user-toggle strong,
.admin-user-toggle .meta {
  display: block;
}

.admin-user-toggle .meta {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.admin {
  background: rgba(77,163,255,0.18);
  color: #9fc3ff;
}

.pill.member {
  background: rgba(61,220,151,0.14);
  color: #a8ffbf;
}

.admin-user-body {
  display: none;
  gap: 14px;
  padding: 0 13px 13px;
}

.admin-user-card.is-open .admin-user-body {
  display: grid;
}

.danger-btn {
  background: rgba(163,75,75,0.25);
  border-color: rgba(255,120,120,0.4);
  color: #ffb1b1;
}

@media (max-width: 720px) {
  .account-hero,
  .admin-user-toggle {
    grid-template-columns: 1fr;
    display: grid;
  }

  .account-info-grid,
  .account-stat-grid,
  .admin-grid,
  .admin-source-add,
  .search-row {
    grid-template-columns: 1fr;
  }

  .admin-source-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 5px;
    padding: 6px;
  }

  .admin-source-row .btn {
    min-width: 0;
    padding: 10px 8px;
    font-size: 13px;
  }

  .account-inline-btn {
    width: 100%;
  }

  .admin-collapse-toggle {
    padding: 15px 16px;
    font-size: 1.25em;
  }
}
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

h2{ margin: 0 0 10px; font-size: 16px; }

.grid2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label{ font-size: 12px; color: var(--muted); }
input, textarea, select{
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0e1522;
  color: var(--text);
  font-size: 16px;
}

textarea{ resize: vertical; }

.btn{
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(77,163,255,0.35);
  background: rgba(77,163,255,0.18);
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
}

.muted{ color: var(--muted); }

.expenseItem{
  border-top: 1px solid var(--border);
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.methodRow, .expencesRow{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.sourceRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.sourceRow .srcBtn {
  flex: 0 1 calc((100% - 16px) / 3);
}

.sourceOptionalRow {
  margin-bottom: 8px;
}

.sourceFixedRow {
  margin-bottom: 10px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title-row h2 {
  margin: 0;
  margin-right: auto;
}

.card-settings-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9fc3ff;
  font-size: 24px;
  cursor: pointer;
}

.card-settings-btn:hover,
.card-settings-btn:focus {
  background: rgba(77,163,255,0.14);
  outline: none;
}

.card-action-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 560px) {
  .card-settings-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 20px;
  }

  .card-action-icon {
    width: 19px;
    height: 19px;
  }
}

.source-settings-help {
  margin: 0 0 12px;
}

.source-settings-list {
  display: grid;
  gap: 8px;
  max-height: min(55vh, 440px);
  overflow-y: auto;
}

.source-settings-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0e1522;
}

.source-settings-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.source-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.source-settings-actions .btn {
  margin-top: 0;
}

.expencesRow {
  align-items: end;
}

.expencesRow > label {
  display: flex;
  flex-direction: column;
}

.expencesRow .btn {
  margin-top: 6px;
  height: 40px;        /* match input height */
  padding: 0 18px;     /* vertical centering */
}

.rangeRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rangeRow .btn {
  grid-column: 1 / -1;
}

.srcBtn, .methodBtn{
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0e1522;
  color: var(--text);
  font-weight: 600;
}

.srcBtn.active, .methodBtn.active{
  background: var(--accent);
  color: #000;
}

.divider{
  height: 1px;
  background: var(--border);
  margin: 10px 0;
  opacity: 0.5;
}

.methodBtn[data-method="account"] {
  color: #4dff88; 
}

.methodBtn[data-method="card"] {
  color: #4dff88;   
}

.methodBtn[data-method="cash"] {
  color: #4dff88;
}

/* When selected, keep colour but invert background */
.methodBtn.active[data-method="account"] {
  background: #4dff88;
  color: #000;
}

.methodBtn.active[data-method="card"] {
  background: #4dff88;
  color: #000;
}

.methodBtn.active[data-method="cash"] {
  background: #4dff88;
  color: #000;
}

.reportGrid{
  display:grid;
  grid-template-columns: repeat(3,1fr);
  gap:12px;
}

.label{
  font-size:12px;
  opacity:0.7;
}

.big{
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  display: block;
  width: 100%;
}

.reportGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
}

.reportGrid > div{
  min-width: 0;
}

#repFees{
  max-width: 100%;
}

.row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 5px 0px 10px;
  border-bottom:1px solid var(--border);
}

.row small {
  opacity:0.6;
}

.row button {
  margin-left:6px;
}

.amount {
  font-weight:600;
}

.amountsPair {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  text-align: right;
}

.grossAmount,
.netAmount {
  font-weight: 600;
}

.amountArrow {
  opacity: 0.7;
}

.addRow {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.addMainRow {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: stretch;
}

.addMainRow input {
  margin-top: 0;
  height: 44px;
  box-sizing: border-box;
}

.addMainRow .btn {
  margin-top: 0;
  height: 44px;
  box-sizing: border-box;
}

.addMainRow3 {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 3fr 2fr 3fr;
  gap: 6px;
  align-items: stretch;
}

.addMainRow3 input {
  margin-top: 0;
  height: 44px;
  box-sizing: border-box;
}

.addMainRow3 .btn {
  margin-top: 0;
  height: 44px;
  box-sizing: border-box;
}

#extrasAmount {
  margin-top: 0;
  box-sizing: border-box;
}

#addEarningBtn {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none; /* iOS */
}

.manualFeeRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.manualFeeRow #commissionPercent,
.manualFeeRow #manualFeeAmount {
  margin-top: 0;
}

.manualFeeRow #commissionPercent {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0e1522;
  color: var(--text);
  box-sizing: border-box;
}

#commissionModeSelect {
  color: rgba(255,255,255,0.4);
}

.footer-link {
  text-align: center;
  margin-top: 0px;
  padding-bottom: 30px;
}

.footer-link a {
  color: #6fb1ff;
  text-decoration: none;
  font-size: 16px;
  opacity: 0.85;
}

.footer-link a:hover {
  opacity: 1;
  text-decoration: underline;
}

.job-highlight {
  background: rgba(77, 255, 136, 0.25);
  box-shadow: 0 0 0 2px rgba(77, 255, 136, 0.45);
  border-radius: 10px;
  transition: background 0.6s ease, box-shadow 0.6s ease;
}

.jobActions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.jobActions input {
  margin-top: 0;
  height: 40px;
  box-sizing: border-box;
  text-align: center;
}

.jobActions input[readonly] {
  opacity: 0.85;
}

.jobEditFields {
  display: flex;
  align-items: center;
  gap: 6px;
}

.saveJob,
.cancelJob,
.delJob {
  height: 40px;
  padding: 0 4px;
  border-radius: 10px;
  border: 0px solid var(--border);
  background: transparent;
  color: var(--text);
}

.editJob {
  height: 32px;
  padding: 0 0px;
  border-radius: 10px;
  border: 0px solid var(--border);
  background: transparent;
  color: var(--text);
}

.saveExp,
.delExp {
  height: 40px;
  padding: 0 4px;
  border-radius: 10px;
  border: 0px solid var(--border);
  background: transparent;
  color: var(--text);
}

/* ---------- Modal ---------- */

.clickable {
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;

  /* animation */
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modalCard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 92%;
  max-width: 420px;
  padding: 14px;

  /* animation */
  transform: translateY(0) scale(1);
  transition: transform 0.25s ease;
}

.modal.hidden .modalCard {
  transform: translateY(12px) scale(0.98);
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modalHeader button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.summaryRow {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.summaryRow:last-child {
  border-bottom: none;
}

.summaryRow .amount {
  font-weight: 600;
}

.jobSourceGroup {
  border-bottom: 1px solid var(--border);
}

.jobSourceGroup:last-child {
  border-bottom: none;
}

.jobSourceGroup .summaryRow {
  border-bottom: none;
}

.jobSourceRow {
  cursor: pointer;
  align-items: center;
  gap: 12px;
}

button.jobSourceRow {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.jobSourceRow:focus-visible {
  outline: 2px solid #4dff88;
  outline-offset: 2px;
  border-radius: 4px;
}

.jobMethodBreakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 0 12px;
}

.jobMethodBreakdown[hidden] {
  display: none;
}

.jobMethodToggle {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.jobMethodToggle:focus-visible {
  outline: 2px solid #4dff88;
  outline-offset: 4px;
  border-radius: 4px;
}

.jobMethodToggle.isExcluded {
  color: var(--muted);
  opacity: 0.45;
}

/* ---------- Jobs Search ---------- */

.jobsSearchFilters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.jobsSearchFilters > label {
  display: flex;
  flex-direction: column;
}

.jobsFilterGroup {
  grid-column: 1 / -1;
}

.jobsFilterLabel {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.jobsChipGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.jobsMethodGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.jobsChipGrid label {
  min-width: 0;
  display: block;
  color: var(--text);
  font-size: 14px;
}

.jobsChipGrid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.jobsChipGrid span {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0e1522;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.jobsChipGrid input:checked + span {
  background: var(--accent);
  color: #000;
}

.jobsChipGrid input:focus-visible + span {
  outline: 2px solid #4dff88;
  outline-offset: 2px;
}

.jobsResultsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.jobsResultsTotals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  text-align: right;
  white-space: nowrap;
}

.jobsResultsHeader h2 {
  margin-bottom: 0;
}

.jobSearchRow {
  gap: 10px;
}

.jobSearchMeta {
  min-width: 0;
}

.jobDateGroup {
  margin: 14px 0 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.jobDateGroup:first-child {
  margin-top: 0;
}

.jobDateLink {
  border: 0;
  padding: 0;
  background: transparent;
  color: #6fb1ff;
  font-weight: 700;
  font-size: inherit;
  text-decoration: none;
  cursor: pointer;
}

.jobDateLink:hover {
  color: #9fd0ff;
}

.jobsSearchPage .jobActions input {
  width: 70px;
}

.jobsSearchPage .jobEditFields input {
  width: 70px;
}

@media (max-width: 560px) {
  .jobsSearchFilters {
    grid-template-columns: 1fr;
  }

  .jobSearchRow {
    align-items: center;
    flex-direction: row;
  }

  .jobsSearchPage .jobActions {
    width: auto;
    justify-content: flex-end;
  }
}

.jobMethodToggle.isExcluded .label {
  opacity: 1;
}

.jobMethodBreakdown > div,
.jobMethodBreakdown > button {
  min-width: 0;
  text-align: center;
}

.jobMethodBreakdown .label + div {
  white-space: nowrap;
}

/* Day planner */
.planner-page {
  display: grid;
  gap: 12px;
}

.planner-timeline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.planner-timeline-heading h2 {
  margin-bottom: 0;
}

.planner-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.planner-title-field {
  grid-column: 1 / -1;
}

.planner-auto-textarea {
  min-height: 44px;
  overflow: hidden;
  resize: none;
  line-height: 1.35;
  white-space: pre-wrap;
}

.planner-modal-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px;
}

.planner-global-option {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(77,255,136,0.35);
  border-radius: 12px;
  background: rgba(77,255,136,0.08);
  color: #a8ffbf;
  cursor: pointer;
}

.planner-global-option input {
  width: auto;
  margin: 0;
  accent-color: #4dff88;
}

.planner-modal-actions .btn {
  margin-top: 0;
}

.planner-cancel {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

.planner-modal-card {
  max-width: 480px;
}

.planner-timeline-card {
  padding: 14px 0 0;
  overflow: hidden;
}

.planner-timeline-heading {
  padding: 0 14px 14px;
}

.planner-scroll {
  position: relative;
  height: min(68vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.025), transparent 72px),
    #0c131f;
}

.planner-times,
.planner-events {
  position: relative;
  min-height: 1728px;
}

.planner-hour {
  position: absolute;
  left: 0;
  right: 0;
  height: 72px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.planner-hour span {
  position: absolute;
  top: -9px;
  left: 12px;
  width: 48px;
  padding-right: 6px;
  background: #0c131f;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.planner-events {
  position: absolute;
  top: 0;
  left: 72px;
  right: 12px;
}

.planner-event {
  position: absolute;
  z-index: 2;
  min-height: 36px;
  overflow: hidden;
  padding: 7px 32px 7px 10px;
  border: 1px solid rgba(41,215,255,0.58);
  border-left: 4px solid var(--planner-personal);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(41,215,255,0.34), rgba(61,220,151,0.18));
  box-shadow: 0 5px 16px rgba(0,0,0,0.25);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.planner-event:hover,
.planner-event:focus-within {
  z-index: 3;
}

.planner-event-global {
  border-color: rgba(77,255,136,0.72);
  border-left-color: #4dff88;
  background: linear-gradient(135deg, rgba(77,255,136,0.34), rgba(31,143,87,0.22));
}

.planner-event-readonly {
  cursor: default;
}

.planner-event strong,
.planner-event span,
.planner-event small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-event span,
.planner-event small {
  margin-top: 2px;
  color: #c7d9ef;
  font-size: 11px;
}

.planner-now {
  position: absolute;
  left: 64px;
  right: 0;
  z-index: 4;
  height: 2px;
  background: #ffd35e;
  box-shadow: 0 0 8px rgba(255,211,94,0.65);
}

.planner-now span {
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd35e;
}

@media (max-width: 560px) {
  .planner-form {
    grid-template-columns: 1fr 1fr;
  }

  .planner-scroll {
    height: 65vh;
  }
}

/* SPA compatibility layer */
[hidden] {
  display: none !important;
}

.icon-button {
  justify-self: start;
  background: transparent;
  border: 0;
  color: #9fc3ff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 18px;
  cursor: pointer;
}

#topbarTitle {
  grid-column: 2;
  justify-self: center;
  min-width: min(420px, 58vw);
}

#app[data-route="report"] #topbarTitle {
  min-width: 0;
}

#calendarButton {
  grid-column: 1;
}

.topbar-row > .auth-menu {
  grid-column: 3;
  justify-self: end;
}

.menu-dropdown[hidden] {
  display: none;
}

#appMenu:not([hidden]) {
  display: block;
}

.menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 13px 15px;
  color: #e8eef7;
  text-align: left;
  text-decoration: none;
  font-size: 16px;
  cursor: pointer;
}

.menu-dropdown button:hover,
.menu-dropdown button:focus-visible,
.menu-dropdown a:hover,
.menu-dropdown a:focus-visible {
  background: rgba(255,255,255,0.08);
  outline: none;
}

.menu-dropdown .menu-group-start {
  border-top: 1px solid rgba(120,160,220,0.18);
}

.menu-icon {
  width: 26px;
  flex: 0 0 26px;
  color: #9fc3ff;
  line-height: 1;
  text-align: center;
}

.menu-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 420px) {
  .menu-dropdown {
    width: min(190px, calc(100vw - 24px));
    min-width: 0;
  }

  .menu-dropdown button,
  .menu-dropdown a {
    gap: 10px;
    padding: 11px 12px;
    font-size: 14px;
  }

  .menu-icon {
    width: 22px;
    flex-basis: 22px;
  }

  .menu-icon svg {
    width: 21px;
    height: 21px;
  }
}

.route-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.route-title h2 {
  margin: 0;
}

.link-button {
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: #9fc3ff;
  font-weight: 700;
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 5px 0 10px;
  border-bottom: 1px solid var(--border);
}

.data-row small {
  opacity: 0.6;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.row-actions input {
  width: 74px;
  margin-top: 0;
}

.row-actions button {
  min-width: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0e1522;
  color: var(--text);
  padding: 7px 9px;
}

.amount-read {
  white-space: nowrap;
  text-align: right;
}

.auth-submit {
  width: 100%;
}

@media (max-width: 560px) {
  .data-row {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions input {
    width: 100%;
  }
}

/* Receipt page copied from the legacy standalone receipt. */
#app[data-route="receipt"] #viewRoot {
  max-width: none;
  padding: 20px;
  background: linear-gradient(180deg, #091018 0%, #0f1724 100%);
}

#app[data-route="receipts"] #viewRoot {
  max-width: 920px;
  padding: 20px;
}

.receipt-page {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  color: #e8eef7;
}

.receipt-header {
  text-align: center;
  padding: 12px 0 4px;
}

.receipt-header h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

.receipt-header p {
  margin: 8px 0 0;
  color: #9fb0c7;
}

.receipt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.receipt-editor-stack,
.receipt-jobs-container {
  display: grid;
  gap: 18px;
  align-content: start;
}

.receipt-card {
  background: linear-gradient(180deg, #141c2b, #0f1624);
  border: 1px solid rgba(120,160,220,0.22);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 40px rgba(0,0,0,0.45);
  padding: 20px;
}

.receipt-card h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.receipt-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.receipt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.receipt-field.full {
  grid-column: 1 / -1;
}

.receipt-split-row,
.receipt-job-money-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.receipt-parking-total {
  display: none;
}

.receipt-page label {
  font-size: 14px;
  color: #b9d7ff;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.receipt-page input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: white;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  min-width: 0;
  margin: 0;
}

.receipt-page input[type="number"],
.receipt-page input.money-input {
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 18px;
}

.receipt-page input:focus {
  border-color: #6fb1ff;
  box-shadow: 0 0 0 2px rgba(111,177,255,0.22);
}

.receipt-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.receipt-add-job-card {
  padding: 14px 20px;
}

.receipt-add-job-card button {
  width: 100%;
}

.receipt-saved-btn {
  width: 100%;
  margin-top: 12px;
}

.receipt-page button {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.receipt-page button:hover {
  transform: translateY(-1px);
}

.receipt-page button:disabled,
.receipt-list-page button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.receipt-primary,
.receipt-actions button {
  background: linear-gradient(135deg, #4da3ff, #2d79ff);
  color: #041423;
}

.receipt-actions button {
  border: 0;
}

.receipt-delete-btn {
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(255,107,107,0.42) !important;
  background: rgba(255,107,107,0.12) !important;
  color: #ffb1b1 !important;
}

.receipt-confirmation-card {
  max-width: 360px;
  padding: 22px;
  text-align: center;
}

.receipt-confirmation-card h2 {
  margin: 0 0 10px;
}

.receipt-confirmation-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.receipt-confirmation-card button {
  width: 100%;
}

.receipt-secondary {
  background: rgba(255,255,255,0.08);
  color: #e8eef7;
  border: 1px solid rgba(255,255,255,0.1);
}

.receipt-job-card-header {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 220px);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.receipt-job-card-header h2 {
  margin: 0;
}

.receipt-job-date-field {
  min-width: 0;
}

.receipt-job-date-field label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.receipt-job-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

.receipt-job-money-row {
  gap: 12px;
}

.receipt-remove-job-btn {
  white-space: nowrap;
  width: 100%;
  margin-top: 20px;
}

.receipt-jobs-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.receipt-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.receipt-paper {
  background: white;
  color: #111;
  border-radius: 18px;
  padding: 24px;
  min-height: 560px;
  box-shadow: 0 16px 34px rgba(0,0,0,0.35);
}

.receipt-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 2px solid #edf2f7;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.receipt-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-align: center;
  width: 100%;
}

.receipt-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1557a1;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.receipt-table td {
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
}

.receipt-table td:first-child {
  width: 38%;
  color: #5a6472;
  font-weight: 600;
}

.receipt-preview-jobs {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.receipt-totals {
  margin-top: 22px;
  margin-left: auto;
  max-width: 340px;
  border: 1px solid #dfe8f2;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,36,0.08);
}

.receipt-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  background: #fcfdff;
  font-size: 15px;
}

.receipt-totals-row span {
  color: #4b5563;
  font-weight: 600;
}

.receipt-totals-row strong {
  color: #111827;
  font-weight: 700;
}

.receipt-totals-row.total-row {
  border-bottom: 0;
  border-top: 2px solid #d7e7fb;
  background: #eef6ff;
  padding-top: 16px;
  padding-bottom: 16px;
}

.receipt-totals-row.total-row span {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.receipt-totals-row.total-row strong {
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  color: #0b3f7a;
}

.receipt-help {
  color: #9fb0c7;
  font-size: 13px;
  line-height: 1.45;
}

.receipt-status {
  min-height: 20px;
  color: #7cc4ff;
  font-size: 14px;
  font-weight: 600;
  margin-top: 16px;
}

.receipt-list-page,
.receipt-list {
  display: grid;
  gap: 10px;
}

.departures-page {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.departures-header {
  text-align: center;
  padding: 12px 0 4px;
}

.departures-header h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

.departures-header p {
  margin: 8px 0 0;
  color: #9fb0c7;
}

.departures-list {
  display: grid;
  gap: 10px;
}

.departures-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 11px 14px;
  border-left: 4px solid #4dff88;
  border-radius: 14px;
  color: #e8eef7;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.departures-card:hover,
.departures-card:focus-visible {
  border-left-color: #9fc3ff;
  background: linear-gradient(180deg, #192438, #121c2d);
  outline: none;
  transform: translateY(-1px);
}

.departures-card:focus-visible {
  box-shadow: 0 0 0 2px #9fc3ff, inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 40px rgba(0,0,0,0.45);
}

.departures-card-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #4dff88;
}

.departures-card-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.departures-card strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.departures-card-action {
  border-radius: 10px;
  padding: 10px 16px;
  background: #242d3e;
  color: #e8eef7;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 780px) {
  #app[data-route="departures"] #viewRoot {
    padding: 14px;
  }
}

@media (max-width: 420px) {
  .departures-card {
    gap: 10px;
  }

  .departures-card-action {
    padding: 8px 12px;
    font-size: 13px;
  }
}

.receipt-list-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.receipt-list-header h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

.receipt-list-header p,
.receipt-empty p {
  margin: 7px 0 0;
  color: #9fb0c7;
}

.receipt-list-header button,
.receipt-list-main button {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.receipt-list-item {
  padding: 11px 14px;
  border-left: 4px solid #4da3ff;
  border-radius: 14px;
}

.receipt-list-item.is-paid {
  border-left-color: #4dff88;
}

.receipt-list-main {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
}

.receipt-list-main time {
  color: #9fb0c7;
  font-size: 13px;
  white-space: nowrap;
}

.receipt-list-name {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-list-total {
  min-width: 76px;
  font-size: 16px;
  text-align: right;
  white-space: nowrap;
}

.receipt-paid-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9fb0c7;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.receipt-paid-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.receipt-paid-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: #77808c;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.receipt-paid-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f4f7fb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.45);
  transition: transform 0.18s ease;
}

.receipt-paid-control input:checked + .receipt-paid-switch {
  border-color: rgba(77,255,136,0.55);
  background: #27965a;
}

.receipt-paid-control input:checked + .receipt-paid-switch::after {
  transform: translateX(18px);
}

.receipt-paid-control input:focus-visible + .receipt-paid-switch {
  outline: 2px solid #9fc3ff;
  outline-offset: 2px;
}

.receipt-paid-control input:disabled + .receipt-paid-switch {
  opacity: 0.55;
}

@media (max-width: 780px) {
  #app[data-route="receipt"] #viewRoot {
    padding: 14px;
  }

  .receipt-grid {
    grid-template-columns: 1fr;
  }

  .receipt-paper {
    padding: 18px;
  }

  .receipt-jobs-header {
    align-items: stretch;
  }

  .receipt-jobs-header .receipt-secondary {
    width: 100%;
  }

  .receipt-totals {
    max-width: 100%;
  }

  .receipt-totals-row.total-row strong {
    font-size: 28px;
  }

  #app[data-route="receipts"] #viewRoot {
    padding: 14px;
  }

  .receipt-list-header {
    align-items: stretch;
    flex-direction: column;
  }

  .receipt-list-header button {
    width: 100%;
  }

  .receipt-list-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
  }

  .receipt-list-main time {
    grid-column: 1;
    grid-row: 1;
  }

  .receipt-list-name {
    grid-column: 2;
    grid-row: 1;
    text-align: center;
  }

  .receipt-list-total {
    grid-column: 3;
    grid-row: 1;
  }

  .receipt-list-main button {
    grid-column: 1 / span 2;
    grid-row: 2;
    justify-self: start;
  }

  .receipt-paid-control {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
  }
}

@media (max-width: 420px) {
  .receipt-job-card-header {
    grid-template-columns: 1fr minmax(135px, 150px);
  }
}

@media print {
  #app[data-route="receipt"] {
    background: white;
  }

  #app[data-route="receipt"] > .topbar,
  #app[data-route="receipt"] .receipt-header,
  #app[data-route="receipt"] .receipt-card:not(.receipt-preview-card) {
    display: none !important;
  }

  #app[data-route="receipt"] #viewRoot,
  #app[data-route="receipt"] .receipt-page,
  #app[data-route="receipt"] .receipt-grid,
  #app[data-route="receipt"] .receipt-preview-card,
  #app[data-route="receipt"] .receipt-preview {
    display: block !important;
    max-width: none;
    background: white;
  }

  #app[data-route="receipt"] #viewRoot,
  #app[data-route="receipt"] .receipt-preview-card {
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  #app[data-route="receipt"] .receipt-paper {
    box-shadow: none;
    border-radius: 0;
    min-height: auto;
  }
}
