:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #555;
  --ink-faint: #888;
  --line: #e4e4e4;
  --line-strong: #cfcfcf;
  --panel: #f7f7f7;
  --hover: #f0f0f0;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
code { font-family: ui-monospace, Menlo, monospace; font-size: 0.85em; background: var(--panel); padding: 1px 5px; border-radius: 4px; }
a { color: var(--ink); }
.muted { color: var(--ink-faint); font-size: 12px; }

/* ---- login gate ---- */
.gate {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 50;
}
.gate-card {
  width: min(340px, 88vw);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
}
.gate-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 30px; letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.gate-sub { color: var(--ink-soft); margin-bottom: 20px; font-size: 13px; }
.gate-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 11px 13px;
  font: inherit;
  margin-bottom: 12px;
  background: var(--bg);
}
.gate-input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.gate-btn {
  width: 100%;
  border: none;
  background: var(--ink);
  color: #fff;
  padding: 11px;
  border-radius: 8px;
  font: inherit; font-weight: 700;
  cursor: pointer;
}
.gate-btn:hover { opacity: 0.88; }
.gate-error { color: var(--ink); font-weight: 700; margin-top: 12px; font-size: 13px; }

/* ---- layout ---- */
.app { max-width: 1180px; margin: 0 auto; padding: 0 20px 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { font-size: 18px; }
.brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.topbar-meta { display: flex; align-items: center; gap: 14px; }
.lock-btn {
  border: 1px solid var(--line-strong); background: var(--bg);
  border-radius: 7px; padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer;
}
.lock-btn:hover { background: var(--hover); }

/* ---- stats ---- */
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.stat {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 16px; min-width: 96px;
}
.stat-num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px; line-height: 1; }
.stat-label { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* ---- controls ---- */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search {
  flex: 1 1 320px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 10px 14px; font: inherit; background: var(--bg);
}
.search:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.chips { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--bg);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.chip:hover { background: var(--hover); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.select {
  border: 1px solid var(--line-strong); background: var(--bg);
  border-radius: 8px; padding: 9px 12px; font: inherit; cursor: pointer;
}

/* ---- table ---- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid { width: 100%; border-collapse: collapse; }
.grid thead th {
  text-align: left; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-soft); padding: 11px 12px; border-bottom: 1px solid var(--line-strong);
  background: var(--panel); white-space: nowrap;
}
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--ink); }
.grid tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:hover { background: var(--hover); }
.cell-company { font-weight: 700; }
.cell-role { color: var(--ink-soft); }
.cell-date, .cell-loc, .cell-pay { white-space: nowrap; color: var(--ink-soft); font-size: 13px; }
.notes-toggle { cursor: pointer; color: var(--ink-faint); font-size: 12px; text-decoration: underline; }
.notes-body { display: none; margin-top: 6px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; max-width: 520px; white-space: pre-wrap; }
.notes-body.open { display: block; }

/* status badges (monochrome, differentiated by fill/border) */
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--ink); white-space: nowrap;
}
.badge.applied   { background: var(--ink); color: #fff; }
.badge.interview { background: var(--ink); color: #fff; }
.badge.offer     { background: var(--ink); color: #fff; }
.badge.responded { background: #fff; color: var(--ink); }
.badge.evaluated { background: #fff; color: var(--ink); border-style: dashed; }
.badge.rejected  { background: #fff; color: var(--ink-faint); border-color: var(--line-strong); }
.badge.discarded { background: #fff; color: var(--ink-faint); border-color: var(--line-strong); }
.badge.skip      { background: repeating-linear-gradient(45deg,#fff,#fff 4px,#f0f0f0 4px,#f0f0f0 8px); color: var(--ink-faint); border-color: var(--line-strong); }

.linkpill {
  display: inline-block; font-size: 12px; padding: 3px 10px; border: 1px solid var(--line-strong);
  border-radius: 7px; text-decoration: none; white-space: nowrap;
}
.linkpill:hover { background: var(--hover); }
.dash { color: var(--ink-faint); }

.empty { padding: 28px; text-align: center; color: var(--ink-faint); }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

@media (max-width: 760px) {
  .cell-loc, .grid thead th:nth-child(4), .grid tbody td:nth-child(4) { display: none; }
}
