/* Job Search Dashboard. One stylesheet, no framework. */

:root {
  --ink: #22352f;
  --muted: #758077;
  --line: #e6eae3;
  --paper: #f4f5f1;
  --panel: #fff;
  --green: #234e40;
  --green-dark: #183e35;
  --lime: #c9da89;
  --amber: #ae7d2f;
  --red: #a0472a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Layout ---------- */

aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: var(--green-dark);
  color: #f5f4e9;
  padding: 35px 24px;
}
.brand {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 2px;
}
.brand span {
  color: var(--lime);
}
.sub {
  font-size: 14px;
  opacity: 0.7;
  margin: 8px 0 42px;
}
nav {
  display: grid;
  gap: 9px;
}
nav button {
  border: 0;
  background: transparent;
  color: #d3e1da;
  text-align: left;
}
.nav-ico {
  display: inline-block;
  width: 1.9em;
}
nav button:hover {
  background: #ffffff14;
}
nav button.active {
  background: #dce8bb;
  color: #173a30;
  font-weight: 650;
}
.aside-foot {
  position: absolute;
  bottom: 30px;
  font-size: 14px;
}
.aside-foot span {
  opacity: 0.6;
}
.mode-toggle {
  margin-bottom: 14px;
  background: transparent;
  color: #d3e1da;
  border-color: #ffffff33;
}
.mode-toggle:hover {
  background: #ffffff14;
}
.mode-switch {
  display: flex;
  gap: 8px;
}

main {
  margin-left: 250px;
  padding: 35px 44px;
  max-width: 1650px;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: center;
}
h1 {
  font-size: 30px;
  line-height: 1.3;
  margin: 8px 0 18px;
  letter-spacing: -1px;
}
h2 {
  font-size: 20px;
  margin: 0 0 15px;
}
.eyebrow {
  font-size: 14px;
  color: #69796f;
  letter-spacing: 1px;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
#saveStatus {
  font-size: 13px;
  color: #5b7564;
}
.notice {
  font-size: 14px;
  color: #63726a;
  margin: 4px 0 24px;
}
.notice.banner {
  background: #fff8e4;
  border: 1px solid #ebd38f;
  border-radius: 10px;
  padding: 10px 14px;
  color: #5b4a14;
}
.notice.banner button {
  margin-left: 8px;
}
footer {
  color: #7c877f;
  font-size: 14px;
  margin-top: 35px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.panel {
  background: var(--panel);
  border: 1px solid #dfe5dc;
  border-radius: 12px;
  padding: 24px;
}
.panel.accent {
  background: #e8eddb;
  border: 0;
}
/* Vertical rhythm between stacked panels. */
#content > * + *,
.grid > div > .panel + .panel {
  margin-top: 20px;
}
#content > .grid + .grid {
  margin-top: 22px;
}

/* ---------- Controls ---------- */

button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #d1d9d3;
  background: white;
  border-radius: 8px;
  padding: 9px 16px;
  color: inherit;
}
button:hover {
  background: #e6ede6;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #316650;
}
.danger {
  color: var(--red);
  border-color: #e8c3b5;
}
.danger:hover {
  background: #fbede6;
}
.small {
  padding: 4px 9px;
  font-size: 14px;
}
.linkish {
  margin-left: 8px;
}
input,
select,
textarea {
  border: 1px solid #cbd4cc;
  border-radius: 7px;
  background: #fff;
  padding: 9px 11px;
  color: var(--ink);
  max-width: 100%;
}
textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}
.review-text {
  min-height: 280px;
  margin-bottom: 12px;
}
a {
  color: #28634f;
}
code {
  background: #edf1e8;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}
mark {
  background: #f6e27a;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* ---------- Stats and filters ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 25px;
}
.stat {
  padding: 18px 22px;
  background: #fff;
  border: 1px solid #e1e5de;
  border-radius: 12px;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stat:hover {
  background: #fff;
  border-color: #9fb7a6;
  box-shadow: 0 2px 10px #183e3514;
}
.stat strong {
  display: block;
  font-size: 32px;
  font-weight: 600;
}
.stat span {
  display: block;
  font-size: 14px;
  color: #69796f;
}
@keyframes flash {
  0% {
    box-shadow: 0 0 0 4px var(--lime);
  }
  100% {
    box-shadow: 0 0 0 0 #c9da8900;
  }
}
.flash {
  animation: flash 1.6s ease-out;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
}
.filters label {
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 420px;
  max-width: 640px;
  background: #fff;
  border: 2px solid #9fb7a6;
  border-radius: 10px;
  padding: 2px 6px 2px 12px;
}
.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #c9da8966;
}
.search-ico {
  font-size: 20px;
  color: #5b7564;
  line-height: 1;
}
.search-box input {
  border: 0;
  flex: 1;
  min-width: 0;
  padding: 10px 4px;
  font-size: 16px;
  outline: none;
  background: transparent;
}
.search-box input::-webkit-search-cancel-button {
  display: none;
}
#searchCount {
  font-weight: 600;
  color: var(--green);
}
.search-summary {
  border-color: #9fb7a6;
  background: #f7faf4;
}

