html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin-bottom: 0;
  overflow: hidden;
}

body > .container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

body > .container-fluid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.app-content-container {
  padding-left: 1rem;
  padding-right: 1rem;
}

body > header,
.footer {
  flex-shrink: 0;
}

.footer {
  padding-bottom: 0.75rem;
  padding-top: 0.75rem;
  text-align: left;
}

.footer .container {
  text-align: left;
}

.footer-content {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.auth-shell {
  align-items: flex-start;
  display: flex;
  justify-content: center;
  padding: 2.5rem 0;
}

.auth-panel {
  background: #ffffff;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgb(15 23 42 / 8%);
  max-width: 26rem;
  padding: 1.5rem;
  width: 100%;
}

.auth-panel-wide {
  max-width: 34rem;
}

.auth-brand {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.auth-brand img {
  height: 3rem;
  width: 3rem;
}

.auth-brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}

.auth-brand p {
  color: #6c757d;
  margin: 0.1rem 0 0;
}

.user-menu {
  margin-left: 1rem;
}

.user-menu .dropdown-item {
  font-size: 0.95rem;
}

.app-hero {
  align-items: center;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.5rem;
}

.home-link-grid {
  display: grid;
  gap: 1rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

@media (min-width: 992px) {
  .home-link-grid {
    max-width: 50vw;
    min-width: 42rem;
  }
}

.app-hero-link {
  color: inherit;
  text-decoration: none;
}

.app-hero-link:hover {
  background: #f7f7f7;
  color: inherit;
}

.app-hero h1,
.page-header-row h1 {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.app-hero h1 {
  font-size: 1.15rem;
}

.app-hero p,
.page-header-row p {
  margin-bottom: 0;
}

.page-header-row {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.superadmin-navbar {
  background-color: #dff1ff;
}

@media (max-width: 575.98px) and (orientation: portrait) {
  .navbar .container-fluid {
    flex-wrap: nowrap;
  }

  .navbar-toggler,
  .navbar-collapse {
    display: none !important;
  }

  .navbar-brand {
    min-width: 0;
  }

  .user-menu {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

.empty-state,
.detail-section {
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  padding: 1rem;
}

.inspection-list {
  display: grid;
  gap: 0.5rem;
}

.inspection-row {
  align-items: center;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  color: inherit;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
  text-decoration: none;
}

.inspection-row:hover {
  background: #f7f7f7;
  color: inherit;
}

.settings-nav-item {
  margin-right: 100px;
}

.settings-menu {
  display: grid;
  gap: 0.5rem;
}

.settings-menu-item {
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  color: inherit;
  padding: 1rem;
  text-decoration: none;
}

.settings-menu-item:hover,
.part-result-panel:hover {
  background: #f7f7f7;
  color: inherit;
}

.parts-search-grid {
  display: grid;
  gap: 0.75rem;
}

.part-result-panel {
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  padding: 1rem;
}

.find-part-thumbnail {
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  float: left;
  height: 4.25rem;
  margin: 0 0.75rem 0.5rem 0;
  object-fit: contain;
  width: 4.25rem;
}

.find-part-title-row {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.find-part-price {
  white-space: nowrap;
}

.find-part-meta {
  clear: both;
}

.detail-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.detail-section h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.detail-section-title-row {
  align-items: baseline;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.detail-section-title-row h2 {
  margin-bottom: 0;
}

.readonly-id {
  color: #6c757d;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.superadmin-panel-link {
  color: inherit;
  display: block;
  text-decoration: none;
}

.superadmin-panel-link:focus,
.superadmin-panel-link:hover {
  background: #f7f7f7;
  color: inherit;
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
}

.detail-section dl,
.detail-section p {
  margin-bottom: 0;
}

.detail-section dt {
  color: #6c757d;
}

.detail-section dd {
  margin-bottom: 0.75rem;
}

.lookup-debug-panel {
  background: #111827;
  border-radius: 6px;
  color: #e5e7eb;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  max-height: 260px;
  overflow: auto;
  padding: 0.75rem;
  white-space: pre-wrap;
}

.clickable-table-row {
  cursor: pointer;
}

.clickable-table-row:focus,
.clickable-table-row:hover {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
}

.company-table-clickable-row:hover > td,
.company-table-clickable-row:focus > td {
  background: #eaf4ff;
}

.superadmin-building-summary {
  display: grid;
  gap: 0.25rem 0.75rem;
  grid-template-columns: max-content minmax(0, 1fr);
  margin-bottom: 0.75rem;
}

.superadmin-building-summary dd {
  margin-bottom: 0;
}

.trip-map-image {
  border: 1px solid #d7d7d7;
  border-radius: 6px;
  display: block;
  max-width: 100%;
  width: 100%;
}

.customer-search-row {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(12rem, 1fr) auto;
  margin-bottom: 1rem;
}

.customer-search-row-narrow {
  grid-template-columns: minmax(12rem, 50%) auto auto;
  justify-content: start;
}

.customer-show-inactive {
  margin-bottom: 0;
  white-space: nowrap;
}

.customer-sync-actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.part-image-edit-panel {
  align-items: end;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(14rem, 1fr) max-content;
}

.part-image-thumbnail {
  border: 1px solid #d7d7d7;
  border-radius: 6px;
  height: 7rem;
  object-fit: contain;
  width: 7rem;
}

.parts-manager-thumbnail {
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  height: 3.5rem;
  object-fit: contain;
  width: 3.5rem;
}

.part-image-url-field {
  min-width: 0;
}

.part-image-change-button {
  justify-self: start;
  white-space: nowrap;
  width: auto;
}

@media (max-width: 575.98px) {
  .part-image-edit-panel {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
}

.detail-section-wide {
  border: 0;
  grid-column: 1 / -1;
  padding: 0;
}

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

.plain-list {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.plain-list li {
  align-items: baseline;
  display: flex;
  gap: 0.5rem;
}

.building-list,
.area-list,
.note-list {
  display: grid;
  gap: 1rem;
}

.building-detail,
.area-detail,
.note-detail {
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  padding: 1rem;
}

.building-detail {
  background: #fbfbfb;
}

.note-detail {
  background: #fff;
}

.area-detail {
  background: lightcyan;
}

.building-detail-header,
.area-detail-header,
.note-detail-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.building-detail-header h3,
.area-detail-header h4,
.note-detail-header h5 {
  margin-bottom: 0.15rem;
}

.building-detail-header h3 {
  font-size: 1.05rem;
}

.area-detail-header h4 {
  font-size: 1rem;
}

.note-detail-header h5,
.note-detail h6 {
  font-size: 0.95rem;
}

.building-detail-header p,
.area-detail-header p,
.note-text {
  margin-bottom: 0;
}

.estimate-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0.75rem 0;
}

.estimate-table {
  margin-bottom: 0.75rem !important;
}

.photo-list {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
}

.photo-list img {
  aspect-ratio: 4 / 3;
  border: 1px solid #d7d7d7;
  border-radius: 6px;
  object-fit: cover;
  width: 100%;
}

@media (max-width: 700px) {
  .settings-nav-item {
    margin-right: 0;
  }

  .app-hero,
  .page-header-row,
  .inspection-row {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header-row {
    align-items: flex-start;
  }

  .building-detail-header,
  .area-detail-header,
  .note-detail-header {
    gap: 0.35rem;
  }
}
