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 {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f3f5f7;
  color: #18212b;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.control-nav {
  background: #101820;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 2rem;
}

.control-nav .navbar-toggler {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  min-height: 44px;
  min-width: 76px;
}

.mobile-menu-icon {
  border-bottom: 2px solid #fff;
  border-top: 2px solid #fff;
  height: 14px;
  position: relative;
  width: 20px;
}

.mobile-menu-icon::before {
  background: #fff;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 4px;
}

.dashboard-container {
  max-width: 1180px;
}

.dashboard-header {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 2rem;
}

.dashboard-header h1,
.auth-card h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 750;
  letter-spacing: -0.045em;
}

.eyebrow {
  color: #607082;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.summary {
  background: #fff;
  border: 1px solid #dce2e8;
  border-radius: 1rem;
  display: flex;
  min-width: 260px;
  overflow: hidden;
}

.summary > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem 1.25rem;
}

.summary > div + div {
  border-left: 1px solid #e6eaee;
}

.summary strong {
  color: #087f5b;
  font-size: 1.65rem;
  line-height: 1;
}

.summary span {
  color: #6b7785;
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

.summary .has-incidents strong {
  color: #c92a2a;
}

.application-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
}

.application-card {
  background: #fff;
  border: 1px solid #dce2e8;
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(16, 24, 32, 0.05);
  overflow: hidden;
}

.application-card__header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 1.35rem 1.5rem 1rem;
}

.application-card h2 {
  font-size: 1.35rem;
  margin: 0;
}

.overall-status {
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.42rem 0.7rem;
}

.overall-status.is-up {
  background: #dff7ed;
  color: #087f5b;
}

.overall-status.is-down {
  background: #fff0f0;
  color: #c92a2a;
}

.application-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 1.5rem 0.75rem;
}

.environment-row {
  border-top: 1px solid #edf0f3;
  padding: 1.1rem 1.5rem;
}

.environment-name {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.environment-name strong,
.environment-name a {
  display: block;
}

.environment-name a {
  color: #607082;
  font-size: 0.82rem;
  text-decoration: none;
}

.environment-name a:hover {
  text-decoration: underline;
}

.status-dot {
  border-radius: 50%;
  flex: 0 0 auto;
  height: 0.7rem;
  width: 0.7rem;
}

.status-dot.is-up {
  background: #12b886;
  box-shadow: 0 0 0 4px #dff7ed;
}

.status-dot.is-down {
  background: #fa5252;
  box-shadow: 0 0 0 4px #fff0f0;
}

.metrics {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, 1fr);
  margin: 1rem 0 0;
}

.metrics div {
  background: #f6f8fa;
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
}

.metrics dt {
  color: #748190;
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
}

.metrics dd {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0.1rem 0 0;
}

.failure-reason {
  color: #c92a2a;
  font-size: 0.8rem;
  margin: 0.75rem 0 0;
}

.last-check {
  color: #748190;
  font-size: 0.78rem;
  margin: 1.25rem 0 3rem;
  text-align: right;
}

.log-filters {
  align-items: end;
  background: #fff;
  border: 1px solid #dce2e8;
  border-radius: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(140px, 0.7fr) minmax(140px, 0.7fr) minmax(150px, 0.7fr) minmax(220px, 1.6fr) auto;
  margin-bottom: 1.25rem;
  padding: 1.25rem;
}

.log-filters label {
  color: #425466;
  font-size: 0.78rem;
  font-weight: 700;
}

.log-filters select,
.log-filters input {
  margin-top: 0.35rem;
}

.log-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.log-toolbar > div {
  display: flex;
  gap: 0.5rem;
}

.log-table-container {
  background: #fff;
  border: 1px solid #dce2e8;
  border-radius: 0.8rem;
  padding: 0.75rem;
}

#log-table {
  table-layout: fixed;
  width: 100%;
}

#log-table th:nth-child(2),
#log-table td:nth-child(2) {
  width: 18%;
}

#log-table th:nth-child(3),
#log-table td:nth-child(3) {
  width: 11%;
}

#log-table th:nth-child(4),
#log-table td:nth-child(4) {
  width: 15%;
}

#log-table th:nth-child(1),
#log-table td:nth-child(1) {
  width: 8%;
}

.copy-log-icon {
  fill: none;
  height: 1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  vertical-align: -0.125em;
  width: 1rem;
}

.copy-log-line.copied {
  color: #198754;
}

.log-source {
  overflow-wrap: anywhere;
}

.log-message {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.log-level {
  border-radius: 1rem;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
}

.log-level--error, .log-level--fatal, .log-level--critical {
  background: #ffe3e3;
  color: #a51111;
}

.log-level--warn, .log-level--warning {
  background: #fff3bf;
  color: #795500;
}

.log-level--info {
  background: #dbeafe;
  color: #164a82;
}

.log-level--debug, .log-level--trace, .log-level--detail {
  background: #e9ecef;
  color: #495057;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 190px);
  place-items: center;
}

.auth-card {
  background: #fff;
  border: 1px solid #dce2e8;
  border-radius: 1.2rem;
  box-shadow: 0 20px 60px rgba(16, 24, 32, 0.08);
  max-width: 470px;
  padding: clamp(1.5rem, 5vw, 3rem);
  width: 100%;
}

@media (max-width: 767px) {
  .dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .summary {
    min-width: 0;
  }

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

  .log-filters {
    grid-template-columns: 1fr;
  }

  .log-toolbar {
    align-items: flex-start;
    gap: 0.75rem;
  }

  .log-table-container {
    padding: 0.5rem;
  }

  .log-table-container .fixed-table-toolbar {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .log-table-container .fixed-table-toolbar .search {
    margin: 0;
    width: 100%;
  }

  .log-table-container .fixed-table-toolbar .search input {
    width: 100%;
  }

  #log-table {
    min-width: 760px;
  }

  .log-table-container .fixed-table-pagination {
    overflow-wrap: anywhere;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .log-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-filter-query {
    grid-column: 1 / -1;
  }
}
