/* backend/static/css/b2b/components.css */
/* Versão: 2.4.1 — SOLID GRIP OVERLAY UX (HOTFIX)
   Conceito: Grip em background, fade suave, badge flutuante
   Correção: flex-shrink: 0 para impedir esmagamento dos cards */

/* --- LOGO & USER INFO --- */
.logo { 
    font-family: var(--font-family-headings);
    font-size: 1.5rem; 
    font-weight: 800; 
    background: linear-gradient(135deg, var(--color-primary-bs), #4f46e5); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
}

.avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 10px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    color: white; 
    background: var(--color-bg-dark); 
    font-size: 0.85rem; 
    box-shadow: var(--shadow-dna-sm);
}

/* --- SISTEMA DE BOTÕES (BTOS DNA) --- */
.btn { 
    padding: 0.6rem 1.2rem; 
    border: none; 
    border-radius: var(--border-radius-md); 
    font-weight: 700; 
    cursor: pointer; 
    transition: var(--transition-fast); 
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; 
    font-size: 0.9rem; 
    text-decoration: none;
}

.btn-primary, .btn-btos-primary { 
    background: var(--color-primary-bs); 
    color: white; 
    box-shadow: var(--shadow-dna-sm);
}
.btn-primary:hover, .btn-btos-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-dna-md); filter: brightness(1.1); }

.btn-secondary, .btn-btos-secondary { 
    background: white; 
    color: var(--color-text-default); 
    border: 1px solid var(--border-color-default); 
}
.btn-secondary:hover, .btn-btos-secondary:hover { background: var(--color-bg-light); border-color: var(--color-primary-bs); }

.btn-danger { background: var(--color-disc-d); color: white; }
.btn-success { background: var(--color-disc-s); color: white; }

.icon-btn { 
    width: 32px; 
    height: 32px; 
    font-size: 1rem; 
    border-radius: 6px; 
    border: 1px solid var(--border-color-default); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: var(--transition-fast); 
    background: white; 
    color: var(--color-text-muted); 
}
.icon-btn:hover { border-color: var(--color-primary-bs); color: var(--color-primary-bs); background: var(--color-bg-subtle-blue); }
.icon-btn.btn-xs { width: 28px; height: 28px; font-size: 0.9rem; }

.btn-fullscreen {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color-default);
    box-shadow: var(--shadow-dna-md);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: var(--transition-fast);
}
.btn-fullscreen:hover { background: var(--color-bg-dark); color: white; }

/* --- CARDS DNA (SOLID STATE) --- */
.card { 
    background: #FFFFFF; 
    border-radius: var(--border-radius-lg); 
    padding: 1.5rem; 
    box-shadow: var(--shadow-dna-md); 
    border: 1px solid var(--border-color-default);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 1rem; 
    padding-bottom: 0.5rem; 
    border-bottom: 1px solid var(--border-color-light); 
}

.card-title { 
    font-family: var(--font-family-headings);
    font-size: 1.1rem; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    color: var(--color-text-headings);
}

/* =========================================================
   CARD DE MEMBRO (BASE)
   ========================================================= */

.team-member {
    display: grid;
    grid-template-columns: auto 1fr auto; /* 3 COLUNAS REAIS */
    grid-template-rows: auto auto;
    gap: 0.25rem 0.75rem;

    padding: 0.75rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 0.65rem;

    border: 1px solid var(--border-color-default);
    background-color: #ffffff;
    box-shadow: var(--shadow-dna-sm);

    position: relative;
    overflow: hidden;

    cursor: grab;
    transition: var(--transition-normal);

    /* CORREÇÃO CRÍTICA: Impede o card de encolher no Flex Container */
    flex-shrink: 0;
}

.team-member:hover {
    border-color: var(--color-primary-bs);
    box-shadow: var(--shadow-dna-md);
    transform: translateY(-1px);
}

/* =========================================================
   GRIP EM BACKGROUND (OVERLAY + FADE)
   ========================================================= */

.team-member::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 55%; /* ESTENDE ATÉ O CENTRO DO CARD */

    background: linear-gradient(
        to left,
        rgba(226, 232, 240, 0.95),
        rgba(226, 232, 240, 0.65),
        rgba(226, 232, 240, 0.35),
        rgba(226, 232, 240, 0)
    );

    pointer-events: none;
    z-index: 1;
}

/* TEXTURA SUAVE DO GRIP */
.team-member::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 55%;

    background-image: radial-gradient(circle, #94a3b8 1px, transparent 1.5px);
    background-size: 4px 4px;
    opacity: 0.35;

    pointer-events: none;
    z-index: 2;
}

/* =========================================================
   CONTEÚDO (SEMPRE ACIMA DO GRIP)
   ========================================================= */

.member-checkbox,
.member-info,
.action-menu {
    position: relative;
    z-index: 3;
}

/* =========================================================
   COLUNA 1 — CHECKBOX
   ========================================================= */

.member-checkbox {
    grid-column: 1;
    grid-row: 1;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary-bs);
    cursor: pointer;
}

/* =========================================================
   COLUNA 2 — INFO
   ========================================================= */

