:root {
  --bg: #0f1117;
  --panel: #171a22;
  --line: #2a3142;
  --text: #e7ecff;
  --muted: #9ea8c4;
  --ok: #32d38f;
  --bad: #ff6a6a;
  --btn: #3f86ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 20px;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.row input {
  flex: 1 1 260px;
  min-width: 220px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0f1523;
  color: var(--text);
  padding: 0 10px;
}

button {
  border: none;
  background: var(--btn);
  color: #fff;
  height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button.alt {
  background: #3c465f;
}

button.refresh-btn {
  background: #2e5ea8;
}

button.logout-btn {
  background: #a94141;
}

button:not(.sort-btn):hover {
  filter: brightness(1.08);
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: #2a7a50;
  color: #fff;
  height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-weight: 600;
  text-decoration: none;
}

.dl-btn:hover {
  filter: brightness(1.08);
}

.delete-btn {
  border: none;
  background: #8a3b3b;
  color: #fff;
  height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.delete-btn:hover {
  filter: brightness(1.08);
}

.msg {
  margin-top: 10px;
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
}

.msg.err {
  color: var(--bad);
}

.msg.ok {
  color: var(--ok);
}

.hidden {
  display: none;
}

.small {
  color: var(--muted);
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px 6px;
  vertical-align: middle;
  word-break: keep-all;
  overflow-wrap: normal;
  overflow: visible;
  text-overflow: clip;
}

th {
  color: #b9c4e8;
  font-weight: 600;
}

td.col-number,
th.col-number,
td.col-real,
th.col-real,
td.col-ip,
th.col-ip,
td.col-created,
th.col-created {
  white-space: nowrap;
}

td.col-file,
th.col-file {
  white-space: nowrap;
}

    td.col-token, th.col-token {
      width: 100%;
      min-width: 260px;
    }
.col-device, th.col-device {
      width: 100%;
      min-width: 260px;
    }

td.col-token,
td.col-device {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.token-view {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-appearance: none;
  appearance: none;
}

.actions-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.chip.ok {
  color: var(--ok);
  border-color: rgba(50, 211, 143, 0.4);
  background: rgba(50, 211, 143, 0.1);
}

.chip.bad {
  color: var(--bad);
  border-color: rgba(255, 106, 106, 0.4);
  background: rgba(255, 106, 106, 0.1);
}

.sort-btn {
  background: transparent;
  border: none;
  color: #b9c4e8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  white-space: nowrap;
  max-width: 100%;
  font: inherit;
  font-weight: 600;
  padding: 0;
  height: auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-btn.active {
  color: #e7ecff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.btn-icon svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
