:root {
  color-scheme: dark;
  --bg: #090d16;
  --panel: #111827;
  --panel2: #172033;
  --border: #26334a;
  --text: #edf3ff;
  --muted: #8fa1bd;
  --primary: #7c5cff;
  --primary2: #9a83ff;
  --good: #29d391;
  --warn: #ffbd59;
  --bad: #ff5d73;
  --blue: #57a6ff;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 75% 0, #17213b 0, transparent 36%), var(--bg);
  color: var(--text);
  font:
    14px/1.5 Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  border: 1px solid var(--border);
  background: #172033;
  color: var(--text);
  border-radius: 9px;
  padding: 9px 13px;
  cursor: pointer;
}
button:hover {
  border-color: #526383;
  background: #202c43;
}
button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), #5b7dff);
  font-weight: 700;
}
button.danger {
  color: #ff9cab;
}
button.link-button {
  border: 0;
  background: transparent;
  padding: 4px;
  color: var(--muted);
}
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: #0d1422;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 11px;
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--primary);
}
label {
  display: grid;
  gap: 6px;
  color: #bdc9da;
  font-size: 13px;
}
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(17, 24, 39, 0.92);
  box-shadow: 0 30px 80px #0008;
}
.login-card h1,
.login-card p {
  margin: 0;
  text-align: center;
}
.login-card p {
  color: var(--muted);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: auto;
  border-radius: 18px;
  background: linear-gradient(135deg, #a58cff, #5577ff);
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 15px 35px #745cff55;
}
.brand-mark.small {
  width: 38px;
  height: 38px;
  margin: 0;
  border-radius: 12px;
  font-size: 13px;
}
.form-error {
  min-height: 20px;
  color: var(--bad);
  text-align: center;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: #0b111de8;
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
}
.sidebar-brand div {
  display: grid;
}
.sidebar-brand small {
  color: var(--muted);
}
nav {
  display: grid;
  gap: 6px;
}
nav button {
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: #aab8cc;
  padding: 11px 14px;
}
nav button.active {
  color: white;
  background: linear-gradient(90deg, #7c5cff33, #5b7dff14);
  border-color: #765fff55;
}
.sidebar-footer {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.content {
  min-width: 0;
  padding: 26px 30px 50px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.topbar h1,
.topbar p {
  margin: 0;
}
.topbar p {
  color: var(--muted);
  margin-top: 3px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  background: #111a2a;
  color: #aab9cf;
  font-size: 12px;
}
.status-pill.ok,
.badge.high_value,
.badge.active,
.badge.completed {
  color: #87f0c4;
  border-color: #29d39155;
  background: #123128;
}
.badge.usable,
.badge.running,
.badge.queued {
  color: #7fc0ff;
  border-color: #57a6ff55;
  background: #102b48;
}
.badge.review,
.badge.standby {
  color: #ffd28a;
  border-color: #ffbd5955;
  background: #382813;
}
.badge.reject,
.badge.error,
.badge.failed,
.status-pill.error {
  color: #ff9cab;
  border-color: #ff5d7355;
  background: #3b1720;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.summary-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(145deg, #151d2d, #0f1624);
}
.summary-card span {
  color: var(--muted);
}
.summary-card strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}
.section-heading,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 14px;
}
.section-heading h2,
.section-heading p,
.panel-title h3 {
  margin: 0;
}
.section-heading p {
  color: var(--muted);
  margin-top: 3px;
}
.account-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.account-card,
.profile-card,
.panel,
.job-card,
.settings-card {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(145deg, #131c2c, #0e1522);
  padding: 18px;
}
.account-card header,
.profile-card header,
.job-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.account-card h3,
.profile-card h3,
.job-card h3 {
  margin: 0;
  font-size: 15px;
}
.muted {
  color: var(--muted);
}
.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.metric {
  padding: 10px;
  border-radius: 10px;
  background: #0c1421;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.metric strong {
  display: block;
  margin-top: 4px;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 22px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0f1623;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid #202c40;
  white-space: nowrap;
}
th {
  color: #92a3bc;
  font-size: 12px;
  background: #121b2a;
}
td {
  color: #d8e1ef;
}
.stack {
  display: grid;
  gap: 12px;
}
.job-progress {
  height: 7px;
  background: #0b111d;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}
.job-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #202b3e;
}
.list-row:last-child {
  border-bottom: 0;
}
.timeline {
  display: grid;
  gap: 0;
  border-left: 1px solid var(--border);
  margin-left: 8px;
}
.timeline-item {
  position: relative;
  margin-left: 20px;
  padding: 0 0 20px;
}
.timeline-item:before {
  content: "";
  position: absolute;
  left: -25px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px #57a6ff22;
}
.timeline-item.error:before {
  background: var(--bad);
}
.timeline-item small {
  color: var(--muted);
}
.notice {
  border: 1px solid #826dff55;
  background: #6c54ff14;
  border-radius: 10px;
  padding: 12px;
  color: #c9c1ff;
}
dialog {
  width: min(760px, calc(100vw - 30px));
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #111827;
  color: var(--text);
  padding: 0;
  box-shadow: 0 30px 100px #000b;
}
dialog::backdrop {
  background: #02050bb8;
  backdrop-filter: blur(5px);
}
.dialog-form {
  display: grid;
  gap: 20px;
  padding: 22px;
}
.dialog-form.wide {
  width: 100%;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
}
.dialog-heading h2,
.dialog-heading p {
  margin: 0;
}
.dialog-heading p {
  color: var(--muted);
}
.dialog-heading button {
  font-size: 22px;
  border: 0;
  background: transparent;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
}
.checkbox-label input {
  width: auto;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  padding: 13px 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #172033;
  box-shadow: 0 15px 50px #0009;
  z-index: 20;
}
.toast.error {
  border-color: #ff5d7388;
  color: #ffb0bd;
}
@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 76px 1fr;
  }
  .sidebar-brand div,
  .sidebar nav button {
    font-size: 0;
  }
  .sidebar nav button:after {
    font-size: 12px;
    content: attr(data-page);
    text-transform: capitalize;
  }
  .sidebar-footer {
    display: none;
  }
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .two-column {
    grid-template-columns: 1fr;
  }
  .form-grid.three {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 680px) {
  .content {
    padding: 18px;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 10px;
    flex-direction: row;
    overflow: auto;
  }
  .sidebar-brand {
    display: none;
  }
  .sidebar nav {
    display: flex;
  }
  .sidebar nav button {
    font-size: 0;
    white-space: nowrap;
  }
  .topbar {
    align-items: flex-start;
  }
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
  .account-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  filter: saturate(0.55);
}
.last-updated {
  color: var(--muted);
  font-size: 12px;
}
.activity-banner {
  margin: -12px 0 24px;
  border: 1px solid #57a6ff66;
  border-radius: 14px;
  background: linear-gradient(90deg, #102b48, #18204a);
  box-shadow: 0 12px 35px #06122766;
  overflow: hidden;
}
.activity-content {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
}
.activity-content > div {
  flex: 1;
}
.activity-content > div > div {
  color: #a8c9ed;
  margin-top: 2px;
}
.activity-pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 #57a6ff99;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px #57a6ff00;
  }
  100% {
    box-shadow: 0 0 0 0 #57a6ff00;
  }
}
.inline-progress,
.live-copy,
.success-notice,
.warning-notice,
.eligibility-box {
  border-radius: 10px;
  padding: 11px 13px;
}
.inline-progress {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: #9bcbff;
  background: #102b48;
  border: 1px solid #57a6ff55;
}
.inline-progress span,
.live-copy {
  color: #a8b9d1;
}
.account-busy,
.account-busy-row td,
.job-live {
  border-color: #57a6ff66;
  background-color: #10223a;
}
.live-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: #7fc0ff;
  font-size: 12px;
}
.live-label .activity-pulse {
  width: 7px;
  height: 7px;
}
.job-progress.indeterminate span {
  width: 38%;
  animation: progress-slide 1.3s ease-in-out infinite;
}
@keyframes progress-slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(365%);
  }
}
.live-copy {
  margin-top: 9px;
  background: #0d1829;
}
.success-notice {
  color: #9aefd0;
  border: 1px solid #29d39155;
  background: #123128;
}
.warning-notice {
  color: #ffd28a;
  border: 1px solid #ffbd5955;
  background: #382813;
}
.candidate-rejected td {
  background: #31151c55;
}
.candidate-eligible td {
  background: #12312844;
}
.decision-reason {
  max-width: 360px;
  margin-top: 5px;
  white-space: normal;
  line-height: 1.35;
  font-size: 12px;
}
.decision-reason.ok {
  color: #82e7bd;
}
.decision-reason.bad {
  color: #ff9cab;
}
.blocked-action {
  align-self: center;
  color: #ff9cab;
  font-size: 12px;
  cursor: help;
}
.eligibility-box {
  display: grid;
  gap: 3px;
  margin-bottom: 16px;
}
.eligibility-box.eligible {
  color: #9aefd0;
  border: 1px solid #29d39177;
  background: #123128;
}
.eligibility-box.blocked {
  color: #ffb0bd;
  border: 1px solid #ff5d7377;
  background: #3b1720;
}
.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.evidence-section {
  margin-top: 18px;
}
.evidence-section h3 {
  margin: 0 0 9px;
}
.reason-list {
  margin: 0;
  padding: 12px 12px 12px 31px;
  border: 1px solid #ff5d7355;
  border-radius: 10px;
  background: #3b1720;
  color: #ffb0bd;
}
.signal-list {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.signal-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.signal-row:last-child {
  border-bottom: 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.detail-grid > div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #0c1421;
}
.detail-grid span {
  color: var(--muted);
  font-size: 12px;
}
.toast {
  white-space: pre-wrap;
}
@media (max-width: 800px) {
  .activity-content,
  .inline-progress {
    align-items: flex-start;
    flex-direction: column;
  }
  .detail-metrics,
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .last-updated {
    display: none;
  }
}

.candidate-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 0.75fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0f1623;
}
.candidate-toolbar button {
  height: 42px;
}
.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted);
}
.filter-summary span {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #111a2a;
}
.filter-summary strong {
  color: var(--text);
}
.candidate-group-row td {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  color: #b9cdf0;
  background: #17233a;
  border-top: 1px solid #385079;
  border-bottom: 1px solid #385079;
  font-weight: 700;
}
.empty-filter {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}
.policy-mode {
  margin-top: 6px;
}
.badge.default {
  color: #c9c1ff;
  border-color: #826dff55;
  background: #241d48;
}
.badge.custom {
  color: #ffd28a;
  border-color: #ffbd5955;
  background: #382813;
}
.default-policy-toggle {
  display: grid;
  grid-template-columns: auto auto 1fr;
}
.default-policy-toggle span {
  color: var(--muted);
  font-size: 12px;
}
.settings-form {
  margin-top: 16px;
}
.settings-form .panel-title {
  margin-top: 0;
}
.settings-form .panel-title p {
  margin: 3px 0 0;
}
.default-policy-preview {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid #57a6ff44;
  border-radius: 10px;
  color: #b9d7f8;
  background: #10243b;
}
@media (max-width: 1100px) {
  .candidate-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 680px) {
  .candidate-toolbar {
    grid-template-columns: 1fr;
  }
  .default-policy-toggle {
    grid-template-columns: auto 1fr;
  }
  .default-policy-toggle span {
    grid-column: 1 / -1;
  }
}
