:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #1b1b1f;
  --panel-2: #24242a;
  --text: #f4f4f5;
  --muted: #a5a5ad;
  --line: #32323a;
  --red: #d50000;
  --red-2: #ff3b3b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, rgba(213,0,0,.18), transparent 32rem), var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--red-2); text-decoration: none; }
input, textarea, button {
  font: inherit;
}
input, textarea {
  width: 100%;
  margin-top: .45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101013;
  color: var(--text);
  padding: .8rem .9rem;
}
button, .button {
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: white;
  padding: .85rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.muted { background: var(--panel-2); color: var(--text); }
.auth-page { display: grid; place-items: center; padding: 1rem; }
.auth-card {
  width: min(420px, 100%);
  background: rgba(27,27,31,.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 24px 80px rgba(0,0,0,.38);
}
.auth-card h1, .panel h1 { margin: .5rem 0; }
.auth-card p, .panel p { color: var(--muted); margin-top: 0; }
.auth-card form, .grid-form { display: grid; gap: 1rem; }
.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), #650000);
  color: white;
  font-weight: 900;
  letter-spacing: .04em;
}
.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-grid;
  margin-right: .6rem;
  vertical-align: middle;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  background: rgba(17,17,17,.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar nav { display: flex; gap: 1rem; }
.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem;
  display: grid;
  gap: 1.5rem;
}
.panel {
  background: rgba(27,27,31,.94);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.2rem;
}
.panel-head {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
}
code {
  max-width: 100%;
  overflow-wrap: anywhere;
  background: #101013;
  color: #ffb4b4;
  padding: .55rem .7rem;
  border-radius: 7px;
}
.grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1rem 0 1.25rem;
}
.grid-form .wide { grid-column: 1 / -1; }
.check {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.check input {
  width: auto;
  margin: 0;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: .85rem .7rem;
  border-bottom: 1px solid var(--line);
}
th { color: var(--muted); font-weight: 600; }
.url {
  display: inline-block;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.actions {
  display: flex;
  gap: .75rem;
  align-items: center;
}
.actions form { margin: 0; }
.link-danger {
  background: transparent;
  color: #ff7777;
  padding: 0;
}
.alert, .success {
  border-radius: 8px;
  padding: .8rem 1rem;
}
.alert { background: rgba(213,0,0,.18); color: #ffc7c7; }
.success { background: rgba(30,160,90,.18); color: #baf7d2; }

@media (max-width: 760px) {
  .panel-head, .topbar { align-items: flex-start; flex-direction: column; }
  .grid-form { grid-template-columns: 1fr; }
  .url { max-width: 260px; }
}
