.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.logs-main {
  padding-bottom: 36px;
}

.logs-page-header {
  gap: 28px;
  border-bottom: 1px solid var(--border-soft);
}

.logs-search {
  display: flex;
  width: min(330px, 38vw);
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  background: #101113;
  color: var(--muted);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.logs-search:focus-within {
  border-color: rgb(0 229 255 / 62%);
  box-shadow: 0 0 0 3px rgb(0 229 255 / 8%);
}

.logs-search > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.logs-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.logs-search input::placeholder {
  color: #686e73;
}

.logs-search kbd {
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 2px 6px;
  color: #686e73;
  font: inherit;
  font-size: 10px;
}

.logs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.log-filters {
  display: inline-flex;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 3px;
  background: #161618;
}

.log-filters button {
  min-height: 36px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 5px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.log-filters button:hover {
  color: var(--text-soft);
}

.log-filters button[aria-pressed="true"] {
  background: #303034;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 4%);
}

.logs-export {
  display: inline-flex;
  min-width: 132px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-color: rgb(0 229 255 / 35%);
  color: var(--primary);
  font-size: 12px;
}

.logs-export svg {
  width: 16px;
  height: 16px;
}

.logs-export:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.logs-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #111214;
}

.logs-table-wrap {
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.logs-table th {
  height: 46px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.logs-table th:first-child {
  width: 150px;
}

.logs-table th:nth-child(2) {
  width: 215px;
}

.logs-table th:last-child {
  width: 100px;
  text-align: right;
}

.logs-table td {
  height: 76px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  font-size: 12px;
  vertical-align: middle;
}

.logs-table tr:last-child td {
  border-bottom: 0;
}

.logs-table tbody tr {
  transition: background .14s ease;
}

.logs-table tbody tr:hover {
  background: rgb(255 255 255 / 1.8%);
}

.log-time strong,
.log-time span {
  display: block;
}

.log-time strong {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.log-time span {
  margin-top: 4px;
  color: #686e73;
  font-size: 10px;
}

.log-source {
  display: flex;
  align-items: center;
  gap: 12px;
}

.log-source__icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: rgb(255 255 255 / 2%);
  color: var(--muted);
}

.log-source__icon svg {
  width: 16px;
  height: 16px;
}

.log-source__icon--security { color: var(--tertiary); }
.log-source__icon--system { color: var(--danger); }
.log-source__icon--telemetry { color: var(--primary); }

.log-source strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.log-payload strong,
.log-payload span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-payload strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.log-payload span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.log-status {
  text-align: right;
}

.status-tag {
  display: inline-block;
  min-width: 40px;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 4px 6px 3px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1;
  text-align: center;
}

.status-tag--crit {
  background: rgb(255 127 135 / 10%);
  color: var(--danger);
}

.status-tag--warn {
  background: rgb(254 201 49 / 10%);
  color: var(--tertiary);
}

.status-tag--sys {
  background: rgb(0 229 255 / 9%);
  color: var(--primary);
}

.status-tag--info {
  background: rgb(133 139 145 / 10%);
  color: #a0a7ad;
}

.logs-empty {
  min-height: 260px;
  place-items: center;
  align-content: center;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.logs-empty:not([hidden]) {
  display: grid;
}

.logs-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
}

.logs-empty h3,
.logs-empty p {
  margin: 4px;
}

.logs-empty h3 {
  color: var(--text-soft);
  font-size: 15px;
}

.logs-empty p {
  font-size: 12px;
}

.load-history {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-top: 1px solid var(--border);
  background: #0e0f10;
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
}

.load-history:hover {
  background: #151719;
}

.load-history svg {
  width: 14px;
  height: 14px;
}

.logs-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.logs-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .logs-table th:nth-child(2) {
    width: 175px;
  }

  .logs-table th:first-child {
    width: 125px;
  }
}

@media (max-width: 820px) {
  .logs-page-header {
    min-height: 118px;
  }

  .logs-search {
    width: min(320px, 42vw);
  }
}

@media (max-width: 650px) {
  .logs-page-header {
    display: flex;
    min-height: auto;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 18px;
  }

  .logs-search {
    width: 100%;
  }

  .logs-toolbar {
    flex-wrap: wrap;
    padding: 14px 0;
  }

  .log-filters {
    width: 100%;
  }

  .log-filters button {
    flex: 1 0 auto;
    padding-inline: 12px;
  }

  .logs-export {
    width: 100%;
  }

  .logs-card {
    border: 0;
    overflow: visible;
    background: transparent;
  }

  .logs-table-wrap {
    overflow: visible;
  }

  .logs-table,
  .logs-table tbody,
  .logs-table tr,
  .logs-table td {
    display: block;
    width: 100%;
  }

  .logs-table thead {
    display: none;
  }

  .logs-table tr {
    position: relative;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 14px;
    background: #111214;
  }

  .logs-table td {
    height: auto;
    border: 0;
    padding: 0;
  }

  .logs-table td + td {
    margin-top: 12px;
  }

  .logs-table .log-time {
    display: flex;
    gap: 8px;
    padding-right: 58px;
  }

  .log-time span {
    margin-top: 1px;
  }

  .log-source__icon {
    width: 28px;
    height: 28px;
  }

  .log-payload strong,
  .log-payload span {
    white-space: normal;
  }

  .log-status {
    position: absolute;
    top: 14px;
    right: 14px;
    margin: 0 !important;
  }

  .load-history {
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  .logs-footer {
    display: block;
  }

  .logs-footer p + p {
    margin-top: 5px;
  }
}
