:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #222;
  background: #f7f8fb;
  --asset-label-font-size: 13px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  width: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

header {
  padding: 1rem 1.25rem;
  background: #1f4e79;
  color: white;
  position: sticky;
  top: 0;
  z-index: 1200;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.header-session-status {
  margin-right: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 251, 255, 0.88);
  font-size: 0.74rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  max-width: min(34vw, 360px);
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.header-session-db,
.header-session-user {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-session-user {
  opacity: 0.86;
}

.header-group-label {
  font-size: 0.85rem;
  opacity: 0.92;
}

.header-group-select {
  min-width: 200px;
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
}

.header-group-active {
  padding: 0.34rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.14);
  color: #f8fbff;
  font-size: 0.78rem;
  white-space: nowrap;
}

.header-icon-link {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.header-icon-link:hover {
  background: rgba(255, 255, 255, 0.26);
}

.app-info-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.app-info-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

.app-info-modal-card {
  position: relative;
  width: min(620px, 96vw);
  background: #ffffff;
  border-radius: 0.85rem;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.35);
  border: 1px solid #dbe3ee;
  padding: 1.1rem 1.1rem 1rem;
  display: grid;
  gap: 0.85rem;
  max-height: 86vh;
  overflow: auto;
}

.app-info-modal-card h2 {
  margin: 0;
  color: #1f4e79;
  font-size: 1.1rem;
}

.app-info-version {
  font-weight: 700;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #dbe3ee;
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
}

.app-info-facts {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.app-info-fact-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 0.6rem;
  padding: 0.34rem 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 0.9rem;
}

.app-info-fact-row dt {
  margin: 0;
  color: #475569;
  font-weight: 600;
}

.app-info-fact-row dd {
  margin: 0;
  color: #0f172a;
  word-break: break-word;
}

.app-info-actions {
  display: flex;
  justify-content: flex-start;
}

.app-info-actions .secondary-button {
  text-decoration: none;
}

.app-info-close-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.app-info-close-btn:hover {
  background: #f8fafc;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.logout-button {
  position: absolute;
  right: 1.25rem;
  top: 1rem;
  padding: 0.6rem 1rem;
  border: none;
  background: white;
  color: #1f4e79;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
}

.logout-button:hover {
  background: #e2e8f0;
}

header p {
  margin: 0;
  opacity: 0.85;
}

main {
  display: grid;
  grid-template-columns: 72px 320px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 0.22s ease;
}

main.sidebar-collapsed {
  grid-template-columns: 72px 0 1fr;
}

body.unauthenticated main {
  grid-template-columns: 1fr;
}

body.unauthenticated #menuRibbon,
body.unauthenticated #sidebar {
  display: none;
}

body.unauthenticated #mapContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(180deg, #eef4fb 0%, #f8fafc 100%);
}

body.unauthenticated #map,
body.unauthenticated #dashboardPanel,
body.unauthenticated #settingsPanel,
body.unauthenticated #overviewPanel,
body.unauthenticated #usersPanel,
body.unauthenticated #groupsPanel,
body.unauthenticated #routesPanel,
body.unauthenticated #reportsPanel,
body.unauthenticated #geozonesPanel {
  display: none !important;
}

.menu-ribbon {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  background: #f1f5f9;
  border-right: 1px solid #e1e5ea;
  align-items: center;
  position: sticky;
  top: 5.35rem;
  max-height: calc(100vh - 5.35rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-self: start;
}

.menu-ribbon::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.menu-button-toggle {
  margin-bottom: 0.25rem;
}

.menu-button {
  width: 100%;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.menu-button:hover,
.menu-button.active {
  background: #ffffff;
  color: #1f4e79;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.menu-icon {
  font-size: 1.25rem;
}

.menu-label {
  font-size: 0.75rem;
  line-height: 1;
}

#sidebar {
  background: #ffffff;
  border-right: 1px solid #e1e5ea;
  overflow: hidden;
  min-width: 0;
  transition: opacity 0.18s ease, border-color 0.18s ease;
  position: sticky;
  top: 5.35rem;
  max-height: calc(100vh - 5.35rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-self: start;
}

#sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

main.sidebar-collapsed #sidebar {
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
}

.asset-action-panel {
  display: flex;
  padding-bottom: 1rem;
}

.asset-action-panel.hidden {
  display: none;
}

.map-selection-panel {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.2rem;
}

.map-selection-button {
  width: 100%;
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  font-weight: 600;
}

.map-selection-meta {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.35;
}

.secondary-button {
  padding: 0.7rem 0.85rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f4e79;
  border-radius: 0.5rem;
  cursor: pointer;
}

.secondary-button:hover {
  background: #f8fafc;
}

.hidden {
  display: none !important;
}

.asset-form-panel {
  padding: 1rem;
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
  width: 100%;
}

.asset-form-header {
  margin-bottom: 1rem;
}

.asset-form-panel form {
  display: grid;
  gap: 0.85rem;
}

.form-section {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 0.9rem;
  background: #f8fafc;
  display: grid;
  gap: 0.75rem;
}

.form-section legend {
  padding: 0 0.5rem;
  font-weight: 700;
  color: #1f2937;
}

.image-preview {
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.5rem;
  display: inline-flex;
  width: 100%;
  max-width: 240px;
  background: white;
}

.image-preview img {
  width: 100%;
  border-radius: 0.5rem;
  object-fit: cover;
  max-height: 180px;
}

.asset-form-panel label {
  font-size: 0.88rem;
  color: #334155;
}

.asset-form-panel input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 0.55rem;
}

