:root {
  color-scheme: light;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: #1e2930;
  background: #eef3f5;
}

body { margin: 0; }

.topbar {
  align-items: center;
  background: #12343b;
  color: white;
  display: flex;
  justify-content: space-between;
  padding: 14px 24px;
}

.topbar span { color: #c9d8dc; display: block; font-size: 13px; margin-top: 2px; }
.topbar a { color: white; margin-left: 16px; text-decoration: none; }

.page { margin: 0 auto; max-width: 1520px; padding: 18px 14px 24px; }
.hero { margin-bottom: 20px; }
.hero h1 { font-size: 30px; margin: 0 0 6px; }
.hero p { margin: 0; color: #52656d; }

.layout { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel {
  background: white;
  border: 1px solid #d8e2e6;
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 18px 14px;
}

h1, h2 { margin: 0 0 16px; }
h2 { font-size: 18px; }

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

.run-grid { grid-template-columns: 1.2fr 1.6fr .7fr .7fr auto; }
label { display: grid; font-size: 13px; font-weight: 700; gap: 6px; }
.check { align-items: center; display: flex; gap: 8px; }
.account-picker { position: relative; }
.account-picker small { color: #52656d; display: block; font-size: 12px; margin-top: 6px; }
.account-results {
  background: white;
  border: 1px solid #bbcbd1;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(18, 52, 59, .16);
  left: 0;
  max-height: 260px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: 64px;
  z-index: 5;
}
.account-option {
  align-self: stretch;
  background: white;
  border: 0;
  border-bottom: 1px solid #edf2f4;
  border-radius: 0;
  color: #1e2930;
  display: block;
  font-weight: 500;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}
.account-option:hover { background: #eef7f7; }

input, select, textarea {
  border: 1px solid #bbcbd1;
  border-radius: 6px;
  font: inherit;
  min-width: 0;
  padding: 9px 10px;
}
input::placeholder,
textarea::placeholder {
  color: #b8b8b8;
  opacity: 1;
}

button {
  align-self: end;
  background: #0b6b6f;
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 11px;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.inline { display: inline; }
code { background: #eef3f5; border-radius: 4px; padding: 2px 5px; }

table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid #dce4e8; padding: 9px; text-align: left; vertical-align: top; }
th { color: #52656d; font-size: 12px; text-transform: uppercase; }
.table-scroll { overflow-x: auto; }
td.actions { white-space: nowrap; }

.jobs { display: grid; gap: 10px; }
.job { border: 1px solid #d8e2e6; border-radius: 8px; padding: 12px; }
.job-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.job-status { color: #52656d; font-size: .85rem; flex: 1; text-align: right; }
.btn-dismiss {
  background: none;
  border: none;
  color: #94a8b0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.btn-dismiss:hover { color: #333; }
.btn-stop {
  background: #fef2f2;
  border: 1px solid #f5a0a0;
  border-radius: 6px;
  color: #b42318;
  cursor: pointer;
  font-size: .8rem;
  margin-top: 6px;
  padding: 4px 10px;
}
.btn-stop:hover { background: #fde8e8; }
.job-notice {
  border-radius: 6px;
  border: 1px solid #b9d8d5;
  background: #eef7f7;
  font-size: .85rem;
  margin-bottom: 8px;
  padding: 6px 10px;
}
.job-notice.error { background: #fef2f2; border-color: #f5a0a0; color: #b42318; }
.scan-progress-box {
  align-items: center;
  background: #eef7f7;
  border: 1px solid #b9d8d5;
  border-radius: 6px;
  display: flex;
  font-size: .88rem;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 14px;
}
.scan-progress-box[hidden] { display: none; }
.scan-spinner {
  animation: spin 1s linear infinite;
  border: 2px solid #b9d8d5;
  border-top-color: #2f9e8f;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  height: 14px;
  width: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-danger {
  background: #fef2f2;
  border: 1px solid #f5a0a0;
  border-radius: 6px;
  color: #b42318;
  cursor: pointer;
  font-size: .78rem;
  padding: 3px 8px;
}
.btn-danger:hover { background: #fde8e8; }
.monitor-notice {
  border-radius: 6px;
  border: 1px solid #b9d8d5;
  background: #eef7f7;
  font-size: .9rem;
  margin-bottom: 12px;
  padding: 10px 14px;
}
.monitor-notice.stopped {
  background: #fff8e6;
  border-color: #f0c040;
  color: #6b4a00;
}
.monitor-notice.success {
  background: #f0faf5;
  border-color: #5cb88a;
  color: #1a5c38;
}
.job span, .job small { color: #52656d; }
.progress { background: #e5ecef; border-radius: 999px; height: 10px; margin: 10px 0; overflow: hidden; }
.progress div { background: #2f9e8f; height: 100%; transition: width .2s ease; }
.progress.secondary div { background: #6b8f9c; }
.progress.scan div { background: #8a6f2a; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hist-pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
}
.hist-pagination button {
  align-self: auto;
  background: #e8f0f2;
  color: #12343b;
  font-size: 13px;
  padding: 6px 14px;
}
.hist-pagination button:disabled { opacity: .4; cursor: default; }
.hist-pagination span { color: #52656d; font-size: 13px; }
.page-size-control {
  align-items: center;
  color: #52656d;
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
}
.page-size-control select {
  min-width: 82px;
  padding: 6px 10px;
}
.list-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.list-search {
  color: #52656d;
  max-width: 320px;
  width: 100%;
}
.list-search input {
  width: 100%;
}
.manifest-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.manifest-actions form, .manifest-actions button { margin: 0; }
.button-link {
  background: #e8f0f2;
  border-radius: 6px;
  color: #12343b;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 9px;
  text-decoration: none;
}
.actions button,
.inline button {
  font-size: 12px;
  padding: 7px 9px;
}
.actions button[aria-label] {
  font-size: 16px;
  line-height: 1;
  min-width: 36px;
  padding: 7px 8px;
}
.notice, .confirm-box {
  background: #eef7f7;
  border: 1px solid #b9d8d5;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px;
}
.confirm-box > div {
  display: flex;
  gap: 18px;
  margin-bottom: 12px;
}
.error { color: #b42318; margin-bottom: 0; }
.ok { border-color: #65a878; }
.bad { border-color: #c85c5c; }

.logout-form { display: inline; }
.btn-topbar-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 5px;
  color: white;
  font-size: 13px;
  margin-left: 16px;
  padding: 5px 10px;
}
.btn-topbar-logout:hover { background: rgba(255,255,255,.1); }

.login-box {
  background: white;
  border: 1px solid #d8e2e6;
  border-radius: 8px;
  margin: 80px auto;
  max-width: 360px;
  padding: 32px;
}
.login-box h2 { margin-bottom: 20px; }
.login-box label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.login-box button { width: 100%; }
.login-error { color: #b42318; margin-bottom: 14px; }

@media (max-width: 900px) {
  .layout, .form-grid, .run-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .topbar a { margin-left: 0; margin-right: 14px; }
  .page { padding: 14px; }
  .panel { padding: 16px 12px; }
}
