:root {
  --bg: radial-gradient(circle at 10% 20%, #0b2545 0, #0d1b2a 35%, #0b132b 100%);
  --card: #111c30;
  --muted: #97a8c4;
  --accent: #50d1c6;
  --border: #1f2b40;
  --input: #0e1726;
  --danger: #ff7a90;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: #e7eefc;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  padding: 32px 18px 48px;
}

main {
  width: min(1200px, 100%);
  display: grid;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.login-card {
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  margin: auto;
}

.login-head h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.login-form {
  display: grid;
  gap: 12px;
}


.router-card {
  padding-top: 0px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.3px;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.inline-pair {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-pair label {
  flex: 1;
  min-width: 130px;
  max-width: 260px;
}

.compact-input {
  width: 130px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

label .hint {
  font-size: 12px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  height: 44px;
  line-height: 1.4;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input);
  color: #e7eefc;
  font-size: 15px;
  transition: border 0.15s ease, transform 0.15s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  transform: translateY(-1px);
}

input.invalid,
select.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px rgba(255, 122, 144, 0.4);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #7fa7ff 50%), linear-gradient(135deg, #7fa7ff 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 1px), calc(100% - 14px) calc(50% + 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  align-items: center;
}

@media (max-width: 720px) {
  .actions {
    flex-direction: column;
  }
}

button {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, #1a2a42, #16263b);
  color: #e7eefc;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border 0.14s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

button.secondary {
  background: transparent;
  color: var(--muted);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border 0.14s ease;
}

.button-link:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.small {
  padding: 8px 12px;
  font-size: 13px;
}

.lang-switch .active {
  border-color: var(--accent);
  color: var(--accent);
}

.lang-switch {
  display: inline-flex;
  gap: 6px;
}

.action-btn {
  background: linear-gradient(145deg, #1f3150, #1a2a42);
  border-color: var(--accent);
  color: #e7eefc;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 12px 18px;
  justify-content: center;
}

.outputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.output-block {
  position: relative;
  background: #0b1323;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px 10px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

textarea {
  width: 100%;
  height: 260px;
  resize: vertical;
  background: transparent;
  border: none;
  color: #e7eefc;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
}

.copy-inline {
  align-self: flex-end;
}

.copy-inline.copied {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(80, 209, 198, 0.4);
}

.copy-inline {
  background: linear-gradient(145deg, #1f3150, #1a2a42);
  border-color: var(--accent);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.chip {
  padding: 11px 8px;
  border-radius: 8px;
  background: #0c1a2d;
  border: 1px solid var(--border);
}

.error {
  margin-top: 10px;
  color: var(--danger);
  font-size: 14px;
  min-height: 24px;
  display: block;
}

.error.info {
  color: #7fe39f;
}

.computed {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.summary {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(12, 20, 35, 0.5);
}

.summary-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  font-size: 13px;
}

.summary-grid .label {
  color: var(--muted);
  margin-right: 6px;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.filter input {
  width: 260px;
  min-width: 200px;
}

.filter {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow: auto;
}

.router-form {
  margin-top: 4px;
  display: grid;
  gap: 6px;
}

.router-host-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.router-host {
  font-size: 14px;
  color: var(--muted);
}

.router-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0 10px;
}

.router-outputs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.router-output-block {
  position: relative;
  background: #0b1323;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px 10px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.router-output-head {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

.router-output-spacer {
  height: 1px;
  width: 100%;
}

.router-outputs ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 10px;
  color: var(--muted);
}

.router-outputs li {
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.router-outputs li:last-child {
  border-bottom: none;
}

.router-active-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.router-active-ip {
  color: var(--danger);
  font-weight: 600;
}

table.records {
  width: 100%;
  border-collapse: collapse;
  color: #e7eefc;
  font-size: 14px;
}

table.records th,
table.records td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

table.records th {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.2px;
}

table.records th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px;
}

table.records th.sortable.sort-asc::after {
  content: "^";
  position: absolute;
  right: 8px;
  color: var(--accent);
}

table.records th.sortable.sort-desc::after {
  content: "v";
  position: absolute;
  right: 8px;
  color: var(--accent);
}

table.records tr:hover td {
  background: #0f1a2c;
}

.muted {
  color: var(--muted);
  text-align: center;
}