.asset-form-panel select,
.asset-form-panel textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 0.55rem;
  background: #ffffff;
  color: #111827;
}

.asset-form-panel textarea {
  resize: vertical;
  min-height: 110px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.form-actions button {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.55rem;
  cursor: pointer;
}

#saveAssetBtn {
  background: #1f4e79;
  color: white;
}

.password-visibility-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}
.password-visibility-field input {
  margin: 0;
}
.password-visibility-toggle {
  padding: 0.7rem 0.85rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f4e79;
  border-radius: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
}
.password-visibility-toggle:hover {
  background: #f8fafc;
}
#saveUserBtn {
  background: #1f4e79;
  color: white;
}

#cancelAssetBtn {
  background: #f8fafc;
  color: #1f4e79;
}

#cancelUserBtn {
  background: #f8fafc;
  color: #1f4e79;
}

.danger-button {
  background: #b91c1c;
  color: #ffffff;
}

.danger-button:hover {
  background: #991b1b;
}

.user-form-columns {
  display: grid;
  gap: 0.9rem;
}

.user-form-hint {
  margin-bottom: 0.8rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.6rem;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.88rem;
}

.user-role-hint {
  margin-bottom: 0.8rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #fcd34d;
  border-radius: 0.6rem;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.88rem;
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.user-subordinate-row td {
  background: #fffaf0;
}

.user-form-section {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.8rem;
  background: #f8fafc;
}

.user-form-section legend {
  font-weight: 700;
  color: #1f2937;
  padding: 0 0.35rem;
}

.user-form-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.user-field {
  display: grid;
  gap: 0.35rem;
}

.user-field-full {
  grid-column: 1 / -1;
}

@media (min-width: 1100px) {
  .user-form-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .user-form-section-full {
    grid-column: 1 / -1;
  }

  .user-form-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  #userEditorPanel {
    padding-right: 1.25rem;
  }

  #userEditorPanel .user-form-columns {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 1rem;
  }

  #userEditorPanel .user-form-section {
    min-width: 0;
  }

  #userEditorPanel .user-form-section-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

.form-message {
  min-height: 1.4rem;
  color: #1f4e79;
  font-size: 0.9rem;
}

.overview-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.overview-header input {
  flex: 1;
  min-width: 220px;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}

.overview-help {
  font-size: 0.82rem;
  color: #64748b;
}

.muted {
  color: #64748b;
  font-size: 0.85em;
}

.io-meta-editor {
  border: 1px solid #dbe4ee;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  margin-top: 0.5rem;
  display: grid;
  gap: 0.6rem;
}

.io-meta-editor-head {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.io-meta-editor-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.io-meta-editor-grid label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: #334155;
}

.io-meta-editor-grid input {
  padding: 0.5rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  background: #ffffff;
}

.io-meta-editor-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 180px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}

.table-export-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.table-export-title {
  font-size: 0.82rem;
  color: #475569;
  font-weight: 600;
}

.table-export-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.table-export-actions .secondary-button {
  padding: 0.3rem 0.55rem;
  font-size: 0.74rem;
}

.groups-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.groups-actions {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 0.75rem;
}

.groups-action-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  background: #f8fafc;
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.groups-action-card h3 {
  margin: 0;
  font-size: 0.92rem;
  color: #334155;
}

.groups-action-card input,
.groups-action-card select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #ffffff;
}

.groups-selected {
  font-size: 0.88rem;
  color: #334155;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 0.45rem;
  padding: 0.5rem;
}

.groups-action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.groups-tree-wrapper {
  overflow: auto;
  max-height: calc(100vh - 220px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.85rem;
}

.asset-group-tree-wrapper {
  max-height: 240px;
  margin-bottom: 0.5rem;
}

.asset-group-tree-toolbar {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.asset-group-tree-toolbar input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #ffffff;
}

.asset-group-tree-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.asset-group-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 1.9rem;
}

.user-compact-select-field {
  display: grid;
  gap: 0.4rem;
}

.user-connection-picker {
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  background: #f8fafc;
  padding: 0.2rem 0.65rem 0.65rem;
}

.user-connection-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0 0.4rem;
  font-size: 0.88rem;
  color: #1f2937;
  font-weight: 600;
}

.user-connection-picker summary::-webkit-details-marker {
  display: none;
}

.user-connection-summary {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

#userConnectionsContainer {
  gap: 0.6rem;
}

.user-picker-panel {
  display: grid;
  gap: 0.5rem;
}

.user-picker-search {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #ffffff;
}

.user-picker-options {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 0.35rem;
  padding-right: 0.1rem;
}

.user-picker-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #334155;
}

.user-picker-option.inherited {
  background: #f8fafc;
  border-style: dashed;
}

.user-picker-option-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.user-picker-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.user-picker-option input {
  width: auto;
  margin: 0;
}

.user-picker-option.hidden {
  display: none;
}

.user-picker-empty {
  color: #64748b;
  font-size: 0.84rem;
  padding: 0.35rem 0.2rem;
}

.asset-group-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.55rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.82rem;
}

.asset-group-empty {
  color: #64748b;
  font-size: 0.84rem;
}

.asset-custom-attributes {
  display: grid;
  gap: 0.65rem;
}

.asset-custom-attributes-list {
  display: grid;
  gap: 0.55rem;
}

