/* panic.codes admin panel — same palette and type as the site and the app. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./assets/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/inter-latin-600-normal.woff2") format("woff2");
}

:root {
  --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --bg: #191919;
  --surface: #202020;
  --surface-hover: #262626;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #f4f4ed;
  --muted: rgba(255, 255, 255, 0.45);
  --accent: #4a051c;
  --accent-hover: #7d0e33;
  --danger: #b3261e;
  --ok: #4f8f5f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(120% 90% at 50% 0%, #1e1e1e 0%, var(--bg) 55%, #151515 100%);
  color: var(--text);
  color-scheme: dark;
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

a {
  color: inherit;
}

/* ---------- gate ---------- */

.gate {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 40px 20px;
}

.gate__card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.gate h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 22px;
}

.brand__mark {
  height: 34px;
  width: auto;
}

.brand__tld {
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
}

.brand__tag {
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand--small .brand__mark {
  height: 24px;
}

.foot {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hint {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.hint--last {
  margin: 16px 0 0;
  font-size: 12px;
}

.link {
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---------- controls ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

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

.input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1b1b1b;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.input:focus {
  border-color: var(--line-strong);
  outline: none;
}

.btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-hover);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--line-strong);
  background: #2c2c2c;
}

.btn--primary {
  border-color: rgba(0, 0, 0, 0.2);
  background: var(--accent);
  font-weight: 600;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--wide {
  width: 100%;
}

.btn--small {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.btn--danger {
  border-color: rgba(179, 38, 30, 0.6);
  color: #ff9b93;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ---------- shell ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 54px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(25, 25, 25, 0.9);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 20px 0;
  flex-wrap: wrap;
}

.tab {
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  border-color: var(--line);
  border-bottom-color: transparent;
  color: var(--text);
  background: var(--surface);
}

.wrap {
  padding: 20px;
}

/* ---------- cards, tables ---------- */

.card {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

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

.card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1c1c1c;
}

.stat__value {
  font-size: 22px;
  font-weight: 600;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

td.wrap-cell {
  white-space: normal;
  max-width: 320px;
  word-break: break-word;
}

.row-actions {
  display: flex;
  gap: 6px;
}

/* ---------- bits ---------- */

.pill {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill--ok {
  border-color: rgba(79, 143, 95, 0.6);
  color: #8fd39c;
}

.pill--bad {
  border-color: rgba(179, 38, 30, 0.6);
  color: #ff9b93;
}

.note {
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1c1c1c;
  font-size: 13px;
}

.note--error {
  border-color: rgba(179, 38, 30, 0.5);
  color: #ff9b93;
}

.note--ok {
  border-color: rgba(79, 143, 95, 0.5);
  color: #8fd39c;
}

.key-reveal {
  margin: 10px 0 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #1b1b1b;
}

.key-reveal__value {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.04em;
  user-select: all;
}

.row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.row .field {
  margin-bottom: 0;
  min-width: 130px;
}

.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.modal {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 22px;
  max-width: 380px;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.modal__body h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.empty {
  padding: 14px 0;
  color: var(--muted);
}
