/* ==========================================================
   gtc-components.css
   Cards, badges, post-its, modais, botões, formulários, pills.
   ========================================================== */

/* --- Botões --- */
.gtc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s ease;
}
.gtc-btn:hover { filter: brightness(0.92); }
.gtc-btn--primary { background: #2B6CB0; color: #fff; }
.gtc-btn--danger  { background: #E53E3E; color: #fff; }
.gtc-btn--ghost   { background: transparent; color: #4A5568; border: 1px solid #E2E8F0; }
.gtc-btn--sm      { padding: 4px 10px; font-size: 12px; }

/* --- Cards de tarefa (Aba 1) --- */
.gtc-task-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gtc-task-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.gtc-task-card__title {
    font-size: 14px;
    font-weight: 700;
    color: #1A202C;
}
.gtc-task-card__meta {
    font-size: 12px;
    color: #718096;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.gtc-task-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

/* --- Badge de status (pill colorido dinâmico via style inline) --- */
.gtc-status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

/* --- Badge "📌 Nota" clicável no card de tarefa --- */
.gtc-note-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #FEF08A;
    color: #744210;
    border: none;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.gtc-note-badge:hover { filter: brightness(0.95); }

/* --- Post-its (Aba 5) --- */
.gtc-postit {
    border-radius: 8px;
    padding: 14px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    cursor: pointer;
    transition: transform .1s ease;
}
.gtc-postit:hover { transform: translateY(-2px); }
.gtc-postit__title {
    font-weight: 700;
    font-size: 14px;
    color: #1A202C;
}
.gtc-postit__content {
    font-size: 12px;
    color: #2D3748;
    flex: 1;
    overflow: hidden;
    white-space: pre-wrap;
}
.gtc-postit__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.gtc-chip {
    background: rgba(0,0,0,.08);
    border: none;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    color: #1A202C;
}

/* --- Modais --- */
.gtc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,32,44,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}
.gtc-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.gtc-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.gtc-modal__header h3 { margin: 0; font-size: 16px; color: #1A365D; }
.gtc-modal__close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #718096;
}
.gtc-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* --- Formulários --- */
.gtc-field { margin-bottom: 12px; }
.gtc-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #4A5568;
    margin-bottom: 4px;
}
.gtc-field input[type="text"],
.gtc-field input[type="date"],
.gtc-field input[type="color"],
.gtc-field select,
.gtc-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}
.gtc-field textarea { min-height: 80px; resize: vertical; }
.gtc-multiselect-list {
    max-height: 140px;
    overflow-y: auto;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 6px;
}
.gtc-multiselect-list label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 400;
    color: #2D3748;
    padding: 4px 2px;
}

/* --- Tabela simples (Departamentos / Configurações) --- */
.gtc-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
}
.gtc-table th, .gtc-table td {
    text-align: left;
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid #EDF2F7;
}
.gtc-table th {
    background: #F7FAFC;
    color: #4A5568;
    font-weight: 700;
}

/* ==========================================================
   Lista de Tarefas estilo board escuro (Aba 1 — Central de Tarefas)
   Um bloco .gtc-tasklist por grupo (Tipo de Tarefa).
   ========================================================== */