.asset-custom-attribute-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) auto;
  gap: 0.55rem;
  align-items: end;
}

.asset-custom-attribute-row label {
  display: grid;
  gap: 0.3rem;
}

.asset-custom-attribute-row .secondary-button {
  min-width: 0;
  padding: 0.7rem 0.8rem;
}

.asset-custom-attributes-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.groups-tree.vertical .group-root,
.groups-tree.vertical .group-children {
  list-style: none;
  margin: 0;
  padding-left: 1rem;
}

.groups-tree.vertical .group-root {
  padding-left: 0;
}

.group-node {
  margin: 0.25rem 0;
}

.group-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  cursor: pointer;
}

.group-row:hover {
  background: #f8fafc;
}

.group-row.selected {
  background: #eff6ff;
  color: #1e3a8a;
}

.group-expand-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #d1d5db;
  border-radius: 0.4rem;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
}

.group-expand-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.group-name {
  flex: 1;
  text-align: left;
}

.group-id {
  color: #64748b;
  font-size: 0.78rem;
}

.groups-tree.horizontal {
  display: flex;
  gap: 0.75rem;
  min-height: 240px;
}

.group-column {
  min-width: 230px;
  max-width: 280px;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.group-column-title {
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.group-column-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem;
}

.group-column-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #ffffff;
  cursor: pointer;
  color: #1f2937;
}

.group-column-item small {
  color: #64748b;
}

.group-column-item.active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}

.asset-group-item.selected {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #1f2937;
}

.asset-group-item.selected small {
  color: #374151;
}

.overview-table {
  width: 100%;
  border-collapse: collapse;
}

.overview-table th,
.overview-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.overview-table thead th {
  background: #f8fafc;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 1;
}

.overview-table th:hover {
  color: #1f4e79;
}

.overview-table tbody tr:hover {
  background: #f8fafc;
}

.overview-table .sort-indicator {
  margin-left: 0.35rem;
  font-size: 0.85rem;
}

.secondary-button.active {
  background: #1f4e79;
  color: #ffffff;
  border-color: #1f4e79;
}

#dashboardPanel {
  height: 100%;
  overflow: auto;
  padding: 1rem 1.1rem 1.2rem;
  background: #f3f4f6;
}

#dashboardPanel:not(.hidden) {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 0.8rem;
  min-height: 0;
}

.dashboard-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard-intro h2 {
  margin: 0;
  font-size: 1.95rem;
  line-height: 1.1;
  color: #1f2937;
}

.dashboard-intro p {
  margin: 0.2rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.dashboard-last-update {
  font-size: 0.82rem;
  color: #2563eb;
  font-weight: 700;
  padding-top: 0.3rem;
}

#settingsPanel {
  height: 100%;
  overflow: auto;
  padding: 1rem;
}

#settingsPanel:not(.hidden) {
  display: block;
}

.settings-content {
  display: grid;
  gap: 0.75rem;
}

.settings-sidebar-panel {
  display: grid;
  gap: 0.45rem;
}

.settings-sidebar-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #64748b;
}

.settings-sidebar-button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
}

.settings-sidebar-button.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.settings-section.hidden {
  display: none !important;
}

.settings-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.9rem;
  display: grid;
  gap: 0.75rem;
}

.settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.settings-card-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #1f2937;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem 0.9rem;
}

.settings-form-grid label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: #475569;
}

.settings-form-grid input,
.settings-form-grid select {
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.5rem 0.6rem;
  background: #ffffff;
}

.settings-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.settings-placeholder-card {
  min-height: 180px;
  align-content: start;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.dashboard-kpi-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  background: #ffffff;
  padding: 0.78rem 0.8rem;
  display: grid;
  gap: 0.3rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.dashboard-kpi-card h4 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  font-size: 0.72rem;
}

.dashboard-kpi-main {
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 800;
  color: #111827;
}

.dashboard-kpi-sub {
  color: #94a3b8;
  font-size: 0.76rem;
}

.dashboard-kpi-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.dashboard-kpi-split strong {
  color: #0f172a;
  font-size: 1.03rem;
}

.dashboard-kpi-card-highlight {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.25);
}

.dashboard-kpi-card-alert {
  border-left: 3px solid #ef4444;
}

.dashboard-kpi-card-alert .dashboard-kpi-main {
  color: #dc2626;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  padding: 0.55rem 0.65rem;
  align-self: start;
}

#dashboardVehiclesContainer {
  min-height: 0;
  overflow: auto;
  align-content: start;
}

#dashboardVehiclesContainer .dashboard-vehicle-grid-wrap,
#dashboardVehiclesContainer .dashboard-section-head,
#dashboardVehiclesContainer .dashboard-detail-wrap,
#dashboardVehiclesContainer .dashboard-table-wrapper {
  align-self: start;
}

.dashboard-mapping {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.85rem;
  display: grid;
  gap: 0.65rem;
}

.dashboard-mapping-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dashboard-mapping-head h3 {
  margin: 0;
  font-size: 0.98rem;
  color: #1f2937;
}

.dashboard-mapping-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.dashboard-mapping-actions select,
.dashboard-mapping-actions input {
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.45rem 0.6rem;
  min-width: 130px;
}

.dashboard-mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.75rem;
}

.dashboard-mapping-grid label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: #475569;
}

.dashboard-mapping-grid input {
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.45rem 0.6rem;
}

