:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --link-oxagile: #ef4444;
  --link-external: #f97316;
}
.card a.link-ox {
  color: var(--link-oxagile);
}

.card a.link-ext {
  color: var(--link-external);
}

.target-url-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
}
.target-url-main {
  display: inline-block;
}
.target-url-actions {
  display: none;
  gap: 6px;
}
.target-url-cell:hover .target-url-actions {
  display: inline-flex;
}
.target-action-btn {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.9);
  color: var(--text);
  padding: 3px 8px;
  font-size: 0.7rem;
  cursor: pointer;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.wrap {
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px;
}

.head h1 {
  margin: 0;
  font-size: 1.2rem;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.filters {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  padding: 12px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.filters label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.filters input,
.filters select {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
}

.actions {
  margin-top: 10px;
}

.actions button,
.modal-filters button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.8);
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.78rem;
}

.table-wrap {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  max-height: 72vh;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: 0.8rem;
}

th,
td {
  border-bottom: 1px solid rgba(51, 65, 85, 0.7);
  padding: 8px 10px;
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(30, 41, 59, 0.98);
  color: var(--muted);
  text-align: left;
}
.sortable {
  cursor: pointer;
  user-select: none;
}
.sortable.sort-asc::after {
  content: " ▲";
  font-size: 0.7em;
}
.sortable.sort-desc::after {
  content: " ▼";
  font-size: 0.7em;
}

th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr.row-click {
  cursor: pointer;
}

tbody tr.row-click:hover {
  background: rgba(99, 102, 241, 0.1);
}

.pill {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  font-size: 0.72rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.modal.open {
  display: block;
}

.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
}

.card {
  position: relative;
  z-index: 1;
  margin: 3vh auto;
  width: min(1320px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b1220;
  padding: 14px;
}
.card-body {
  overflow-x: auto;
}
.card-body table {
  min-width: 0;
}
.modal-links-table,
.page-detail-table {
  table-layout: fixed;
  width: 100%;
}
.modal-links-table th:nth-child(1),
.modal-links-table td:nth-child(1) {
  width: 22%;
}
.modal-links-table th:nth-child(2),
.modal-links-table td:nth-child(2) {
  width: 18%;
}
.modal-links-table th:nth-child(3),
.modal-links-table td:nth-child(3) {
  width: 24%;
}
.modal-links-table th:nth-child(4),
.modal-links-table td:nth-child(4) {
  width: 18%;
}
.modal-links-table th:nth-child(5),
.modal-links-table td:nth-child(5) {
  width: 8%;
}
.modal-links-table th:nth-child(6),
.modal-links-table td:nth-child(6) {
  width: 10%;
}
.clip-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-modal-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.page-modal-summary .pill {
  margin: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-head h2 {
  margin: 0;
  font-size: 1rem;
}

.modal-filters {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}
.modal-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}
.modal-filters label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.modal-filters input,
.modal-filters select {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
}

.card-head button {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #111827;
  color: var(--text);
  width: 34px;
  height: 34px;
}
