html,
body,
#root {
  height: 100%;
  max-width: 100%;
}

body {
  overflow: hidden;
}

.app-shell,
.main,
.topbar,
.topbar-tools,
.grid,
.module-grid,
.action-strip-grid,
.inbox-grid,
.inbox-grid-pro,
.fleet-grid,
.panel,
.table-wrap,
.conversation-detail,
.conversation-list,
.message-thread,
.support-card,
.stack,
.session-chip,
.panel form,
.panel .settings-grid,
.panel .action-bar,
.panel .inline-metrics {
  min-width: 0;
}

.app-shell {
  height: 100vh;
  overflow: hidden;
  align-items: stretch;
}

.sidebar {
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.main {
  height: 100vh;
  overflow-y: auto;
  overflow-x: clip;
  align-content: start;
  overscroll-behavior: contain;
  padding-bottom: 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 4px;
  backdrop-filter: blur(14px);
}

.topbar-utility-row,
.topbar-main-row {
  min-width: 0;
}

.topbar-highlight-strip {
  min-width: 0;
}

.module-grid,
.inbox-grid-pro {
  align-items: start;
}

.module-grid > .panel,
.module-grid > .stack,
.inbox-grid-pro > .panel,
.inbox-grid-pro > div {
  align-self: start;
  min-height: 0;
}

.module-grid > .panel:first-child,
.module-grid > .stack:first-child {
  position: sticky;
  top: 112px;
  max-height: calc(100vh - 136px);
  overflow-y: auto;
}

.inbox-grid-pro > .panel,
.inbox-grid-pro > div {
  max-height: calc(100vh - 136px);
  overflow-y: auto;
}

.module-grid:has(.fleet-grid) {
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
}

.fleet-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.fleet-card,
.fleet-card-body,
.table-wrap table {
  min-width: 0;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
}

@media (max-width: 1280px) {
  body {
    overflow: auto;
  }

  .app-shell,
  .main {
    height: auto;
    overflow: visible;
  }

  .sidebar {
    max-height: none;
    overflow: visible;
  }

  .topbar {
    position: static;
    backdrop-filter: none;
  }

  .module-grid > .panel:first-child,
  .module-grid > .stack:first-child,
  .inbox-grid-pro > .panel,
  .inbox-grid-pro > div {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .module-grid:has(.fleet-grid) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.image-upload-preview {
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,245,249,0.92));
  padding: 12px;
}

.vehicle-upload-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 14px;
  background: #f8fafc;
}


.upload-field {
  display: grid;
  gap: 10px;
}

.upload-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.95));
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  cursor: pointer;
}

.upload-trigger:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.upload-trigger-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.upload-trigger-copy strong {
  font-size: 0.95rem;
  color: #0f172a;
}

.upload-trigger-copy span {
  color: #64748b;
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-trigger-action {
  flex-shrink: 0;
  padding: 9px 12px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
}

.sidebar {
  padding: 16px 14px;
  gap: 14px;
}

.app-shell.sidebar-compact {
  grid-template-columns: 88px minmax(0, 1fr);
}

.sidebar.compact {
  width: 88px;
  padding-inline: 12px;
}

.brand-panel {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  padding: 2px 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  padding: 5px;
}

.brand-copy {
  gap: 2px;
}

.brand-eyebrow {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.brand {
  font-size: 0.98rem;
  line-height: 1.08;
  max-width: none;
}

.subtitle {
  font-size: 0.74rem;
  line-height: 1.2;
  max-width: none;
}

.nav {
  gap: 14px;
}

.nav-section {
  gap: 8px;
}

.nav-section-items {
  gap: 6px;
}

.sidebar-section-label {
  font-size: 0.68rem;
}

.nav-item {
  padding: 10px 12px;
  gap: 10px;
}

.nav-item-shell {
  gap: 6px;
}

.nav-item-row {
  gap: 6px;
}

.nav-item-shell.has-children .nav-item-row {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.nav-icon-wrap {
  width: 30px;
  height: 30px;
}

.nav-expand {
  border-radius: 10px;
}

.nav-children {
  margin-left: 16px;
  padding-left: 12px;
  gap: 4px;
}

.nav-subitem {
  padding: 8px 10px;
}

.nav-subitem-copy strong {
  font-size: 0.8rem;
}

.nav-subitem-copy small {
  display: none;
}

.nav-copy strong {
  font-size: 0.88rem;
}

.nav-copy small {
  display: none;
}

.sidebar-controls {
  padding-top: 10px;
}

.sidebar-mode-toggle {
  padding: 9px 10px;
  border-radius: 12px;
}

.sidebar-mode-copy strong {
  font-size: 0.84rem;
}

.sidebar-mode-copy small {
  font-size: 0.7rem;
}

@media (min-width: 981px) {
}

@media (max-width: 980px) {
  .sidebar {
    padding: 20px 18px;
    gap: 18px;
  }

  .brand-panel {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 72px;
    height: 72px;
  }

  .brand {
    font-size: 1.1rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }
}
