/* «Resor» (admin/taxi/rides.html), round 47, panel redesign R6.
   The page pattern (page.css) for the header, the figures, the bar, the cards and the dialogs; below, the capsule tabs, the
   waiting rides with «Föreslå nytt pris» (support's daily list, first on the page), the large figures, the list beside the
   ride, the receipt, the log and «Kvitton». Colours only through the tokens (tokens.css, page.css): the accent classes amber,
   violet and green carry their own light and dark values, so both themes follow the sun/moon button. Bigger, calmer type
   (owner, note 86): body text 15 px and up, labels and chips 14 px, the figures far larger than their labels. */
[hidden] { display: none !important; }

/* the page's small line icons (24x24, stroke currentColor); an arrow points the way the page reads */
.ic { width: 18px; height: 18px; flex: none; }
html[dir="rtl"] .ic-dir { transform: scaleX(-1); }

/* ---- the header ---- */
.pg-head .pg-sub { font-size: 16px; line-height: 1.5; }
.pg-head .pg-btn { min-height: 42px; padding: 9px 20px; font-size: 15px; }

/* ---- the two views («Alla resor», «Kvitton») as capsule tabs ---- */
.rides-tabs { border-radius: var(--radius-full); padding: 5px; gap: 4px; margin-block-end: 20px; }
.rides-tabs .pg-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 22px; border-radius: var(--radius-full); font-size: 15px; }
.rides-tabs .pg-tab:focus-visible, .pg-kpi:focus-visible, .wait-code:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- the buttons, the notes and the empty and error states ---- */
.pg-btn.sm { min-height: 38px; padding: 7px 16px; font-size: 15px; }
.pg-note { font-size: 15px; }
.pg-empty { font-size: 16px; line-height: 1.5; }
.pg-card-title { font-size: 17px; }
.pg-card-sub { font-size: 15px; line-height: 1.5; }
.pg-list-foot { font-size: 15px; }
.pg-list:empty { display: none; }
.rides-state { margin: 12px; }
.mini { font-size: 15px; line-height: 1.5; color: var(--pg-muted); overflow-wrap: anywhere; }

/* ---- «Väntande resor» (round 28): first on the page, an amber edge; one row per ride, its facts, its price proposal and
   «Föreslå nytt pris» at the row's end (under it on a phone) ---- */
.waiting-card { margin-block-end: 20px; border-inline-start: 4px solid var(--a2); }
.wait-head { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.wait-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 42px; height: 42px; border-radius: var(--radius-full);
  color: var(--a); background: var(--a-bg); border: 1px solid var(--a-line); }
.wait-ico svg { width: 21px; height: 21px; }
.waiting-card .pg-card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 19px; }
.waiting-card .pg-card-title .pg-chip { font-size: 15px; padding: 3px 12px; font-variant-numeric: tabular-nums; }
.waiting-msg { margin: 14px 22px 4px; }
.waiting-card .pg-empty { padding: 26px 22px; }
.wait-row { padding: 16px 22px; border-block-end: 1px solid var(--pg-line); min-width: 0; }
.wait-row:last-child { border-block-end: 0; }
.wait-code { padding: 0; border: 0; background: none; color: var(--pg-text); font: inherit; font-size: 17px; font-weight: 800; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; border-radius: 6px; }
.wait-row .pg-row-line { margin-top: 6px; font-size: 16px; font-weight: 600; }
.wait-row .pg-row-sub { margin-top: 4px; font-size: 15px; }
.wait-proposal { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 14px; border-radius: 14px;
  background: var(--pg-inner); border: 1px solid var(--pg-line); font-size: 15px; overflow-wrap: anywhere; }
.wait-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wait-acts .pg-btn { min-height: 42px; padding: 9px 18px; }
[data-countdown] { font-variant-numeric: tabular-nums; }
@media (min-width: 761px) {
  .wait-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: start; }
  .wait-row > * { grid-column: 1; }
  .wait-row > .wait-acts { grid-column: 2; grid-row: 1 / span 5; align-self: center; margin-top: 0; flex-direction: column; align-items: stretch; }
}
/* beside a long waiting list the search stays near: the list scrolls in its card on a desktop */
@media (min-width: 901px) { .wait-list { max-height: min(560px, 62vh); overflow-y: auto; } }

/* ---- the figures: the server's own counts, a tap filters the list ---- */
.rides-kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-block-end: 20px; }
.rides-kpis .pg-kpi { gap: 6px; padding: 20px 22px 18px; }
.rides-kpis .pg-kpi-value { font-size: 40px; line-height: 1.05; margin-block: 6px 2px; }

