:root {
  --bg: #08131a;
  --bg-soft: #10222c;
  --panel: rgba(12, 26, 34, 0.84);
  --panel-strong: rgba(9, 21, 29, 0.95);
  --line: rgba(143, 191, 201, 0.18);
  --text: #ecf6f4;
  --muted: #95b6b4;
  --accent: #4fe0b3;
  --accent-strong: #1ecf95;
  --warning: #ffb14a;
  --danger: #ff7d74;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 14px;
  --browser-table-height: clamp(420px, 62vh, 760px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 224, 179, 0.16), transparent 30%),
    radial-gradient(circle at right 20%, rgba(255, 177, 74, 0.12), transparent 25%),
    linear-gradient(160deg, #051015 0%, #0d1b24 52%, #0c0f13 100%);
}

code,
pre,
textarea,
input {
  font-family: Consolas, "Courier New", monospace;
}

.app-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 90%);
  pointer-events: none;
}

.page,
.login-page {
  position: relative;
  z-index: 1;
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.panel {
  backdrop-filter: blur(14px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--accent);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.45rem;
}

.hero-copy {
  margin-top: 12px;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.6;
}

.hero-meta {
  display: grid;
  gap: 12px;
  min-width: min(360px, 100%);
}

.meta-card,
.destination-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.meta-card code,
.destination-card code,
.selection-chip code,
.job-destination code {
  display: block;
  margin-top: 8px;
  color: #d8fff4;
  word-break: break-word;
}

.meta-label,
.section-label,
.job-destination span {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.warning-pill {
  padding: 12px 14px;
  border-radius: 999px;
  color: #211300;
  background: linear-gradient(135deg, #ffd36f, #ffad49);
  font-weight: 700;
}

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

.browser-panel,
.jobs-panel,
.action-panel {
  padding: 22px;
}

.browser-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.action-panel,
.jobs-panel {
  grid-column: 1 / -1;
}

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button,
.primary-button,
.selection-chip,
.crumb,
.name-button {
  border: 0;
  border-radius: 14px;
  transition: 0.18s ease;
}

.ghost-button,
.crumb {
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.ghost-button:hover,
.crumb:hover,
.name-button:hover,
.selection-chip:hover {
  background: rgba(255, 255, 255, 0.11);
}

.primary-button {
  padding: 12px 18px;
  color: #032018;
  background: linear-gradient(135deg, var(--accent), #8de8c7);
  font-weight: 700;
  cursor: pointer;
}

.primary-button.subtle {
  background: linear-gradient(135deg, rgba(79, 224, 179, 0.75), rgba(141, 232, 199, 0.75));
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.crumb-sep {
  color: rgba(236, 246, 244, 0.35);
}

.table-wrap {
  overflow: auto;
  height: var(--browser-table-height);
  min-height: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-strong);
  font-size: 0.86rem;
  color: var(--muted);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.small-col {
  white-space: nowrap;
}

.name-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.name-button.static {
  cursor: default;
}

.name-button.folder {
  font-weight: 700;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #032018;
  background: linear-gradient(135deg, #7ef0ca, #c7ffe7);
}

.name-button.file .icon-pill,
.name-button.static .icon-pill {
  color: #1b1200;
  background: linear-gradient(135deg, #ffd98d, #ffb24d);
}

.table-empty,
.empty-state {
  padding: 26px;
  color: var(--muted);
}

.action-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 136px;
  padding: 4px 0;
}

.selection-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.selection-chip strong {
  color: var(--accent);
}

.field,
.toggle {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.field span,
.toggle span {
  color: var(--muted);
  font-size: 0.92rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}

.feedback {
  min-height: 22px;
  margin-top: 12px;
  color: #d8fff4;
}

.jobs-list {
  display: grid;
  gap: 14px;
}

.job-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.job-title {
  font-size: 1rem;
  font-weight: 700;
}

.job-title span {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
}

.job-copy {
  margin-top: 6px;
  color: var(--muted);
}

.progress-track {
  height: 12px;
  margin: 14px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #c3ffe8);
}

.job-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.job-current {
  margin-top: 10px;
  color: #dffef3;
}

.job-log {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.status-completed .job-title span {
  color: #05261d;
  background: linear-gradient(135deg, #8af7cf, #c7ffe7);
}

.status-completed_with_errors .job-title span,
.status-failed .job-title span {
  color: #2b1100;
  background: linear-gradient(135deg, #ffd98f, #ff9874);
}

.status-running .job-title span,
.status-scanning .job-title span,
.status-queued .job-title span {
  color: #06231e;
  background: linear-gradient(135deg, #7edfff, #b7f6ff);
}

.login-shell {
  display: grid;
  min-height: 100vh;
}

.login-page {
  display: grid;
  place-items: center;
}

.login-card {
  width: min(480px, 100%);
  padding: 28px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.alert {
  padding: 12px 14px;
  margin-top: 16px;
  border-radius: 14px;
}

.alert.error {
  color: #ffdede;
  background: rgba(255, 125, 116, 0.14);
  border: 1px solid rgba(255, 125, 116, 0.35);
}

.alert.warning {
  color: #fff0d2;
  background: rgba(255, 177, 74, 0.12);
  border: 1px solid rgba(255, 177, 74, 0.3);
}

@media (max-width: 980px) {
  .hero,
  .panel-head,
  .job-head {
    flex-direction: column;
  }

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

  .page,
  .login-page {
    width: min(100vw - 20px, 1380px);
  }

  :root {
    --browser-table-height: 420px;
  }
}
