/* ============================================================
   TALENT BRIDGE — Estilos partilhados dos painéis (candidato/empresa)
   ============================================================ */

.tb-panel-hero {
    background: linear-gradient(135deg, var(--tb-navy) 0%, var(--tb-navy2) 100%);
    color: #fff;
    border-radius: 14px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(11, 31, 64, 0.18);
}

.tb-panel-eyebrow {
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 4px;
    font-weight: 600;
}

.tb-panel-title {
    margin: 0 0 6px 0;
    font-weight: 700;
    font-size: 28px;
}

.tb-panel-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

.tb-panel-hero-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tb-stat-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 12px 20px;
    text-align: center;
    min-width: 100px;
}

.tb-stat-num {
    font-size: 24px;
    font-weight: 800;
    color: var(--tb-orange);
    line-height: 1;
}

.tb-stat-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    margin-top: 4px;
}

/* Tabs — scroll horizontal (touch + arrastar com rato) */
.tb-tabs-scroll-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0;
    cursor: grab;
    user-select: none;
}

.tb-tabs-scroll-wrap.dragging {
    cursor: grabbing;
}

.tb-tabs-scroll-wrap .tb-tabs {
    flex-wrap: nowrap;
    border-bottom: none;
    min-width: min-content;
    display: flex;
}

.tb-tabs-scroll-wrap .nav-item {
    flex-shrink: 0;
}

.tb-tabs {
    border-bottom: 2px solid #e9ecef;
}

.tb-tabs .nav-link {
    color: #555;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    transition: all 0.15s ease;
}

.tb-tabs .nav-link:hover {
    color: var(--tb-navy);
    background: transparent;
}

.tb-tabs .nav-link.active {
    color: var(--tb-orange);
    border-bottom-color: var(--tb-orange);
    background: transparent;
}

/* Card de candidatura / vaga */
.tb-app-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}

.tb-app-card:hover {
    box-shadow: 0 6px 16px rgba(11, 31, 64, 0.08);
    border-color: #d8dee5;
}

.tb-app-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    flex-wrap: wrap;
}

.tb-app-card-title {
    font-weight: 700;
    color: var(--tb-navy);
    font-size: 16px;
    margin: 0 0 4px 0;
}

.tb-app-card-sub {
    color: var(--tb-blue);
    font-size: 13px;
    margin-bottom: 8px;
}

.tb-app-ref {
    font-family: monospace;
    font-size: 12px;
    background: #f4f6f9;
    color: var(--tb-navy);
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
    border: 1px dashed #c8cfd8;
}