.gtc-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.gtc-type-filter {
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    font-size: 13px;
    background: #fff;
    color: #2D3748;
}
.gtc-tasklist {
    background: #181B20;
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
    color: #E2E8F0;
    margin-bottom: 20px;
}
.gtc-tl-group-header {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #90CDF4;
    background: #12151A;
    border-bottom: 1px solid #2D333B;
    text-transform: uppercase;
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.gtc-tl-group-count {
    font-weight: 400;
    color: #718096;
    text-transform: none;
    letter-spacing: normal;
}
.gtc-tl-group-header-add {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
    font-size: 12px;
    color: #63B3ED;
    cursor: pointer;
    flex-shrink: 0;
}
.gtc-tl-group-header-add:hover { color: #90CDF4; }

/* --- Sub-bloco por Grupo Familiar dentro do mesmo Tipo de Tarefa (ex: "SPED - CAPITANIO") --- */
.gtc-tl-subgroup-header {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #ED8936;
    background: #1A1D23;
    border-bottom: 1px solid #2D333B;
    border-top: 1px solid #2D333B;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.gtc-tl-subgroup-check {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.gtc-tl-subgroup-check input { cursor: pointer; }

/* --- Checkbox de seleção (individual e "selecionar tudo" no topo) --- */
.gtc-tl-col--check {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.gtc-tl-row-check,
.gtc-tl-subgroup-select-all,
.gtc-select-all-label input {
    cursor: pointer;
    width: 14px;
    height: 14px;
}
.gtc-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #4A5568;
    cursor: pointer;
    white-space: nowrap;
}

/* --- Barra de ações em lote (aparece quando há tarefas selecionadas) --- */
.gtc-bulk-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #1A365D;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.gtc-bulk-bar__count {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
    white-space: nowrap;
}
.gtc-bulk-bar .gtc-btn--ghost {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.2);
    color: #E2E8F0;
}
.gtc-bulk-bar .gtc-btn--ghost:hover { background: rgba(255,255,255,.18); }
.gtc-tasklist > .gtc-tl-subgroup-header:first-of-type { border-top: none; }

.gtc-tl-header,
.gtc-tl-row {
    display: grid;
    grid-template-columns: 24px 2.4fr 1fr 1.4fr 1fr 1.4fr;
    align-items: stretch;
}
.gtc-tl-header {
    padding: 6px 16px;
    color: #A0AEC0;
    font-size: 11px;
    font-weight: 600;
    border-bottom: 1px solid #2D333B;
    align-items: center;
}
.gtc-tl-col--add {
    text-align: right;
    cursor: pointer;
    color: #63B3ED;
}
.gtc-tl-col--add:hover { color: #90CDF4; }

.gtc-tl-rows { display: flex; flex-direction: column; }
.gtc-tl-row {
    padding: 3px 16px;
    border-bottom: 1px solid #23272E;
    transition: background-color .1s ease, opacity .1s ease;
    min-height: 30px;
}
.gtc-tl-rows > *:last-child { border-bottom: none; }
.gtc-tl-row:hover { background: #1F242B; }

/* --- Efeito visual de bloqueio (dependência entre tarefas ainda não concluída) --- */
.gtc-tl-row--blocked {
    opacity: .55;
    background: repeating-linear-gradient( 135deg, #12151A, #12151A 8px, #181B20 8px, #181B20 16px );
}
.gtc-tl-row--blocked:hover { background: repeating-linear-gradient( 135deg, #12151A, #12151A 8px, #181B20 8px, #181B20 16px ); }
.gtc-tl-row--blocked .gtc-tl-title { color: #A0AEC0; }
.gtc-tl-lock { flex-shrink: 0; font-size: 11px; }
.gtc-tl-status-select:disabled,
.gtc-tl-priority-select:disabled {
    cursor: not-allowed;
    opacity: .7;
}

/* --- Notificação de dependência (aguardando / liberada) --- */
.gtc-dep-notice {
    padding: 4px 16px 6px 34px;
    font-size: 10px;
    font-weight: 600;
    border-bottom: 1px solid #23272E;
}
.gtc-dep-notice--waiting {
    color: #F6AD55;
    background: rgba(246, 173, 85, .07);
}
.gtc-dep-notice--released {
    color: #68D391;
    background: rgba(104, 211, 145, .1);
    animation: gtc-dep-notice-fade-in .25s ease;
}
@keyframes gtc-dep-notice-fade-in {
    from { opacity: 0; transform: translateY( -3px ); }
    to { opacity: 1; transform: translateY( 0 ); }
}

.gtc-tl-col--name {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-width: 0;
}
.gtc-tl-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.gtc-tl-title {
    font-weight: 600;
    color: #F7FAFC;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gtc-tl-col--assignee {
    color: #718096;
    font-size: 15px;
}
.gtc-tl-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2B6CB0;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}
.gtc-tl-icon-muted { color: #4A5568; font-size: 14px; }
.gtc-tl-date-chip { color: #CBD5E0; font-size: 12px; }

.gtc-tl-status-select,
.gtc-tl-priority-select {
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
    text-transform: uppercase;
}
.gtc-tl-status-select {
    color: #fff;
    appearance: none;
    -webkit-appearance: none;
}
.gtc-tl-priority-select {
    background: transparent;
    border: 1px solid #2D333B;
}

@media screen and (max-width: 900px) {
    .gtc-tl-header,
    .gtc-tl-row {
        grid-template-columns: 18px 1.8fr 0.7fr 1fr 0.8fr 1fr;
    }
}

/* --- Score card (Aba 3 - Metas) --- */
.gtc-score-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 16px;
}
.gtc-score-card__bar-bg {
    background: #EDF2F7;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-top: 6px;
}
.gtc-score-card__bar-fill {
    background: #38A169;
    height: 100%;
}
.gtc-score-card__certs {
    font-size: 11px;
    color: #4A5568;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #EDF2F7;
}

/* ==========================================================
   Sidebar de Métricas (shortcode [gtc_metricas]) — % de tarefas
   concluídas por usuário, com mini gráfico de pizza (donut).
   ========================================================== */
.gtc-metrics-root { width: 100%; }
.gtc-metrics-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 16px;
}
.gtc-metrics-title {
    font-size: 13px;
    font-weight: 700;
    color: #1A365D;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.gtc-metrics-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #EDF2F7;
}
.gtc-metrics-row:last-child { border-bottom: none; padding-bottom: 0; }

/* Donut via conic-gradient: preenche de 0% a 100% com a cor de progresso,
   o resto fica cinza claro; o ::after cria o buraco central do "rosquinha". */
.gtc-donut {
    --gtc-pct: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    background: conic-gradient(
        #38A169 calc(var(--gtc-pct) * 1%),
        #E2E8F0 0
    );
    display: flex;
    align-items: center;
    justify-content: center;
}
.gtc-donut::after {
    content: '';
    position: absolute;
    inset: 7px;
    background: #fff;
    border-radius: 50%;
}
.gtc-donut__label {
    position: relative;
    z-index: 1;
    font-size: 10px;
    font-weight: 700;
    color: #2D3748;
}
.gtc-metrics-row__info { min-width: 0; }
.gtc-metrics-row__name {
    font-size: 13px;
    font-weight: 600;
    color: #1A202C;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gtc-metrics-row__sub {
    font-size: 11px;
    color: #718096;
    margin-top: 1px;
}

/* --- Card de Certificados Digitais (clicável, abre o outro plugin) --- */
.gtc-cert-card {
    cursor: pointer;
    transition: box-shadow .15s ease, transform .1s ease;
    margin-bottom: 16px;
}
.gtc-cert-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.1);
    transform: translateY( -1px );
}
.gtc-cert-card:focus-visible {
    outline: 2px solid #2B6CB0;
    outline-offset: 2px;
}
.gtc-cert-card__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    text-align: center;
}
.gtc-cert-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 4px;
    border-radius: 6px;
    background: #F7FAFC;
}
.gtc-cert-stat__num {
    font-size: 18px;
    font-weight: 800;
}
.gtc-cert-stat__label {
    font-size: 10px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.gtc-cert-stat--ok .gtc-cert-stat__num { color: #38A169; }
.gtc-cert-stat--warn .gtc-cert-stat__num { color: #D69E2E; }
.gtc-cert-stat--danger .gtc-cert-stat__num { color: #E53E3E; }
.gtc-cert-card__hint {
    text-align: center;
    font-size: 11px;
    color: #2B6CB0;
    font-weight: 600;
    margin-top: 10px;
}

/* ==========================================================
   Identificação de Responsável (PIN de 4 dígitos)
   ========================================================== */
.gtc-navbar-responsible {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #E2E8F0;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.gtc-navbar-resp-tag {
    background: #D69E2E;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    text-transform: uppercase;
}
.gtc-navbar-resp-switch {
    background: rgba(255,255,255,.1);
    border: none;
    color: #CBD5E0;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    cursor: pointer;
}
.gtc-navbar-resp-switch:hover { background: rgba(255,255,255,.2); color: #fff; }

.gtc-resp-gate-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,20,28,.92);
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.gtc-resp-gate-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.gtc-resp-gate-box h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #1A365D;
}
.gtc-resp-gate-box p {
    margin: 0 0 18px;
    font-size: 13px;
    color: #718096;
}
.gtc-resp-gate-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}
.gtc-resp-gate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #F7FAFC;
    color: #1A202C;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease;
}
.gtc-resp-gate-btn:hover { background: #EDF2F7; border-color: #2B6CB0; }
.gtc-resp-gate-tag {
    background: #D69E2E;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    text-transform: uppercase;
}
.gtc-resp-gate-pin {
    width: 140px;
    margin: 0 auto;
    display: block;
    text-align: center;
    font-size: 26px;
    letter-spacing: 12px;
    padding: 10px 0 10px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    outline: none;
}
.gtc-resp-gate-pin:focus { border-color: #2B6CB0; }
.gtc-resp-gate-error {
    color: #E53E3E;
    font-size: 12px;
    font-weight: 600;
    min-height: 16px;
    margin-top: 8px;
}
.gtc-resp-gate-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}