.member-info {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.member-name-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.member-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text-headings);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-edit-btn {
    background: none;
    border: none;
    font-size: 0.7rem;
    opacity: 0.25;
    cursor: pointer;
}

.team-member:hover .member-edit-btn {
    opacity: 0.6;
}

.member-email-identity {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================================
   COLUNA 3 — BADGE (SOBRE O GRIP)
   ========================================================= */

.member-status-aside {
    grid-column: 3;
    grid-row: 1;

    display: flex;
    align-items: center;
    gap: 0.5rem;

    justify-self: end;
    position: relative;
    z-index: 4;
}

.disc-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
    font-size: 0.85rem;
    color: #ffffff;

    box-shadow: 0 2px 4px rgba(0,0,0,0.15);

    pointer-events: none; /* NÃO CLICÁVEL — MAS ARRASTÁVEL VIA CARD */
}

.disc-d { background-color: var(--color-disc-d); }
.disc-i { background-color: var(--color-disc-i); }
.disc-s { background-color: var(--color-disc-s); }
.disc-c { background-color: var(--color-disc-c); }
.disc-pending {
    background-color: #f1f5f9;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
}

/* =========================================================
   ROW 2 — AÇÕES
   ========================================================= */

.action-menu {
    grid-column: 1 / 4;
    grid-row: 2;

    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color-light);

    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.action-buttons-group {
    display: flex;
    gap: 0.4rem;
}

/* BOTÕES INTERNOS */
.team-member .icon-btn {
    border: none;
    background-color: #f8fafc;
    color: #64748b;
}

.team-member .icon-btn:hover {
    background-color: var(--color-bg-subtle-blue);
    color: var(--color-primary-bs);
}

/* =========================================================
   LIXEIRA — CLICÁVEL NO FIM DO FADE
   ========================================================= */

.icon-btn[data-action="open-delete-user"] {
    position: relative;
    z-index: 5;
    cursor: pointer;
}

.icon-btn[data-action="open-delete-user"]:hover {
    color: var(--color-disc-d);
    background-color: rgba(239, 68, 68, 0.1);
}

/* =========================================================
   ESTADOS DE DRAG (VISUAIS)
   ========================================================= */

.team-member.is-picked {
    transform: scale(1.02);
    box-shadow: var(--shadow-dna-lg);
    border-color: var(--color-primary-bs);
    z-index: 100;
}

.sortable-ghost {
    opacity: 0.4;
    border: 2px dashed var(--color-primary-bs);
    background-color: var(--color-bg-light) !important;
}

.sortable-drag {
    opacity: 0.95 !important;
    box-shadow: var(--shadow-dna-xl);
    z-index: 9999;
}