.io-detected-keys {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.io-mapping-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.io-suggestion-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #f8fafc;
  padding: 0.55rem;
  display: grid;
  gap: 0.35rem;
}

.io-suggestion-card h4 {
  margin: 0;
  font-size: 0.84rem;
  color: #1f2937;
}

.io-suggestion-text {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.35;
}

.io-suggestion-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.io-suggestion-actions button {
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  font-size: 0.75rem;
}

.io-suggestion-actions button:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.io-model-table-wrapper {
  display: grid;
  gap: 0.45rem;
}

.io-model-table-head {
  font-size: 0.82rem;
  color: #334155;
  font-weight: 600;
}

.io-model-table-scroll {
  max-height: 320px;
  overflow: auto;
}

.io-model-table th,
.io-model-table td {
  font-size: 0.78rem;
  vertical-align: middle;
}

.io-model-table td input[type='checkbox'] {
  width: 16px;
  height: 16px;
}

.dashboard-view-toggle {
  display: flex;
  gap: 0.5rem;
}

.dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dashboard-section-head h3 {
  margin: 0;
  font-size: 1.75rem;
  color: #1f2937;
}

.dashboard-section-head span {
  font-size: 0.78rem;
  font-weight: 700;
  color: #2563eb;
  background: #e5efff;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.dashboard-vehicle-grid-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.dashboard-vehicle-card {
  border: 1px solid #dbe3ee;
  border-radius: 0.6rem;
  background: #ffffff;
  padding: 0.75rem;
  display: grid;
  gap: 0.45rem;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.dashboard-controls-panel {
  display: grid;
  gap: 0.6rem;
  background: #eef2f7;
  border: 1px solid #d9dde3;
  border-radius: 0.6rem;
  padding: 0.6rem;
}

.dashboard-control-group {
  display: grid;
  gap: 0.24rem;
}

.dashboard-control-group label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  font-weight: 700;
}

.dashboard-controls-panel input,
.dashboard-controls-panel select {
  background: #fff;
}

.routes-controls-panel {
  display: grid;
  gap: 0.55rem;
  background: #eef2f7;
  border: 1px solid #d9dde3;
  border-radius: 0.6rem;
  padding: 0.6rem;
}

.routes-control-group {
  display: grid;
  gap: 0.24rem;
}

.routes-control-group label,
.routes-custom-range label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  font-weight: 700;
}

.routes-controls-panel select,
.routes-controls-panel input {
  width: 100%;
  max-width: none;
  background: #ffffff;
}

.routes-custom-range {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
}

.reports-controls-panel {
  display: grid;
  gap: 0.55rem;
  background: #eef2f7;
  border: 1px solid #d9dde3;
  border-radius: 0.6rem;
  padding: 0.6rem;
}

.reports-control-group {
  display: grid;
  gap: 0.24rem;
}

.reports-control-group label,
.reports-custom-range label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  font-weight: 700;
}

.reports-controls-panel select,
.reports-controls-panel input {
  width: 100%;
  max-width: none;
  background: #ffffff;
}

.reports-controls-panel select[multiple] {
  min-height: 9rem;
}

.reports-custom-range {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
}

.routes-speed-scale {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  color: #475569;
}

.routes-speed-scale-bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(90deg, #16a34a 0%, #facc15 40%, #dc2626 75%, #2b0a3d 100%);
}

.routes-legend {
  display: grid;
  gap: 0.22rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.5rem;
  background: #ffffff;
}

.routes-legend-title {
  font-size: 0.72rem;
  color: #334155;
  font-weight: 700;
}

.routes-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: #475569;
}

.routes-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  display: inline-block;
  flex: 0 0 12px;
}