/* Estado da candidatura — badges coloridos */
.tb-estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tb-estado-submetida { background: #e3f2fd; color: #1565c0; }
.tb-estado-em_analise { background: #fff3cd; color: #856404; }
.tb-estado-entrevista { background: #d4edda; color: #155724; }
.tb-estado-aceite    { background: #d1f4dd; color: #0a6b2c; }
.tb-estado-rejeitada { background: #f8d7da; color: #842029; }
.tb-estado-cancelada { background: #e2e3e5; color: #41464b; }

/* Pontuação IA (ATS automático) */
.tb-ai-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: help;
}
.tb-ai-score-high { background: #d1f4dd; color: #0a6b2c; }
.tb-ai-score-mid { background: #fff3cd; color: #856404; }
.tb-ai-score-low { background: #f8d7da; color: #842029; }
.tb-ai-score-pending { background: #e9ecef; color: #6c757d; font-weight: 600; font-size: 11px; }

.tb-estado-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

/* Timeline de estado */
.tb-timeline {
    display: flex;
    gap: 0;
    align-items: stretch;
    margin: 16px 0;
    overflow-x: auto;
}

.tb-timeline-step {
    flex: 1;
    min-width: 110px;
    padding: 10px 12px;
    background: #f4f6f9;
    border-right: 2px solid #fff;
    text-align: center;
    color: #999;
    font-size: 12px;
    font-weight: 600;
    position: relative;
}

.tb-timeline-step.done {
    background: var(--tb-navy);
    color: #fff;
}

.tb-timeline-step.current {
    background: var(--tb-orange);
    color: #fff;
}

.tb-timeline-step:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.tb-timeline-step:last-child  { border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-right: none; }

/* Tabela compacta de candidaturas (empresa) */
.tb-cand-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tb-cand-table thead th {
    text-align: left;
    padding: 10px 12px;
    background: #f4f6f9;
    color: var(--tb-navy);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e4ea;
}

.tb-cand-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #eef0f3;
    vertical-align: middle;
}

.tb-cand-table tbody tr:hover {
    background: #fafbfd;
    cursor: pointer;
}

/* Acções de vaga — ícones horizontais */
.tb-vaga-icon-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tb-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: var(--tb-blue);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tb-icon-action:hover:not(.disabled) {
    background: #f4f6f9;
    border-color: var(--tb-blue);
    color: var(--tb-navy);
}

.tb-icon-action-primary {
    background: var(--tb-orange);
    border-color: var(--tb-orange);
    color: #fff;
}

.tb-icon-action-primary:hover {
    background: #e67a00;
    border-color: #e67a00;
    color: #fff;
}

.tb-icon-action-danger {
    color: #c0392b;
    border-color: #f5c6cb;
}

.tb-icon-action-danger:hover {
    background: #fdf0f0;
    border-color: #c0392b;
}

.tb-icon-action.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Paginação */
.tb-pagination {
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.tb-pagination-info {
    line-height: 2;
}

.tb-admin-badge {
    font-size: 11px;
    letter-spacing: 0.03em;
}

/* Dashboard admin — cards com altura igual */
.tb-dashboard-cards > [class*="col"] {
    display: flex;
}

.tb-dashboard-card {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Painel Plataforma (super-admin) */
.tb-platform-intro {
    padding: 12px 16px;
    background: #eef4fb;
    border: 1px solid #c8daf0;
    border-radius: 8px;
    font-size: 13px;
    color: var(--tb-navy);
}

.tb-platform-nav .list-group-item {
    font-size: 13px;
    border-color: #e9ecef;
}

.tb-platform-nav .list-group-item.active {
    background: var(--tb-navy);
    border-color: var(--tb-navy);
}

.tb-platform-nav-locked {
    opacity: 0.85;
}

.tb-platform-locked {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.tb-platform-locked-inner {
    max-width: 420px;
    text-align: center;
    padding: 1.5rem;
    background: #fffbf0;
    border: 1px dashed #f0c674;
    border-radius: 12px;
}

.tb-platform-textarea {
    min-height: 120px;
    font-size: 0.8125rem;
    line-height: 1.5;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.tb-platform-textarea-compact {
    min-height: 200px;
}

.tb-platform-tpl {
    min-height: 140px;
}

.tb-platform-list-grid .tb-platform-textarea-compact,
.tb-platform-tpl-grid .tb-platform-tpl {
    width: 100%;
}

@media (min-width: 768px) {
    .tb-platform-list-grid {
        align-items: stretch;
    }
    .tb-platform-list-grid > [class*="col-"] {
        display: flex;
        flex-direction: column;
    }
    .tb-platform-list-grid .tb-platform-textarea-compact {
        flex: 1 1 auto;
        min-height: 220px;
    }
}

/* Licença off — partilhado (Permissões + Plataforma IA) */
.tb-lic-locked,
.tb-perm-editor .perm-item--locked {
    position: relative;
    margin-bottom: 0.5rem;
    padding: 0.55rem 0.65rem 0.55rem 0.5rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #fffbf5 0%, #fff8ee 100%);
    border: 1px dashed #e8c88a;
    opacity: 0.95;
}

.tb-lic-locked-card {
    border-radius: 10px;
    overflow: hidden;
}

.tb-lic-locked-card .tb-lic-locked {
    margin-bottom: 0;
}

.tb-lic-locked .form-check-input,
.tb-perm-editor .perm-item--locked .form-check-input {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.tb-lic-locked .form-check-label,
.tb-perm-editor .perm-item--locked .form-check-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: not-allowed;
    color: #6c757d;
}

.tb-lic-lock-icon,
.tb-perm-editor .perm-lock-icon {
    flex-shrink: 0;
    width: 1.65rem;
    height: 1.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff3cd 0%, #ffe69c 100%);
    color: #b58105;
    font-size: 0.72rem;
    box-shadow: 0 1px 3px rgba(181, 129, 5, 0.15);
}

.tb-lic-locked .perm-item-text .small,
.tb-perm-editor .perm-item--locked .perm-item-text .small {
    color: #495057;
}

.perm-upgrade-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-top: 0.35rem;
}

.perm-upgrade-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.perm-upgrade-cta {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #fff3cd 0%, #ffe8a1 100%);
    color: #856404;
    border: 1px solid #f0c674;
}

.tb-lic-locked-card > .tb-lic-locked {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.tb-lic-locked-card .perm-item-text {
    flex: 1;
    min-width: 0;
}

.tb-interview-day-head {
    font-size: 0.95rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--tb-border, #e9ecef);
    text-transform: capitalize;
}

.tb-interview-day-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.tb-interview-card {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--tb-border, #e9ecef);
    border-radius: 10px;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.tb-interview-time {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--tb-navy, #1a2b4a);
    min-width: 4.5rem;
    font-size: 0.9rem;
}

.tb-interview-title {
    font-weight: 600;
    color: var(--tb-navy, #1a2b4a);
}

.tb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.tb-cal-wd {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    padding: 0.35rem 0;
}

.tb-cal-day {
    min-height: 88px;
    border: 1px solid var(--tb-border, #e9ecef);
    border-radius: 8px;
    padding: 0.35rem;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.tb-cal-day:hover {
    background: #f8f9fc;
}

.tb-cal-day--pad {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.tb-cal-day--today .tb-cal-day-num {
    background: var(--tb-orange, #f47920);
    color: #fff;
    border-radius: 50%;
    width: 1.6rem;
    height: 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tb-cal-day--has {
    border-color: #c5d4f0;
    background: linear-gradient(180deg, #fff 0%, #f4f7fc 100%);
}

.tb-cal-day-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tb-navy, #1a2b4a);
    margin-bottom: 0.25rem;
}

.tb-cal-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tb-cal-chip {
    display: block;
    width: 100%;
    border: none;
    background: rgba(27, 61, 122, 0.08);
    color: var(--tb-navy, #1a2b4a);
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 4px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-cal-chip:hover {
    background: rgba(244, 121, 32, 0.15);
}

.tb-cal-more {
    font-size: 0.65rem;
    color: #6c757d;
}

.tb-interview-group {
    border-left: 3px solid var(--tb-orange, #f47920);
}

.tb-interview-actions .btn {
    font-size: 0.75rem;
}

.tb-cal-day-detail {
    border-top: 1px solid var(--tb-border, #e9ecef);
    padding-top: 1rem;
}

.tb-perm-matrix {
    font-size: 12px;
}

.tb-perm-matrix th,
.tb-perm-matrix td {
    vertical-align: middle;
    padding: 6px 8px;
}

.tb-perm-matrix .fa-check {
    color: #198754;
}

.tb-perm-matrix .fa-minus {
    color: #ced4da;
}

/* Editor de permissões — hierarquia visual */
.tb-perm-editor {
    --perm-indent: 1.35rem;
}

.tb-perm-editor .perm-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--tb-border, #e9ecef);
}

.tb-perm-editor .perm-actor-block {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--tb-border, #e9ecef);
}

.tb-perm-editor .perm-actor-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tb-perm-editor .perm-actor-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tb-perm-editor .perm-actor-head h6 {
    letter-spacing: 0.04em;
}

.tb-perm-editor .perm-cat-block {
    margin-left: var(--perm-indent);
    padding-left: 0.75rem;
    border-left: 2px solid #dee2e6;
    margin-bottom: 0.85rem;
}

.tb-perm-editor .perm-cat-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.tb-perm-editor .perm-cat-head .perm-cat-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
}

.tb-perm-editor .perm-items {
    margin-left: var(--perm-indent);
    padding-left: 0.5rem;
}

.tb-perm-editor .perm-item {
    margin-bottom: 0.35rem;
}

.tb-perm-editor .perm-item .form-check-input {
    margin-top: 0.2rem;
}

.tb-perm-editor .perm-item code {
    color: #c0397a;
}

/* perm-item--locked: estilos base em .tb-lic-locked (acima) */
.tb-career-panel {
    border: 1px solid var(--tb-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.tb-career-panel-head {
    padding: 0.85rem 1.1rem;
    background: linear-gradient(180deg, #f4f8fc 0%, #fff 100%);
    border-bottom: 1px solid var(--tb-border);
}

.tb-career-panel-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--tb-navy);
}

.tb-career-panel-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.tb-career-panel-body {
    padding: 1rem 1.1rem 1.1rem;
}

.tb-career-top {
    display: grid;
    grid-template-columns: minmax(168px, 220px) minmax(0, 1fr);
    gap: 1rem 1.25rem;
    align-items: start;
}

.tb-career-top-grow {
    min-width: 0;
}

.tb-career-top-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0.35rem 0 1rem;
}

.tb-career-input-group .form-control,
.tb-career-input-group .input-group-text {
    min-height: 42px;
    display: flex;
    align-items: center;
}

.tb-career-input-group .input-group-text {
    background: #f8fafc;
    color: var(--tb-navy);
    border-color: var(--tb-border);
    font-size: 0.85rem;
}

.tb-exp-list-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tb-muted);
    margin-bottom: 0.65rem;
}

.tb-exp-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tb-exp-empty {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px dashed var(--tb-border);
    border-radius: 8px;
    text-align: center;
}

.tb-exp-card {
    border: 1px solid var(--tb-border);
    border-radius: 10px;
    background: #fafbfc;
    overflow: hidden;
}

.tb-exp-card-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    background: #fff;
    border-bottom: 1px solid var(--tb-border);
}

.tb-exp-badge {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--tb-navy);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tb-exp-head-title {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--tb-navy);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tb-exp-remove {
    border: none;
    background: transparent;
    color: #cbd5e1;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.tb-exp-remove:hover {
    color: #e74c3c;
    background: #fef2f2;
}

.tb-exp-card-body {
    padding: 0.85rem;
}

.tb-exp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.tb-exp-dates-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.75rem 1rem;
    align-items: end;
}

.tb-exp-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
    min-width: 0;
}

.tb-exp-field input[type="date"] {
    min-height: 42px;
}

.tb-exp-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    line-height: 1.2;
    min-height: 0.9rem;
}

.tb-exp-atual-field {
    display: flex;
    align-items: flex-end;
    padding-bottom: 0.45rem;
}

.tb-exp-atual-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    font-size: 0.84rem;
    color: var(--tb-text);
    min-height: 42px;
}

.tb-exp-atual-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.tb-btn-outline-navy {
    color: var(--tb-navy);
    border: 1px solid var(--tb-border);
    background: #fff;
}

.tb-btn-outline-navy:hover {
    background: var(--tb-navy);
    color: #fff;
    border-color: var(--tb-navy);
}

@media (max-width: 767px) {
    .tb-career-top {
        grid-template-columns: 1fr;
    }

    .tb-exp-grid {
        grid-template-columns: 1fr;
    }

    .tb-exp-dates-row {
        grid-template-columns: 1fr 1fr;
    }

    .tb-exp-atual-field {
        grid-column: 1 / -1;
        padding-bottom: 0;
    }

    .tb-exp-atual-check {
        white-space: normal;
        min-height: auto;
    }
}

.tb-idioma-row {
    border: 1px solid var(--tb-border);
    border-radius: 8px;
    padding: 0.75rem;
    background: #fff;
}

.tb-idioma-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.tb-doc-item {
    border: 1px solid var(--tb-border);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    background: #fafbfc;
}
