:root {
  color-scheme: light;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  --bg: #eef3f5;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --text: #15232f;
  --muted: #607080;
  --line: #d5e0e6;
  --green: #1f7a5a;
  --green-dark: #116b4f;
  --secondary-green: #3f6f5f;
  --secondary-green-hover: #2f5f50;
  --blue: #2f609e;
  --cyan: #7dbdd7;
  --yellow: #d9b43a;
  --danger: #a33b3b;
  --shadow: 0 18px 42px rgba(21, 35, 47, 0.12);
  --glass: rgba(255, 255, 255, 0.76);
  --glass-strong: rgba(255, 255, 255, 0.9);
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(238, 246, 242, 0.94) 360px, rgba(238, 243, 245, 0.98)),
    url("/static/brand/login-background.png") center / cover fixed no-repeat,
    var(--bg);
}

.app-shell {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  background: #ffffff;
  border-right: 1px solid #d9e0e7;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
  justify-content: flex-start;
  padding: 22px 18px;
  position: sticky;
  top: 0;
}

header {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d9e0e7;
  display: flex;
  justify-content: space-between;
  padding: 18px 28px;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.app-sidebar .header-actions {
  align-items: stretch;
  flex-direction: column;
  margin-top: auto;
}

.app-sidebar .button-link,
.app-sidebar button {
  justify-content: center;
  width: 100%;
}

.user-badge {
  color: #65717e;
  font-size: 13px;
  line-height: 1.25;
}

.login-page {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-panel {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  display: grid;
  gap: 16px;
  max-width: 380px;
  padding: 24px;
  width: 100%;
}

.login-panel label {
  display: grid;
  gap: 6px;
}

.login-panel span {
  color: #65717e;
  font-size: 13px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

p {
  color: #65717e;
  margin-top: 4px;
}

main {
  padding: 22px 28px;
}

.app-main {
  min-width: 0;
  padding: 14px 16px;
}

button, select, textarea, input {
  border: 1px solid #bac5d0;
  border-radius: 6px;
  font: inherit;
}

button {
  background: #1f7a5a;
  color: #ffffff;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

.button-link {
  align-items: center;
  border: 1px solid #bac5d0;
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  min-height: 38px;
  padding: 0 14px;
  text-decoration: none;
}

select, input {
  background: #ffffff;
  min-height: 38px;
  padding: 0 10px;
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 12px;
  min-width: 0;
  overflow: visible;
  position: relative;
  z-index: 50;
}

.toolbar button,
.toolbar select,
.toolbar input {
  font-size: 14px;
  min-height: 32px;
}

.toolbar button {
  padding: 0 12px;
}

.date-picker {
  position: relative;
  z-index: 60;
}

.date-nav {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

#dateInput {
  cursor: pointer;
  width: 150px;
}

#vehicleSelect {
  flex: 1 1 300px;
  min-width: 260px;
}

.scheme-nav {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.scheme-nav label {
  display: grid;
  gap: 5px;
}

.scheme-nav label span {
  color: var(--muted);
  font-size: 12px;
}

.scheme-nav select {
  font-size: 14px;
  width: 100%;
}

.vehicle-tree {
  background: rgba(247, 250, 249, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  max-height: calc(100vh - 392px);
  min-height: 220px;
  overflow: auto;
  padding: 8px 6px;
}

.tree-tools {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.tree-tools button {
  min-height: 30px;
}

.tree-status {
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
}

.tree-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  color: var(--text);
  display: grid;
  font-size: 13px;
  gap: 4px;
  grid-template-columns: 12px 18px minmax(0, 1fr) 46px;
  min-height: 30px;
  padding: 4px 6px 4px calc(6px + var(--tree-depth, 0) * 12px);
  text-align: left;
  width: 100%;
}

.tree-row:hover {
  background: #edf4f1;
  box-shadow: none;
  transform: none;
}

.tree-row--folder {
  font-weight: 600;
}

.tree-row--vehicle {
  border-left: 4px solid transparent;
  grid-template-columns: 18px minmax(0, 1fr) 46px;
  padding-left: calc(6px + var(--tree-depth, 0) * 4px);
}

.tree-row--checkable {
  cursor: default;
  grid-template-columns: 24px 18px minmax(0, 1fr) 46px;
}

.tree-row--folder.tree-row--checkable {
  grid-template-columns: 18px 18px 18px minmax(0, 1fr) 46px;
}

.tree-checkbox {
  accent-color: var(--green);
  cursor: pointer;
  min-height: auto;
  padding: 0;
}

.tree-caret-button {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  min-height: 18px;
  min-width: 18px;
  padding: 0;
}

.tree-caret-button:hover {
  box-shadow: none;
  transform: none;
}

.tree-row--vehicle .tree-caret {
  display: none;
}

.tree-row--vehicle.vehicle-health-green {
  border-left-color: #58b77a;
}

.tree-row--vehicle.vehicle-health-yellow {
  border-left-color: #ffd966;
}

.tree-row--vehicle.vehicle-health-red {
  border-left-color: #d95d5d;
}

.tree-row--vehicle.is-active {
  background: #d9efe7;
  color: #0f513c;
}

.tree-row--vehicle.is-disabled {
  color: #9aa5af;
  cursor: not-allowed;
}

.tree-caret,
.tree-count,
.tree-percent {
  color: var(--muted);
  font-size: 12px;
}

.tree-icon {
  text-align: center;
}

.tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#statusSelect {
  flex: 0 0 170px;
}

#refreshBtn {
  flex: 0 0 auto;
  white-space: nowrap;
}

#vehicleSelect.vehicle-health-green {
  border-color: #58b77a;
  box-shadow: inset 5px 0 0 #58b77a;
}

#vehicleSelect.vehicle-health-yellow {
  border-color: #d6ad2f;
  box-shadow: inset 5px 0 0 #ffd966;
}

#vehicleSelect.vehicle-health-red {
  border-color: #d95d5d;
  box-shadow: inset 5px 0 0 #d95d5d;
}

