:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e9edf5;
  background: #101218;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #101218;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 32px;
  border-bottom: 1px solid #2b303b;
  background: #151820;
}

header h1 {
  margin: 0;
  font-size: 24px;
}

header p {
  margin: 4px 0 0;
  color: #9da7b8;
}

.identity {
  color: #b9c4d5;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

.card {
  background: #181c25;
  border: 1px solid #2b303b;
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
}

h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

p {
  color: #9da7b8;
}

.row,
.section-header,
.tabs {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.section-header {
  justify-content: space-between;
  margin-bottom: 14px;
}

input,
select,
button {
  border-radius: 8px;
  border: 1px solid #394151;
  padding: 10px 12px;
  font: inherit;
}

input,
select {
  background: #10141c;
  color: #eef2f7;
}

#api-key {
  flex: 1;
  min-width: 280px;
}

button {
  cursor: pointer;
  background: #e8edf5;
  color: #11151c;
  font-weight: 600;
}

button.secondary,
button.tab {
  background: #242a36;
  color: #dce3ed;
}

button.tab.active {
  background: #e8edf5;
  color: #11151c;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.message {
  min-height: 20px;
  margin-top: 10px;
  color: #aeb8c8;
}

.message.error { color: #ff9a9a; }
.message.success { color: #9fe0ad; }

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

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

th,
td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid #2a303b;
  vertical-align: middle;
}

th {
  color: #9da7b8;
  font-size: 13px;
}

td {
  font-size: 14px;
}

.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #2a303b;
}

.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small {
  padding: 6px 9px;
  font-size: 12px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

details summary {
  cursor: pointer;
  color: #dce3ed;
}

details pre {
  max-width: 520px;
  max-height: 300px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: #10141c;
  border: 1px solid #2b303b;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}


.job-modal {
  width: min(1000px, calc(100vw - 40px));
  max-height: 90vh;
  padding: 0;
  border: 1px solid #394151;
  border-radius: 14px;
  background: #181c25;
  color: #e9edf5;
}

.job-modal::backdrop {
  background: rgba(0, 0, 0, .72);
}

.job-modal-shell {
  padding: 24px;
  overflow: auto;
  max-height: 90vh;
}

.job-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid #2b303b;
}

.job-modal-header h2 {
  margin-bottom: 4px;
}

.job-modal-header p {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.job-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.job-meta-grid > div {
  background: #10141c;
  border: 1px solid #2b303b;
  border-radius: 8px;
  padding: 12px;
}

.job-meta-grid span {
  display: block;
  margin-bottom: 5px;
  color: #9da7b8;
  font-size: 12px;
}

.job-meta-grid strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.job-detail-section {
  margin-top: 18px;
}

.job-detail-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #cbd4e1;
}

.job-detail-section pre {
  width: 100%;
  max-width: none;
  min-height: 70px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #2b303b;
  background: #10141c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}

#job-modal-error-section pre {
  white-space: pre-wrap;
}


.job-diagnostic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.job-diagnostic-header h3 {
  margin: 0;
}


.admin-create-user,
.admin-key-create {
  margin: 18px 0;
  padding: 16px;
  background: #10141c;
  border: 1px solid #2b303b;
  border-radius: 10px;
}

.admin-create-user h3,
.admin-key-create h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.secret-warning {
  margin: 20px 0 12px;
  padding: 12px;
  border: 1px solid #5a4d2e;
  border-radius: 8px;
  background: #211d13;
}

.secret-modal pre {
  user-select: all;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #394151;
  background: #10141c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
