/* Crew Cars tab — fleet cards, reservation/check-in rows, status modal.
   Reuses the shared tokens (.btn, .modal-overlay, .field-input, .empty-row,
   .toast) from styles.css; everything here is prefixed .cc-. */

/* ─── Sub-tabs (mirror .gse-subtab) ─────────────────────────────────────────── */
.cc-subtabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #ececec;
}
.cc-subtab {
  border: none; background: none; color: #777;
  padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.cc-subtab:hover { background: #f4f4f4; color: #333; }
.cc-subtab.active { background: #1c1c1c; color: #fff; }
.cc-panel.hidden { display: none; }

/* ─── Toolbar (sub-tabs + create actions) ───────────────────────────────────── */
.cc-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #ececec;
}
.cc-toolbar .cc-subtabs { margin: 0; padding: 0; border: none; }
.cc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Status pills ──────────────────────────────────────────────────────────── */
.cc-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
}
.cc-pill-ok   { background: #e6f4ec; color: #1f7a45; }
.cc-pill-out  { background: var(--gold-subtle, rgba(183,155,88,0.14)); color: var(--gold-dark, #9A8145); }
.cc-pill-inop { background: #fbe9e7; color: #B42318; }
.cc-pill-na   { background: #eee; color: #777; }
.cc-pill-done { background: #eef0f2; color: #5a6470; }

/* ─── Fleet grid + cards ────────────────────────────────────────────────────── */
.cc-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
}
.cc-card {
  text-align: left; cursor: pointer; font: inherit;
  background: #fff; border: 1px solid #ececec; border-left: 4px solid #d6d6d6;
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .12s, transform .12s;
}
.cc-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.07); transform: translateY(-1px); }
.cc-card-ok   { border-left-color: #3a8a55; }
.cc-card-out  { border-left-color: var(--gold, #B79B58); }
.cc-card-inop { border-left-color: #B42318; background: #fffaf9; }
.cc-card-na   { border-left-color: #c6c6c6; }
.cc-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-card-name { font-size: 16px; font-weight: 700; color: #1c1c1c; }
.cc-card-foot { font-size: 12px; color: #888; }

.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f5f5f5; border-radius: 7px; padding: 3px 8px; font-size: 12px; color: #444;
}
.cc-chip-k { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #999; }

/* ─── Reservation / check-in rows ───────────────────────────────────────────── */
.cc-section-head {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #888;
  margin: 18px 0 8px; display: flex; align-items: center; gap: 8px;
}
.cc-section-head:first-child { margin-top: 0; }
.cc-section-n {
  background: #eee; color: #666; border-radius: 999px;
  font-size: 11px; padding: 1px 8px; letter-spacing: 0;
}
.cc-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid #ececec; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px;
}
.cc-row-overdue { border-color: #f1c9c4; background: #fffaf9; }
.cc-row-main { min-width: 0; flex: 1; }
.cc-row-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.cc-row-name { font-size: 15px; font-weight: 700; color: #1c1c1c; }
.cc-row-veh { font-size: 13px; color: #777; }
.cc-row-sub { font-size: 12px; color: #888; margin-top: 2px; }
.cc-row-note { font-size: 13px; color: #555; margin-top: 6px; white-space: pre-wrap; }
.cc-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.cc-row-when { font-size: 12px; color: #999; text-align: right; }

/* A check-in row is tappable → opens the full completed form. */
.cc-row-tappable { cursor: pointer; transition: box-shadow .12s, border-color .12s; }
.cc-row-tappable:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.07); border-color: #dcdcdc; }
.cc-row-tappable:focus-visible { outline: 2px solid var(--gold, #B79B58); outline-offset: 2px; }
.cc-row-chev { font-size: 20px; line-height: 1; color: #c4c4c4; margin-top: 2px; }
.cc-row-tappable:hover .cc-row-chev { color: var(--gold, #B79B58); }

.cc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cc-badge {
  background: #f1ece0; color: #7a6a45; border-radius: 6px;
  padding: 2px 8px; font-size: 11px; font-weight: 600;
}
.cc-badge-inop { background: #fbe9e7; color: #B42318; }

/* ─── Status modal ──────────────────────────────────────────────────────────── */
.cc-status-dialog { max-width: 420px; }
.cc-status-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-status-opt {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid #e2e2e2; border-radius: 9px; padding: 8px 12px; cursor: pointer; font-size: 14px;
}
.cc-status-opt:has(input:checked) { border-color: var(--gold, #B79B58); background: var(--gold-subtle, rgba(183,155,88,0.08)); }
.cc-status-opt input { accent-color: var(--gold, #B79B58); }

.cc-row-photos { font-size: 12px; color: #888; }

/* ─── Check-in detail modal (read-only) ─────────────────────────────────────── */
.cc-detail-dialog { max-width: 520px; }
.cc-d-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cc-d-sub { font-size: 13px; color: #777; }
.cc-d-head .cc-badges { margin-top: 0; }

.cc-d-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cc-d-fact {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f5f5f5; border-radius: 8px; padding: 5px 10px; font-size: 13px; color: #333;
}
.cc-d-fact-k { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #999; }

.cc-d-section { margin-bottom: 16px; }
.cc-d-section:last-child { margin-bottom: 0; }
.cc-d-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #999; margin-bottom: 8px;
}

.cc-d-checks {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: #ececec; border: 1px solid #ececec; border-radius: 10px; overflow: hidden;
}
.cc-d-check {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; padding: 9px 12px;
}
.cc-d-check-q { font-size: 13px; color: #444; display: flex; flex-direction: column; gap: 2px; }
.cc-d-check-note { font-size: 11px; color: #B42318; font-weight: 600; }
.cc-d-check-a { font-size: 13px; font-weight: 700; color: #1f7a45; flex: 0 0 auto; }
.cc-d-check.is-bad { background: #fffaf9; }
.cc-d-check.is-bad .cc-d-check-q { color: #B42318; font-weight: 600; }
.cc-d-check.is-bad .cc-d-check-a { color: #B42318; }

.cc-d-note { font-size: 14px; color: #333; white-space: pre-wrap; }

.cc-d-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.cc-d-photo {
  width: 92px; height: 92px; border-radius: 10px; overflow: hidden;
  border: 1px solid #e2e2e2; background: #f5f5f5; display: block;
}
.cc-d-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-d-photo-doc {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  font-size: 12px; font-weight: 700; color: #888;
}

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

/* ─── Forms (reservation + check-in) ────────────────────────────────────────── */
.cc-form-dialog { max-width: 560px; }
.cc-checkin-dialog { max-width: 600px; }
.cc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.cc-form-grid .cc-f-wide { grid-column: 1 / -1; }
.cc-form-note { font-size: 12px; color: #888; margin: 12px 0 0; }
.cc-form-note strong { color: var(--gold-dark, #9A8145); }

.cc-yn-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 16px;
}
.cc-yn { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cc-yn-label { font-size: 13px; color: #333; font-weight: 600; }
.cc-yn-opts { display: inline-flex; border: 1.5px solid #e2e2e2; border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.cc-yn-opt { position: relative; }
.cc-yn-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cc-yn-opt span {
  display: block; padding: 5px 14px; font-size: 13px; font-weight: 600; color: #777; cursor: pointer;
  background: #fff; transition: background .1s, color .1s;
}
.cc-yn-opt:first-child span { border-right: 1.5px solid #e2e2e2; }
.cc-yn-opt input:checked + span { background: #1c1c1c; color: #fff; }
.cc-which-warning { margin-top: 12px; }

/* Audi Pre-Sense advisory — only shown when an Audi is the selected vehicle. */
.cc-audi-note {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 16px; padding: 12px 14px;
  background: #fff8e6; border: 1px solid #f0d98a; border-radius: 10px;
}
.cc-audi-note[hidden] { display: none; }
.cc-audi-note-icon { font-size: 17px; line-height: 1.35; flex: 0 0 auto; }
.cc-audi-note strong { color: #8a6300; font-weight: 700; }
.cc-audi-note p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: #6b5320; }
.cc-form-dialog .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Photo upload */
.cc-upload { display: flex; flex-direction: column; gap: 10px; }
.cc-upload-btn { cursor: pointer; align-self: flex-start; }
.cc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid #e2e2e2; background: #f5f5f5; }
.cc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cc-thumb-doc { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 11px; font-weight: 700; color: #888; }
.cc-thumb-x {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
}

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

/* ─── Analytics sub-tab note ────────────────────────────────────────────────── */
.cc-an-note { font-size: 12px; color: #888; margin: -4px 0 12px; }

/* ─── Dashboard home strip (rendered by dashboard-home.js) ───────────────────── */
.dh-cc { margin-bottom: 18px; }
.dh-cc-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.dh-cc-card {
  text-align: left; cursor: pointer; font: inherit;
  background: #fffaf9; border: 1px solid #f1c9c4; border-left: 4px solid #B42318;
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.dh-cc-card.dh-cc-overdue { background: var(--gold-subtle, rgba(183,155,88,0.06)); border-color: #e7d4a8; border-left-color: var(--gold, #B79B58); }
.dh-cc-name { font-size: 15px; font-weight: 700; color: #1c1c1c; }
.dh-cc-status { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #B42318; }
.dh-cc-card.dh-cc-overdue .dh-cc-status { color: var(--gold-dark, #9A8145); }
.dh-cc-meta { font-size: 12px; color: #888; }