.routes-legend-swatch.is-green { background: #16a34a; }
.routes-legend-swatch.is-yellow { background: #facc15; }
.routes-legend-swatch.is-red { background: #dc2626; }
.routes-legend-swatch.is-purple { background: #2b0a3d; }

.table-threshold-panel {
  margin-top: 0.55rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.6rem;
  background: #f8fafc;
  overflow: hidden;
}

.table-threshold-panel details > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  background: #eef2f7;
}

.table-threshold-panel details > summary::-webkit-details-marker {
  display: none;
}

.table-threshold-body {
  display: grid;
  gap: 0.45rem;
  padding: 0.6rem;
}

.table-threshold-body label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.table-threshold-body input,
.table-threshold-body select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  padding: 0.38rem 0.5rem;
  font-size: 0.8rem;
  background: #ffffff;
}

.table-threshold-range-row,
.table-threshold-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.table-threshold-color-row input[type='color'] {
  min-height: 34px;
  padding: 0.18rem;
}

.table-threshold-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.table-threshold-actions .secondary-button {
  width: 100%;
  font-size: 0.78rem;
  padding: 0.45rem 0.55rem;
}

.table-threshold-rules {
  display: grid;
  gap: 0.4rem;
}

.table-threshold-empty {
  color: #64748b;
  font-size: 0.78rem;
}

.table-threshold-rule {
  border: 1px solid #e2e8f0;
  border-radius: 0.45rem;
  padding: 0.4rem;
  background: #fff;
  display: grid;
  gap: 0.35rem;
}

.table-threshold-rule-main {
  display: grid;
  gap: 0.15rem;
  font-size: 0.74rem;
  color: #475569;
}

.table-threshold-rule-colors {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.table-threshold-rule-colors .swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
  display: inline-block;
}

.table-threshold-rule-colors .secondary-button {
  margin-left: auto;
  padding: 0.25rem 0.45rem;
  font-size: 0.72rem;
}

.dashboard-vehicle-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.dashboard-vehicle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dashboard-vehicle-head h3 {
  margin: 0;
  font-size: 0.98rem;
}

.dashboard-vehicle-meta {
  font-size: 0.78rem;
  color: #64748b;
}

.dashboard-vehicle-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.65rem;
  font-size: 0.84rem;
}

.dashboard-vehicle-grid strong {
  color: #0f172a;
}

.dashboard-table-wrapper {
  max-height: calc(100vh - 280px);
}

.dashboard-filter-row input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.4rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.dashboard-detail-wrap {
  display: grid;
  gap: 0.75rem;
}

.dashboard-detail-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-detail-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.dashboard-detail-table td:first-child {
  width: 34%;
  font-weight: 600;
  color: #334155;
}

.dashboard-vehicle-card,
.dashboard-table tbody tr {
  cursor: pointer;
}

.dashboard-table tbody tr {
  cursor: pointer;
}

.dashboard-detail-wrap {
  display: grid;
  gap: 0.7rem;
}

.dashboard-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard-detail-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-view-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-detail-header h3 {
  margin: 0;
  font-size: 1.02rem;
  color: #1f2937;
}

.dashboard-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dashboard-detail-toolbar input {
  width: 100%;
  max-width: 360px;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.45rem 0.6rem;
}

.dashboard-detail-toolbar .secondary-button {
  white-space: nowrap;
}

.dashboard-detail-period {
  display: grid;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: #334155;
}

.dashboard-detail-period select {
  min-width: 220px;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.42rem 0.5rem;
  background: #ffffff;
}

.dashboard-detail-key-picker {
  display: grid;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: #334155;
}

.dashboard-detail-key-picker select {
  min-width: 260px;
  min-height: 132px;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.35rem 0.45rem;
  background: #ffffff;
}

.dashboard-motor-table {
  border: 1px solid #dbe3ee;
  border-radius: 0.55rem;
  background: #ffffff;
}

.dashboard-motor-table > summary {
  cursor: pointer;
  user-select: none;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
  color: #1f2937;
}

.dashboard-motor-table[open] > summary {
  border-bottom: 1px solid #e2e8f0;
}

.dashboard-motor-table .dashboard-table-wrapper {
  border: none;
  border-radius: 0;
}

.dashboard-detail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.dashboard-motor-card {
  display: grid;
  gap: 0.3rem;
  text-align: left;
  padding: 0.8rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.65rem;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.dashboard-motor-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.dashboard-motor-card.is-mapped {
  border-color: #bfdbfe;
}

.dashboard-motor-card.is-selected {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px #60a5fa inset;
}

.dashboard-motor-card.is-updated {
  animation: dashboardValueFlash var(--dashboard-flash-duration, 8s) ease-out 1 both;
  animation-delay: var(--dashboard-update-delay, 0ms);
}

.dashboard-motor-card-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2937;
}

.dashboard-motor-card-value {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.dashboard-motor-card-key {
  font-size: 0.76rem;
  color: #64748b;
}

@keyframes dashboardValueFlash {
  0% {
    background: var(--dashboard-flash-color, #dcfce7);
    border-color: var(--dashboard-flash-border-color, #86efac);
  }
  55% {
    background: var(--dashboard-flash-color, #dcfce7);
    border-color: var(--dashboard-flash-border-color, #86efac);
  }
  100% {
    background: #ffffff;
    border-color: #dbe3ee;
  }
}

.dashboard-detail-table tr.mapped-row td:first-child {
  color: #1e3a8a;
}

.dashboard-detail-table tr.history-selected-row {
  background: #eff6ff;
}

.dashboard-detail-table tr.is-updated td {
  animation: dashboardTableValueFlash var(--dashboard-flash-duration, 8s) ease-out 1 both;
  animation-delay: var(--dashboard-update-delay, 0ms);
}

@keyframes dashboardTableValueFlash {
  0% {
    background: var(--dashboard-flash-color, #dcfce7);
  }
  55% {
    background: var(--dashboard-flash-color, #dcfce7);
  }
  100% {
    background: #ffffff;
  }
}

.dashboard-history-panel {
  border: 1px solid #dbe3ee;
  border-radius: 0.65rem;
  background: #ffffff;
  padding: 0.7rem;
  display: grid;
  gap: 0.6rem;
}

.dashboard-history-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 0.75rem;
  align-items: end;
}

.dashboard-history-custom-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.75rem;
}

.dashboard-history-custom-controls.hidden {
  display: none;
}

.dashboard-history-controls label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: #334155;
}

.dashboard-history-controls select,
.dashboard-history-controls input,
.dashboard-history-custom-controls input {
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.4rem 0.5rem;
  background: #ffffff;
}

.dashboard-detail-key-picker {
  display: grid;
  gap: 0.25rem;
  min-width: 240px;
}

.dashboard-detail-key-picker-label {
  font-size: 0.82rem;
  color: #334155;
}

.dashboard-history-key-dropdown {
  position: relative;
}

.dashboard-history-key-dropdown summary {
  list-style: none;
  border: 1px solid #d1d5db;
  border-radius: 0.6rem;
  padding: 0.68rem 2.2rem 0.68rem 0.8rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  cursor: pointer;
  min-height: 42px;
  display: flex;
  align-items: center;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.dashboard-history-key-dropdown summary::-webkit-details-marker {
  display: none;
}

.dashboard-history-key-dropdown summary::after {
  content: '▾';
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.9rem;
}

.dashboard-history-key-dropdown[open] summary {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.18);
}

.dashboard-history-key-dropdown[open] summary::after {
  content: '▴';
}

.dashboard-history-key-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 0.4rem);
  left: 0;
  width: min(360px, 100%);
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 0.8rem;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
  padding: 0.65rem;
}

.dashboard-history-key-menu-head {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.45rem;
}

.dashboard-history-key-options {
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 0.3rem;
}

.dashboard-history-key-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.45rem 0.5rem;
  border-radius: 0.55rem;
  color: #1e293b;
  cursor: pointer;
}

.dashboard-history-key-option:hover {
  background: #f8fafc;
}

.dashboard-history-key-option input {
  margin: 0.15rem 0 0;
}

.dashboard-history-actions {
  display: flex;
  align-items: end;
}

.dashboard-history-actions .secondary-button {
  width: 100%;
}

.dashboard-history-range-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.dashboard-history-range-card {
  border: 1px solid #dbe3ee;
  border-radius: 0.55rem;
  background: #f8fafc;
  padding: 0.6rem;
  display: grid;
  gap: 0.4rem;
}

.dashboard-history-range-title {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1f2937;
}

.dashboard-history-range-title span {
  color: #64748b;
  font-weight: 500;
}

.dashboard-history-range-card label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: #475569;
}

.dashboard-history-range-card input {
  border: 1px solid #d1d5db;
  border-radius: 0.4rem;
  padding: 0.4rem 0.5rem;
  background: #ffffff;
}

.dashboard-history-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 0.7rem;
  align-items: start;
}

