.report-shell { position: relative; min-width: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.report-close {
  position: absolute; top: 15px; right: 16px; z-index: 4; width: 36px; height: 36px;
  border: 1px solid #d4e2ed; border-radius: 8px; background: #fff; color: #547087;
}
.report-close:hover { color: var(--violet); background: #edf7ff; }
.report-header {
  display: flex; justify-content: space-between; gap: 24px; align-items: flex-start;
  padding: 22px 68px 18px 26px; background: #fff; border-bottom: 1px solid var(--line);
}
.report-eyebrow { margin-bottom: 3px; color: var(--violet); font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.report-header h1 { margin: 0; color: var(--ink); font-size: 1.4rem; font-weight: 780; letter-spacing: -.02em; }
.report-header p { margin: 4px 0 0; color: #6c8294; font-size: .84rem; }
.report-header-actions { display: flex; gap: 8px; margin-top: 4px; }
.report-header-actions .btn { white-space: nowrap; border: 1px solid #d7e4ed; }

.report-tabs {
  position: sticky; top: 0; z-index: 3; display: flex; gap: 4px; padding: 9px 22px;
  overflow-x: auto; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.report-tab {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 12px;
  white-space: nowrap; border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: #587287; font-size: .78rem; font-weight: 680;
}
.report-tab:hover { color: var(--violet); background: #f0f8ff; }
.report-tab.active { color: var(--violet); background: var(--violet-soft); border-color: #b9daf5; }

.report-filters {
  display: flex; align-items: end; gap: 10px; padding: 15px 24px; background: var(--surface-soft); border-bottom: 1px solid var(--line);
}
.report-filter-field { flex: 0 1 190px; min-width: 145px; }
.report-filter-field.report-filter-vehicle { flex-basis: 240px; position: relative; }
.report-filter-field.report-datetime-field { flex-basis: 215px; min-width: 195px; position: relative; }
.report-filter-field.report-filter-small { flex-basis: 150px; }
.report-filter-field label { display: block; margin: 0 0 4px 2px; color: #60798d; font-size: .7rem; font-weight: 720; }
.report-filter-field .form-control,.report-filter-field .form-select { min-height: 38px; font-size: .78rem; background-color: #fff; }
.report-filter-field .input-group-text { padding: .375rem .55rem; color: #6e8293; font-size: .7rem; background: #edf5fb; border-color: #cfe2f5; }
.report-filter-submit { margin-left: auto; }
.report-filter-submit .btn { min-height: 38px; white-space: nowrap; }
/* Temperature has more quality controls than the other reports; allow this
   one filter bar to form a second row on desktop without changing old pages. */
.report-filters-temperature { flex-wrap: wrap; }

.report-filter-field.report-range-field { flex-basis: 160px; }

.report-download-status { flex-basis: 100%; color: #547087; font-size: .78rem; text-align: right; }

.report-datetime { position: relative; }
.report-datetime-input { padding-right: 34px !important; cursor: text; }
.report-datetime-input:invalid:not(:placeholder-shown) { border-color: #e0554f; }
.report-datetime-toggle {
  position: absolute; top: 0; right: 0; width: 38px; height: 38px; display: inline-flex;
  align-items: center; justify-content: center; border: 0; background: transparent;
  color: #6c8294; border-radius: 0 8px 8px 0; transition: color .15s ease, background .15s ease;
}
.report-datetime-toggle:hover { color: var(--violet); background: #eef6fd; }
.report-datetime-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; width: 272px;
  display: grid; gap: 10px; padding: 14px; background: #fff; border: 1px solid #d4e2ed;
  border-radius: 14px; box-shadow: 0 18px 42px rgba(16, 46, 68, .18);
}
.report-datetime-panel.d-none { display: none; }
.report-datetime-panel-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; }
.report-datetime-title { color: var(--ink); font-size: .86rem; font-weight: 720; text-align: center; }
.report-datetime-nav {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid #d9e7f2;
  border-radius: 50%; background: #f7fbff; color: #35566f; transition: background .15s ease, color .15s ease;
}
.report-datetime-nav:hover { background: var(--violet-soft); color: var(--violet); }
.report-datetime-week, .report-datetime-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.report-datetime-week span { color: #8298ab; font-size: .62rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.report-datetime-day {
  min-height: 30px; border: 0; border-radius: 8px; background: transparent; color: #274962;
  font-size: .78rem; font-weight: 620; transition: background .15s ease, color .15s ease;
}
.report-datetime-day:hover { background: #eef6fd; }
.report-datetime-day.is-muted { color: #b7c4cf; }
.report-datetime-day.is-today { box-shadow: inset 0 0 0 1.5px var(--violet); }
.report-datetime-day.is-selected { background: var(--violet); color: #fff; font-weight: 720; box-shadow: none; }
.report-datetime-time { border-top: 1px solid #e7eff5; padding-top: 10px; }
.report-datetime-time label {
  display: block; margin-bottom: 6px; color: #6c8294; font-size: .68rem; font-weight: 720;
  text-transform: uppercase; letter-spacing: .04em;
}
.report-datetime-time-inputs { display: flex; align-items: center; justify-content: center; gap: 6px; }
.report-datetime-time-inputs input {
  width: 56px; padding: 6px 4px; text-align: center; border: 1px solid #d4e2ed; border-radius: 8px;
  color: var(--ink); font-size: .86rem; font-weight: 660;
}
.report-datetime-time-inputs input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(11,116,201,.15); }
.report-datetime-time-inputs span { color: #8298ab; font-weight: 700; }
.report-datetime-time-inputs select.report-datetime-period {
  padding: 6px 4px; text-align: center; border: 1px solid #d4e2ed; border-radius: 8px;
  color: var(--ink); font-size: .8rem; font-weight: 660; background: #fff;
}
.report-datetime-time-inputs select.report-datetime-period:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(11,116,201,.15); }
.report-datetime-actions { display: flex; justify-content: space-between; gap: 8px; }
.report-datetime-actions .btn { flex: 1; min-height: 34px; font-size: .78rem; }
@media (max-width: 992px) {
  .report-datetime-panel { left: auto; right: 0; }
}

.report-vehicle-picker { position: relative; }
.report-vehicle-input { padding-right: 34px !important; cursor: pointer; background: #fff !important; }
.report-vehicle-toggle {
  position: absolute; top: 0; right: 0; width: 38px; height: 38px; display: inline-flex;
  align-items: center; justify-content: center; border: 0; background: transparent;
  color: #6c8294; border-radius: 0 8px 8px 0; transition: color .15s ease, background .15s ease;
}
.report-vehicle-toggle:hover { color: var(--violet); background: #eef6fd; }
.report-vehicle-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; width: 280px;
  display: grid; gap: 10px; padding: 12px; background: #fff; border: 1px solid #d4e2ed;
  border-radius: 14px; box-shadow: 0 18px 42px rgba(16, 46, 68, .18);
}
.report-vehicle-panel.d-none { display: none; }
.report-vehicle-search {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #d4e2ed;
  border-radius: 8px; background: #f7fbff; color: #8298ab;
}
.report-vehicle-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: .82rem;
}
.report-vehicle-search input:focus { outline: none; }
.report-vehicle-list { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; }
.report-vehicle-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px;
  color: #274962; font-size: .82rem; font-weight: 600; cursor: pointer; transition: background .15s ease;
}
.report-vehicle-row:hover { background: #eef6fd; }
.report-vehicle-row input[type="checkbox"] { accent-color: var(--violet); width: 15px; height: 15px; flex-shrink: 0; }
.report-vehicle-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-vehicle-row-meta { margin-left: auto; color: #8298ab; font-size: .68rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.report-vehicle-empty { padding: 14px 4px; color: #8298ab; font-size: .8rem; text-align: center; }
.report-vehicle-actions { display: flex; align-items: center; gap: 12px; border-top: 1px solid #e7eff5; padding-top: 10px; }
.report-vehicle-actions .report-vehicle-select-all,
.report-vehicle-actions .report-vehicle-clear {
  border: 0; background: transparent; color: var(--violet); font-size: .76rem; font-weight: 700; padding: 0;
}
.report-vehicle-actions .report-vehicle-select-all:hover,
.report-vehicle-actions .report-vehicle-clear:hover { text-decoration: underline; }
.report-vehicle-actions .report-vehicle-done { margin-left: auto; min-height: 30px; font-size: .78rem; }
@media (max-width: 992px) {
  .report-vehicle-panel { left: auto; right: 0; }
}

.report-print-area { padding: 20px 24px 30px; }
.report-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 280px; color: #60798d; font-size: .88rem; }
.report-error,.report-empty { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 260px; color: #6a8193; text-align: left; }
.report-error > i,.report-empty > i { color: #d75454; font-size: 2rem; }
.report-empty { flex-direction: column; gap: 4px; text-align: center; }
.report-empty > i { color: #84a3ba; }
.report-error div { display: flex; flex-direction: column; }
.report-error strong,.report-empty strong { color: #284b64; font-size: .94rem; }
.report-error span,.report-empty span { font-size: .8rem; }

.report-kpis { display: grid; grid-template-columns: repeat(5,minmax(150px,1fr)); gap: 10px; margin-bottom: 18px; }
.report-kpi { display: flex; gap: 11px; min-height: 104px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 16px rgba(15,64,96,.055); }
.report-kpi-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 8px; font-size: 1rem; }
.report-kpi > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.report-kpi span { color: #708596; font-size: .68rem; font-weight: 680; }
.report-kpi strong { margin: 3px 0 2px; color: var(--ink); font-size: 1.13rem; line-height: 1.2; white-space: nowrap; }
.report-kpi small { color: #8799a7; font-size: .63rem; line-height: 1.3; }
.report-tone-blue .report-kpi-icon { color: #0969b1; background: #e2f1fd; }
.report-tone-green .report-kpi-icon { color: #16824d; background: #e1f6e9; }
.report-tone-amber .report-kpi-icon { color: #a36b00; background: #fff3cf; }
.report-tone-violet .report-kpi-icon { color: #7352b8; background: #efe9fc; }
.report-tone-cyan .report-kpi-icon { color: #087e91; background: #ddf5f7; }
.report-tone-red .report-kpi-icon { color: #c53f3f; background: #fde8e8; }

.report-section-heading { display: flex; justify-content: space-between; align-items: end; margin: 20px 1px 9px; }
.report-section-heading h2,.report-chart-card h2 { margin: 0; color: #1b3c54; font-size: .92rem; font-weight: 760; }
.report-section-heading p,.report-chart-card p { margin: 3px 0 0; color: #7c90a0; font-size: .7rem; }
.report-table-card,.report-chart-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 16px rgba(15,64,96,.05); }
.report-table-scroll { width: 100%; overflow: auto; }
.report-table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; font-size: .72rem; }
.report-table th { position: sticky; top: 0; z-index: 1; padding: 10px 11px; white-space: nowrap; color: #587287; background: var(--surface-soft); border-bottom: 1px solid #d7e6f0; font-size: .65rem; font-weight: 780; letter-spacing: .02em; text-transform: uppercase; }
.report-table td { padding: 10px 11px; white-space: nowrap; color: #37566d; border-bottom: 1px solid #edf2f6; }
.report-table tbody tr:last-child td { border-bottom: 0; }
.report-table tbody tr:hover td { background: #f8fbfe; }
.report-table .report-number { text-align: right; font-variant-numeric: tabular-nums; }
.report-row-count { padding: 8px 12px; color: #8093a2; background: #fbfdff; border-top: 1px solid #edf2f6; font-size: .65rem; text-align: right; }
.report-pagination { display: inline-flex; align-items: center; gap: 10px; margin-left: 14px; }
.report-pagination .btn { font-size: .68rem; padding: 2px 9px; }
.report-status,.report-type,.report-severity { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; font-size: .64rem; font-weight: 750; text-transform: capitalize; }
.report-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.report-status-running,.report-status-moving,.report-status-completed { color: #137649; background: #e2f6e9; }
.report-status-idle,.report-status-inside,.report-status-open { color: #946300; background: #fff2cb; }
.report-status-stopped { color: #991b1b; background: #fee2e2; }
.report-status-inactive,.report-status-offline,.report-status-data_gap { color: #475569; background: #e2e8f0; }
.report-status-nodata { color: #334155; background: #f1f5f9; }
.report-type-trip { color: #137649; background: #e2f6e9; }
.report-type-stop { color: #991b1b; background: #fee2e2; }
.report-type-idle { color: #946300; background: #fff2cb; }
.report-type-gap { color: #475569; background: #e2e8f0; }
/* Temperature excursion badges intentionally use distinct hot/cold colours. */
.report-type-high { color: #991b1b; background: #fee2e2; }
.report-type-low { color: #075985; background: #e0f2fe; }
.report-severity-critical { color: #ad3737; background: #fde5e5; }
.report-severity-warning { color: #946300; background: #fff0c2; }
.report-severity-info { color: #176b9e; background: #e1f1fb; }
.report-map-button { padding: 3px 7px; border: 1px solid #c9ddeb; border-radius: 6px; color: var(--violet); background: #f4faff; font-size: .66rem; font-weight: 680; }
.report-map-button:hover { background: #e3f2fd; }
.report-address { display: flex; flex-direction: column; gap: 4px; min-width: 240px; max-width: 340px; white-space: normal; line-height: 1.35; }
.report-address-text { color: #294c65; font-size: .7rem; }
.report-address small { display: flex; align-items: center; gap: 7px; color: #8496a4; font-size: .6rem; font-variant-numeric: tabular-nums; }
.report-address .report-map-button { margin-left: auto; white-space: nowrap; }
.report-address.is-loading .report-address-text { color: #718b9e; }
.report-address.is-loading .report-address-text::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border: 1px solid #73a8cc; border-top-color: transparent; border-radius: 50%; animation: report-address-spin .8s linear infinite; }
.report-address-attribution { margin-top: 12px; color: #8395a3; font-size: .62rem; text-align: right; }
.report-address-attribution a { color: #597d96; }
@keyframes report-address-spin { to { transform: rotate(360deg); } }

.report-chart-card { display: grid; grid-template-columns: 190px 1fr; gap: 10px; align-items: center; min-height: 230px; padding: 16px 18px; }
.report-chart-wrap { position: relative; height: 195px; }
.report-chart-empty { display: grid; place-items: center; height: 100%; color: #8194a3; font-size: .8rem; }

@media (max-width: 1100px) {
  .report-kpis { grid-template-columns: repeat(3,minmax(145px,1fr)); }
  .report-filters { flex-wrap: wrap; }
  .report-filter-submit { margin-left: 0; }
}
@media (max-width: 768px) {
  .report-header { padding: 18px 58px 14px 16px; }
  .report-header-actions { position: absolute; top: 67px; right: 12px; }
  .report-header-actions .btn { padding: 5px 8px; font-size: .7rem; }
  .report-tabs { padding: 8px 12px; }
  .report-tab span { display: none; }
  .report-tab { min-width: 38px; justify-content: center; }
  .report-filters { display: grid; grid-template-columns: 1fr 1fr; padding: 13px 12px; }
  .report-filter-field,.report-filter-field.report-filter-vehicle,.report-filter-field.report-filter-small { min-width: 0; }
  .report-filter-vehicle,.report-filter-submit { grid-column: 1 / -1; }
  .report-filter-submit .btn { width: 100%; }
  .report-print-area { padding: 14px 12px 24px; }
  .report-kpis { display: flex; overflow-x: auto; padding-bottom: 3px; }
  .report-kpi { flex: 0 0 190px; min-height: 94px; }
  .report-chart-card { grid-template-columns: 1fr; }
}

/* clientui controls and responsive container, independent of Bootstrap. */
.reports-active .page-heading { display: none; }
.report-shell .d-none { display: none !important; }
.report-shell .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--secondary); font-size: 12px; font-weight: 700; }
.report-shell .btn-primary { color: white; background: var(--violet); border-color: var(--violet); }
.report-shell .btn-primary:hover { background: var(--violet-dark); }
.report-shell .form-control,.report-shell .form-select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #ded9e5; border-radius: 8px; color: var(--ink); background: white; font-size: 12px; }
.report-shell .input-group { display: flex; align-items: center; }
.report-shell .input-group-text { flex: none; }
.report-shell i.bi { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.report-shell i.bi .icon { width: 17px; height: 17px; }
.report-shell .report-table { margin: 0; }
.report-header { border-radius: 14px 14px 0 0; }
.report-header h1 { font-size: 22px; }
.report-header p { font-size: 12px; }
.report-header-actions { flex-wrap: wrap; justify-content: flex-end; }
.report-tabs { position: relative; top: auto; border-color: var(--line); }
.report-tab { flex: 0 0 auto; font-size: 12px; }
.report-tab:hover { color: var(--violet); background: var(--violet-soft); }
.report-tab.active { background: var(--violet-soft); border-color: #d9ccee; }
.report-filters { flex-wrap: wrap; }
.report-filter-field label { font-size: 11px; color: var(--secondary); }
.report-filter-field.report-datetime-field { flex-basis: 230px; }
.report-filter-submit { margin-left: 0; }
.report-filter-field .report-vehicle-row { display: flex; font-size: 12px; }
.report-filter-field .report-vehicle-row input { margin: 0; }
.report-datetime-panel,.report-vehicle-panel { left: 0; right: auto; max-width: calc(100vw - 68px); border-color: #ded9e5; }
.report-vehicle-row-meta { font-size: 10px; }
.report-kpis { grid-template-columns: repeat(auto-fit,minmax(165px,1fr)); }
.report-kpi span { font-size: 11px; }
.report-kpi strong { font-size: 19px; white-space: normal; overflow-wrap: anywhere; }
.report-kpi small { font-size: 10px; }
.report-kpi-icon { flex-basis: 30px; width: 30px; height: 30px; }
.report-section-heading h2,.report-chart-card h2 { font-size: 15px; color: var(--ink); }
.report-section-heading p,.report-chart-card p { font-size: 11px; color: var(--secondary); line-height: 1.6; }
.report-table-card,.report-chart-card { min-width: 0; }
.report-table th { font-size: 10px; color: var(--secondary); }
.report-table td { font-size: 12px; color: var(--ink); }
.report-address-text { font-size: 11px; }
.report-address small { font-size: 10px; }
.report-map-button { color: var(--violet); background: var(--violet-soft); border-color: #ded9e5; font-size: 10px; }
.report-row-count { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; font-size: 11px; }
.report-status,.report-type,.report-severity { font-size: 10px; }
.report-pagination .btn { font-size: 11px; }
.report-error { padding: 20px; }
.report-error strong,.report-empty strong { font-size: 15px; }
.report-error span,.report-empty span { font-size: 12px; }
.report-location-map { height: 340px; border-radius: 10px; }
@media (max-width: 760px), (max-width:1024px) and (max-height:500px) {
  .reports-active .page-content { padding-top: 10px; }
  .report-shell { height: auto; overflow: visible; }
  .report-header { flex-direction: column; gap: 14px; padding: 18px 14px; }
  .report-header h1 { padding-right: 38px; font-size: 20px; }
  .report-header-actions { position: static; justify-content: flex-start; margin: 0; width: 100%; gap: 6px; }
  .report-header-actions .btn { font-size: 11px; }
  .report-download-status { text-align: left; }
  .report-tabs { padding: 8px; }
  .report-tab span { display: inline; }
  .report-tab { font-size: 11px; padding: 9px; }
  .report-filters { display: grid; grid-template-columns: minmax(0,1fr); padding: 14px 12px; gap: 12px; }
  .report-filter-field.report-datetime-field { min-width: 0; }
  .report-filter-field,.report-filter-submit { grid-column: 1; }
  .report-filter-submit .btn { width: 100%; }
  .report-kpis { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
  .report-kpi { flex-direction: column; padding: 12px; min-width: 0; min-height: 110px; }
  .report-print-area { padding: 14px 10px 24px; }
  .report-chart-card { grid-template-columns: minmax(0,1fr); }
  .report-chart-wrap { min-width: 0; }
  .report-table-scroll { border: 0; border-radius: 8px 8px 0 0; }
  .report-pagination { margin: 0; gap: 6px; }
}
@media print {
  body.reports-active { display: block !important; height: auto !important; overflow: visible !important; background: white; }
  .reports-active .sidebar,.reports-active .topbar,.reports-active .mobile-nav,.reports-active .page-heading,.reports-active .workspace-footer,.report-close,.report-tabs,.report-filters,.report-header-actions,.report-pagination,.report-map-button { display: none !important; }
  .reports-active .main,.reports-active .page-content,.reports-active .secondary-view,.report-shell,.report-print-area { position: static !important; display: block; height: auto !important; width: 100% !important; max-width: none; overflow: visible !important; padding: 0; margin: 0; border: 0; }
  .report-table-scroll { overflow: visible; }
  .report-table { min-width: 0; }
  .report-table th,.report-table td { font-size: 8px; padding: 5px; white-space: normal; }
  .report-address { min-width: 0; max-width: none; }
  .report-address-text,.report-address small { font-size: 8px; }
  .report-header { padding: 12px 0; }
  .report-kpis { display: grid; grid-template-columns: repeat(3,1fr); }
  .report-kpi { min-height: 70px; padding: 8px; box-shadow: none; break-inside: avoid; }
  .report-kpi-icon { display: none; }
  .report-chart-card { break-inside: avoid; }
}
