/* Biểu mẫu tạo/sửa đơn thuê: bản nháp, bước xác nhận theo nhóm, cảnh báo tiền. */
#taodon.td-choosing #td-steps,
#taodon.td-choosing .td-step,
#taodon.td-choosing .td-actions { display: none !important; }

.td-draft-choice { border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: var(--brand-tint); }
.td-draft-choice[hidden] { display: none; }
.td-draft-choice h3 { font-size: 14px; margin: 0 0 4px; }
.td-draft-choice p { margin: 0 0 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.td-draft-choice .td-draft-warn { color: var(--danger, #b42318); font-weight: 600; }
.td-draft-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.td-draft-actions .btn { flex: 1 1 140px; justify-content: center; min-height: 40px; }

.sum-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
.sum-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sum-group-head b { font-size: 12px; }
.sum-group-head .btn { min-height: 32px; padding: 0 12px; }
.sum-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 3px 0; }
.sum-line > span:first-child { color: var(--ink-soft); flex: 0 0 auto; }
.sum-line > span:last-child { text-align: right; overflow-wrap: anywhere; }
.sum-line[hidden] { display: none; }
.sum-note { font-size: 12px; color: var(--ink-faint); margin: 4px 0 0; line-height: 1.45; }
.sum-warn { border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 12px; line-height: 1.45; background: #fff4e5; color: #8a4b00; }
:root[data-theme="dark"] .sum-warn { background: #3a2a10; color: #ffcf8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sum-warn { background: #3a2a10; color: #ffcf8a; } }
.td-live-total { margin-top: -2px; }

/* ---------- Lịch: tìm xe trống, ô trống, cố định cột xe và hàng ngày (CAL-01..03) ---------- */
.cal-finder { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cal-finder > summary { cursor: pointer; padding: 11px 14px; font-weight: 650; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.cal-finder-body { padding: 0 14px 14px; }
.cal-finder-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.cal-finder-fields .field { margin: 0; }
.cal-finder-fields .btn { min-height: 40px; }
.cal-finder-error { margin: 8px 0 0; color: var(--red, #b42318); font-size: 12px; }
.cal-find-summary { margin: 12px 0 8px; font-size: 14px; }
.cal-find-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal-find-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; }
.cal-find-info b { display: block; font-size: 14px; }
.cal-find-info span { font-size: 12px; color: var(--ink-soft); }
.cal-find-state { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.cal-find-state small { font-size: 12px; color: var(--ink-soft); }
.cal-find-badge { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.cal-find-badge.is-ok::before { content: '✓ '; }
.cal-find-badge.is-warn::before { content: '! '; }
.cal-find-badge.is-no::before { content: '✕ '; }
.cal-find-badge.is-ok { color: #1d6b3a; background: #e8f5ec; }
.cal-find-badge.is-warn { color: #8a5a00; background: #fff4de; }
.cal-find-badge.is-no { color: #7a2e2e; background: #fdecec; }
.cal-find-row.is-no { opacity: .75; }
.cal-find-actions { display: flex; gap: 6px; }
@media (max-width: 720px) {
  .cal-finder-fields { grid-template-columns: 1fr; }
  .cal-find-row { grid-template-columns: 1fr; }
  .cal-find-actions .btn { flex: 1; min-height: 40px; }
}
.calendar-free-slot { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; margin-top: auto; border: 1px dashed var(--line-strong); border-radius: 6px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 12px; cursor: pointer; }
.calendar-free-slot::before { content: '+ '; margin-right: 3px; }
.calendar-free-slot:hover, .calendar-free-slot:focus-visible { background: var(--brand-tint); color: var(--brand-ink); border-style: solid; }
.calendar-free-text { font-size: 12px; color: var(--ink-faint); text-align: center; margin-top: auto; }
.calendar-today-tag { display: block; font-size: 12px; font-weight: 700; color: var(--brand-ink); }
.calendar-scroll-hint { display: none; margin: 0 0 6px; font-size: 12px; color: var(--ink-soft); }
.calendar-week-head { position: sticky; top: 0; z-index: 3; }
.calendar-week-head > div:first-child, .calendar-week-vehicle { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.calendar-week-head > div:first-child { z-index: 4; background: var(--surface-muted); }
.calendar-week-vehicle { box-shadow: 1px 0 0 var(--line); }
.calendar-week-head > div.today { box-shadow: inset 0 -3px 0 var(--brand); font-weight: 700; }
.calendar-week-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
@media (max-width: 720px) {
  .calendar-scroll-hint { display: block; }
  .calendar-week-scroll { max-height: calc(100dvh - 260px) !important; min-height: 280px; }
}
#lich .mobile-calendar-free.is-tappable { width: 100%; border: 1px dashed var(--line-strong); background: transparent; font: inherit; cursor: pointer; min-height: 44px; }
#lich .mobile-calendar-free.is-tappable:active, #lich .mobile-calendar-free.is-tappable:focus-visible { background: var(--brand-tint); color: var(--brand-ink); }
#lich .mobile-calendar-busy b { font-size: 12px; color: var(--ink-soft); }
#lich .mobile-calendar-date .calendar-today-tag { margin-top: 2px; font-size: 12px; }

/* ---------- Danh sách đơn thuê: tab theo việc, hành động chính, menu phụ (LIST-01..04) ---------- */
.bo-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; }
.bo-tab { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.bo-tab b { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--surface-muted); font-size: 12px; text-align: center; }
.bo-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 650; }
.bo-tab.active b { background: rgba(255,255,255,.25); color: #fff; }
.bo-tab-hint { margin: 2px 0 8px; font-size: 12px; }
.bo-search { margin-bottom: 10px; }
.bo-search .field-input { width: 100%; }
.bo-more-filters { margin-top: 6px; }
.bo-more-filters > summary { cursor: pointer; font-size: 12px; color: var(--ink-soft); padding: 6px 2px; min-height: 36px; display: flex; align-items: center; }
.bo-reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.bo-reason-link { border: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.bo-actions { position: relative; }
.bo-more { position: relative; display: inline-block; }
.bo-more > summary { list-style: none; cursor: pointer; }
.bo-more > summary::-webkit-details-marker { display: none; }
.bo-more > summary::after { content: ' ▾'; }
.bo-more-list { position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 20; min-width: 170px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(16,24,40,.16); display: grid; }
.bo-more-item { text-align: left; border: 0; background: none; padding: 10px 12px; min-height: 40px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; }
.bo-more-item:hover, .bo-more-item:focus-visible { background: var(--surface-muted); }
.bo-more-item.is-danger { color: var(--red-ink, #b42318); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 12px; }
.bo-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .bo-actions .btn { flex: 1; } .bo-more { flex: 0 0 auto; } }
@media (max-width: 480px) {
  .bo-tabs { gap: 4px; }
  .bo-tab { flex: 1 1 auto; padding: 6px 7px; gap: 4px; font-size: 12px; }
  .bo-tab b { min-width: 18px; padding: 1px 5px; font-size: 12px; }
}
.bo-more > summary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; }
.bo-actions > .btn { min-height: 44px; }
@media (max-width: 480px) {
  .bo-tab { flex: 1 1 0; flex-direction: column; gap: 0; min-height: 50px; padding: 5px 4px; line-height: 1.2; border-radius: 14px; }
  .bo-tab b { background: none !important; padding: 0; font-size: 16px; }
}
