:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --border: #d9dee5;
  --text: #1f2530;
  --muted: #68707d;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --new: #16a34a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.container { max-width: 1150px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.app-header h1 { font-size: 1.4rem; margin: 0 0 1rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.query-row { display: flex; gap: 0.5rem; }

.query-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.query-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-mini { padding: 0.15rem 0.5rem; font-size: 0.75rem; border-radius: 6px; }

.sources { border: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.sources legend { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 0 0 0.35rem; }
.source-option { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.source-option.disabled { color: var(--muted); cursor: default; }
.source-option .hint { font-size: 0.75rem; color: var(--muted); background: var(--bg); border-radius: 5px; padding: 0.05rem 0.4rem; }

.flash { padding: 0.6rem 1rem; border-radius: 8px; margin: 0 0 1rem; }
.flash-notice { background: #e8f6ee; border: 1px solid #b5e3c8; color: #14532d; }
.flash-alert { background: #fdeeee; border: 1px solid #f3c1c1; color: #7f1d1d; }

.filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; font-size: 0.85rem; }
.filter-form input[type="text"], .filter-form select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.85rem;
}
.filter-form label { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); }
.clear-link { color: var(--muted); }

.result-count { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.5rem; }
.empty-state { color: var(--muted); text-align: center; padding: 3rem 0; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfd; }
.nowrap { white-space: nowrap; }

.title-cell { max-width: 420px; }
.title-cell > a { font-weight: 600; color: var(--accent); text-decoration: none; }
.title-cell > a:hover { text-decoration: underline; }

.description { margin-top: 0.25rem; }
.description summary { font-size: 0.78rem; color: var(--muted); cursor: pointer; }
.description p { font-size: 0.82rem; color: var(--muted); margin: 0.35rem 0 0; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
}
.badge-new { background: var(--new); color: #fff; margin-left: 0.35rem; }
.badge-remote { background: #ede9fe; color: #5b21b6; margin-left: 0.3rem; }
.badge-source { background: var(--bg); border: 1px solid var(--border); color: var(--muted); font-weight: 500; margin: 0 0.2rem 0.2rem 0; }
.badge-status { background: var(--bg); color: var(--muted); text-transform: capitalize; }
.badge-status-applied { background: #dbeafe; color: #1e40af; }
.badge-status-rejected { background: #fee2e2; color: #991b1b; }
.badge-status-ignored { background: #e5e7eb; color: #4b5563; }

.status-cell { min-width: 130px; }
.status-actions { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.35rem; }
.status-actions form { display: inline; }

tr.status-ignored .title-cell > a, tr.status-rejected .title-cell > a { color: var(--muted); }
