:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --sheet: #fff;
  --text: #1f2328;
  --muted: #6b7280;
  --grid: #dfe3e8;
  --blue: #2563eb;
  --rejected: #f1f2f4;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.sheet-wrap {
  width: min(1400px, calc(100% - 28px));
  margin: 20px auto 40px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
h1 { margin: 0; font-size: 22px; font-weight: 700; }
.head-actions, .row-actions { display: flex; gap: 6px; align-items: center; }

.btn, .icon-btn {
  border: 1px solid var(--grid);
  background: #fff;
  color: var(--text);
  border-radius: 5px;
  padding: 6px 10px;
  line-height: 1.2;
}
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.icon-btn { padding: 4px 7px; color: var(--muted); font-size: 12px; }
.icon-btn:hover { color: var(--text); }
.delete-btn:hover { color: #b42318; }

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--grid);
  background: var(--sheet);
}
.table-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.05fr) minmax(220px, 1.75fr) minmax(110px, .8fr) minmax(90px, .7fr) minmax(180px, 1.5fr) 92px;
  min-width: 900px;
  align-items: stretch;
}
.table-head {
  background: #f8f9fa;
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
  border-bottom: 1px solid var(--grid);
}
.table-head > div,
.job-row > .cell,
.job-row > .view-actions {
  padding: 8px 10px;
  border-right: 1px solid var(--grid);
  min-width: 0;
}
.table-head > div:last-child,
.job-row > .view-actions { border-right: 0; }
.job-row {
  border-bottom: 1px solid var(--grid);
  background: #fff;
}
.job-row:last-child { border-bottom: 0; }
.job-row:not(.same-company) { border-top: 7px solid var(--bg); }
.job-row:first-child { border-top: 0; }
.job-row.same-company { border-top: 0; }
.cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
  font-size: 13px;
}
.company-text { font-weight: 650; }
.stage-text { font-weight: 600; }
.note-text { color: #4b5563; }
.view-actions { justify-content: flex-end; display: flex; gap: 4px; align-items: center; }

.job-row.is-rejected {
  background: var(--rejected);
  color: #8b9098;
}
.job-row.is-rejected .note-text,
.job-row.is-rejected .icon-btn { color: #9ca1a9; }
.job-row.is-rejected .icon-btn { background: transparent; }

.edit-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.05fr) minmax(220px, 1.75fr) minmax(110px, .8fr) minmax(90px, .7fr) minmax(180px, 1.5fr) 150px;
  gap: 0;
  min-width: 900px;
  background: #fffbe8;
  border: 1px solid var(--grid);
}
.edit-mode {
  grid-column: 1 / -1;
  border: 0;
  border-top: 1px solid var(--grid);
}
.edit-row[hidden] { display: none; }
.edit-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--grid);
  border-radius: 0;
  padding: 8px 10px;
  outline: none;
  background: transparent;
}
.edit-row input:focus { box-shadow: inset 0 0 0 2px #93b4ff; }
.edit-row .row-actions { padding: 4px 6px; justify-content: flex-end; }
.add-row { margin-bottom: 8px; }
.message { min-height: 16px; margin: 0 0 6px; color: #b42318; font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 28px; }

@media (max-width: 720px) {
  .sheet-wrap { width: calc(100% - 16px); margin-top: 10px; }
  h1 { font-size: 18px; }
  .btn { padding: 5px 8px; font-size: 13px; }
}
