/* Calendar section of admin.html (assets/admin-calendar.js) */
.cx-top { margin-bottom: 18px; }

/* van reminder strip */
.cx-alert { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 16px; padding: 11px 14px; border: 1px solid #f1d9a6; border-radius: 12px; background: var(--amber-bg, #fff7e6); color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.cx-alert b { color: #8a5a00; white-space: nowrap; }
.cx-alert span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-500); }
.cx-alert::after { content: "›"; margin-left: auto; font-size: 18px; color: var(--ink-400); }
.cx-alert.is-over { border-color: #f2c4b9; background: var(--red-bg); }
.cx-alert.is-over b { color: var(--red); }

/* layout: month on the left, the day on the right */
.cx-wrap { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 440px); gap: 20px; align-items: stretch; }
.cx-month, .cx-day { padding: 20px; overflow: visible; }
.cx-day { display: flex; flex-direction: column; min-width: 0; }
.cx-day .cx-free { margin-top: auto; }
.cx-day .cx-group:last-of-type { margin-bottom: 14px; }
.cx-day > .cx-empty { flex: 1; display: grid; place-items: center; min-height: 120px; }

/* month */
.cx-mhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cx-mhead h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
.cx-mhead h2 span { color: var(--ink-400); font-weight: 500; }
.cx-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cx-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink-500); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cx-chip i { width: 8px; height: 8px; border-radius: 50%; }
.cx-chip:hover { border-color: var(--ink-400); color: var(--ink); }
.cx-chip.is-on { border-color: var(--navy); background: var(--navy); color: #fff; }
.cx-chip.is-on i { box-shadow: 0 0 0 2px #fff; }

.cx-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cx-dow { padding: 0 0 6px; text-align: center; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-400); }
.cx-cell { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: clamp(58px, min(6.2vw, (100vh - 420px) / 6), 104px); padding: 8px; border: 1px solid transparent; border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background .12s; }
.cx-cell:hover { border-color: var(--line-2); background: var(--white); }
.cx-cell.is-wkend { background: #e6eaf1; color: var(--ink-500); }
.cx-cell.is-out { opacity: .38; }
.cx-num { font-size: 13.5px; font-weight: 600; }
.cx-cell.is-today { border-color: #e8731a; background: #fdeedf; box-shadow: inset 0 0 0 1px #e8731a; }
.cx-cell.is-today .cx-num { color: #c85a0c; font-weight: 800; }
.cx-cell.is-sel.is-today { border-color: #e8731a; background: var(--navy); box-shadow: inset 0 0 0 2px #e8731a; }
.cx-cell.is-sel.is-today .cx-num { color: #ff9a4d; }
.cx-cell.is-sel { border-color: var(--navy); background: var(--navy); color: #fff; }
.cx-cell.is-sel .cx-num { color: #fff; }
.cx-jobs { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cx-jobs b { font-size: 12px; font-weight: 650; color: var(--ink-500); }
.cx-cell.is-sel .cx-jobs b { color: #fff; }
.cx-dots { display: flex; gap: 3px; }
.cx-dots i { width: 8px; height: 8px; border-radius: 50%; }
.cx-cell.is-sel .cx-dots i { box-shadow: 0 0 0 1.5px #fff; }

/* the day */
.cx-dhead { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.cx-dhead > div { flex: 1; min-width: 0; }
.cx-dhead h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
.cx-dhead p { margin: 2px 0 0; font-size: 13px; color: var(--ink-500); }
.cx-empty { padding: 26px 12px; border: 1px dashed var(--line-2); border-radius: 12px; text-align: center; color: var(--ink-500); font-size: 14px; }
.card > .cx-empty { margin: 16px; }
.cx-group { margin-bottom: 14px; }
.cx-who { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 12.5px; font-weight: 650; color: var(--ink-500); }
.cx-route { display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--white); color: var(--navy); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.cx-route:hover { border-color: var(--navy); background: var(--bg); }
@media (max-width: 720px) { .cx-route { width: 100%; justify-content: center; min-height: 42px; } }
.cx-who i { width: 9px; height: 9px; border-radius: 50%; }
.cx-job { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; margin: 0 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.cx-job:hover { border-color: var(--ink-400); box-shadow: var(--shadow); }
.cx-time { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.cx-what { min-width: 0; }
.cx-what b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.cx-what b em { font-style: normal; font-weight: 600; font-size: 11.5px; padding: 1px 7px; margin-left: 4px; border-radius: 999px; background: var(--bg); color: var(--ink-500); }
.cx-what small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; font-size: 12px; color: var(--ink-500); }
.cx-what small > span:not([class]) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cx-arrow { color: var(--ink-400); font-weight: 500; }
.cx-tag, .cx-temp { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 650; background: var(--bg); color: var(--ink-500); }
.cx-tag--c { background: #e8f1fb; color: #1d5a7e; }
.cx-tag--d { background: #eaf6ef; color: #2d7a4b; }
.cx-temp--chilled { background: #e6f3f6; color: #0f6c7c; }
.cx-temp--frozen { background: #eceffb; color: #4a5fc1; }
.cx-temp--dryice { background: #f1ebf8; color: #7a4bb0; }
.cx-warn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--amber-bg, #fff7e6); color: #8a5a00; font-size: 13px; font-weight: 800; box-shadow: inset 0 0 0 1px #f1d9a6; }
.cx-ok { color: var(--green); font-weight: 800; }
.cx-road { font-size: 11px; font-weight: 650; color: var(--navy); white-space: nowrap; }
.cx-job.is-cancelled { opacity: .55; }
.cx-job.is-cancelled b { text-decoration: line-through; }
.cx-job.is-done { background: #fafbfd; }
.cx-free { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-500); }
.cx-free button { padding: 0; border: 0; background: none; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; }
.cx-free button:hover { text-decoration: underline; }

/* list tabs (drivers, vans, hubs) */
.cx-thead { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cx-thead h2 { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink); }
.cx-tacts { display: flex; align-items: center; gap: 12px; margin-left: auto; }
label.cx-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; color: var(--ink-500); cursor: pointer; }
.cx-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 14px; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: var(--white); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cx-row:last-child { border-bottom: 0; }
.cx-row:hover { background: #fafbfd; }
.cx-row.is-dim { opacity: .6; }
.cx-av { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; }
.cx-av--hub { background: var(--aqua-50, #e6f3f6); color: var(--navy); }
.cx-stat { font-size: 12.5px; color: var(--ink-500); white-space: nowrap; }
.cx-stat b { color: var(--ink); font-size: 14px; }
.cx-go { color: var(--ink-400); font-size: 20px; line-height: 1; }

/* vans */
.cx-rem { margin: 0; padding: 12px 16px 12px 34px; border-bottom: 1px solid var(--line); background: var(--amber-bg, #fff7e6); font-size: 13px; color: #8a5a00; }
.cx-rem li { margin: 2px 0; }
.cx-rem li.is-over { color: var(--red); font-weight: 600; }
.cx-vans { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 16px; }
.cx-van { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.cx-van.is-dim { opacity: .6; }
.cx-vtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cx-vtop b { display: block; font-size: 15px; color: var(--ink); }
.cx-vtop small { font-size: 12.5px; color: var(--ink-500); }
.cx-plate { padding: 3px 8px; border-radius: 6px; background: #ffd84d; color: #111; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.cx-vst { align-self: flex-start; padding: 2px 9px; border-radius: 999px; background: var(--red-bg); color: var(--red); font-size: 12px; font-weight: 650; }
.cx-vdates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cx-vdates span { padding: 7px 8px; border-radius: 8px; background: var(--bg); font-size: 12.5px; font-weight: 600; color: var(--ink); }
.cx-vdates small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-500); }
.cx-vdates .is-soon { background: var(--amber-bg, #fff7e6); color: #8a5a00; }
.cx-vdates .is-over { background: var(--red-bg); color: var(--red); }
.cx-oil { font-size: 12.5px; color: var(--ink-500); }
.cx-oil i { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.cx-oil i b { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.cx-oil.is-soon { color: #8a5a00; }
.cx-oil.is-soon i b { background: var(--amber, #d99a00); }
.cx-oil.is-over { color: var(--red); font-weight: 600; }
.cx-oil.is-over i b { background: var(--red); }
.cx-vacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* panel contents */
#dwCal .dw__foot { align-items: center; }
.cx-grow { flex: 1; }
.cx-muted { color: var(--ink-500); font-size: 13px; }
.cx-warnbox { margin: 0 0 18px; padding: 10px 12px; border-radius: 10px; background: var(--amber-bg, #fff7e6); color: #8a5a00; font-size: 13px; line-height: 1.45; }
.sec .cx-warnbox { margin: 4px 0 0; }
.cx-warnbox p { margin: 0; }
.cx-warnbox p + p { margin-top: 4px; }
.cx-st { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--bg); color: var(--ink-500); }
.cx-st--booked { background: #e8f1fb; color: #1d5a7e; }
.cx-st--transit { background: var(--amber-bg, #fff7e6); color: #8a5a00; }
.cx-st--delivered { background: var(--green-bg); color: var(--green); }
.cx-st--cancelled { background: var(--red-bg); color: var(--red); }
.cx-leg { margin-top: 4px; padding: 14px 14px 2px; border-radius: 12px; background: var(--bg); }
.cx-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-pick label { margin: 0; font-weight: 500; cursor: pointer; }
.cx-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cx-pick span { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--white); font-size: 13.5px; font-weight: 600; color: var(--ink-500); transition: all .12s; }
.cx-pick label:hover span { border-color: var(--ink-400); color: var(--ink); }
.cx-pick input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.cx-pick input:focus-visible + span { box-shadow: 0 0 0 3px rgba(34, 116, 144, .25); }
.cx-contact { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
#dwCal .box2 .field { margin-bottom: 14px; }
#dwCal .box2 { gap: 0 12px; }

/* tablet and phone: day panel goes under the month */
/* tablets: month on top, the day underneath */
@media (max-width: 1080px) {
  .cx-wrap { grid-template-columns: minmax(0, 1fr); }
  .cx-day { scroll-margin-top: 70px; }
  .cx-cell { min-height: clamp(56px, 9vw, 88px); }
}
@media (max-width: 720px) {
  .cx-top .seg { display: flex; width: 100%; }
  .cx-top .seg button { flex: 1; padding: 0 8px; }
  .cx-month, .cx-day { padding: 14px; }
  .cx-grid { gap: 3px; }
  .cx-cell { min-height: 50px; padding: 5px; border-radius: 8px; align-items: center; }
  .cx-num { font-size: 13px; }
  .cx-jobs b { display: none; }
  .cx-jobs { justify-content: center; }
  .cx-dots i { width: 6px; height: 6px; }
  .cx-dow { font-size: 10.5px; }
  .cx-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px; scrollbar-width: none; }
  .cx-chips::-webkit-scrollbar { display: none; }
  .cx-chip { flex: none; }
  .cx-job { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 10px; }
  .cx-row { grid-template-columns: 36px minmax(0, 1fr) 14px; padding: 12px 14px; }
  .cx-row .cx-stat { display: none; }
  .cx-thead { flex-wrap: wrap; }
  .cx-vans { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .cx-vdates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-contact { grid-template-columns: minmax(0, 1fr); }
  #dwCal .box2 { grid-template-columns: minmax(0, 1fr); }
}

/* booking summary */
.cx-sumtop { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cx-rt { position: relative; margin: 0 0 18px; padding: 0; list-style: none; }
.cx-rt li { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 0 0 18px 0; }
.cx-rt li:last-child { padding-bottom: 0; }
.cx-rt li > div { position: relative; padding-left: 22px; min-width: 0; }
.cx-rt li > div::before { content: ""; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #1d5a7e; box-shadow: 0 0 0 3px #e8f1fb; }
.cx-rt li:not(:last-child) > div::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: -14px; width: 2px; background: var(--line); }
.cx-rt__d > div::before { background: #2d7a4b !important; box-shadow: 0 0 0 3px #eaf6ef !important; }
.cx-rt__h > div::before { background: var(--ink-400) !important; box-shadow: 0 0 0 3px var(--bg) !important; }
.cx-rt__t { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); padding-top: 14px; }
.cx-rt__l { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-400); }
.cx-rt b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.cx-rt small { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-500); overflow-wrap: anywhere; }
.cx-rt a { color: var(--navy); font-weight: 600; text-decoration: none; }
.cx-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cx-facts span { padding: 4px 10px; border-radius: 999px; background: var(--bg); font-size: 12.5px; font-weight: 600; color: var(--ink-500); }
.cx-note { margin: 0 0 10px; font-size: 13.5px; color: var(--ink); white-space: pre-line; }
.cx-note span { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 2px; }