.dashboard-history-canvas {
  width: 100%;
  min-height: 260px;
  border: 1px solid #e2e8f0;
  border-radius: 0.45rem;
  background: #f8fafc;
  touch-action: none;
  cursor: grab;
}

.dashboard-history-canvas-wrap {
  position: relative;
}

.dashboard-history-inspect {
  border: 1px solid #dbe3ee;
  border-radius: 0.55rem;
  background: #f8fafc;
  padding: 0.6rem;
  display: grid;
  gap: 0.5rem;
}

.dashboard-history-inspect.is-expanded {
  grid-column: 1 / -1;
}

.dashboard-history-inspect-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-history-inspect-head .secondary-button {
  width: auto;
  white-space: nowrap;
}

.dashboard-history-inspect-values {
  display: grid;
  gap: 0.25rem;
  max-height: 170px;
  overflow: auto;
}

.dashboard-history-inspect-value-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.78rem;
  color: #334155;
}

.dashboard-history-inspect-value-row strong {
  color: #0f172a;
}

.dashboard-history-inspect-map {
  width: 100%;
  height: 185px;
  border: 1px solid #dbe3ee;
  border-radius: 0.5rem;
  overflow: hidden;
}

.dashboard-history-inspect.is-expanded .dashboard-history-inspect-map {
  height: 360px;
}

.dashboard-history-canvas-hint {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.72rem;
  color: #334155;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  pointer-events: none;
}

.dashboard-history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.dashboard-history-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #ffffff;
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  color: #334155;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.dashboard-history-legend-item:hover {
  background: #f8fafc;
}

.dashboard-history-legend-item.is-hidden {
  opacity: 0.45;
}

.dashboard-history-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
}

.dashboard-history-legend-key {
  font-weight: 700;
  color: #0f172a;
}

.dashboard-history-legend-range,
.dashboard-history-legend-points {
  color: #475569;
}

@media (max-width: 1080px) {
  .dashboard-history-main {
    grid-template-columns: 1fr;
  }

  .dashboard-history-inspect {
    grid-column: 1 / -1;
  }
}

.dashboard-detail-table th[data-dashboard-detail-sort] {
  cursor: pointer;
}

.panel {
  padding: 1rem;
}

.auth-login-panel {
  width: min(440px, 100%);
}

.auth-login-card {
  border: 1px solid #d7e0ea;
  border-radius: 0.9rem;
  background: #ffffff;
  padding: 1.25rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.auth-login-card h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #0f172a;
}

.auth-login-hint {
  margin: 0.4rem 0 0.9rem;
  color: #475569;
  font-size: 0.9rem;
}

.auth-login-actions {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-login-actions button {
  margin-top: 0;
  flex: 1;
}

.auth-login-icon-link {
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #1f4e79;
  background: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-decoration: none;
}

.auth-login-icon-link:hover {
  background: #eef2f7;
}

#loginPanel label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #374151;
}

#loginPanel input[type="url"],
#loginPanel input[type="text"],
#loginPanel input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  margin-top: 0.25rem;
}

#loginPanel button {
  width: 100%;
  padding: 0.45rem 0.8rem;
  border: none;
  background: #1f4e79;
  color: white;
  border-radius: 0.375rem;
  cursor: pointer;
}

#loginPanel button[disabled] {
  opacity: 0.6;
  cursor: default;
}

#loginMessage {
  min-height: 1.25rem;
  margin-top: 0.55rem;
  color: #b00020;
  font-size: 0.9rem;
}

.logout-button {
  position: static;
  margin-left: auto;
  align-self: center;
  padding: 0.65rem 1rem;
  border: none;
  background: #ffffff;
  color: #1f4e79;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
}

