:root {
  color-scheme: dark;
  --bg: #0d1320;
  --panel: #151e2e;
  --panel-soft: #1a2638;
  --border: #2b3a52;
  --text: #eef4ff;
  --muted: #98a7bb;
  --blue: #3485ff;
  --green: #16c784;
  --danger: #ff5c7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: #7fb1ff;
  text-decoration: none;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: #101827;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.login-panel {
  width: min(460px, 100%);
  margin: 96px auto;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 4px;
}

.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.muted,
.empty {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 650;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

input[type="file"] {
  padding: 10px 12px;
}

button,
.primary-button,
.secondary-button,
.icon-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: var(--text);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  background: var(--green);
}

.secondary-button,
.icon-button {
  background: #263348;
}

.wide {
  grid-column: 1 / -1;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 14px 12px;
  text-align: left;
  white-space: nowrap;
}

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

.actions {
  display: flex;
  gap: 12px;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message {
  border-radius: 6px;
  padding: 12px 14px;
  background: #23314a;
}

.message.success {
  border-left: 4px solid var(--green);
}

.message.error {
  border-left: 4px solid var(--danger);
}

.head-actions {
  display: flex;
  gap: 10px;
}

.code-view {
  max-height: calc(100vh - 230px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b111d;
  padding: 18px;
  line-height: 1.5;
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .topbar {
    padding: 0 16px;
  }

  .grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    display: grid;
  }
}
