/* Trabajos Produ — componentes del design system (copia de components/bundle.css). Usa solo las variables de tokens.json. Prefijo de clases: tp- */

.tp-root, .tp-root * { box-sizing: border-box; }
.tp-root { font-family: var(--font-text); font-size: 16px; line-height: 24px; color: var(--ink); }
.tp-root :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tp-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.tp-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.tp-muted { color: var(--ink-muted); font-size: 14px; line-height: 20px; }

/* ---------- Button ---------- */
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: var(--space-3) var(--space-5);
  font: 600 15px/20px var(--font-text); letter-spacing: 0.005em;
  border-radius: var(--radius-md); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.tp-btn--primary { background: var(--brand); color: var(--on-brand); }
.tp-btn--primary:hover { background: var(--brand-hover); }
.tp-btn--secondary { background: var(--surface); color: var(--brand); border-color: var(--line-strong); }
.tp-btn--secondary:hover { border-color: var(--brand); background: var(--brand-soft); }
.tp-btn--ghost { background: transparent; color: var(--brand); padding-inline: var(--space-3); }
.tp-btn--ghost:hover { background: var(--brand-soft); }
.tp-btn--danger { background: var(--danger); color: var(--on-danger); }
.tp-btn--danger:hover { filter: brightness(.9); }
.tp-btn--sm { min-height: 36px; padding: var(--space-2) var(--space-4); font-size: 14px; }
.tp-btn--block { width: 100%; }
.tp-btn[disabled], .tp-btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.tp-btn.is-loading { color: transparent; position: relative; pointer-events: none; }
.tp-btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--on-brand); border-right-color: transparent; animation: tp-spin .7s linear infinite;
}
.tp-btn--secondary.is-loading::after { border-color: var(--brand); border-right-color: transparent; }
@keyframes tp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tp-btn.is-loading::after { animation-duration: 2s; } }

/* ---------- Field: input, textarea, select ---------- */
.tp-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.tp-field__label { font: 600 14px/20px var(--font-text); color: var(--ink); }
.tp-field__label .tp-req { color: var(--danger); margin-left: 2px; }
.tp-field__help { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.tp-input, .tp-select, .tp-textarea {
  width: 100%; min-height: 44px; padding: var(--space-3) var(--space-4);
  font: 400 16px/20px var(--font-text); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
}
.tp-textarea { min-height: 112px; line-height: 24px; resize: vertical; }
.tp-input::placeholder, .tp-textarea::placeholder { color: var(--ink-subtle); }
.tp-input:hover, .tp-select:hover, .tp-textarea:hover { border-color: var(--ink-muted); }
.tp-input:focus, .tp-select:focus, .tp-textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--brand); }
.tp-select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.tp-input:disabled, .tp-select:disabled, .tp-textarea:disabled { background: var(--surface-sunken); color: var(--ink-subtle); cursor: not-allowed; }
.tp-field.is-error .tp-input, .tp-field.is-error .tp-select, .tp-field.is-error .tp-textarea { border-color: var(--danger); background: var(--danger-soft); }
.tp-field__error { font: 500 13px/18px var(--font-text); color: var(--danger); }
.tp-form-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .tp-form-grid--2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Choice: checkbox, radio, switch ---------- */
.tp-choice { display: inline-flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; font-size: 15px; line-height: 22px; }
.tp-choice input { appearance: none; flex: none; width: 20px; height: 20px; margin: 1px 0 0; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; display: grid; place-content: center; }
.tp-choice input[type="checkbox"] { border-radius: var(--radius-sm); }
.tp-choice input[type="radio"] { border-radius: 50%; }
.tp-choice input:checked { background: var(--brand); border-color: var(--brand); }
.tp-choice input[type="checkbox"]:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--on-brand); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.tp-choice input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-brand); }
.tp-choice input:disabled { opacity: .45; cursor: not-allowed; }
.tp-choice input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tp-switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-size: 15px; }
.tp-switch input { appearance: none; width: 40px; height: 24px; border-radius: var(--radius-full); background: var(--line-strong); position: relative; cursor: pointer; transition: background-color .15s; margin: 0; }
.tp-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.tp-switch input:checked { background: var(--brand); }
.tp-switch input:checked::after { transform: translateX(16px); }
.tp-switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Badge (estado) ---------- */
.tp-badge { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); border-radius: var(--radius-sm); font: 600 12px/18px var(--font-text); white-space: nowrap; }
.tp-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tp-badge--success { background: var(--success-soft); color: var(--success); }
.tp-badge--warning { background: var(--warning-soft); color: var(--warning); }
.tp-badge--danger { background: var(--danger-soft); color: var(--danger); }
.tp-badge--brand { background: var(--brand-soft); color: var(--brand); }
.tp-badge--neutral { background: var(--surface-sunken); color: var(--ink-muted); }
.tp-badge--new { background: var(--lima); color: var(--ink); }
.tp-badge--new::before, .tp-badge--featured::before { display: none; }
.tp-badge--featured { background: var(--lila); color: var(--ink); }

/* ---------- Tag (profesión, filtro) ---------- */
.tp-tag { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); background: var(--celeste); color: var(--ink); font: 500 13px/20px var(--font-text); }
.tp-tag--principal { background: var(--brand); color: var(--on-brand); }
.tp-tag__remove { border: 0; background: none; padding: 0 0 0 2px; font: inherit; color: inherit; cursor: pointer; line-height: 1; }
.tp-tag--filter { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); cursor: pointer; }
.tp-tag--filter.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.tp-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- Alert ---------- */
.tp-alert { display: flex; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); font-size: 15px; line-height: 22px; }
.tp-alert__title { font-weight: 600; display: block; }
.tp-alert__icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-content: center; font: 700 13px/1 var(--font-display); color: var(--surface); }
.tp-alert--info { background: var(--brand-soft); color: var(--ink); }
.tp-alert--info .tp-alert__icon { background: var(--brand); }
.tp-alert--success { background: var(--success-soft); color: var(--ink); }
.tp-alert--success .tp-alert__icon { background: var(--success); }
.tp-alert--warning { background: var(--warning-soft); color: var(--ink); }
.tp-alert--warning .tp-alert__icon { background: var(--warning); }
.tp-alert--danger { background: var(--danger-soft); color: var(--ink); }
.tp-alert--danger .tp-alert__icon { background: var(--danger); }