.logout-button:hover {
  background: #e2e8f0;
}

#mapContainer {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#dashboardPanel,
#settingsPanel,
#overviewPanel,
#usersPanel,
#groupsPanel,
#routesPanel,
#reportsPanel,
#geozonesPanel {
  min-height: 0;
  height: 100%;
  overflow: auto;
}

#mapContainer.routes-layout {
  display: grid;
  grid-template-rows: minmax(300px, 55vh) minmax(240px, 1fr);
  gap: 0.6rem;
  padding: 0.6rem;
  background: #f3f4f6;
}

#mapContainer.routes-layout #map {
  border: 1px solid #dbe3ee;
  border-radius: 0.55rem;
  overflow: hidden;
}

#routesPanel {
  height: 100%;
  min-height: 0;
  padding: 0.25rem 0;
}

#routesPanel:not(.hidden) {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.5rem;
}

.routes-table-wrapper {
  max-height: none;
  height: 100%;
}

#routesHistoryTable tbody tr {
  cursor: pointer;
}

#routesHistoryTable tbody tr.routes-row-selected {
  background: #eff6ff;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-zoom-level-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 850;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #dbe3ee;
  background: rgba(255, 255, 255, 0.9);
  color: #1f2937;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

#sidebar .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.asset-controls {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.asset-controls input,
.asset-controls select {
  width: 100%;
  padding: 0.42rem 0.62rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #fafbfc;
  color: #111827;
  font-size: 0.86rem;
}

.asset-controls select {
  max-width: 180px;
}

.asset-controls-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
}

#assetSort {
  max-width: none;
  min-width: 0;
}

#mapDensitySelect {
  display: none;
}

.density-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #f8fafc;
  padding: 0.15rem;
}

.density-btn {
  width: 30px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: transparent;
  color: #475569;
  cursor: pointer;
  line-height: 1;
  font-size: 0.92rem;
}

.density-btn:hover {
  background: #ffffff;
  color: #1f4e79;
}

.density-btn.is-active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

#settingsControls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

#settingsControls .secondary-button {
  width: 100%;
  text-align: left;
}

#settingsControls input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #fafbfc;
  color: #111827;
}

#deviceList {
  overflow: auto;
  margin-top: 0.55rem;
  padding-right: 0.25rem;
}

.custom-marker {
  display: block;
}

.marker-icon {
  display: block;
  transform-origin: center center;
}

.marker-icon.stopped {
  width: 12px;
  height: 12px;
  background: #2563eb;
  border-radius: 2px;
  border: 2px solid white;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
}

.marker-icon.moving {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 14px solid #16a34a;
}

.asset-cluster-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.24);
  font-weight: 700;
}

.asset-cluster-icon.online {
  background: radial-gradient(circle at 30% 30%, #22c55e 0%, #15803d 100%);
}

.asset-cluster-icon.offline {
  background: radial-gradient(circle at 30% 30%, #ef4444 0%, #991b1b 100%);
}

.asset-cluster-count {
  font-size: 0.85rem;
  line-height: 1;
}

.empty-state {
  color: #6b7280;
  padding: 1rem 0;
}

#status {
  margin-bottom: 0.55rem;
  font-size: 0.95rem;
  color: #4a5568;
}

@media (max-width: 860px) {
  .asset-controls-row {
    grid-template-columns: 1fr;
  }

  .density-toggle {
    justify-content: flex-start;
  }
}

.device-card {
  border: 1px solid #dde2ea;
  border-radius: 0.75rem;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.device-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.device-card.is-selected {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35), 0 12px 24px rgba(37, 99, 235, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.device-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.device-card-subline {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.device-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.device-card-head h3 {
  margin: 0;
}

.device-card-title-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.device-card-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.device-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(148, 163, 184, 0.45);
}

.device-status-dot.online {
  background: #16a34a;
}

.device-status-dot.offline {
  background: #dc2626;
}

.device-ignition-badge {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.72rem;
  line-height: 1;
  background: #fff;
  color: #64748b;
}

.device-ignition-badge.on {
  border-color: #86efac;
  background: #ecfdf5;
  color: #15803d;
}

.device-ignition-badge.off {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.device-speed-row {
  margin-top: 0.15rem;
}

.device-speed-row strong {
  color: #111827;
}

.device-metrics {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.device-telemetry-section {
  display: grid;
  gap: 0.3rem;
}

.device-telemetry-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.device-metric {
  display: grid;
  grid-template-columns: 62px 1fr 44px;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #475569;
}

.device-metric-label,
.device-metric-value {
  white-space: nowrap;
}

.device-metric-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.device-metric-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.device-metric-fuel .device-metric-fill {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.device-metric-adblue .device-metric-fill {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.device-metric-battery .device-metric-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.device-metric-bev .device-metric-fill {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.device-metric-vehicle .device-metric-fill {
  background: linear-gradient(90deg, #dc2626, #fb7185);
}

.device-metric-vehicle .device-metric-value-inline {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #7c2d12;
}

.device-card div {
  margin: 0.25rem 0;
  font-size: 0.95rem;
  color: #4a5568;
}

#deviceList.density-tight .device-card {
  padding: 0.55rem;
  margin-bottom: 0.55rem;
}

#deviceList.density-tight .device-card h3 {
  font-size: 0.92rem;
}

#deviceList.density-tight .device-card-subline,
#deviceList.density-tight .device-metrics {
  display: none;
}

#deviceList.density-tight .device-speed-row {
  margin-top: 0;
  font-size: 0.82rem;
}

#deviceList.density-comfortable .device-card {
  padding: 1rem;
  margin-bottom: 1rem;
}

#deviceList.density-comfortable .device-card h3 {
  font-size: 1.05rem;
}

#deviceList.density-comfortable .device-card-subline {
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

#deviceList.density-comfortable .device-metrics {
  gap: 0.5rem;
  margin-top: 0.65rem;
}

/* Geozones Styles */
.panel-split {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  padding: 1rem;
}

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

.content-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 1px solid #e2e8f0;
  padding-left: 1rem;
}

.overview-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #ffffff;
}

