/* =========================================================
   Job tracker — tracker-only styles.
   Everything else (tokens, cards, buttons, popups, toast)
   comes from ../styles.css so it matches the whole site.
   ========================================================= */

/* Links styled as round icon buttons (back arrow in header) */
a.icon-btn {
  text-decoration: none;
}

/* ===== Counts card (parked: to be replaced later) ===== */
.stats-card .views-number {
  font-size: 22px;
}

/* ===== Job list ===== */
.jobs-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.job-card {
  position: relative;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer; /* whole card is clickable */
}

.job-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.job-company {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.job-role {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.job-meta svg {
  vertical-align: -2px;
  margin-right: 4px;
}

/* Closing date colours (6) */
.closing-note {
  font-weight: 600;
}

.closing-note.ok {
  color: var(--text-secondary);
}

.closing-note.soon {
  color: #ff9f0a;
}

.closing-note.passed {
  color: #ff453a;
}

/* ===== Status (dropdown styled as your status pill) ===== */
.job-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.job-status,
.status-tag {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
}

.job-status {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  cursor: pointer;
}

.s-toapply {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
}

.s-followed,
.s-offer {
  background: rgba(52, 199, 89, 0.16) !important;
  color: var(--success) !important;
}

.s-interview {
  background: rgba(120, 90, 255, 0.18) !important;
  color: #a99bff !important;
}

.s-rejected {
  background: rgba(255, 59, 48, 0.14) !important;
  color: #ff453a !important;
}

.job-status option {
  background: #12141a;
  color: var(--text-primary);
}

.followed-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
}

.applied-note {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* "I've applied" button on To-apply cards (1) */
.applied-btn {
  width: 100%;
  padding: 11px 22px;
}

/* ===== Email / Call / Site buttons ===== */
.job-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  background: var(--card-bg-strong);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s var(--ease),
    transform 0.12s var(--ease);
}

.action-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.action-btn:active {
  transform: scale(0.95);
}

.action-btn.off {
  opacity: 0.35;
  pointer-events: none;
}

/* ===== Rejected section (7) ===== */
.rejected-toggle {
  margin-top: 4px;
}

.rejected-list .job-card {
  opacity: 0.6;
}

.rejected-list .job-card:hover {
  opacity: 1;
}

/* ===== Popups ===== */
.job-modal {
  max-width: 480px;
}

.call-modal {
  max-width: 360px;
}

.paste-area {
  min-height: 200px !important;
}

.sorted-note {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}

/* ===== View job popup ===== */
.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.view-title {
  min-width: 0;
}

.view-modal .view-head h3 {
  margin-bottom: 0;
  word-break: break-word;
}

.view-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.view-actions #view-close {
  font-size: 18px;
  line-height: 1;
}

.view-body {
  display: flex;
  flex-direction: column;
}

.view-section {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.view-section:first-child {
  border-top: none;
  padding-top: 0;
}

.view-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.view-value {
  font-size: 15px;
  color: var(--text-primary);
  word-break: break-word;
}

.view-notes {
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Tappable rows (phone, email, website) */
.view-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px;
  word-break: break-word;
}

.view-link + .view-link {
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.view-link small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.view-link svg {
  flex-shrink: 0;
  color: var(--accent);
}

.view-link:hover {
  color: var(--accent);
}

.view-dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

/* Collapsible sections: job ad + cover letter (2, 3) */
.view-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.view-section-head .view-label {
  margin-bottom: 0;
}

.view-section-buttons {
  display: flex;
  gap: 6px;
}

.mini-btn {
  border: none;
  border-radius: var(--radius-pill);
  background: var(--card-bg-strong);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.mini-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.view-longtext {
  margin-top: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 14px;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Activity log (5) */
.activity-add {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.activity-add input {
  flex: 1;
  min-width: 0;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.activity-add input:focus {
  outline: none;
  border-color: var(--accent);
}

.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.activity-item:first-child {
  border-top: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.activity-dot.note {
  background: var(--text-tertiary);
}

.activity-dot.applied {
  background: var(--success);
}

.activity-text {
  font-size: 14px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.activity-date {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.activity-empty {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ===== Form extras ===== */
.form-select {
  width: 100%;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.form-select option {
  background: #12141a;
  color: var(--text-primary);
}

.phones-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phone-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px;
  align-items: center;
}

.phone-remove {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 59, 48, 0.14);
  color: #ff453a;
  font-size: 16px;
  line-height: 1;
}

.text-btn {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 2px 0;
}

.text-btn:hover {
  text-decoration: underline;
}

/* ===== Call picker ===== */
.call-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.call-option {
  display: block;
  padding: 14px 16px;
  background: var(--card-bg-strong);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.15s var(--ease);
}

.call-option:hover {
  border-color: var(--accent);
}

.call-option span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===== Mobile ===== */
@media (max-width: 760px) {
  .jobs-list {
    grid-template-columns: 1fr;
  }

  .stats-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 16px;
  }

  .stats-card .views-divider {
    display: none;
  }

  .action-label {
    display: none;
  }

  .job-modal input,
  .job-modal textarea,
  .form-select,
  .activity-add input {
    font-size: 16px;
  }
}
