/* pages-rental.css – bookings, booking form, rental file, calendar (Belegungsplan), planner, fleet & pricing lists. Tokens only. */
.rs { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 650; white-space: nowrap;
  color: var(--ct, var(--c, var(--text-2))); background: color-mix(in srgb, var(--c, var(--text-3)) 13%, transparent); vertical-align: middle; }
.rs::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rs-request { --c: var(--st-request); } .rs-reserved { --c: var(--st-reserved); } .rs-confirmed { --c: var(--st-confirmed); } .rs-active { --c: var(--st-active); }
.rs-returned { --c: var(--st-returned); } .rs-closed { --c: var(--st-closed); } .rs-cancelled { --c: var(--st-cancelled); } .rs-overdue { --c: var(--st-overdue); }
/* text colour where the state colour itself is too light for text (WCAG AA on the tinted pill) */
.rs-reserved { --ct: var(--warning); } .rs-cancelled { --ct: var(--text-3); } [data-mode="dark"] .rs-confirmed { --ct: var(--primary); }
.plate { display: inline-flex; align-items: center; height: 22px; padding: 0 7px 0 12px; border: 1.5px solid var(--text); border-radius: 4px; font-weight: 700; font-size: 12px; letter-spacing: .04em;
  background: linear-gradient(90deg, #1d4ed8 0 7px, var(--surface) 7px); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
a .plate { color: var(--text); }
.ok-t { color: var(--success); font-weight: 600; } .err-t { color: var(--danger); font-weight: 600; }
.form-sec { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.form-grid > .form-sec:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.page-head.sub-head { margin: 4px 0 12px; } .page-head.sub-head h2 { font-size: var(--fs-lg); }
.price-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--primary-soft); margin: 0 0 12px; }
.price-total span { font-size: var(--fs-sm); color: var(--text-2); font-weight: 600; } .price-total b { font-size: 26px; letter-spacing: -.02em; color: var(--primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt { margin-top: var(--gap); }
.kpi.warn-k { background: var(--warning-bg); border-color: transparent; }
.stack > .card + .card, .stack > section + section { margin-top: var(--gap); }

/* driver checks */
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.checks li, .checks.ok { display: flex; flex-direction: row; align-items: center; gap: 6px; } .checks li.error { color: var(--danger); font-weight: 600; } .checks li.warn { color: var(--warning); } .checks.ok { color: var(--success); font-weight: 600; }

/* files */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file-it { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; }
.file-it img { width: 100%; height: 110px; object-fit: cover; display: block; } .file-it .file-ic { height: 110px; display: grid; place-items: center; color: var(--text-3); } .file-ic .icon { width: 34px; height: 34px; }
.file-it > div { padding: 8px 10px; } .file-it [data-rm] { position: absolute; top: 6px; right: 6px; background: var(--surface); }

/* ---------- booking form ---------- */
.bk { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
.bk-main { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.bk-side { position: sticky; top: calc(var(--topbar-h) + 12px); }
.bk-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.bk-cust { display: flex; gap: 8px; } .bk-cust .fl-search { flex: 1; } .bk-cust .fl-search .input { padding-left: 34px; }
.bk-results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.bk-res { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.bk-res:hover { border-color: var(--primary); background: var(--primary-soft); } .bk-res .small { margin-left: auto; }
.bk-cust-card { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; border: 1px solid var(--primary); border-radius: var(--radius); background: var(--primary-soft); }
.bk-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.bk-class { display: flex; justify-content: space-between; gap: 10px; text-align: left; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.bk-class:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.bk-class.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); } .bk-class.off { opacity: .6; }
.bk-cn, .bk-cp { display: flex; flex-direction: column; gap: 2px; } .bk-cp { align-items: flex-end; text-align: right; } .bk-cp b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.bk-pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.bk-pkg { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.bk-pkg.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); } .bk-pkg .bk-pp { font-weight: 650; color: var(--primary); font-size: var(--fs-sm); }
.bk-extras { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.bk-extra { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; border: 1px solid var(--border); border-radius: 10px; }
.bk-extra .qty { display: inline-flex; align-items: center; gap: 8px; } .bk-extra .qty b { min-width: 16px; text-align: center; }
.bk-lines { list-style: none; margin: 0 0 6px; padding: 0; } .bk-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: var(--fs-sm); }
.bk-lines li b { font-variant-numeric: tabular-nums; white-space: nowrap; } .bk-lines li:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .bk { grid-template-columns: 1fr; } .bk-side { position: static; } }

/* ---------- rental file ---------- */
.rv-period { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.rv-period > div:not(.rv-arrow) { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.rv-period b { font-size: var(--fs-md); } .rv-arrow { display: flex; flex-direction: column; align-items: center; color: var(--text-3); }
.rv-driver { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); } .rv-driver > div { flex: 1; min-width: 0; } .rv-driver:last-of-type { margin-bottom: 10px; }
@media (max-width: 560px) { .rv-period { grid-template-columns: 1fr; } .rv-arrow { flex-direction: row; gap: 8px; } }

/* ---------- planner ---------- */
.pl-list .pl-it { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.pl-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: var(--text); text-decoration: none !important; }
.pl-time { font-weight: 750; font-variant-numeric: tabular-nums; font-size: var(--fs-md); min-width: 48px; color: var(--primary); }
.pl-t { display: flex; flex-direction: column; min-width: 0; flex: 1; } .pl-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-v { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.card-head h2 .icon { display: inline-block; vertical-align: -3px; color: var(--primary); }
@media (max-width: 560px) { .pl-list .pl-it { flex-wrap: wrap; } .pl-list .pl-it > .btn { margin-left: 60px; } }

/* ---------- calendar ---------- */
.cal-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: var(--fs-xs); color: var(--text-2); }
.cal-legend-d { margin-left: auto; } .cal-legend-d > summary { display: none; }
.cal-date { width: 160px; } .cal-filters { display: flex; gap: 10px; } .cal-filters .input { width: auto; max-width: 220px; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-request { background: var(--st-request); } .lg-reserved { background: var(--st-reserved); } .lg-confirmed { background: var(--st-confirmed); } .lg-active { background: var(--st-active); }
.lg-overdue { background: var(--st-overdue); } .lg-returned { background: var(--st-returned); } .lg-maintenance { background: var(--st-maintenance); }
.cal-card { overflow: hidden; } .cal-scroll { overflow: auto; max-height: calc(100vh - 230px); }
.cal-inner { position: relative; }
.cal-head { display: flex; position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--border); }
.cal-days { display: flex; } .cal-day { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 46px; border-left: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }
.cal-day b { color: var(--text-2); font-size: 12px; } .cal-day.we { background: var(--surface-2); } .cal-day.today { background: var(--primary-soft); } .cal-day.today b, .cal-day.today span { color: var(--primary); font-weight: 700; }
.cal-veh { position: sticky; left: 0; z-index: 3; width: var(--veh, 170px); flex: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 12px; background: var(--surface); border-right: 1px solid var(--border); min-width: 0; }
.cal-corner { font-size: var(--fs-xs); color: var(--text-3); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.cal-body { position: relative; background-image: linear-gradient(to right, var(--border) 1px, transparent 1px); background-size: var(--day) 100%; background-position: var(--veh, 170px) 0; }
.cal-row { display: flex; border-bottom: 1px solid var(--border); position: relative; } .cal-row.drop .cal-lane { background: var(--primary-soft); }
.cal-row.cal-unassigned .cal-veh { background: var(--warning-bg); } .cal-row.cal-unassigned { background: color-mix(in srgb, var(--warning-bg) 40%, transparent); }
.cal-lane { position: relative; flex: none; cursor: copy; }
.cal-group > span { position: sticky; left: 12px; } .cal-group { padding: 6px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-bar-it { position: absolute; height: 28px; border-radius: 8px; padding: 0 8px; display: flex; align-items: center; gap: 6px; overflow: hidden; color: #fff; font-size: 12px; cursor: pointer;
  background: var(--c); box-shadow: 0 1px 2px rgba(15, 23, 42, .18); z-index: 2; user-select: none; touch-action: none; }
.cal-bar-it:hover { filter: brightness(1.06); box-shadow: 0 3px 10px rgba(15, 23, 42, .22); }
.cal-bar-it.drag { cursor: grab; } .cal-bar-it.dragging { cursor: grabbing; opacity: .85; z-index: 10; box-shadow: var(--shadow-lg); }
.cal-t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cal-s { opacity: .8; font-size: 11px; white-space: nowrap; }
.cal-rs { position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: ew-resize; background: rgba(255, 255, 255, .25); }
.st-request { --c: var(--st-request); } .st-reserved { --c: var(--st-reserved); } .st-confirmed { --c: var(--st-confirmed); } .st-active { --c: var(--st-active); } .st-overdue { --c: var(--st-overdue); }
.st-returned { --c: var(--st-returned); } .st-closed { --c: var(--st-closed); } .st-cancelled { --c: var(--st-cancelled); }
.st-request.cal-bar-it { background: repeating-linear-gradient(135deg, var(--st-request) 0 8px, color-mix(in srgb, var(--st-request) 80%, #fff) 8px 16px); }
.st-reserved.cal-bar-it { color: #1f1300; }
.cal-buf { position: absolute; height: 28px; border-radius: 0 8px 8px 0; background: repeating-linear-gradient(135deg, var(--surface-3) 0 5px, transparent 5px 10px); border: 1px dashed var(--border-strong); border-left: 0; z-index: 1; }
.cal-blk { position: absolute; top: 8px; height: 28px; border-radius: 8px; padding: 0 8px; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #fff; overflow: hidden; white-space: nowrap;
  background: repeating-linear-gradient(135deg, var(--st-maintenance) 0 8px, color-mix(in srgb, var(--st-maintenance) 80%, #000) 8px 16px); z-index: 1; }
.cal-blk.st-block { background: var(--st-block); }
.cal-blk.st-ical { background: repeating-linear-gradient(45deg, var(--st-ical) 0 6px, color-mix(in srgb, var(--st-ical) 82%, #fff) 6px 12px); outline: 1px solid color-mix(in srgb, var(--st-ical) 70%, #000); outline-offset: -1px; }
.lg-ical { background: var(--st-ical); }
.cal-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 5; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
@media (max-width: 720px) {
  .cal-bar { gap: 8px; } .cal-bar > .row { width: 100%; } .cal-date { flex: 1; width: auto; min-width: 0; }
  .cal-filters { flex: 1 1 100%; min-width: 0; } .cal-filters .input { flex: 1; min-width: 0; max-width: none; }
  .cal-legend-d { margin-left: 0; flex: 1 1 100%; } .cal-legend-d > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--fs-xs); color: var(--text-2); list-style: none; }
  .cal-legend-d > summary::-webkit-details-marker { display: none; } .cal-legend-d[open] > summary { margin-bottom: 6px; }
  .cal-veh { padding: 0 6px; } .cal-veh .plate { font-size: 11px; } .cal-scroll { max-height: none; }
  .cal-day { font-size: 10.5px; } .cal-day b { font-size: 11px; }
}
.cal-inner.narrow .cal-bar-it { padding: 0 5px; font-size: 11px; } .cal-inner.narrow .cal-s { display: none; }

/* quotes */
.q-items td { padding: 6px 8px; } .q-items .input.sm { min-width: 0; }
.veh-diagram { max-width: 420px; margin: 0 auto; }

/* ---------- long-term rentals: billing period timeline (rental-billing.js) + booking form options ---------- */
.bl-actions { gap: 8px; }
.bl-tl { list-style: none; margin: 0; padding: 4px 18px 12px; }
.bl-p { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) auto minmax(0, .9fr); gap: 4px 14px; align-items: center; padding: 12px 6px 12px 26px; border-bottom: 1px solid var(--border); border-radius: var(--radius-sm); }
.bl-p:last-child { border-bottom: 0; } .bl-p[hidden] { display: none; }
.bl-p::after { content: ''; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.bl-p:first-child::after { top: 22px; } .bl-p:last-child::after { bottom: calc(100% - 22px); }
.bl-p::before { content: ''; position: absolute; z-index: 1; left: 4px; top: 17px; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; background: var(--border-strong); box-shadow: 0 0 0 3px var(--surface); }
.bl-plan::before { background: var(--surface); border: 2px solid var(--border-strong); }
.bl-due::before { background: var(--warning); } .bl-inv::before { background: var(--info); } .bl-paid::before { background: var(--success); } .bl-skip::before { background: var(--neutral-bg); }
.bl-now { background: linear-gradient(90deg, var(--primary-soft), transparent 75%); }
.bl-when, .bl-km { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bl-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bl-doc { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: flex-end; min-width: 0; }
.bk-mon { margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.bl-more { display: flex; justify-content: center; padding: 4px 0 12px; }
.bk-once { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; margin-left: 6px; }
@media (max-width: 720px) {
  .bl-tl { padding: 4px 12px 10px; }
  .bl-p { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when amt" "km doc"; align-items: start; }
  .bl-when { grid-area: when; } .bl-amt { grid-area: amt; } .bl-km { grid-area: km; } .bl-doc { grid-area: doc; align-self: end; }
}
/* ---------- Preise → Regeln (price rules, booking rules, simulator) ---------- */
.pr-cond { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pr-cond[hidden] { display: none; }
@media (max-width: 640px) { .pr-cond { grid-template-columns: 1fr; gap: 14px; } }
.pr-cap { font-size: var(--fs-sm); color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pr-rules .card-head { flex-wrap: wrap; }
.pr-rules tr.pr-off td { color: var(--text-3); }
.pr-rules tr.pr-off td b { color: var(--text-2); }
.pr-break td { padding-top: 8px; padding-bottom: 8px; }
.pr-break .pr-rule td:first-child { padding-left: 18px; }
.pr-break .pr-rule .icon { vertical-align: -3px; color: var(--text-3); }
.pr-break .pr-season td { color: var(--text-2); }
.pr-break .pr-sum td { border-top: 2px solid var(--border-strong); }
.bk-rule-hint { margin-top: 10px; }
.bk-class .bk-rule { display: block; font-size: 11px; color: var(--warning); font-weight: 600; margin-top: 2px; white-space: normal; text-align: left; }
.ins-impact-pos { color: var(--danger); } .ins-impact-neg { color: var(--success); }
.bk-lines li.bk-line-rule { color: var(--text-2); } .bk-lines li.bk-line-rule .icon { vertical-align: -3px; color: var(--text-3); }
.pr-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: var(--fs-sm); color: var(--text-2); } .pr-note .icon { flex: none; margin-top: 2px; color: var(--text-3); }
/* Tagesplan: range grouped by day */
.pl-days { display: grid; gap: 20px; }
.pl-day-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 2px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.pl-day-h h2 { margin: 0; font-size: var(--fs-md); font-weight: 650; display: inline-flex; align-items: center; gap: 8px; }
.pl-day .card-head h2 { font-size: var(--fs); }
.pl-dt { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); line-height: 1.1; }
.pl-range .rng > .rng-btn { min-width: 230px; }
@media (max-width: 560px) { .pl-range { width: 100%; } .pl-range .rng, .pl-range .rng > .rng-btn { width: 100%; min-width: 0; } }
@media (max-width: 560px) {   /* phone: time + name/number on the first line, plate + status below (no squeezed three columns) */
  .pl-main { flex: 1 1 100%; flex-wrap: wrap; row-gap: 6px; }
  .pl-t { flex: 1 1 calc(100% - 60px); }
  .pl-t .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pl-v { flex-direction: row; flex-wrap: wrap; align-items: center; margin-left: 60px; }
}
