/* Job tracker list. Shares tokens and shell with base.css. */

.nav__link.is-active {
  color: var(--text);
  font-weight: 500;
}

.tracker {
  padding: calc(var(--nav-height) + 36px) 0 72px;
}

.tracker__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.tracker__title {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.tracker__lede {
  margin-top: 6px;
  max-width: 42rem;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.tracker__status {
  min-height: 1.4em;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.tracker__count {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Filter bar */

.filters {
  margin-bottom: 18px;
}

.filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
}

.search__input {
  padding-left: 40px;
  font-size: 14.5px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a94' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 15px center;
}

.search__input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 12px 28px rgba(22, 22, 26, 0.12);
}

.search__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.search__item.is-active,
.search__item:hover {
  background: var(--surface);
}

.search__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--text);
}

.search__meta {
  flex: none;
  color: var(--text-muted);
  font-size: 12px;
}

.select {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.select:focus {
  outline: none;
  border-color: var(--text-muted);
  box-shadow: 0 0 0 4px rgba(22, 22, 26, 0.04);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.is-empty {
  opacity: 0.45;
}

.chip[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.chip__count {
  font-size: 12px;
  opacity: 0.65;
}

.tracker__empty {
  padding: 48px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  color: var(--text-secondary);
}

.tracker__empty p {
  margin: 0 0 6px;
}

.tracker__empty-hint {
  margin-bottom: 18px !important;
  color: var(--text-muted);
  font-size: 14px;
}

.apps {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
}

.app-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.6fr) auto;
  gap: 14px 20px;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.app-row:first-child {
  border-top: none;
}

.app-row__main {
  min-width: 0;
}

.app-row__company {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Position in the list as it is currently sorted and filtered. */
.app-row__index {
  display: inline-block;
  min-width: 1.5em;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.app-row__title,
.app-row__meta {
  margin-left: 1.5em;
}

.app-row__title {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 14px;
}

.app-row__meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* Status reads as a pill, because it is the one thing worth scanning for. */

.app-row__status {
  justify-self: start;
  width: auto;
  min-width: 116px;
  max-width: 160px;
  height: 30px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.app-row__status[data-status="applied"] {
  border-color: #d5e2f8;
  background-color: #e8effc;
  color: #2c5aa8;
}

.app-row__status[data-status="interview"] {
  border-color: #f6e4c8;
  background-color: #fdf2e3;
  color: #93610f;
}

.app-row__status[data-status="offer"] {
  border-color: #cfe9da;
  background-color: #e6f4ec;
  color: #1f7a46;
}

.app-row__status[data-status="rejected"] {
  border-color: #f0d5d4;
  background-color: #fbeceb;
  color: #a8443f;
}

:root[data-theme="dark"] .app-row__status[data-status="applied"] {
  border-color: #345078;
  background-color: #1d2a3d;
  color: #9ebeea;
}

:root[data-theme="dark"] .app-row__status[data-status="interview"] {
  border-color: #66502e;
  background-color: #302719;
  color: #dfb96f;
}

:root[data-theme="dark"] .app-row__status[data-status="offer"] {
  border-color: #315d45;
  background-color: #1b3024;
  color: #8fd0a9;
}

:root[data-theme="dark"] .app-row__status[data-status="rejected"] {
  border-color: #6a3c3a;
  background-color: #34201f;
  color: #e59a96;
}

.app-row__status:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(22, 22, 26, 0.06);
}

.app-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* One button per document, opening a format menu. */

.docbtn,
.iconbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, opacity 0.14s ease;
}

/* The glyph must not swallow the click that the button is listening for. */
.docbtn > *,
.iconbtn > * {
  pointer-events: none;
}

.iconbtn__glyph {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.iconbtn__caret {
  width: 11px;
  height: 11px;
  margin-left: -1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

.docbtn:hover,
.iconbtn:hover,
.docbtn[aria-expanded="true"] {
  border-color: var(--text-muted);
  background: var(--surface);
  color: var(--text);
}

.docbtn:focus-visible,
.iconbtn:focus-visible {
  outline: none;
  border-color: var(--text-muted);
  box-shadow: 0 0 0 4px rgba(22, 22, 26, 0.06);
}

/* Nothing was tailored for this one, so there is nothing to download. */
.docbtn:disabled {
  border-style: dashed;
  border-color: var(--border);
  background: transparent;
  color: #c3c3ca;
  cursor: not-allowed;
}

.iconbtn--delete {
  padding: 0 9px;
  border-color: transparent;
  color: var(--text-muted);
  opacity: 0;
}

.iconbtn--delete .iconbtn__glyph {
  width: 15px;
  height: 15px;
}

.app-row:hover .iconbtn--delete,
.app-row:focus-within .iconbtn--delete {
  opacity: 1;
}

/* No hover to reveal it on a touch screen. */
@media (hover: none) {
  .iconbtn--delete {
    opacity: 1;
  }
}

/* Pages */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pager__page,
.pager__step {
  min-width: 32px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.pager__page:hover,
.pager__step:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text);
}

.pager__page[aria-current="page"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.pager__step:disabled {
  color: #c3c3ca;
  cursor: not-allowed;
}

.pager__gap {
  padding: 0 2px;
  color: var(--text-muted);
  font-size: 13px;
}

.docmenu {
  position: absolute;
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 104px;
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 10px 26px rgba(22, 22, 26, 0.13);
}

.docmenu__item {
  padding: 7px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
}

.docmenu__item:hover,
.docmenu__item:focus-visible {
  outline: none;
  background: var(--surface);
  color: var(--text);
}

/* Company, status, and the document buttons need width; below this they stack. */
@media (max-width: 900px) {
  .app-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .app-row__actions {
    justify-content: flex-start;
  }

  /* Stacked rows have no hover target to speak of. */
  .iconbtn--delete {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .tracker {
    padding: calc(var(--nav-height) + 24px) 0 56px;
  }

  .tracker__head {
    align-items: stretch;
    gap: 14px;
    margin-bottom: 16px;
  }

  .tracker__title {
    font-size: 24px;
  }

  .tracker__head .btn {
    align-self: flex-start;
  }

  /* Search owns its row; the two selects split the next one. */
  .search {
    flex: 1 0 100%;
  }

  .filters__row .select {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  /*
   * A card, read top to bottom: company and role, the status it sits at, then
   * the documents. The status and the buttons together are wider than a phone,
   * so each keeps its own line rather than wrapping mid-row.
   */
  .app-row {
    gap: 10px;
    padding: 16px;
  }

  .app-row__actions {
    justify-content: flex-end;
    gap: 8px;
  }

  .docbtn,
  .iconbtn {
    height: 34px;
  }

  .chip {
    height: 34px;
  }

  /* A finger needs more than a pointer does. */
  .docmenu {
    min-width: 128px;
  }

  .docmenu__item {
    padding: 11px 14px;
    font-size: 14px;
  }

  .pager__page,
  .pager__step {
    min-width: 36px;
    height: 36px;
  }
}
