/* =====================================================================
   The application tracker, loaded only by /tableau-suivi-candidature/ on
   top of gallery.css, which supplies the tokens, header, bands and footer.

   Plain CSS rather than Tailwind: the page chrome already comes from the
   shared stylesheet, and pulling Tailwind in for one tool would emit a
   second base layer for a handful of classes.
   ===================================================================== */

.tk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #f8fafc;
}

/* Stated once, plainly, and always visible: the data is on this device and
   nowhere else. Someone tracking a job search has a reason to care. */
.tk-warn {
  max-width: 44rem;
  margin: 0 !important;
  font-size: 13.5px;
  line-height: 1.55;
  color: #56657a;
}

.tk-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tk-btn:hover {
  border-color: #9fb0c4;
  background: #f8fafc;
}

.tk-btn--go {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.tk-btn--quiet {
  border-color: transparent;
  color: #6b7a8d;
}

.tk-btn--danger {
  width: 100%;
  margin-top: 0.4rem;
  border-color: #fecaca;
  color: #b91c1c;
}

.tk-btn--danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}

/* ---- the board ---- */
.tk-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.tk-col {
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
}

.tk-col[data-over] {
  border-color: var(--teal);
  background: #f0fbfa;
}

.tk-col-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 0.8rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.tk-col-head h2 {
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 700;
  color: var(--navy);
}

.tk-col-head p {
  margin: 0.15rem 0 0 !important;
  font-size: 11.5px;
  line-height: 1.35;
  color: #8b98a8;
}

.tk-count {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.02rem 0.42rem;
  border-radius: 999px;
  background: #e6ecf3;
  font-size: 11px;
  color: #64748b;
}

.tk-add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}

.tk-add:hover {
  border-color: #9fb0c4;
  background: #f1f5f9;
}

/* Tall enough to read as a place where something is dropped, rather than as a
   band under a heading. An empty board is the first thing most visitors see. */
.tk-col-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.6rem;
  min-height: 11rem;
}

.tk-empty {
  margin: 0 !important;
  padding: 0.85rem 0.75rem;
  border: 1px dashed #cbd7e4;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #8b98a8;
  text-align: center;
}

/* ---- a card ---- */
.tk-card {
  position: relative;
  border: 1px solid var(--rule);
  border-left: 4px solid #cbd5e1;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 48, 74, 0.05);
}

/* The colour code, and the only thing a spreadsheet cannot do. The bands are
   a convention, not a rule — the prose below the board says where they come
   from and that they move with the size of the company. */
.tk-card[data-heat='fresh'] { border-left-color: #16a34a; }
.tk-card[data-heat='due'] { border-left-color: #d97706; }
.tk-card[data-heat='late'] { border-left-color: #dc2626; }

.tk-card[data-dragging] {
  opacity: 0.85;
  box-shadow: 0 10px 28px rgba(18, 48, 74, 0.18);
  z-index: 5;
}

.tk-card-grab {
  padding: 0.65rem 0.7rem 0.5rem;
  cursor: grab;
  touch-action: manipulation;
}

.tk-role {
  margin: 0 !important;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy);
}

.tk-untitled { color: #94a3b8; font-weight: 500; }

.tk-company {
  margin: 0.1rem 0 0 !important;
  font-size: 12.5px;
  color: #56657a;
}

.tk-meta {
  margin: 0.35rem 0 0 !important;
  font-size: 11.5px;
  color: #8b98a8;
}

.tk-card-actions {
  display: flex;
  gap: 0.2rem;
  padding: 0 0.45rem 0.45rem;
}

.tk-move,
.tk-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #8b98a8;
  cursor: pointer;
}

.tk-move:hover:not(:disabled),
.tk-del:hover {
  background: #f1f5f9;
  color: var(--navy);
}

.tk-move:disabled {
  opacity: 0.28;
  cursor: default;
}

.tk-del { margin-left: auto; }
.tk-del:hover { background: #fef2f2; color: #b91c1c; }

/* On a pointer device the delete cross appears on hover; on touch there is no
   hover, so it stays. */
@media (hover: hover) and (pointer: fine) {
  .tk-del { opacity: 0; transition: opacity 0.12s; }
  .tk-card:hover .tk-del,
  .tk-del:focus-visible { opacity: 1; }
}

/* ---- add row ---- */
.tk-addrow {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem;
  border: 1px solid #c7d7e6;
  border-radius: 11px;
  background: #fff;
}

.tk-addrow input,
.tk-field input,
.tk-field select,
.tk-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}

.tk-addrow input:focus,
.tk-field input:focus,
.tk-field select:focus,
.tk-field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
  border-color: var(--teal);
}

.tk-addrow-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.tk-addrow-actions {
  display: flex;
  gap: 0.4rem;
}

.tk-addrow-actions .tk-btn {
  flex: 1;
  min-height: 38px;
  font-size: 13px;
}

.tk-hint {
  margin: 0 !important;
  font-size: 11px;
  color: #8b98a8;
}

/* ---- figures ---- */
.tk-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #fff;
}

.tk-stat strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  color: var(--navy);
}

.tk-stat span {
  display: block;
  margin-top: 0.2rem;
  font-size: 13px;
  color: #56657a;
}

.tk-stat-note {
  grid-column: 1 / -1;
  margin: 0.3rem 0 0 !important;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: #56657a;
}

/* ---- detail panel ---- */
.tk-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 30, 48, 0.42);
}

.tk-panel {
  position: relative;
  width: min(28rem, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.4rem 1.3rem 1.2rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 30, 48, 0.3);
}

.tk-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #8b98a8;
  cursor: pointer;
}

.tk-close:hover { background: #f1f5f9; color: var(--navy); }

.tk-field {
  display: block;
  margin-bottom: 0.7rem;
}

.tk-field > span {
  display: block;
  margin-bottom: 0.22rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b98a8;
}

.tk-field-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.tk-open-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: -0.3rem 0 0.8rem;
  font-size: 12.5px;
}

/* ---- undo ---- */
.tk-undo {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  transform: translateX(-50%);
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 12px 32px rgba(15, 30, 48, 0.32);
}

.tk-undo button {
  min-height: 32px;
  padding: 0 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.tk-undo button:hover { background: rgba(255, 255, 255, 0.14); }

/* ---- responsive ----
   Five columns stop being readable well before a tablet. Below 1100px the
   board scrolls sideways with columns wide enough to read; below 720px it
   becomes one column per row, stacked, where the arrows do the moving. */
@media (max-width: 1100px) {
  .tk-board {
    grid-template-columns: repeat(5, minmax(15rem, 1fr));
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
}

@media (max-width: 720px) {
  .tk-board {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .tk-stats {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .tk-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .tk-bar-actions .tk-btn { flex: 1; }
}