/* ---------- Rows, badges, tables ---------- */

.row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid #e7eae4;
}
.row:last-child {
  border-bottom: 0;
}
.row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: #315d48;
  margin-top: 5px;
}
.row .grow {
  flex: 1;
  min-width: 0;
}
.meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.empty {
  color: #718075;
  padding: 22px 0;
}
.nowrap,
a.ext {
  white-space: nowrap;
}

.badge {
  display: inline-block;
  font-size: 13px;
  background: #edf1e8;
  border-radius: 5px;
  padding: 2px 7px;
  margin: 0 5px 3px 0;
}
.badge.late {
  color: var(--red);
  background: #fbede6;
}
.badge.dl-soon {
  color: #8a5a12;
  background: #fbf0d9;
}
.badge.fu {
  background: #dfe9f5;
  color: #2b5687;
}
.badge.prio-high {
  background: #f6e7cf;
  color: #7a4c0c;
}
.roll-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 5px;
  padding: 2px 8px;
  margin: 0 5px 3px 0;
  background: #fff1c7;
  color: #7a5200;
  border: 1px solid #ebcf7a;
}
.roll-badge.day {
  background: #e5efff;
  color: #1d4b8f;
  border-color: #b3cbef;
}

.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  text-align: left;
}
th {
  font-size: 14px;
  font-weight: 500;
  color: #778279;
}
td,
th {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

/* ---------- Tasks ---------- */

.quick-add {
  margin: 2px 0 6px;
}
.quick-add input {
  width: 100%;
  border: 1px dashed #c3cec4;
  background: #fafbf8;
  padding: 8px 11px;
}
.quick-add input:focus {
  border-style: solid;
  background: #fff;
  outline: 2px solid #b9cf8a;
  outline-offset: 0;
}
.task-title {
  font-weight: 550;
  overflow-wrap: anywhere;
  cursor: text;
  border-radius: 4px;
  margin: -2px -5px;
  padding: 2px 5px;
  transition: color 0.2s, background 0.15s;
}
.task-title:hover {
  background: #f0f3ec;
}
.task-title .title-input {
  width: 100%;
  padding: 3px 8px;
  font-weight: 550;
}
.done {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  color: #8b958e;
}
.task-row.is-done .meta {
  opacity: 0.5;
}
.task-row.is-done input[type="checkbox"] {
  opacity: 0.7;
}
.task-row.is-done .note {
  display: none;
}
.progress {
  height: 8px;
  background: #e4eadc;
  border-radius: 20px;
  overflow: hidden;
}
.progress div {
  height: 100%;
  background: #557950;
}
.job-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.job-chip {
  font-size: 13px;
  padding: 2px 9px;
  border-radius: 14px;
  border: 1px solid #b9cbbf;
  background: #f2f7f1;
  color: var(--green);
}
.job-chip span {
  color: var(--muted);
  margin-left: 4px;
}
.job-chip:hover {
  background: #dce8bb;
}

/* ---------- Jobs: review queue ---------- */

.score {
  font-size: 20px;
  color: var(--green);
  margin-right: 6px;
}
.inbox-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.inbox-section {
  border-top: 6px solid var(--green);
  padding-top: 18px;
}
.inbox-section.is-br {
  border-top-color: var(--amber);
}
.inbox-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e7eae4;
}
.inbox-sec-head h2 {
  margin: 0;
  font-size: 22px;
  white-space: nowrap;
}
.inbox-section.is-lt h2 {
  color: var(--green);
}
.inbox-section.is-br h2 {
  color: #8a5f1c;
}
.inbox-card {
  flex-direction: column;
}
.inbox-card .task-title {
  cursor: default;
}
.inbox-card .task-title:hover {
  background: none;
}
.inbox-card .task-title b {
  font-weight: 700;
}
.inbox-card .comment {
  width: 100%;
  min-height: 36px;
  margin-top: 8px;
  font-size: 14px;
  resize: none;
  overflow: hidden;
  background: #fbfcf9;
}
.inbox-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 6px;
}
.company-group {
  border-bottom: 1px solid #d9e0d3;
  padding: 4px 0;
}
.company-group .inbox-card {
  border-bottom: 0;
}
.secondary summary {
  cursor: pointer;
  font-size: 14px;
  color: #3f5a4d;
  padding: 4px 0 4px 28px;
}
.is-secondary {
  padding-left: 28px;
  opacity: 0.92;
}
.role-tag {
  display: inline-block;
  font-size: 12px;
  border: 1px solid #8aa48f;
  color: #3f5a4d;
  border-radius: 4px;
  padding: 0 6px;
  margin-right: 6px;
  vertical-align: middle;
}
.role-tag.main {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Engine badges: the color is picked from the engine name (see engineBadge in ui.js). */
.source-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 5px;
  padding: 3px 8px;
  margin: 0 5px 3px 0;
  white-space: nowrap;
  border: 1px solid;
}
.source-0 { background: #f3e2d8; color: #783f27; border-color: #dec0ae; }
.source-1 { background: #dbe9f6; color: #17446d; border-color: #adcae4; }
.source-2 { background: #e5f2dc; color: #2f5a17; border-color: #bcd9a6; }
.source-3 { background: #ece4fb; color: #4a2d8c; border-color: #cdbcf0; }
.source-4 { background: #d1eeec; color: #0b5856; border-color: #96d3cf; }
.source-5 { background: #f9e0ea; color: #7d1f47; border-color: #eab3c9; }
.source-inline {
  margin-top: 5px;
}
.source-comparison {
  grid-column: 1 / -1;
  margin: 7px 0;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #d8e1d8;
  border-radius: 6px;
  font-size: 13px;
}
.source-comparison > div {
  margin: 3px 0;
}

/* Employer badges, colored by employer_category. */
.org-badge {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 5px;
  padding: 3px 9px;
  margin: 0 7px 2px 0;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}
.org-startup { background: #fdddd2; color: #962c0c; border-color: #f3b29c; }
.org-growth { background: #fbe5cc; color: #7a3f06; border-color: #efc491; }
.org-enterprise { background: #dce8f8; color: #173f73; border-color: #aac4e8; }
.org-research { background: #d1eeec; color: #0b5856; border-color: #96d3cf; }
.org-public { background: #d6eed7; color: #1b5a2c; border-color: #a3d2a7; }
.org-nonprofit { background: #ece4fb; color: #4a2d8c; border-color: #cdbcf0; }
.org-other { background: #eceee9; color: #3f4a44; border-color: #cfd5cc; }
.org-about {
  font-size: 13.5px;
  color: #4d5e55;
  margin: 3px 0 2px;
  line-height: 1.5;
}
.org-detail {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cdd6cc;
}
.org-detail .org-about {
  margin-top: 6px;
  font-size: 14px;
}

/* ---------- Jobs: stages and starred ---------- */

.stage-panel > summary,
details.panel > summary {
  cursor: pointer;
  font-size: 17px;
  padding: 2px 0;
}
.stage-panel[open] > summary {
  margin-bottom: 12px;
}
.stage-applied > summary b {
  color: var(--green);
}
.stage-closed,
.stage-later {
  opacity: 0.92;
}
.star-btn {
  color: #a07a1f;
  border-color: #e3d3a8;
  background: #fffaf0;
  white-space: nowrap;
}
.star-btn.on {
  background: #f5e3a8;
  border-color: #d9b75a;
  color: #6b4d05;
  font-weight: 650;
}
.star-btn:hover {
  background: #f8ebc4;
}
.star-panel {
  border-color: #e3cf8f;
  background: #fffdf6;
}
.star-row .star-btn {
  margin-top: 2px;
}
.star-row.is-closed {
  opacity: 0.55;
}
.star-head-done {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}
.star-done {
  margin-top: 10px;
  border-top: 1px dashed #e3cf8f;
  padding-top: 8px;
}
.star-done > summary {
  cursor: pointer;
  padding: 8px 0;
  color: #5b4a14;
}
.star-done .star-row {
  opacity: 0.8;
}

/* ---------- Calendar ---------- */

.cal-row {
  align-items: center;
}
.cal-date {
  width: 92px;
  flex: none;
  text-align: center;
  border-radius: 9px;
  background: #eef2ea;
  padding: 6px 4px;
  line-height: 1.25;
}
.cal-date b {
  display: block;
  font-size: 18px;
}
.cal-date span {
  font-size: 12px;
  color: #5f6f65;
}
.cal-date.soon {
  background: #fbf0d9;
}
.cal-date.soon span {
  color: #8a5a12;
}
.cal-date.past {
  background: #fbede6;
}
.cal-date.past span {
  color: var(--red);
}
.cal-type {
  display: inline-block;
  font-size: 12px;
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 6px;
  font-weight: 600;
}
.cal-type.deadline,
.cal-chip.deadline {
  background: var(--red);
  color: #fff;
}
.cal-type.follow,
.cal-chip.follow {
  background: #dfe9f5;
  color: #2b5687;
}
.cal-sec.soon {
  border-color: #e7c98a;
}
.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cal-legend {
  margin: 0 0 10px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-wd {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 4px 0;
}
.cal-cell {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cal-cell.blank {
  border: 0;
}
.cal-cell.is-today {
  border-color: #557950;
  box-shadow: inset 0 0 0 1px #557950;
}
.cal-num {
  font-size: 12px;
  color: var(--muted);
}
.cal-chip {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cal-chip.deadline:hover {
  background: #86391f;
}

/* ---------- Editor dialog ---------- */

dialog {
  border: 0;
  border-radius: 15px;
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  box-shadow: 0 24px 90px #183e3540;
  padding: 26px;
}
dialog::backdrop {
  background: #17352870;
}
.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
#fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
#fields label {
  display: grid;
  gap: 5px;
  font-size: 14px;
}
#fields label.wide,
#fields .task-jobs,
.scout-block {
  grid-column: 1 / -1;
}
#fields label.wide select {
  width: 100%;
  min-width: 0;
}
.scout-block {
  background: #f1f4ec;
  border-radius: 8px;
  padding: 10px 12px;
}
.scout-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.kv {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  font-size: 14px;
  padding: 3px 0;
}
.kv .k {
  color: #69796f;
}
.kv .v {
  overflow-wrap: anywhere;
}
.research {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #cdd6cc;
}
.task-jobs {
  border: 1px solid #cddbd1;
  background: #f7faf6;
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.tj-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}
.tj-card {
  background: #fff;
  border: 1px solid #e1e8e2;
  border-radius: 8px;
  padding: 10px 12px;
}
.tj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  font-size: 14px;
}
.tj-task {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tj-task > span:first-child {
  flex: 1;
  min-width: 0;
}

/* ---------- Data page ---------- */

.file-links {
  display: grid;
  gap: 15px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1250px) {
  .inbox-columns {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1050px) {
  aside {
    width: 210px;
    padding: 25px 15px;
  }
  main {
    margin-left: 210px;
    padding: 25px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  header {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 650px) {
  aside {
    position: static;
    width: auto;
    padding: 20px;
  }
  .sub {
    margin-bottom: 15px;
  }
  nav {
    grid-template-columns: 1fr 1fr;
  }
  .aside-foot {
    display: none;
  }
  main {
    margin: 0;
    padding: 20px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    padding: 12px;
  }
  h1 {
    font-size: 26px;
  }
  #fields {
    grid-template-columns: 1fr;
  }
  #fields label.wide {
    grid-column: auto;
  }
  .cal-cell {
    min-height: 54px;
  }
  .cal-chip {
    font-size: 10px;
  }
  .cal-date {
    width: 70px;
  }
}