option.vehicle-health-green {
  background: #d8f4df;
  color: #123b22;
}

option.vehicle-health-yellow {
  background: #fff2bf;
  color: #5f4700;
}

option.vehicle-health-red {
  background: #f5d6d6;
  color: #6f1d1d;
}

.calendar-popup {
  background: #ffffff;
  border: 1px solid #bac5d0;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(23, 32, 42, 0.16);
  left: 0;
  padding: 12px;
  position: absolute;
  top: 44px;
  max-width: calc(100vw - 16px);
  width: 292px;
  z-index: 1000;
}

.calendar-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.calendar-title {
  font-weight: 700;
}

.calendar-nav {
  display: flex;
  gap: 6px;
}

.calendar-nav button {
  background: #ffffff;
  color: #17202a;
  min-height: 30px;
  min-width: 30px;
  padding: 0;
}

.calendar-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday {
  color: #65717e;
  font-size: 12px;
  min-width: 0;
  text-align: center;
}

.calendar-day {
  background: #eef2f5;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #17202a;
  cursor: pointer;
  font-size: 13px;
  min-height: 32px;
  min-width: 0;
  padding: 0;
  position: relative;
  width: 100%;
}

.calendar-day.is-outside {
  opacity: 0.38;
}

.calendar-day.is-selected {
  border-color: #17202a;
  box-shadow: inset 0 0 0 1px #17202a;
}

.calendar-day.has-new-events::after {
  border: 2px solid #116b4f;
  border-radius: 50%;
  content: "";
  height: 24px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
}

.coverage-none {
  background: #e1e5e9;
}

.coverage-low {
  background: #ffe58a;
}

.coverage-mid {
  background: #bff2c8;
}

.coverage-high {
  background: #5bd66d;
}

.calendar-legend {
  border-top: 1px solid #eef2f5;
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
  padding-top: 10px;
}

.legend-item {
  align-items: center;
  color: #65717e;
  display: flex;
  font-size: 12px;
  gap: 6px;
}

.legend-swatch {
  border-radius: 4px;
  height: 12px;
  width: 18px;
}

.daily-panel {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 16px;
}

.admin-page {
  display: grid;
  gap: 18px;
}

.admin-shell {
  grid-template-columns: 300px minmax(0, 1fr);
}