/* ---- the search bar ---- */
.pg-bar input, .pg-bar select { min-height: 42px; font-size: 15px; }

/* ---- the list and the ride side by side (page.css .pg-split), each card scrolling on its own on a desktop (admin.css makes
   the body the scroller, so a sticky pane cannot do it); on a phone the ride under the list ---- */
@media (min-width: 901px) { .rides-layout > .pg-card { max-height: calc(100vh - 32px); overflow-y: auto; } }
@media (max-width: 900px) {
  /* nothing chosen: on a phone the ride's card is not drawn under the list, where it would only say «Välj en resa» */
  .rides-layout > [data-part="ride-detail"][data-open="0"] { display: none; }
}
.rides-layout .pg-row { padding-block: 14px; }
.rides-layout .pg-row-title { font-size: 16px; }
.rides-layout .pg-row-line { font-size: 15px; }
.rides-layout .pg-row-sub { font-size: 15px; }

/* ---- the ride ---- */
.detail-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.section-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--pg-muted); margin: 22px 0 10px; }
html[dir="rtl"] .section-title { letter-spacing: 0; }
.box { padding: 14px 16px; border-radius: 14px; background: var(--pg-inner); border: 1px solid var(--pg-line); font-size: 15px; }
.pg-facts.lines, .pg-facts.lines dt, .pg-facts.lines dd { font-size: 15px; }
.pg-facts.lines { gap: 10px 18px; }
.receipt .line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.receipt .line span:first-child { color: var(--pg-muted); }
.receipt .line > :last-child { text-align: end; overflow-wrap: anywhere; min-width: 0; }
.intervene { margin-block-end: 16px; border-color: var(--a-line); background: var(--a-bg); }
.intervene .section-title { margin-top: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.result { font-size: 15px; font-weight: 600; color: var(--a); margin: 10px 0 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--pg-line); font-size: 15px; line-height: 1.45; }
.timeline .when { color: var(--pg-muted); font-variant-numeric: tabular-nums; }
.timeline .what { color: var(--pg-text); overflow-wrap: anywhere; }
.timeline .who { display: block; color: var(--pg-muted); margin-top: 2px; }
.capture-note { font-size: 15px; color: var(--a); margin: 6px 0 10px; }
.notes { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notes:empty { display: none; }
.notes li { padding: 10px 14px; border-radius: 14px; background: var(--pg-inner); border: 1px solid var(--pg-line); font-size: 15px; }
.notes .body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--pg-text); }
.notes .by { display: block; color: var(--pg-muted); margin-top: 3px; }
.proposals .prop-top { display: flex; justify-content: space-between; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.proposals .prop-top strong { color: var(--pg-text); }
.form-control { font-size: 15px; }
textarea.form-control { min-height: 76px; }
.note-form .actions { margin-top: 8px; }
.fee { margin-bottom: 14px; }
.fee div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.back-to-list { display: none; }
.modal-body > .mini { margin: 0 0 14px; }

/* ---- «Kvitton»: one row per receipt ---- */
.receipt-list { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.receipt-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px;
  background: var(--pg-inner); border: 1px solid var(--pg-line); }
.receipt-card > div { min-width: 0; }
.receipt-card .row-code { font-size: 16px; font-weight: 800; color: var(--pg-text); }
.receipt-meta { font-size: 15px; color: var(--pg-muted); margin-top: 3px; overflow-wrap: anywhere; }

@media (max-width: 900px) { .back-to-list { display: inline-flex; } }
@media (max-width: 760px) {
  .wait-row { padding-inline: 16px; }
  .waiting-msg { margin-inline: 16px; }
  .wait-acts .pg-btn { flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .rides-tabs { display: flex; width: 100%; }
  .rides-tabs .pg-tab { flex: 1 1 0; justify-content: center; padding-inline: 14px; min-height: 44px; }
  .rides-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rides-kpis .pg-kpi { padding: 16px 14px 14px; }
  .rides-kpis .pg-kpi-value { font-size: 32px; }
  .wait-head { gap: 12px; }
  .wait-ico { width: 38px; height: 38px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* «Tillbaka till listan» to the list card (its ride behind the first 50 rows): its heading clear of the sticky top bar */
[data-part="list-card"] { scroll-margin-top: calc(var(--shell-topbar-h, 56px) + 8px); }
