:root {
  --bg: #0b1020;
  --panel: #121a2e;
  --text: #edf2ff;
  --muted: #9da9c6;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #73e0a9;
  --accent-2: #74a7ff;
  --warning: #ffcc66;
  --danger: #ff7b8a;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #15203b 0%, var(--bg) 48%);
  color: var(--text);
}
button { font: inherit; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.hero,
.panel,
.stat-card {
  background: rgba(18, 26, 46, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

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

.hero-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.language-control {
  display: inline-flex;
}

.language-select {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

h1, h2 { margin: 0; }
h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
.subtitle, .muted { color: var(--muted); }
.subtitle { margin: 10px 0 0; max-width: 72ch; }

.ghost-button,
.filter-chip,
.link-chip,
.action-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
}

.ghost-button,
.action-button { cursor: pointer; }
.ghost-button:hover,
.filter-chip:hover,
.link-chip:hover,
.action-button:hover { background: rgba(255, 255, 255, 0.08); }

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

.stat-card { padding: 16px; }
.stat-label { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: 700; }

.panel { padding: 18px; margin-bottom: 16px; }
.filters-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}
.filters-copy {
  min-width: 0;
  max-width: 72ch;
}
.filters-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.applications-filters-stack {
  margin-top: 12px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.filter-chip { border-radius: 999px; cursor: pointer; }
.filter-chip.active {
  background: rgba(116, 167, 255, 0.2);
  border-color: rgba(116, 167, 255, 0.55);
}
.filter-chip.view-chip.active {
  background: rgba(115, 224, 169, 0.15);
  border-color: rgba(115, 224, 169, 0.45);
}
.panel-head { margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }

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

th, td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { color: var(--muted); font-weight: 600; font-size: 0.92rem; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.cell-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.vacancy-link {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.vacancy-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.vacancy-link:hover,
.vacancy-link:hover .cell-title {
  text-decoration: underline;
}

.cell-subtitle {
  color: var(--muted);
  font-size: 0.94rem;
}

.meta-list {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.meta-row strong {
  color: var(--text);
  font-weight: 600;
}

.link-stack,
.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-stack {
  margin-top: 10px;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
}

.action-button {
  padding: 8px 10px;
  border-radius: 999px;
}

.archive-button {
  color: var(--warning);
  border-color: rgba(255, 204, 102, 0.28);
  background: rgba(255, 204, 102, 0.1);
}

.restore-button {
  color: var(--accent);
  border-color: rgba(115, 224, 169, 0.28);
  background: rgba(115, 224, 169, 0.1);
}

.processed-button {
  color: #9fd3ff;
  border-color: rgba(116, 167, 255, 0.28);
  background: rgba(116, 167, 255, 0.1);
}

.secondary-button {
  color: var(--text);
}

.action-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-waiting { color: var(--accent-2); background: rgba(116, 167, 255, 0.14); border-color: rgba(116, 167, 255, 0.28); }
.status-interview { color: var(--warning); background: rgba(255, 204, 102, 0.14); border-color: rgba(255, 204, 102, 0.28); }
.status-offer { color: var(--accent); background: rgba(115, 224, 169, 0.14); border-color: rgba(115, 224, 169, 0.28); }
.status-rejected { color: var(--danger); background: rgba(255, 123, 138, 0.14); border-color: rgba(255, 123, 138, 0.28); }
.status-unknown { color: #c8d2ea; background: rgba(200, 210, 234, 0.1); border-color: rgba(200, 210, 234, 0.24); }

.archived-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--warning);
  border: 1px solid rgba(255, 204, 102, 0.25);
  background: rgba(255, 204, 102, 0.08);
}

.quality-chip {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.recent-jobs-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.recent-jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.source-card,
.recent-job-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.detail-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.detail-back-button {
  width: fit-content;
}

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

.detail-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.detail-card h3 {
  margin: 0 0 12px;
}

.detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-card-head h3 {
  margin: 0;
}

.detail-resume-block {
  margin-top: 12px;
}

.cover-card {
  margin-top: 12px;
}

.cover-letter-block {
  color: var(--text);
  line-height: 1.6;
  white-space: normal;
}

.source-card h3,
.recent-job-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.recent-job-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.recent-job-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--accent);
  border: 1px solid rgba(115, 224, 169, 0.28);
  background: rgba(115, 224, 169, 0.1);
  font-weight: 700;
}

.recent-job-run,
.recent-job-tags,
.recent-job-url {
  color: var(--muted);
  font-size: 0.92rem;
}

.recent-job-url {
  margin-top: 8px;
  word-break: break-word;
}

.recent-job-url strong {
  color: var(--text);
}

.recent-job-track {
  display: inline-flex;
  align-items: center;
  margin: 2px 0 10px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(116, 167, 255, 0.28);
  background: rgba(116, 167, 255, 0.1);
  color: #9fd3ff;
  font-size: 0.85rem;
}

.source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
}

.empty-state { padding: 16px 4px 4px; color: var(--muted); }

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sources-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .filters-panel,
  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .ghost-button { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100%, calc(100% - 16px));
    padding-top: 12px;
  }

  .hero,
  .panel,
  .stat-card { border-radius: 14px; }
  .stats-grid { grid-template-columns: 1fr; }
  th, td { padding: 12px 10px; }
}
