* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f5f6f8;
  color: #1a1a2e;
  margin: 0;
  padding: 2rem;
}

h1 {
  margin-top: 0;
}

.top-nav {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.top-nav a {
  color: #2b6cb0;
  text-decoration: none;
  font-weight: 600;
  margin-right: 1.25rem;
}

.top-nav a:hover {
  text-decoration: underline;
}

.scrape-form {
  margin-left: auto;
}

.scrape-form button {
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  border: 1px solid #2b6cb0;
  background: white;
  color: #2b6cb0;
  font-weight: 600;
  cursor: pointer;
}

.scrape-form button:disabled {
  border-color: #ccc;
  color: #888;
  cursor: not-allowed;
}

.notice {
  background: #fffbea;
  border: 1px solid #f0e0a0;
  color: #6b5600;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.notice-success {
  background: #ecfdf3;
  border-color: #a7e0bb;
  color: #14532d;
}

.filters {
  display: flex;
  gap: 1rem;
  align-items: end;
  background: white;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: #555;
  gap: 0.25rem;
}

.filters select, .filters input {
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.filters button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background: #2b6cb0;
  color: white;
  cursor: pointer;
}

.job-count {
  color: #666;
  margin-bottom: 1rem;
}

.job-card {
  background: white;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.job-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.job-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: #1a1a2e;
}

.job-title:hover {
  text-decoration: underline;
}

.job-score {
  font-weight: 700;
  color: #2b6cb0;
  white-space: nowrap;
}

.job-meta {
  color: #555;
  font-size: 0.9rem;
  margin: 0.25rem 0 0.5rem;
}

.job-source {
  display: inline-block;
  background: #edf2f7;
  color: #4a5568;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-right: 0.5rem;
}

.job-description {
  font-size: 0.9rem;
  color: #333;
  max-height: 3.6em;
  overflow: hidden;
}

.job-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.job-actions form {
  display: inline;
}

.job-actions button {
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fafafa;
  cursor: pointer;
  font-size: 0.8rem;
}

.job-actions button.current {
  background: #2b6cb0;
  color: white;
  border-color: #2b6cb0;
}

.empty-state {
  color: #666;
  padding: 2rem;
  text-align: center;
}

.apply-panel {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.apply-panel form {
  display: inline;
}

.btn-link {
  color: #2b6cb0;
  text-decoration: none;
  font-weight: 600;
}

.btn-link:hover {
  text-decoration: underline;
}

.apply-panel button {
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  border: 1px solid #2b6cb0;
  background: #2b6cb0;
  color: white;
  cursor: pointer;
  font-size: 0.8rem;
}

.apply-panel button:disabled {
  border-color: #ccc;
  background: #ddd;
  color: #888;
  cursor: not-allowed;
}

.apply-panel button.btn-subtle {
  background: #fafafa;
  color: #333;
  border-color: #ccc;
}

.resume-pending {
  color: #b7791f;
}

.resume-error {
  color: #c53030;
  cursor: help;
}

.settings-card {
  background: white;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  max-width: 700px;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.stacked-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #444;
}

.stacked-form input[type="text"],
.stacked-form input[type="number"],
.stacked-form input[type="file"] {
  padding: 0.45rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

.stacked-form button {
  align-self: flex-start;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 4px;
  background: #2b6cb0;
  color: white;
  cursor: pointer;
}

.stacked-form textarea {
  resize: vertical;
}

.custom-search-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.custom-search-row:last-child {
  border-bottom: none;
}

.custom-search-row button {
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  border: 1px solid #2b6cb0;
  background: white;
  color: #2b6cb0;
  cursor: pointer;
  white-space: nowrap;
}

.custom-search-row button:disabled {
  border-color: #ccc;
  color: #888;
  cursor: not-allowed;
}

.btn-subtle {
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fafafa;
  color: #333;
  cursor: pointer;
  font-size: 0.85rem;
}

.custom-search-entry {
  border-bottom: 1px solid #eee;
  padding: 0.4rem 0;
}

.custom-search-entry:last-child {
  border-bottom: none;
}

.custom-search-entry .custom-search-row {
  border-bottom: none;
  padding: 0.2rem 0;
}

.known-sites {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.85rem;
}

.known-sites summary {
  cursor: pointer;
  color: #2b6cb0;
}

.known-sites .stacked-form {
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.admin-actions form {
  margin: 0;
}

.admin-actions .stacked-form {
  flex-direction: row;
  gap: 0.4rem;
}

.admin-actions input[type="password"] {
  padding: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
}

.sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.sources-table th {
  text-align: left;
  border-bottom: 2px solid #eee;
  padding: 0.5rem 0.6rem;
  color: #555;
}

.sources-table td {
  border-bottom: 1px solid #f0f0f0;
  padding: 0.5rem 0.6rem;
  vertical-align: top;
}

.job-added {
  color: #888;
  font-size: 0.8rem;
}
