:root {
  --bg0: #03051a;
  --bg1: #0a0f30;
  --panel: rgba(13, 18, 48, 0.88);
  --line: rgba(160, 180, 255, 0.16);
  --ink: #f2f5ff;
  --muted: #aab6de;
  --faint: #68739f;
  --cyan: #43e9ff;
  --magenta: #e00076;
  --blue: #00a1e4;
  --danger: #ff6b81;
  --ok: #7ec352;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Outfit", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(224, 0, 118, 0.28), transparent 55%),
    radial-gradient(100% 70% at 90% 0%, rgba(0, 161, 228, 0.25), transparent 50%),
    linear-gradient(180deg, #171150 0%, var(--bg1) 45%, var(--bg0) 100%);
}

a {
  color: var(--cyan);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.brand .flag {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  box-shadow: 0 4px 18px rgba(3, 6, 26, 0.5);
}
.brand .flag i:nth-child(1) {
  background: var(--magenta);
}
.brand .flag i:nth-child(2) {
  background: #ed1c24;
}
.brand .flag i:nth-child(3) {
  background: #ffcb05;
}
.brand .flag i:nth-child(4) {
  background: #7ec352;
}
.brand .flag i:nth-child(5) {
  background: var(--blue);
}
.brand h1 {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.brand p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
}
.login-card h2 {
  font-family: var(--display);
  font-size: 26px;
  margin-bottom: 6px;
}
.login-card .lead {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 22px;
}

label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field {
  margin-bottom: 16px;
}
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(10, 16, 48, 0.95);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color-scheme: dark;
}
select {
  appearance: none;
  cursor: pointer;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2343e9ff' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  background-color: #101542;
}
select option,
select optgroup {
  background: #101542;
  color: #f2f5ff;
}
input:focus,
select:focus {
  outline: none;
  border-color: rgba(67, 233, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(67, 233, 255, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: 600 14px/1 var(--display);
  letter-spacing: 0.04em;
  cursor: pointer;
  color: #04102b;
  background: var(--cyan);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-block {
  width: 100%;
}

.msg {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.msg.is-error {
  color: var(--danger);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.topbar .meta {
  color: var(--muted);
  font-size: 13px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}
.toolbar .filters {
  display: flex;
  gap: 10px;
  align-items: end;
}
.toolbar label {
  margin-bottom: 6px;
}
.toolbar select {
  min-width: 180px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: top;
}
th {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  position: sticky;
  top: 0;
}
tr:last-child td {
  border-bottom: 0;
}
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(67, 233, 255, 0.08);
  color: var(--cyan);
  font-size: 12px;
  text-transform: lowercase;
}
.link {
  font-weight: 600;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 12px;
  font-size: 14px;
}
.foot {
  margin-top: 18px;
  color: var(--faint);
  font-size: 12px;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}
.btn-link {
  background: transparent;
  color: var(--cyan);
  border: 1px solid transparent;
  padding: 4px 0;
  font: 600 13px/1.2 var(--body);
  cursor: pointer;
}
.btn-link:hover {
  text-decoration: underline;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 26, 0.72);
  backdrop-filter: blur(6px);
}
.overlay[hidden] {
  display: none !important;
}
.detail-modal {
  width: min(860px, 100%);
  max-height: min(88dvh, 900px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.detail-head h3 {
  font-family: var(--display);
  font-size: 20px;
  margin-bottom: 4px;
}
.detail-head p {
  color: var(--muted);
  font-size: 13px;
}
.detail-close {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
.detail-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
}
.detail-item.span-2 {
  grid-column: 1 / -1;
}
.detail-item dt {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-item dd {
  font-size: 14px;
  word-break: break-word;
  white-space: pre-wrap;
}
.detail-item dd.rich {
  white-space: normal;
}
.detail-sec {
  grid-column: 1 / -1;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.detail-sec:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.detail-mini th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 8px;
  border: 1px solid var(--line);
  text-align: left;
}
.detail-list {
  margin: 0;
  padding-left: 18px;
  white-space: normal;
}
.detail-list li + li {
  margin-top: 4px;
}
.detail-sub {
  margin-bottom: 10px;
  white-space: normal;
}
.detail-sub p {
  margin: 4px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}
.detail-mini {
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 12.5px;
}
.detail-mini td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  white-space: pre-wrap;
}
.detail-pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.detail-json {
  margin-top: 16px;
}
.detail-json summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.detail-json pre {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-size: 12px;
  overflow: auto;
  max-height: 240px;
}