/* ---------- Card base ---------- */
.tp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); min-width: 0; }
a.tp-card, .tp-card--link { text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; display: block; }
a.tp-card:hover, .tp-card--link:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.tp-overline { font: 600 12px/16px var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- JobCard (empleo) ---------- */
.tp-job { display: grid; gap: var(--space-3); align-content: start; }
.tp-job__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.tp-job__title { font: 600 20px/26px var(--font-display); margin: 2px 0 0; color: var(--ink); text-wrap: balance; }
.tp-job__company { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; color: var(--ink-muted); }
.tp-job__logo { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--celeste); display: grid; place-content: center; font: 700 12px/1 var(--font-display); color: var(--brand); flex: none; overflow: hidden; }
.tp-job__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); font-size: 14px; line-height: 20px; color: var(--ink-muted); margin: 0; padding: 0; list-style: none; }
.tp-job__meta strong { color: var(--ink); font-weight: 600; }
.tp-job__meta li:not(:last-child)::after { content: "·"; margin-left: var(--space-2); color: var(--ink-subtle); }
.tp-job__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); flex-wrap: wrap; }

/* ---------- ProfileCard (profesional) ---------- */
.tp-profile { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start; }
.tp-avatar { width: 64px; height: 64px; border-radius: var(--radius-full); background: var(--lila); color: var(--brand); display: grid; place-content: center; font: 700 22px/1 var(--font-display); overflow: hidden; flex: none; }
.tp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tp-avatar--sm { width: 40px; height: 40px; font-size: 15px; }
.tp-profile__name { font: 600 20px/26px var(--font-display); margin: 0; }
.tp-profile__titular { margin: 2px 0 var(--space-2); color: var(--ink-muted); font-size: 15px; line-height: 22px; }
.tp-profile__body { display: grid; gap: var(--space-3); min-width: 0; }
.tp-availability { display: inline-flex; align-items: center; gap: var(--space-1); font: 600 13px/18px var(--font-text); color: var(--success); }
.tp-availability::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tp-availability--off { color: var(--ink-muted); }

/* ---------- Completitud ---------- */
.tp-progress { display: grid; gap: var(--space-2); }
.tp-progress__head { display: flex; justify-content: space-between; align-items: baseline; font: 600 14px/20px var(--font-text); }
.tp-progress__value { font: 700 20px/24px var(--font-display); color: var(--brand); font-variant-numeric: tabular-nums; }
.tp-progress__track { height: 8px; border-radius: var(--radius-full); background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.tp-progress__bar { display: block; height: 100%; border-radius: var(--radius-full); background: var(--brand); }
.tp-progress__bar.is-complete { background: var(--success); }
.tp-progress__todo { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-1); font-size: 14px; color: var(--ink-muted); }
.tp-progress__todo li::before { content: "+ "; color: var(--brand); font-weight: 700; }

/* ---------- Table ---------- */
.tp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.tp-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.tp-table th { text-align: left; font: 600 12px/16px var(--font-text); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface-sunken); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tp-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tp-table tr:last-child td { border-bottom: 0; }
.tp-table tbody tr:hover { background: var(--surface-sunken); }
.tp-table .tp-cell-person { display: flex; align-items: center; gap: var(--space-3); }
.tp-table .tp-cell-person strong { display: block; font-weight: 600; }

/* ---------- Pagination ---------- */
.tp-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); font: 600 14px/20px var(--font-text); }
.tp-pagination a, .tp-pagination span { min-width: 40px; height: 40px; display: inline-grid; place-content: center; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--brand); text-decoration: none; }
.tp-pagination a:hover { background: var(--brand-soft); }
.tp-pagination [aria-current="page"] { background: var(--brand); color: var(--on-brand); }
.tp-pagination .is-gap { color: var(--ink-muted); min-width: 24px; padding: 0; }
.tp-pagination .is-disabled { color: var(--ink-subtle); }

/* ---------- Modal ---------- */
.tp-overlay { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; padding: var(--space-4); z-index: 100; }
.tp-modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.tp-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); padding: var(--space-5) var(--space-5) 0; }
.tp-modal__title { font: 600 22px/28px var(--font-display); margin: 0; }
.tp-modal__close { border: 0; background: none; width: 36px; height: 36px; border-radius: var(--radius-md); cursor: pointer; font-size: 22px; line-height: 1; color: var(--ink-muted); }
.tp-modal__close:hover { background: var(--surface-sunken); color: var(--ink); }
.tp-modal__body { padding: var(--space-4) var(--space-5); color: var(--ink); }
.tp-modal__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-3); padding: 0 var(--space-5) var(--space-5); }

/* ---------- Tabs ---------- */
.tp-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tp-tab { border: 0; background: none; padding: var(--space-3) var(--space-4); font: 600 14px/20px var(--font-text); color: var(--ink-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: var(--space-2); align-items: center; }
.tp-tab:hover { color: var(--ink); }
.tp-tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tp-tab__count { font: 600 12px/16px var(--font-text); padding: 1px 6px; border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink-muted); }
.tp-tab[aria-selected="true"] .tp-tab__count { background: var(--brand-soft); color: var(--brand); }