.zones-actions {
  display: grid;
  gap: 0.75rem;
}

.zones-action-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  background: #f8fafc;
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.zones-action-card h3 {
  margin: 0;
  font-size: 0.92rem;
  color: #334155;
}

.zones-action-card button {
  width: 100%;
}

.zones-selected {
  font-size: 0.88rem;
  color: #334155;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 0.45rem;
  padding: 0.5rem;
  min-height: 2rem;
  display: flex;
  align-items: center;
}

.zones-action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

.asset-name-tooltip {
  background: rgba(17, 24, 39, 0.92);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
  padding: 0.2rem 0.55rem;
  font-size: var(--asset-label-font-size);
  font-weight: 600;
}

.leaflet-tooltip-right.asset-name-tooltip::before {
  border-right-color: rgba(17, 24, 39, 0.92);
}

.leaflet-tooltip-left.asset-name-tooltip::before {
  border-left-color: rgba(17, 24, 39, 0.92);
}

.asset-name-label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.asset-name-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.asset-name-status-dot.online {
  background: #16a34a;
}

.asset-name-status-dot.offline {
  background: #dc2626;
}

.zone-tooltip {
  background: rgba(31, 78, 121, 0.95);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
}

.zone-tooltip::before {
  border-top-color: rgba(31, 78, 121, 0.95);
}

.zone-form-panel {
  margin-top: 0.5rem;
}

.zone-form-panel .asset-form-header {
  margin-bottom: 0.75rem;
}

.zone-form-panel .asset-form-panel {
  border-left: none;
  padding: 0;
}

.zone-form-panel .form-actions {
  margin-top: 0.25rem;
}

.zone-form-panel .user-form-columns {
  gap: 0.75rem;
}

.zone-form-panel .user-form-section-grid {
  grid-template-columns: 1fr;
}

.zone-map-container {
  width: 100%;
  height: 400px;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #f8fafc;
  position: relative;
}

.zone-draw-info {
  font-size: 0.82rem;
  color: #64748b;
  padding: 0.5rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.45rem;
  margin-top: 0.5rem;
}

.primary-button {
  background: #1f4e79;
  color: white;
}

.primary-button:hover {
  background: #1a3d5c;
}

.asset-form-panel .primary-button,
.asset-form-panel .secondary-button {
  min-width: 120px;
}

.asset-form-panel .secondary-button {
  background: #f8fafc;
}

.asset-form-panel .secondary-button:hover {
  background: #edf2f7;
}

.close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-button:hover {
  color: #1f2937;
}

.asset-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.asset-form-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #1f2937;
}

.map-tools-note {
  font-size: 0.8rem;
  color: #64748b;
}

#mapToolsPanel {
  flex-wrap: wrap;
}

#mapToolsPanel button {
  flex: 1 1 140px;
}

.map-tools-control {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 230px;
  max-width: 280px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 0.75rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.32s ease;
  transform: translateX(0);
}

.map-tools-control.collapsed {
  transform: translateX(calc(100% - 50px));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.map-tools-toggle {
  border: 1px solid #1f4e79;
  border-radius: 999px;
  background: #1f4e79;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  width: 50px;
  height: 34px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.map-tools-toggle:hover {
  background: #285f93;
  border-color: #173a59;
  transform: translateX(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.26);
}

.map-tools-toggle:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.map-tools-toggle-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  transform: rotate(180deg);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.map-tools-toggle-icon svg {
  width: 100%;
  height: 100%;
}

.map-tools-toggle-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-tools-control.collapsed .map-tools-toggle-icon {
  transform: rotate(0deg);
}

.map-tools-content {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.map-tools-control.collapsed .map-tools-content {
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
}

.map-tools-control .map-tools-note {
  line-height: 1.35;
}

.map-tools-control .secondary-button {
  width: 100%;
}

#geozonesSearchInput,
#geozonesTableWrapper {
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-card-wide {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .app-info-modal-card {
    width: min(94vw, 620px);
    padding: 0.95rem 0.9rem 0.85rem;
  }

  .app-info-fact-row {
    grid-template-columns: 1fr;
    gap: 0.18rem;
  }
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 72px 1fr;
  }

  main.sidebar-collapsed {
    grid-template-columns: 72px 1fr;
  }

  #sidebar {
    display: none;
  }

  .dashboard-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-intro h2 {
    font-size: 1.45rem;
  }

  .dashboard-section-head h3 {
    font-size: 1.3rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-mapping-grid {
    grid-template-columns: 1fr;
  }

  .io-mapping-suggestions {
    grid-template-columns: 1fr;
  }

  .dashboard-history-controls {
    grid-template-columns: 1fr;
  }
}

