:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #162033;
  --muted: #55627c;
  --line: #dfe5ef;
  --accent: #1677ff;
  --danger: #d94848;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "SF Pro Text", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f9fbff, #eef3fb);
  color: var(--ink);
}

.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 14px;
  display: grid;
  gap: 14px;
}

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

h1, h2 {
  margin: 0 0 10px;
}

h3 {
  margin: 16px 0 8px;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

input, button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 14px;
}

input {
  min-width: 180px;
}

button {
  background: #fff;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

#revokePaidBtn, #deleteFreeBtn {
  color: var(--danger);
}

.lk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.tile {
  background: #f6f9ff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tile strong {
  font-size: 12px;
  color: var(--muted);
}

.btn-link {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  text-decoration: none;
  background: #fff;
}

.btn-link.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.hidden {
  display: none;
}

pre {
  background: #0b1220;
  color: #dce8ff;
  border-radius: 10px;
  padding: 10px;
  overflow: auto;
  white-space: pre-wrap;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  font-size: 14px;
}

a {
  color: var(--accent);
}

@media (max-width: 900px) {
  .container {
    margin: 10px auto;
    padding: 0 8px;
    gap: 8px;
  }

  .card {
    padding: 12px;
    border-radius: 12px;
  }

  input, button, .btn-link {
    width: 100%;
    min-height: 42px;
  }

  input {
    min-width: 0;
  }

  .row {
    gap: 6px;
    margin-bottom: 8px;
  }

  .lk-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  table {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: #fff;
  }

  td {
    border: 0;
    padding: 7px 0;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    word-break: break-word;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    flex: 0 0 42%;
  }
}