/* --- WELCOME SECTION --- */
.welcome-card { 
    background: linear-gradient(135deg, var(--color-primary-bs) 0%, #4f46e5 100%); 
    border-radius: var(--border-radius-lg); 
    padding: 2.5rem; 
    color: white; 
    margin-bottom: 2rem; 
    position: relative; 
    overflow: hidden; 
    box-shadow: var(--shadow-dna-lg);
}
.welcome-card::before { content: '🎯'; position: absolute; right: -30px; top: -30px; font-size: 180px; opacity: 0.1; }
.welcome-content { position: relative; z-index: 1; }
.welcome-title { font-family: var(--font-family-headings); font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.welcome-subtitle { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; }
.quick-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* --- SUMMARY BAR --- */
.summary-bar { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 1.5rem; 
    background: #FFFFFF; 
    padding: 1.5rem; 
    border-radius: var(--border-radius-lg); 
    box-shadow: var(--shadow-dna-md); 
    border: 1px solid var(--border-color-default); 
    margin-bottom: 2rem; 
}
.summary-item { display: flex; align-items: center; gap: 1rem; }
.summary-icon { 
    width: 48px; height: 48px; border-radius: 12px; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 1.5rem; flex-shrink: 0; 
}
.summary-item.credits .summary-icon { color: var(--color-primary-bs); background: var(--color-bg-subtle-blue); }
.summary-item.team .summary-icon { color: var(--color-disc-s); background: rgba(16, 185, 129, 0.1); }
.summary-value { font-size: 1.75rem; font-weight: 800; color: var(--color-text-headings); }
.summary-label { font-size: 0.85rem; color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; }

/* --- ACTION BANNERS --- */
.action-banner-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.action-banner { 
    border: 1px solid var(--border-color-default); 
    border-radius: var(--border-radius-lg); 
    padding: 1.5rem; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 1.5rem; 
    background: white; 
    box-shadow: var(--shadow-dna-md); 
}
.action-banner .icon-wrapper { font-size: 2rem; flex-shrink: 0; }
.action-banner-content h3 { font-weight: 800; font-size: 1.1rem; margin-bottom: 0.25rem; }
.action-banner-content p { margin: 0; color: var(--color-text-muted); font-size: 0.9rem; }

.invite-banner { background: linear-gradient(135deg, #eaf4ff, #dbe9fa); border-color: var(--color-primary-bs); }
.buy-credits-banner { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-color: var(--color-disc-s); }

/* --- CARD DE VAGA (VACANCY) --- */
.vacancy-card { 
    background: white; border-radius: var(--border-radius-md); padding: 1.25rem; margin-bottom: 1rem; 
    border: 1px solid var(--border-color-default); transition: var(--transition-normal); cursor: pointer; 
}
.vacancy-card:hover { border-color: var(--color-primary-bs); transform: translateX(4px); box-shadow: var(--shadow-dna-md); }
.vacancy-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.vacancy-title { font-weight: 800; font-size: 1rem; color: var(--color-text-headings); }
.vacancy-status { padding: 0.3rem 0.7rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }

.status-OPEN { background: rgba(16, 185, 129, 0.1); color: var(--color-disc-s); }
.status-IN_PROGRESS { background: rgba(245, 158, 11, 0.1); color: var(--color-disc-i); }
.status-CLOSED { background: var(--color-bg-light); color: var(--color-text-muted); }

/* --- TABELAS --- */
.table-responsive { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.table th, .table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color-light); vertical-align: middle; }
.table th { font-weight: 700; font-size: 0.85rem; color: var(--color-text-muted); background-color: var(--color-bg-light); text-transform: uppercase; }

/* --- FORMULÁRIOS & INPUTS --- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 700; margin-bottom: 0.4rem; color: var(--color-text-headings); font-size: 0.9rem; }
.form-input, .form-select { 
    width: 100%; padding: 0.75rem; border: 1px solid var(--border-color-default); 
    border-radius: var(--border-radius-md); font-size: 0.95rem; background-color: #FFFFFF; 
}
.form-input:focus { outline: none; border-color: var(--color-primary-bs); box-shadow: 0 0 0 3px rgba(48, 55, 197, 0.1); }

.search-bar { 
    width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border-color-default); 
    border-radius: var(--border-radius-md); font-size: 0.95rem; margin-bottom: 1rem; 
    box-shadow: var(--shadow-dna-sm);
}

.form-switch { padding-left: 2.5rem; }
.form-switch .form-check-input { width: 2.5rem; height: 1.25rem; margin-left: -2.5rem; border-radius: 2rem; cursor: pointer; }
.form-check-input:checked { background-color: var(--color-primary-bs); border-color: var(--color-primary-bs); }

/* --- ESTATÍSTICAS DE DISTRIBUIÇÃO --- */
.distribution-card { 
    text-align: center; padding: 1.25rem; border-radius: var(--border-radius-md); 
    background: #FFFFFF; border: 1px solid var(--border-color-default); transition: var(--transition-normal);
}
.distribution-value { font-size: 2rem; font-weight: 800; margin-bottom: 0.15rem; }
.distribution-d .distribution-value { color: var(--color-disc-d); } 
.distribution-i .distribution-value { color: var(--color-disc-i); } 
.distribution-s .distribution-value { color: var(--color-disc-s); } 
.distribution-c .distribution-value { color: var(--color-disc-c); }

/* --- LISTAS COMPACTAS --- */
.mini-list-container { background-color: var(--color-bg-light); border: 1px solid var(--border-color-light); border-radius: var(--border-radius-md); padding: 0.75rem; }
.mini-list-item { padding: 0.6rem 0; border-bottom: 1px solid var(--border-color-light); transition: var(--transition-fast); }
.mini-list-item:last-child { border-bottom: none; }
.department-list-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem; border-radius: var(--border-radius-sm); margin-bottom: 0.5rem; transition: var(--transition-fast); }
.department-list-item:hover { background-color: white; box-shadow: var(--shadow-dna-sm); }

/* --- WIDGETS DE INTELIGÊNCIA (SOLID STATE ADDITIONS) --- */
.trial-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #fff9e6 0%, #fff3cd 100%);
    border: 1px solid #ffeeba;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.trial-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #856404;
}

.trial-clock {
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

.trial-days-badge {
    background: #856404;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
}

.trial-expired-alert {
    border-radius: 12px; 
    background-color: rgba(239, 68, 68, 0.1); 
    border: 1px solid var(--color-disc-d); 
    color: var(--color-disc-d);
}

.token-usage-container {
    background: #ffffff;
    border: 1px solid var(--border-color-light);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    margin-top: 1rem;
}

.progress-ia {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-ia-bar {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cultural-fit-empty-state {
    background-color: rgba(19, 50, 188, 0.1); 
    border-radius: 8px; 
    color: var(--color-primary-bs);
}

.radar-chart-container {
    position: relative; 
    height: 250px; 
    width: 100%;
}

.distribution-grid {
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 0.3rem;
}

.distribution-item {
    transition: var(--transition-normal);
}
.distribution-item:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary-bs);
}

.journey-list {
    max-height: 320px;
    overflow-y: auto;
}

.journey-item {
    border-left: 3px solid var(--color-primary-bs);
    transition: transform 0.2s, background-color 0.2s;
    background-color: #ffffff;
}

.journey-item:hover {
    transform: translateX(5px);
    background-color: #f8fafc;
}

.profile-badge-mini {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.75rem;
    color: white;
}

/* --- ANIMAÇÕES & FEEDBACK --- */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}