.admin-nav {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.admin-nav__button {
  background: var(--secondary-green);
  box-shadow: none;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.admin-nav__button.is-active {
  background: #1f7a5a;
  box-shadow: 0 10px 20px rgba(31, 122, 90, 0.16);
}

.admin-nav__button:not(.is-active):hover,
.secondary:hover {
  background: var(--secondary-green-hover);
}

.admin-panel {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 16px;
}

.admin-panel__head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-panel__actions {
  display: flex;
  gap: 10px;
}

.admin-grid--vehicles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-grid--vehicles > *,
.admin-grid--vehicles label,
.admin-grid--vehicles input,
.admin-grid--vehicles select {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.admin-grid--vehicles select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technology-tree {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  max-height: 600px;
  overflow: auto;
}

.technology-bulk-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.technology-bulk-actions button {
  min-height: 36px;
  padding: 7px 12px;
}

.technology-folder {
  align-items: center;
  background: var(--surface-soft);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--text);
  display: grid;
  gap: 8px;
  grid-template-columns: 16px 20px minmax(0, 1fr) 54px;
  min-height: 42px;
  padding: 8px 12px;
  text-align: left;
  width: 100%;
}

.technology-folder:hover {
  background: #edf5f1;
  box-shadow: none;
  transform: none;
}

.technology-folder__count {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.technology-branch.is-collapsed > .technology-branch__children {
  display: none;
}

.technology-branch.is-collapsed > .technology-folder .tree-caret {
  transform: rotate(-90deg);
}

.technology-vehicle {
  align-items: center;
  border-left: 4px solid #91a29b;
  border-top: 1px solid #e6eeea;
  display: grid;
  gap: 10px;
  grid-template-columns: 34px 24px minmax(260px, 1fr) 132px minmax(190px, 240px) 92px;
  min-height: 72px;
  padding: 7px 10px 7px calc(10px + var(--tech-depth, 0) * 14px);
}

.technology-vehicle--active { border-left-color: #4eb878; }
.technology-vehicle--paused { border-left-color: #d9b43a; }
.technology-vehicle--available { border-left-color: #82a8b8; }
.technology-vehicle--no_data { border-left-color: #cf8e45; }
.technology-vehicle--no_sensor { border-left-color: #b87732; }
.technology-vehicle--no_permission { border-left-color: #b85c5c; }
.technology-vehicle--unavailable,
.technology-vehicle--archived { border-left-color: #9aa5af; }

.technology-vehicle__identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.technology-vehicle__identity strong,
.technology-vehicle__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technology-vehicle__identity small,
.technology-last-data {
  color: var(--muted);
  font-size: 12px;
}

.technology-last-data {
  display: grid;
  gap: 2px;
  line-height: 1.25;
  min-width: 0;
}

.technology-last-data small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technology-import-hint {
  color: #9a5520;
  font-weight: 600;
}

.technology-state {
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  padding: 5px 9px;
  text-align: center;
  white-space: nowrap;
}

.technology-state--active { background: #e3f5e9; color: #176f43; }
.technology-state--paused { background: #fff5d8; color: #7b6213; }
.technology-state--available { background: #e8f2f5; color: #416c7c; }
.technology-state--no_data { background: #fff0df; color: #8a561d; }
.technology-state--no_sensor { background: #fff0df; color: #8a561d; }
.technology-state--no_permission { background: #ffe8e8; color: #9c3636; }
.technology-state--unavailable,
.technology-state--archived { background: #edf0f2; color: #66717a; }

.technology-toggle {
  display: grid;
  place-items: center;
}

.technology-toggle input {
  height: 18px;
  width: 18px;
}

.technology-actions {
  display: grid;
  gap: 6px;
}

.technology-archive-button,
.technology-sensors-button {
  min-height: 34px;
  padding: 6px 10px;
}

.technology-import {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.technology-import h3 {
  font-size: 16px;
  margin: 0 0 12px;
}

.modal {
  align-items: center;
  background: rgba(21, 35, 47, 0.28);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 24px;
  position: fixed;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal__panel {
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  width: min(760px, 100%);
}

.modal__head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal__head h2 {
  margin: 0 0 4px;
}

.modal__head p {
  color: var(--muted);
  margin: 0;
}

.sensor-settings-panel {
  padding: 22px;
}

.sensor-settings-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sensor-settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.admin-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.admin-grid--mail {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.admin-grid--ml {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.source-editor {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
}

.source-list {
  overflow: hidden;
}

.source-list__row {
  align-items: center;
  background: rgba(255, 255, 255, 0.62);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 120px 86px;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.source-list__row.is-active {
  background: rgba(216, 239, 230, 0.78);
}

.source-list__row strong,
.source-list__row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-list__row small {
  color: var(--muted);
  font-size: 12px;
}

.source-editor__actions {
  display: flex;
  gap: 10px;
}

.source-editor__actions button {
  flex: 1;
}

.admin-split {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
}

.admin-split--ml {
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  margin-top: 14px;
}

.admin-column {
  align-content: start;
  display: grid;
  gap: 12px;
}

.admin-column label {
  display: grid;
  gap: 6px;
}

.admin-column span {
  color: #65717e;
  font-size: 12px;
}

.admin-grid label {
  display: grid;
  gap: 6px;
}

.admin-grid span {
  color: #65717e;
  font-size: 12px;
}

.admin-table {
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  margin-top: 14px;
  overflow: hidden;
}

.admin-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 84px minmax(220px, 1fr) 130px 130px 180px;
  padding: 10px 12px;
}

.admin-row--users {
  grid-template-columns: 84px minmax(180px, 1fr) 130px 180px 110px;
}

.admin-row--boundary {
  grid-template-columns: minmax(180px, 1.4fr) 90px minmax(190px, 1fr) minmax(190px, 1fr) 110px;
}

.admin-row--ml-stats {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) 120px;
}

.admin-row--action-log {
  grid-template-columns: 130px 170px 170px minmax(220px, 0.9fr) minmax(320px, 1.4fr);
}

.admin-row--action-log span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row--action-log span:last-child {
  white-space: normal;
}

.action-log-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.action-log-toolbar label {
  display: grid;
  gap: 6px;
}

.action-log-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.action-log-toolbar input {
  min-width: 170px;
}

.action-log-table {
  margin-top: 10px;
}

.action-log-pager {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.action-log-pager button {
  min-height: 30px;
  min-width: 42px;
}

.action-log-pager button:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.ml-note {
  color: #65717e;
  font-size: 14px;
  margin-top: 14px;
}

.compact-button {
  min-height: 34px;
  padding: 7px 12px;
}

.access-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  padding: 14px;
}

.access-panel__head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.access-panel h3,
.access-panel h4,
.access-panel p {
  margin: 0;
}

.access-panel p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.access-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 0.7fr) minmax(360px, 1.3fr);
  margin-bottom: 14px;
}

.access-section-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.access-actions {
  display: flex;
  gap: 8px;
}

.access-tree-scheme {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.access-tree-scheme span {
  color: var(--muted);
  font-size: 12px;
}

.access-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0;
  margin-top: 8px;
  max-height: 340px;
  overflow: auto;
}

.access-list--vehicles {
  max-height: 380px;
}

.access-list--vehicles .tree-row {
  border-radius: 0;
}

.access-item {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 22px minmax(0, 1fr);
  padding: 9px 10px;
}

.access-item + .access-item {
  border-top: 1px solid #eef2f5;
}

.access-item input {
  min-height: auto;
}

.report-page {
  align-content: start;
  display: grid;
  gap: 18px;
  grid-auto-rows: max-content;
}

.report-shell {
  grid-template-columns: 390px minmax(0, 1fr);
}

.report-toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 220px) minmax(180px, 220px) auto auto auto auto;
  justify-content: start;
}

.report-toolbar label {
  display: grid;
  gap: 6px;
}

.report-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.report-toolbar button {
  min-width: 92px;
}

.report-selected-count {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.report-table {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.report-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.report-tab {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--text);
  min-height: 34px;
}

.report-tab.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.report-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(190px, 1.4fr) 110px 110px 120px 150px 110px 130px;
  padding: 10px 12px;
}

.report-row > span,
.report-row > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-row + .report-row {
  border-top: 1px solid #eef2f5;
}

.report-row--head {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.report-row--total {
  background: #eef7f2;
  border-top: 2px solid #b7d8c6;
}

.event-type-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  padding: 4px 9px;
}

.event-type-refuel {
  background: #d8f4df;
  color: #166534;
}

.event-type-suspected_drain {
  background: #f5d6d6;
  color: #8a2d2d;
}

.report-empty {
  padding: 14px;
}

.admin-row + .admin-row {
  border-top: 1px solid #eef2f5;
}

.admin-row--head {
  background: #f8faf9;
  color: #65717e;
  font-size: 13px;
  font-weight: 700;
}

.switch-cell input {
  min-height: auto;
}

.mail-recipient-field {
  grid-column: span 2;
}

.recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.recipient-pill {
  align-items: center;
  background: #f8faf9;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  display: inline-flex;
  gap: 8px;
  padding: 6px 8px;
}

.recipient-pill button {
  background: transparent;
  color: #536271;
  min-height: auto;
  padding: 0 4px;
}

.daily-panel__head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chart-tools {
  display: flex;
  gap: 8px;
}

.icon-button {
  font-size: 20px;
  line-height: 1;
  min-width: 38px;
  padding: 0;
}

.daily-chart-wrap {
  height: 340px;
  position: relative;
  width: 100%;
}

.vehicle-card__head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.vehicle-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.vehicle-form label {
  display: grid;
  gap: 6px;
}

.vehicle-form span {
  color: #65717e;
  font-size: 12px;
}

.vehicle-form .is-hidden {
  display: none;
}

.vehicle-icon-field {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
}

.vehicle-icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vehicle-icon-option {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #bac5d0;
  box-shadow: none;
  color: #17202a;
  display: inline-flex;
  justify-content: center;
  min-height: 40px;
  min-width: 44px;
  padding: 0 8px;
}

.vehicle-icon-option.is-active {
  background: #d9efe7;
  border-color: #1f7a5a;
  box-shadow: inset 0 0 0 1px #1f7a5a;
}

.vehicle-icon-glyph {
  font-size: 21px;
  line-height: 1;
}

.modal {
  align-items: center;
  background: rgba(23, 32, 42, 0.36);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal__panel {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(23, 32, 42, 0.22);
  max-width: 760px;
  padding: 18px;
  width: min(760px, 100%);
}

.modal__foot {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
}

#dailyChart {
  cursor: grab;
  height: 340px;
  width: 100%;
}

#dailyChart.dragging {
  cursor: grabbing;
}

#dailyChart.selecting-manual-event {
  cursor: crosshair;
}

.chart-tooltip {
  background: #17202a;
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  left: 0;
  max-width: 260px;
  padding: 7px 9px;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translate(12px, -50%);
  white-space: nowrap;
  z-index: 3;
}

.hidden {
  display: none;
}

.layout {
  display: block;
}

#events {
  display: grid;
  gap: 10px;
}

.events-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.events-head h2 {
  margin-bottom: 0;
}

.manual-event-add-btn {
  background: #1f7a5a;
  border-color: #1f7a5a;
  color: #ffffff;
  min-height: 32px;
  width: 32px;
}

.manual-badge {
  background: #e6f4ee;
  border: 1px solid #b7d8c6;
  border-radius: 999px;
  color: #116b4f;
  font-size: 12px;
  padding: 3px 8px;
}

.ml-auto-badge {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 3px 8px;
}

.event-stats {
  align-items: center;
  color: #65717e;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  font-size: 13px;
  gap: 6px;
  justify-content: flex-start;
  margin-left: auto;
  white-space: nowrap;
}

.stat-pill {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  padding: 5px 7px;
}

.notification-bell {
  overflow: visible;
  position: relative;
}

.notification-bell--active {
  background: var(--green);
}

.notification-badge {
  align-items: center;
  background: #b83c3c;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 5px;
  position: absolute;
  right: -8px;
  top: -8px;
}

.notification-panel {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(21, 35, 47, 0.14);
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
  inset: 0 0 0 auto;
  max-height: 100vh;
  padding: 18px;
  position: fixed;
  width: min(390px, 100vw);
  z-index: 900;
}

.notification-panel.hidden {
  display: none;
}

.notification-panel__head,
.notification-panel__foot {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.notification-panel__foot {
  flex: 0 0 auto;
  margin-top: auto;
}

.notification-panel__head div {
  display: grid;
  gap: 2px;
}

.notification-panel__head strong {
  font-size: 18px;
}

.notification-panel__head span,
.notification-item__meta {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.notification-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.notification-item {
  align-items: stretch;
  background: rgba(247, 250, 249, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  flex: 0 0 auto;
  gap: 7px;
  grid-template-rows: auto auto auto;
  line-height: 1.25;
  min-height: 94px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.notification-item__title {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.notification-type--refuel,
.notification-type--drain {
  border-radius: 999px;
  font-size: 12px;
  padding: 3px 9px;
}

.notification-type--refuel {
  background: #d9f5df;
  color: #0d6b38;
}

.notification-type--drain {
  background: #f9dcdc;
  color: #8a2626;
}

.notification-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
}

.notification-journal-modal {
  z-index: 1200;
}

.notification-journal {
  max-height: calc(100vh - 48px);
  max-width: 980px;
  overflow: auto;
  width: min(980px, calc(100vw - 32px));
}

.notification-journal__filters {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) auto;
  margin-bottom: 12px;
}

.notification-journal__table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.notification-journal-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 1.7fr) minmax(100px, 0.8fr) 90px 105px 130px 100px 80px;
  padding: 10px 12px;
}

.notification-journal-row + .notification-journal-row {
  border-top: 1px solid #e8eef2;
}

.notification-journal-row--head {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.notification-journal__pager {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.notification-toast-root {
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(390px, calc(100vw - 32px));
  pointer-events: none;
  position: fixed;
  right: 22px;
  z-index: 1300;
}

.notification-toast {
  background: rgba(47, 96, 158, 0.18);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(47, 96, 158, 0.26);
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(31, 75, 132, 0.13);
  color: #153554;
  display: grid;
  gap: 4px;
  min-height: 0;
  padding: 13px 15px;
  pointer-events: auto;
  text-align: left;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.notification-toast span {
  color: #2f609e;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.notification-toast strong {
  color: #102a43;
  font-size: 15px;
}

.notification-toast small {
  color: #486579;
  font-size: 13px;
}

.notification-toast--hide {
  opacity: 0;
  transform: translateY(10px);
}

.event {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 12px;
}

.event--processed {
  background: #f8faf9;
  border-color: #b7d8c6;
}

.event:hover {
  border-color: #1f7a5a;
}

.event--active {
  border-color: #a33b3b;
}

.manual-draft {
  border-color: #1f7a5a;
}

.manual-draft__hint {
  color: #52616f;
  font-size: 14px;
  margin-bottom: 10px;
}

.manual-type-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.event-detail {
  border-top: 1px solid #eef2f5;
  cursor: default;
  margin-top: 14px;
  padding-top: 14px;
}

.event-detail__top {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(380px, 0.95fr) minmax(460px, 1.05fr);
}

.event-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.2;
}

.event-title__left {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge {
  border-radius: 999px;
  font-size: 12px;
  padding: 3px 8px;
}

.status-new {
  background: #fff2bf;
  color: #775b00;
}

.status-confirmed {
  background: #d8f4df;
  color: #166534;
}

.status-false_positive {
  background: #f5d6d6;
  color: #8a2d2d;
}

.status-ignored {
  background: #e1e5e9;
  color: #52616f;
}

.meta {
  color: #65717e;
  font-size: 13px;
  margin-top: 7px;
}

.event-meta-line {
  align-items: center;
  color: #65717e;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 6px 12px;
  margin-top: 8px;
}

.event-meta-line strong {
  color: #52616f;
  font-weight: 600;
}

aside {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 16px;
}

.empty {
  color: #65717e;
}

.chart {
  border-bottom: 1px solid #d9e0e7;
  border-left: 1px solid #d9e0e7;
  height: 180px;
  margin: 0;
  width: 100%;
}

.event-detail__chart {
  max-height: 180px;
}

.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.review-tag {
  background: #ffffff;
  border-color: #9fb0bf;
  color: #17202a;
  min-height: 28px;
  padding: 0 9px;
}

.review-tag.is-active {
  background: #d9efe7;
  border-color: #1f7a5a;
  box-shadow: inset 0 0 0 1px #1f7a5a;
  color: #116b4f;
}

.event-summary {
  align-content: start;
  display: grid;
  gap: 8px;
  margin: 0;
}

.event-boundary-tools {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(320px, 0.82fr) minmax(520px, 1.18fr);
  margin: 12px 0;
}

.event-adjust {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) auto;
  margin: 0;
}

.event-adjust-panel {
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.event-adjust-panel__head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.event-adjust-panel__head strong {
  display: block;
}

.event-adjust-panel__head span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.boundary-learning {
  align-content: start;
  align-items: start;
  background: #eef7f2;
  border: 1px solid #b7d8c6;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 10px 12px;
}

.boundary-learning--muted {
  background: #f7faf9;
  border-color: var(--line);
}

.boundary-learning strong {
  color: var(--text);
}

.boundary-learning__head {
  display: grid;
  gap: 2px;
}

.boundary-learning span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.boundary-learning__facts {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.boundary-learning__facts span {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(183, 216, 198, 0.8);
  border-radius: 6px;
  color: var(--text);
  display: grid;
  gap: 2px;
  padding: 6px 8px;
}

.boundary-learning__facts b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.adjust-bound {
  display: grid;
  gap: 4px;
}

.event-adjust span {
  color: #65717e;
  font-size: 12px;
}

.adjust-stepper {
  align-items: center;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  min-height: 36px;
  padding: 3px;
}

.adjust-stepper .icon-button {
  min-height: 30px;
  width: 34px;
}

.adjust-stepper strong {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adjust-volume {
  align-self: center;
  color: #17202a;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.event-adjust > button {
  align-self: end;
  min-height: 34px;
  padding: 0 14px;
  width: 118px;
}

.event-summary p {
  color: #17202a;
  line-height: 1.45;
  margin: 0;
}

.event-summary dl {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin: 0;
}

.event-summary dl div {
  background: #f8faf9;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 7px 9px;
}

.event-summary dl .event-summary__item--wide {
  grid-column: span 2;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: start;
}

.event-summary dt {
  color: #65717e;
  font-size: 12px;
}

.event-summary dd {
  font-size: 14px;
  margin: 0;
}

.reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.reason-list span {
  background: #eef7f2;
  border: 1px solid #b7d8c6;
  border-radius: 999px;
  color: #1f7a5a;
  font-size: 12px;
  padding: 4px 8px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.secondary {
  background: var(--secondary-green);
}

.danger {
  background: #a33b3b;
}

textarea {
  min-height: 76px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

pre {
  background: #f4f6f8;
  border-radius: 6px;
  overflow: auto;
  padding: 10px;
}

@media (max-width: 860px) {
  header, .toolbar, .daily-panel__head, .vehicle-card__head, .events-head, .modal__foot, .admin-panel__head {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell {
    display: block;
  }

  .admin-shell {
    display: block;
  }

  .app-sidebar {
    align-items: stretch;
    border-bottom: 1px solid #d9e0e7;
    border-right: 0;
    height: auto;
    position: static;
  }

  .vehicle-tree {
    max-height: 320px;
  }

  .app-main {
    padding: 16px;
  }

  .event-stats {
    margin-left: 0;
    justify-content: flex-start;
  }

  .vehicle-form {
    grid-template-columns: 1fr;
  }

  .event-adjust {
    grid-template-columns: 1fr;
  }

  .event-adjust-panel__head {
    display: grid;
  }

  .adjust-volume {
    text-align: left;
  }

  .event-detail__top {
    grid-template-columns: 1fr;
  }

  .event-summary dl .event-summary__item--wide {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .event-boundary-tools {
    grid-template-columns: 1fr;
  }

  .boundary-learning,
  .boundary-learning--muted {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .boundary-learning__facts {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .admin-grid, .admin-split, .admin-row, .report-toolbar, .report-row {
    grid-template-columns: 1fr;
  }

  .admin-panel__actions {
    display: grid;
    width: 100%;
  }

  .technology-vehicle {
    grid-template-columns: 30px 22px minmax(0, 1fr);
    padding-left: 8px;
  }

  .technology-state,
  .technology-last-data,
  .technology-actions {
    grid-column: 3;
    justify-self: start;
  }

  .sensor-settings-grid {
    grid-template-columns: 1fr;
  }

  .admin-row--head {
    display: none;
  }

  .admin-row--action-log {
    grid-template-columns: 1fr;
  }
}

/* Brand refresh */
.app-shell {
  grid-template-columns: 390px minmax(0, 1fr);
}

.app-sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(247, 250, 249, 0.78) 100%);
  backdrop-filter: blur(16px);
  border-right-color: var(--line);
  box-shadow: 8px 0 28px rgba(21, 35, 47, 0.04);
}

header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--line);
}

.brand-block {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-block--header {
  gap: 14px;
}

.brand-mark {
  align-items: center;
  background: var(--glass-strong);
  border: 1px solid rgba(213, 224, 230, 0.82);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(21, 35, 47, 0.05);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  flex: 0 0 auto;
  gap: 2px 10px;
  min-height: 54px;
  padding: 8px 12px;
  width: 100%;
}

.brand-mark img {
  display: block;
  height: auto;
  grid-row: 1 / span 2;
  max-height: 38px;
  max-width: 118px;
}

.brand-mark strong {
  align-self: end;
  color: var(--text);
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
}

.brand-mark span {
  align-self: start;
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
}

.brand-mark--small {
  min-height: 46px;
  width: 82px;
}

.brand-mark--small img {
  max-height: 34px;
}

h1 {
  color: var(--text);
  font-size: 25px;
  letter-spacing: 0;
}

h2 {
  color: var(--text);
}

p,
.user-badge,
.meta,
.event-meta-line,
.event-stats,
.admin-grid span,
.vehicle-form span,
.event-adjust span,
.event-summary dt,
.legend-item,
.calendar-weekday,
.empty {
  color: var(--muted);
}

button {
  background: var(--green);
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(31, 122, 90, 0.16);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button:hover,
.button-link:hover {
  box-shadow: 0 10px 20px rgba(21, 35, 47, 0.14);
  transform: translateY(-1px);
}

.secondary {
  background: var(--secondary-green);
}

.danger {
  background: var(--danger);
}

select,
input,
textarea {
  border-color: #b8c7d1;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.14);
  outline: none;
}

.toolbar {
  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(213, 224, 230, 0.72);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(21, 35, 47, 0.05);
  padding: 10px;
}

.daily-panel,
.admin-panel,
.event,
aside,
.modal__panel,
.login-panel {
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  border-color: rgba(213, 224, 230, 0.86);
  box-shadow: 0 10px 24px rgba(21, 35, 47, 0.06);
}

.daily-panel,
.admin-panel,
.event,
.modal__panel,
.calendar-popup {
  border-radius: 8px;
}

.event {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.event:hover {
  border-color: var(--green);
  box-shadow: 0 12px 24px rgba(21, 35, 47, 0.08);
  transform: translateY(-1px);
}

.event--active {
  border-color: var(--green);
  box-shadow: 0 14px 30px rgba(31, 122, 90, 0.14);
}

.event--processed,
.event-summary dl div,
.recipient-pill,
.admin-row--head {
  background: var(--surface-soft);
}

.stat-pill,
.admin-table,
.adjust-stepper,
.chart,
.event-summary dl div,
.recipient-pill {
  border-color: var(--line);
}

.calendar-popup {
  box-shadow: var(--shadow);
}

.calendar-day {
  color: var(--text);
}

.calendar-day.is-selected {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.calendar-day.has-new-events::after {
  border-color: var(--green-dark);
}

.chart-tooltip {
  background: var(--text);
}

.review-tag.is-active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
  color: var(--green-dark);
}

.reason-list span {
  color: var(--green);
}

.login-page {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.2) 44%, rgba(255, 255, 255, 0.72) 66%, rgba(255, 255, 255, 0.96) 100%),
    url("/static/brand/login-background.png") center / cover no-repeat,
    var(--bg);
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 520px) minmax(24px, 0.12fr);
  min-height: 100vh;
  padding: 42px 56px;
}

.login-panel {
  align-self: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.16));
  backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -24px 42px rgba(255, 255, 255, 0.12),
    0 24px 58px rgba(31, 75, 132, 0.12);
  gap: 18px;
  grid-column: 2;
  max-width: 420px;
  padding: 28px;
}

.login-brand {
  align-items: center;
  display: grid;
  gap: 2px 12px;
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 4px;
}

.login-brand img {
  display: block;
  grid-row: 1 / span 2;
  max-height: 50px;
  max-width: 140px;
}

.login-brand strong {
  color: var(--text);
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.login-brand span {
  color: var(--muted);
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.login-panel__head {
  margin-bottom: 2px;
}

.login-hero {
  align-self: start;
  display: grid;
  gap: 28px;
}

@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .login-hero {
    max-width: 620px;
    width: 100%;
  }

  .login-panel {
    grid-column: auto;
    justify-self: start;
  }
}

@media (max-width: 860px) {
  .brand-block {
    align-items: flex-start;
  }

  .brand-mark {
    width: 96px;
  }

  .login-page {
    padding: 18px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .app-shell,
  .report-shell {
    display: block;
    min-height: auto;
  }

  .app-sidebar,
  .report-toolbar,
  .report-tabs,
  #reportStatus,
  .header-actions {
    display: none !important;
  }

  .app-main,
  main {
    padding: 0;
  }

  .report-page {
    gap: 10px;
  }

  .admin-panel {
    border: 0;
    box-shadow: none;
    padding: 0 0 12px;
  }

  .admin-panel__head {
    align-items: flex-start;
  }

  .report-table {
    border-color: #c8d0d6;
  }

  .report-row {
    break-inside: avoid;
    grid-template-columns: 170px 90px 90px 100px 130px 80px 100px;
    padding: 7px 8px;
  }

  button,
  .button-link {
    display: none !important;
  }
}

/* Fleet analytics dashboard */
.dashboard-page {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
}

.dashboard-tree {
  max-height: calc(100vh - 350px);
}

.dashboard-toolbar {
  display: grid;
  gap: 14px;
}

.dashboard-toolbar h1 {
  margin-bottom: 4px;
}

.dashboard-toolbar p,
.dashboard-panel__head p {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-period {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(170px, 240px) minmax(170px, 240px) auto;
}

.dashboard-period label {
  display: grid;
  gap: 5px;
}

.dashboard-period span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-period input,
.dashboard-period button {
  height: 42px;
}

.dashboard-status {
  min-height: 18px;
}

.dashboard-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-kpi {
  display: grid;
  gap: 6px;
  min-height: 112px;
  overflow: hidden;
  padding: 15px;
  position: relative;
}

.dashboard-kpi::after {
  background: var(--green);
  bottom: 0;
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
}

.dashboard-kpi--red::after { background: #bd5959; }
.dashboard-kpi--blue::after { background: #4385a8; }
.dashboard-kpi span, .dashboard-kpi small { color: var(--muted); }
.dashboard-kpi span { font-size: 13px; min-height: 31px; }
.dashboard-kpi strong { font-size: 24px; line-height: 1; }
.dashboard-kpi small { font-size: 11px; }

.dashboard-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(280px, .72fr);
}

.dashboard-panel {
  min-width: 0;
  padding: 15px;
}

.dashboard-panel h2 { margin-bottom: 4px; }
.dashboard-panel__head { margin-bottom: 15px; }
.dashboard-panel__head--table { align-items: end; display: flex; justify-content: space-between; }

.dashboard-bars {
  display: grid;
  gap: 8px;
}

.dashboard-bar-row {
  align-items: center;
  display: grid;
  font-size: 12px;
  gap: 8px;
  grid-template-columns: minmax(110px, 150px) minmax(70px, 1fr) 78px;
}

.dashboard-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar-track {
  background: #e4eeeb;
  border-radius: 3px;
  display: block;
  height: 14px;
  overflow: hidden;
}

.dashboard-bar-track i {
  background: linear-gradient(90deg, var(--green-dark), #56b78f);
  border-radius: 3px;
  display: block;
  height: 100%;
}

.dashboard-bar-track i.is-rate {
  background: linear-gradient(90deg, #387a96, #76b5b0);
}

.dashboard-bar-row > strong {
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.dashboard-time {
  align-items: center;
  display: grid;
  gap: 20px;
  justify-items: center;
}

.dashboard-donut {
  aspect-ratio: 1;
  background: conic-gradient(var(--green) 0 var(--moving), #86b6c8 var(--moving) 100%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  width: min(180px, 72%);
}

.dashboard-donut > span {
  align-content: center;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, .94);
  border-radius: 50%;
  display: grid;
  text-align: center;
  width: 64%;
}

.dashboard-donut strong { font-size: 21px; }
.dashboard-donut small { color: var(--muted); font-size: 11px; }
.dashboard-legend { display: grid; gap: 9px; width: 100%; }
.dashboard-legend > div { align-items: center; display: grid; gap: 7px; grid-template-columns: 12px 1fr auto; font-size: 12px; }
.dashboard-legend i { background: var(--green); border-radius: 2px; height: 12px; width: 12px; }
.dashboard-legend i.is-stationary { background: #86b6c8; }

.dashboard-table-wrap { overflow-x: auto; }
.dashboard-table { border-collapse: collapse; min-width: 850px; width: 100%; }
.dashboard-table th, .dashboard-table td { border-bottom: 1px solid var(--line); padding: 10px; text-align: right; white-space: nowrap; }
.dashboard-table th { background: rgba(240, 247, 245, .78); color: var(--muted); font-size: 12px; }
.dashboard-table td { font-size: 13px; }
.dashboard-table th:first-child, .dashboard-table td:first-child { text-align: left; }
.dashboard-table td:first-child strong, .dashboard-table td:first-child span { display: block; }
.dashboard-table td:first-child span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.dashboard-quality { background: #d9efe6; border-radius: 10px; color: var(--green-dark); display: inline-block; font-size: 11px; padding: 3px 7px; }
.dashboard-quality.is-warning { background: #fff0c6; color: #7c5c00; }

@media (max-width: 1280px) {
  .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-panel--time { grid-column: 1 / -1; }
  .dashboard-time { grid-template-columns: 180px minmax(220px, 360px); justify-content: center; }
}

@media (max-width: 860px) {
  .dashboard-page { padding: 12px; }
  .dashboard-period, .dashboard-kpis, .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-panel--time { grid-column: auto; }
  .dashboard-time { grid-template-columns: 1fr; }
  .dashboard-bar-row { grid-template-columns: minmax(90px, 120px) minmax(50px, 1fr) 70px; }
  .dashboard-panel__head--table { align-items: flex-start; flex-direction: column; gap: 8px; }
  .dashboard-tree { max-height: 400px; }
}
