:root {
    --alpargatas-blue: #0597F2;
    --alpargatas-light-blue: #4BB2F2;
    --neutral-fill-rest: #fafafa;
    --neutral-fill-hover: #f5f5f5;
    --neutral-stroke-rest: #d1d1d1;
    --card-background: #ffffff;
    --surface-background: #f8f9fa;
    --elevation-shadow: 0 0.3px 0.9px rgba(0, 0, 0, 0.1), 0 1.6px 3.6px rgba(0, 0, 0, 0.13);
    /* Tokens semânticos de texto/borda · consumidos pelo tema escuro (theme-dark.css).
       O claro mantém os valores históricos para não alterar a aparência atual. */
    --text-primary: #242424;
    --text-secondary: #605e5c;
    --text-muted: #9aa1a8;
    --border-subtle: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background-color: var(--surface-background);
    color: #323130;
    height: 100%;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* ===== UTILITARIOS ===== */
.is-hidden {
    display: none;
}

.spaced-top {
    margin-top: 24px;
}

.section-divider {
    margin: 24px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

.required-asterisk {
    color: #ff0000;
}

.conformidade-rule {
    font-size: 0.85rem;
    color: #666;
}

.progress-fill-default {
    width: 60%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stats-card {
    padding: 20px;
    border-radius: 8px;
    background: #f5f5f5;
}

.stats-label {
    font-size: 14px;
    color: #605e5c;
    font-weight: 500;
}

.stats-value {
    font-weight: 700;
    margin-top: 8px;
}

.stats-value-large {
    font-size: 32px;
}

.stats-value-medium {
    font-size: 18px;
}

.stats-value-blue {
    color: #0597f2;
}

.stats-value-green {
    color: #107c10;
}

.stats-value-red {
    color: #d13438;
}

.stats-value-dark {
    color: #323130;
}

.chart-canvas-fixed {
    position: relative;
    height: 350px;
}

/* ===== ADMINISTRACAO ===== */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.admin-card {
    background: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--elevation-shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Card que ocupa toda a largura do grid */
.admin-card-full {
    grid-column: 1 / -1;
}

/* Itens de importação / rotinas */
.admin-import-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.import-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.import-item:last-child { border-bottom: none; }
.import-info { display: flex; flex-direction: column; gap: 2px; }
.import-name { font-size: 14px; font-weight: 600; color: #1e293b; }
.import-desc { font-size: 12px; color: #6b7280; }

/* Role badge pequeno na tabela de usuários */
.role-badge-small {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.role-badge-small.role-employee { background: #e0f0ff; color: #0052a3; }
.role-badge-small.role-manager  { background: #e8f5e9; color: #107c10; }
.role-badge-small.role-hr       { background: #fff3e0; color: #c94f0a; }
.role-badge-small.role-admin    { background: #f3e8ff; color: #6b2fa0; }

.admin-card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.admin-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-input {
    flex: 1 1 180px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--neutral-stroke-rest);
    background: #fff;
    font-size: 14px;
}

.admin-btn {
    background: var(--alpargatas-blue);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(5, 151, 242, 0.2);
}

.admin-btn.ghost {
    background: transparent;
    color: #333;
    border: 1px solid var(--neutral-stroke-rest);
    box-shadow: none;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f5f7fa;
    border: 1px solid #e6e8eb;
    gap: 12px;
}

.flags-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flags-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e6e8eb;
}

.flags-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #4a4a4a;
    margin-bottom: 2px;
}

.flag-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #eef0f2;
}

.flag-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.flag-label {
    font-size: 13px;
    font-weight: 600;
    color: #2f2f2f;
}

.flag-desc {
    font-size: 11px;
    color: #6a6a6a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flag-status {
    font-size: 12px;
    font-weight: 600;
    color: #2f2f2f;
    min-width: 60px;
    text-align: right;
}

.flag-toggle {
    position: relative;
    width: 42px;
    height: 24px;
}

.flag-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.flag-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #dfe3e8;
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.flag-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.flag-toggle input:checked + .flag-slider {
    background-color: var(--alpargatas-blue);
}

.flag-toggle input:checked + .flag-slider::before {
    transform: translateX(18px);
}

.pie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.pie-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e6e8eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pie-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.pie-canvas-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: #4a4a4a;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pie-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .flag-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .flag-status {
        text-align: left;
    }

    .admin-form-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== MENU LATERAL ===== */
/* Seção admin oculta por padrão — exibida apenas via JS após confirmar role=admin */
/* .role-admin visibilidade controlada exclusivamente pelo JS (applyProfileMenu) */

.navigation {
    width: 280px;
    background-color: var(--card-background);
    border-right: 1px solid var(--neutral-stroke-rest);
    display: flex;
    flex-direction: column;
    box-shadow: var(--elevation-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
}

.navigation.collapsed {
    width: 80px;
}

.nav-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--neutral-stroke-rest);
    background: linear-gradient(135deg, var(--alpargatas-light-blue), #0052a3);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    flex: 1;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--alpargatas-orange);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.navigation.collapsed .brand-text {
    opacity: 0;
}

.brand-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.brand-subtitle {
    font-size: 10px;
    opacity: 0.8;
    line-height: 1;
}

.subtitle {
    margin-bottom: 5px;
}

.nav-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    color: white;
    font-size: 24px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.nav-toggle:hover {
    background-color: #217cc6;
    transform: scale(1.1);
}

.nav-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0;
    min-height: 0;
}

.nav-section {
    margin-bottom: 4px;
}

/* Dashboard fixo no topo do menu — acima de todas as categorias */
.nav-dashboard-pin {
    padding: 4px 12px 10px;
    border-bottom: 1px solid rgba(0,0,0,.06);
    margin-bottom: 4px;
}
.nav-dashboard-pin .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    transition: background .15s;
}
.nav-dashboard-pin .nav-link:hover { background: rgba(5,151,242,.08); }
.nav-dashboard-pin .nav-link.active {
    background: rgba(5,151,242,.12);
    color: #0597F2;
}
.navigation.collapsed .nav-dashboard-pin { padding: 4px 0 10px; }
.navigation.collapsed .nav-dashboard-pin .nav-link { justify-content: center; }
.navigation.collapsed .nav-dashboard-pin .nav-text { display: none; }

.nav-profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.nav-profile-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #9ca3af;
    transition: background .3s;
}
.nav-profile-dot.employee { background: #0597F2; }
.nav-profile-dot.manager  { background: #107c10; }
.nav-profile-dot.hr       { background: #c94f0a; }
.nav-profile-dot.admin    { background: #6b2fa0; }

.nav-profile-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #605e5c;
    transition: opacity .3s;
}
.navigation.collapsed .nav-profile-badge { padding: 10px 0 14px; justify-content: center; }
.navigation.collapsed .nav-profile-label { opacity: 0; width: 0; overflow: hidden; }

/* Título de grupo de menu */
.nav-group-title {
    font-size: 10px;
    font-weight: 700;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 12px 20px 4px;
    opacity: 1;
    transition: opacity .3s;
}
.navigation.collapsed .nav-group-title { opacity: 0; }

/* Separador visual entre grupos */
.nav-section + .nav-section {
    border-top: 1px solid rgba(0,0,0,.05);
    padding-top: 4px;
    margin-top: 4px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #605e5c;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 20px;
    margin-bottom: 8px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.navigation.collapsed .nav-section-title {
    opacity: 0;
}

.nav-item {
    margin: 2px 12px;
    border-radius: 8px;
    overflow: hidden;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #323130;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.nav-link:hover {
    background-color: var(--neutral-fill-hover);
}

.nav-link.active {
    background-color: var(--alpargatas-light-blue);
    color: white;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--alpargatas-orange);
}

.nav-icon {
    font-size: 18px;
    margin-right: 16px;
    min-width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.navigation.collapsed .nav-text {
    opacity: 0;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.header {
    height: 60px;
    background-color: var(--card-background);
    border-bottom: 1px solid var(--neutral-stroke-rest);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    box-shadow: var(--elevation-shadow);
    justify-content: space-between;
    flex-wrap: nowrap;
}


.profile-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    cursor: pointer;
}

.profile-name {
    font-size: 14px;
    font-weight: 500;
    color: #323130;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--alpargatas-light-blue), #0052a3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background-color: var(--surface-background);
}

.page-view {
    display: none;
}

.page-view.active {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

/* ===== ADERÊNCIA CARD ===== */
.adherence-card {
    background: var(--card-background);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--elevation-shadow);
}

.adherence-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    margin-top: 5px;
    background: none;
}

.adherence-card .status-badge {
    margin-bottom: 20px;
}

.adherence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.adherence-item {
    background: #f5f7fa;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #0597F2;
}

.adherence-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    background: none;
}

.adherence-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    background: none;
}

.adherence-note {
    font-size: 12px;
    color: #d9534f;
    margin-top: 4px;
    background: none;
}

/* ===== CONFORMIDADE 3x2 ===== */
.conformidade-section {
    margin-bottom: 24px;
    padding: 20px;
    background: #f5f7fa;
    border-radius: 8px;
    border-left: 4px solid #0597F2;
}

.conformidade-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 🚩 NOVO FORMATO SIMPLIFICADO X/5 */
.conformidade-simplificada {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--neutral-stroke-rest);
}

.conformidade-valor {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 48px;
    font-weight: 700;
    color: var(--alpargatas-blue);
}

.dias-count {
    color: var(--alpargatas-blue);
}

.separador {
    color: #605E5C;
    font-size: 36px;
    margin: 0 4px;
}

.dias-max {
    color: #605E5C;
    font-size: 36px;
}

.farol-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #DFF6DD;
    border: 2px solid #107C10;
    border-radius: 8px;
}

.farol-status.nao-conformidade {
    background: #FDE7E9;
    border-color: #C50F1F;
}

.farol-icon {
    font-size: 24px;
}

.farol-text {
    font-size: 14px;
    font-weight: 600;
    color: #107C10;
}

.farol-status.nao-conformidade .farol-text {
    color: #C50F1F;
}
.farol-status.nao-conformidade .farol-icon::before {
    content: '❌';
}

/* FORMATO ANTIGO 3x2 (mantido para compatibilidade) */
.conformidade-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.conformidade-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conformidade-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Farol inline ao lado do título */
.farol-icon-inline {
    font-size: 18px;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.farol-icon-inline.nao-conformidade {
    filter: grayscale(100%);
}

.conformidade-icon {
    font-size: 18px;
}

.conformidade-text {
    background: none;
}

.conformidade-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 24px;
    background-color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.3s ease;
}

.progress-fill.presenciais-fill {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.progress-fill.remotos-fill {
    background: linear-gradient(90deg, #17a2b8 0%, #20c997 100%);
}

.conformidade-counter {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 40px;
    text-align: right;
    background: none;
}

.status-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    width: fit-content;
    background: none;
}

.status-conformidade {
    background-color: #28a745;
    color: white;
}

.status-dica {
    background-color: #ffc107;
    color: #333;
}

.status-atencao {
    background-color: #ffe7a3;
    color: #5a4300;
}

.status-nao-conformidade {
    background-color: #dc3545;
    color: white;
}

.status-message {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #333;
}

.status-message.conformidade {
    background-color: #d4edda;
    border-left-color: #28a745;
}

.status-message.atencao {
    background-color: #fff3cd;
    border-left-color: #ffc107;
}

.status-message.nao-conformidade {
    background-color: #f8d7da;
    border-left-color: #dc3545;
}

.status-icon {
    font-size: 16px;
    background: none;
}

#statusText {
    background: none;
}



/* ===== FÉRIAS ===== */
.ferias-container {
    background: var(--card-background);
    padding: 24px;
    border-radius: 8px;
    box-shadow: var(--elevation-shadow);
}

.ferias-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.ferias-controls label {
    font-weight: 600;
    color: #323130;
}

.ferias-input {
    padding: 8px 12px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    background: var(--neutral-fill-rest);
    margin-bottom: 5px;
}

.textarea {
    width: 365px;
    height: 97px;
    margin-bottom: 10px;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 14px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

th {
    background: #1e40af;
    color: #fff;
    font-weight: 600;
}

/* Borda preta no topo do cabeçalho somente para os relatórios RH */
/* Borda preta no topo do cabeçalho somente para os relatórios RH */
#relatorioAderenciaTable thead tr,
#relatorioStatusJustificativasTable thead tr {
    border-top: 3px solid #555555;
    border-bottom: none;
}

/* Estilo da linha TOTAL posicionada no final da tabela */
.total-row {
    font-weight: 700;
    background-color: #f0f0f0;
    border-top: 2px solid #d1d1d1;
}

/* Garantir que a linha TOTAL não mostre borda inferior e que use apenas borda superior */
#relatorioAderenciaTable tbody tr.total-row td,
#relatorioStatusJustificativasTable tbody tr.total-row td {
    border-bottom: none !important;
    border-top: 2px solid #d1d1d1 !important;
}

td.department {
    text-align: left;
    font-weight: 600;
    background: #f8fafc;
    padding-left: 8px;
    position: relative;
}

.expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-right: 8px;
    background-color: var(--alpargatas-blue);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s ease;
    user-select: none;
    border: none;
    padding: 0;
}

.expand-btn:hover {
    background-color: var(--alpargatas-light-blue);
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(5, 151, 242, 0.3);
}

.expand-btn.expanded {
    background-color: #22c55e;
}

.area-name {
    vertical-align: middle;
    font-weight: 600;
}

/* Estilos para linhas de gestores */
.gestor-row {
    background-color: #f9f9f9;
    border-left: 4px solid var(--alpargatas-blue);
    animation: slideDown 0.3s ease-out;
    transition: all 0.3s ease;
}

.gestor-row:hover {
    background-color: #f0f7ff;
}

.gestor-row.removing {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.gestor-name {
    padding-left: 24px;
    font-weight: 500;
    color: #555;
    background: #fafafa;
}

.indent {
    display: inline-block;
    margin-left: 40px;
    color: #666;
    font-size: 0.95rem;
}

.gestor-hc {
    color: #888;
    font-size: 0.95rem;
    background: #fafafa;
}

.gestor-data {
    opacity: 0.85;
    background-color: #f9f9f9;
}

.gestor-data.excellent {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

.gestor-data.good {
    background-color: rgba(245, 158, 11, 0.08) !important;
}

.gestor-data.critical {
    background-color: rgba(239, 68, 68, 0.08) !important;
}

/* Animação de expansão */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gestor-row {
    animation: slideDown 0.25s ease-out;
}

.grupo-header {
    background: #e0e7ff;
    font-weight: bold;
    text-align: left;
    padding: 10px;
}

.tabela-com-grupo {
    display: flex;
    align-items: flex-start;
}

.grupo-lateral {
    display: flex;
    flex-direction: column;
    margin-right: 8px;
}

.grupo-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: bold;
    background: #e0e7ff;
    color: #1e40af;
    text-align: center;
    padding: 4px;
    border: 1px solid #cbd5e1;
}



/* NOVA REGRA DE CORES */
.excellent {
    background: #dbeafe;
    border: 2px solid #3b82f6;
}


.good {
    background: #fef3c7;
    border: 2px solid #f59e0b;
}


.critical {
    background: #fee2e2;
    border: 2px solid #ef4444;
}

.percent {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ── Painel de Aderência — grade compacta no desktop ───────────────────────────
   16 colunas (BU/Área + #HC + Média + 13 semanas). Fonte/padding reduzidos e BU
   sem quebra de linha para caber sem barra de rolagem horizontal. */
@media (min-width: 769px) {
    #aderenciaTable { font-size: 12px; width: 100%; }
    #aderenciaTable th,
    #aderenciaTable td { padding: 4px 5px; }
    #aderenciaTable .dept-row .department,
    #aderenciaTable .total-row .department { white-space: nowrap; }   /* nome da BU não quebra */
    #aderenciaTable .percent { font-size: 12px; font-weight: 600; }
    #aderenciaTable .gestor-data { font-size: 11px; }
    #aderenciaTable th { font-size: 11px; white-space: nowrap; }
}

/* ── Painel de Aderência — view MOBILE (card por BU + faixa de semanas) ─────── */
.adh-mobile { display: none; }
@media (max-width: 768px) {
    .adh-desktop { display: none; }      /* esconde a tabela larga no celular */
    .adh-mobile { display: block; }
}
.adh-card {
    border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 10px;
    background: #fff; overflow: hidden;
}
.adh-card-head {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    cursor: pointer; background: #f8fafc; border-bottom: 1px solid #eef2f7;
}
.adh-exp {
    flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e2e8f0; color: #334155; font-weight: 700; font-size: 16px; line-height: 1;
}
.adh-bu { flex: 1 1 auto; font-weight: 700; color: #1e293b; font-size: 14px; }
.adh-hc { flex: 0 0 auto; font-size: 12px; color: #64748b; }
.adh-avg {
    flex: 0 0 auto; min-width: 48px; text-align: center; padding: 3px 8px;
    border-radius: 8px; font-weight: 700; font-size: 13px;
}
.adh-weeks {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px;
}
.adh-wk {
    flex: 0 0 auto; min-width: 52px; border-radius: 8px; padding: 4px 6px;
    text-align: center; display: flex; flex-direction: column; gap: 1px;
}
.adh-wk-d { font-size: 10px; color: #64748b; line-height: 1; }
.adh-wk-v { font-size: 13px; font-weight: 700; line-height: 1.1; }
.adh-gestores { padding: 4px 12px 12px; background: #fcfdfe; }
.adh-g { border-top: 1px dashed #e2e8f0; padding-top: 8px; margin-top: 8px; }
.adh-g-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adh-g-name { flex: 1 1 60%; font-size: 13px; color: #334155; }
.adh-g .adh-weeks { padding: 8px 0 0; }
.adh-g .adh-wk { min-width: 46px; }
.adh-card-total { border-color: #cbd5e1; }
.adh-card-total .adh-card-head { background: #eef2f7; }

/* ── Árvore de gestores recursiva (mesma BU) ───────────────────────────────── */
.adh-tnode-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.adh-tchildren { padding-left: 4px; }
.adh-exp-spacer { flex: 0 0 22px; width: 22px; height: 22px; }
.dept-leaf-spacer { display: inline-block; width: 22px; height: 22px; margin-right: 6px; vertical-align: middle; }
.role-sigla {
    display: inline-block; padding: 1px 6px; margin-right: 2px;
    border-radius: 6px; background: #e8eef5; color: #1e3a5f;
    font-size: 10px; font-weight: 700; letter-spacing: .04em; vertical-align: middle;
}

/* ── Saúde do cadastro · órfãos vivos ──────────────────────────────────────── */
.orphan-block { margin-bottom: 18px; border: 1px solid #eef2f7; border-radius: 10px; overflow: hidden; }
.orphan-mgr {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px; background: #fff6f6; border-bottom: 1px solid #f3dada;
}
.orphan-badge {
    flex: 0 0 auto; padding: 2px 7px; border-radius: 6px;
    background: #c0392b; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .05em;
}
.orphan-mgr-name { font-weight: 700; color: #1e293b; }
.orphan-mgr-meta { color: #64748b; }
.orphan-count { margin-left: auto; font-size: 12px; font-weight: 600; color: #c0392b; }
.orphan-block .team-table { margin: 0; }

/* ── Explorador de usuário (ativação & hierarquia) ─────────────────────────── */
.ux-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.ux-dot.on { background: #16a34a; }
.ux-dot.off { background: #cbd5e1; }
.ux-results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ux-res {
    display: flex; align-items: center; gap: 8px; text-align: left;
    padding: 8px 10px; border: 1px solid #eef2f7; border-radius: 8px; background: #fff; cursor: pointer;
}
.ux-res:hover { background: #f8fafc; }
.ux-res-name { font-weight: 600; color: #1e293b; }
.ux-res small, .ux-node small, .ux-anc small, .ux-focus-meta { color: #94a3b8; font-size: 12px; }
.ux-section { font-size: 13px; color: #475569; margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.ux-above { font-size: 13px; margin-bottom: 8px; }
.ux-anc { padding: 3px 0; color: #334155; }
.ux-conn { color: #cbd5e1; margin-right: 4px; }
.ux-anc-focus { color: #94a3b8; font-weight: 600; }
.ux-focus {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 14px; background: #f0f6ff; border: 1px solid #d6e4f5; border-radius: 10px;
}
.ux-focus-name { font-weight: 700; font-size: 15px; color: #0f2748; }
.ux-status { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.ux-status.on { background: #dcfce7; color: #166534; }
.ux-status.off { background: #f1f5f9; color: #64748b; }
.ux-focus .ux-toggle { margin-left: auto; }
.ux-warn { margin: 8px 2px 0; padding: 8px 10px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; font-size: 13px; color: #9a3412; }
.ux-tree { margin-top: 4px; }
.ux-children { padding-left: 22px; }
.ux-node-row { display: flex; align-items: center; gap: 7px; padding: 4px 0; flex-wrap: wrap; }
.ux-node-name { color: #1e293b; font-weight: 500; }
.ux-node-name.off { color: #94a3b8; text-decoration: line-through; }
.ux-rc { margin-left: 4px; font-size: 11px; font-weight: 700; color: #475569; background: #eef2f7; border-radius: 6px; padding: 1px 6px; }
.ux-empty { color: #94a3b8; font-size: 12px; padding: 2px 0 2px 22px; }

/* ── Roteamento de decisão (regra do BP) ───────────────────────────────────── */
.rt-opt {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
    border: 1px solid #eef2f7; border-radius: 10px; cursor: pointer;
}
.rt-opt.sel { border-color: #2563eb; background: #f0f6ff; }
.rt-opt input { margin-top: 3px; }

/* ── Combobox (busca + lista num só controle) ──────────────────────────────── */
.ov-combo {
    position: absolute; left: 0; right: 0; z-index: 50; margin-top: 2px;
    background: #fff; border: 1px solid #cbd5e1; border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15,23,42,.16); max-height: 260px; overflow-y: auto; padding: 4px;
}
.ov-combo-item {
    display: block; width: 100%; text-align: left; border: 0; background: #fff;
    padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;   /* nome+BU longos: 1 linha, sem estourar */
}
.ov-combo-item:hover { background: #f0f6ff; }
.ov-combo-item small { color: #94a3b8; }
.ov-combo-empty { padding: 10px; color: #94a3b8; font-size: 13px; }

/* ── Toggle switch (on/off moderno · substitui checkbox cru) ────────────────── */
.sw { display: inline-flex; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-track {
    width: 38px; height: 22px; border-radius: 999px; background: #cbd5e1;
    position: relative; transition: background .15s ease; display: inline-block;
}
.sw-track::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease;
}
.sw input:checked + .sw-track { background: #2563eb; }
.sw input:checked + .sw-track::after { transform: translateX(16px); }
.sw input:focus-visible + .sw-track { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* ── Auto-aceite SAP · shuttle de duas listas ──────────────────────────────── */
.aa-shuttle { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .aa-shuttle { grid-template-columns: 1fr; } }
.aa-col { display: flex; flex-direction: column; }
.aa-head { font-size: 13px; font-weight: 700; color: #334155; text-transform: uppercase; letter-spacing: .04em; }
.aa-count { color: #94a3b8; font-weight: 600; }
.aa-list { border: 1px solid #eef2f7; border-radius: 10px; max-height: 52vh; overflow-y: auto; padding: 4px; }
.aa-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 9px; border: 0; border-radius: 8px; background: #fff; cursor: pointer; }
.aa-item:hover { background: #f0f6ff; }
.aa-arrow { color: #2563eb; font-weight: 700; flex: 0 0 16px; }
.aa-code { font-family: ui-monospace, monospace; font-weight: 700; color: #1e293b; flex: 0 0 auto; }
.aa-label { color: #475569; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aa-grp { font-size: 10px; color: #94a3b8; background: #f1f5f9; border-radius: 6px; padding: 1px 6px; }
.aa-empty { color: #94a3b8; font-size: 13px; padding: 14px; text-align: center; }

/* ── Políticas de Jornada — cards com padrão + valor salvo ─────────────────── */
.policy-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.policy-field-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow .15s;
}
.policy-field-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.pfc-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.pfc-icon { font-size: 22px; line-height: 1; margin-top: 2px; }
.pfc-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}
.pfc-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.pfc-values {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
}
.pfc-default-row, .pfc-persisted-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.pfc-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.pfc-tag-default { background: #f0f4ff; color: #4f6ef7; }
.pfc-tag-saved   { background: #e8f5e9; color: #107c10; }
.pfc-tag-same    { background: #f3f4f6; color: #9ca3af; }  /* igual ao padrão */

.pfc-default-val  { color: #374151; font-weight: 500; }
.pfc-persisted-val {
    color: #107c10;
    font-weight: 700;
}
.pfc-persisted-val.is-default { color: #9ca3af; font-weight: 400; }

.pfc-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pfc-input { width: 80px !important; flex: none !important; }
.pfc-btn   { padding: 8px 14px; font-size: 13px; }
.pfc-range { font-size: 11px; color: #9ca3af; }

.pfc-feedback {
    font-size: 12px;
    min-height: 16px;
    color: #107c10;
}
.pfc-feedback.error { color: #e63946; }


.adherence-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* Coluna da semana mais recente — destaque azul claro */
#aderenciaTable td.last-week,
#aderenciaTable th.last-week {
    background: #e8f4ff !important;
    border-left: 2px solid #93c5fd;
}

/* Célula sem dados */
#aderenciaTable td[title="Sem dados"] {
    background: #fafafa;
    color: #d1d5db;
    font-size: 13px;
    text-align: center;
}

.legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
}


.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--surface-background);
    border-radius: 8px;

}

.calendar-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    padding: 8px;
    color: var(--alpargatas-blue);
}

.calendar .calendar-day-name {
    text-align: center;
    font-weight: 600;
    color: var(--alpargatas-blue);
    font-size: 12px;
    padding: 8px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-bottom: 2px solid var(--alpargatas-blue);
    border-radius: 4px 4px 0 0;
    grid-row: 1;
}

.calendar .calendar-day-name:nth-of-type(1) {
    grid-column: 1;
}

.calendar .calendar-day-name:nth-of-type(2) {
    grid-column: 2;
}

.calendar .calendar-day-name:nth-of-type(3) {
    grid-column: 3;
}

.calendar .calendar-day-name:nth-of-type(4) {
    grid-column: 4;
}

.calendar .calendar-day-name:nth-of-type(5) {
    grid-column: 5;
}

.calendar .calendar-day-name:nth-of-type(6) {
    grid-column: 6;
}

.calendar .calendar-day-name:nth-of-type(7) {
    grid-column: 7;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    background: white;
    min-height: 40px;
}

.calendar-day:hover {
    background-color: var(--neutral-fill-hover);
    border-color: var(--alpargatas-light-blue);
}

.calendar-day.selected {
    background-color: var(--alpargatas-light-blue);
    color: white;
    font-weight: 600;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.ferias-info {
    background: var(--surface-background);
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.ferias-info p {
    margin: 8px 0;
    color: #323130;
}

.detalhes-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detalhes-wrapper .btn-solicitar {
    align-self: flex-start;
}

.btn-solicitar {
    padding: 10px 24px;
    background-color: var(--alpargatas-blue);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Botão Cancelar · secundário NEUTRO, mesmas dimensões do "Solicitar" (estava sem estilo). */
.btn-cancelar {
    padding: 10px 24px;
    background-color: #fff;
    color: #475569;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}
.btn-cancelar:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

.btn-solicitar:hover {
    background-color: #0052a3;
}

.btn-solicitar:hover {
    background-color: #0052a3;
}

/* Botões secundários */
.btn-secondary {
    padding: 10px 24px;
    background-color: #f0f0f0;
    color: #323130;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* Container de ações do formulário */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    align-items: center;
}

/* Hints de formulário */
.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* ===== HISTÓRICO DE PRESENÇA ===== */
.historico-container {
    background: var(--card-background);
    padding: 24px;
    border-radius: 8px;
    box-shadow: var(--elevation-shadow);
}

.historico-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.badge-justificativa {
    background-color: #6f42c1;
}

.badge-atestado {
    background-color: #0d6efd;
}

.badge-trabalho-externo {
    background-color: #20c997;
}

.badge-aprovado {
    background-color: #198754;
    color: #fff;
}

.badge-pendente {
    background-color: #ffc107;
    color: #000;
}

.badge-reprovado {
    background-color: #dc3545;
    color: #fff;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-cancelada {
    background-color: #e5e7eb;
    color: #6b7280;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.btn-mes {
    padding: 8px 16px;
    background-color: var(--alpargatas-light-blue);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-mes:hover {
    background-color: #0052a3;
}

.mes-ano {
    font-size: 16px;
    font-weight: 600;
    color: #323130;
    text-transform: capitalize;
}

.calendar-historico {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--surface-background);
    border-radius: 8px;
}

.calendar-historico .calendar-day-name {
    text-align: center;
    font-weight: 600;
    color: var(--alpargatas-blue);
    font-size: 12px;
    padding: 8px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-bottom: 2px solid var(--alpargatas-blue);
    border-radius: 4px 4px 0 0;
    grid-row: 1;
}

.calendar-historico .calendar-day-name:nth-of-type(1) {
    grid-column: 1;
}

.calendar-historico .calendar-day-name:nth-of-type(2) {
    grid-column: 2;
}

.calendar-historico .calendar-day-name:nth-of-type(3) {
    grid-column: 3;
}

.calendar-historico .calendar-day-name:nth-of-type(4) {
    grid-column: 4;
}

.calendar-historico .calendar-day-name:nth-of-type(5) {
    grid-column: 5;
}

.calendar-historico .calendar-day-name:nth-of-type(6) {
    grid-column: 6;
}

.calendar-historico .calendar-day-name:nth-of-type(7) {
    grid-column: 7;
}

.calendar-day-historico {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 4px;
    cursor: default;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    min-height: 40px;
    color: #323130;
    user-select: none;
}

.calendar-day-historico:not(.empty-day):not(.fim-semana) {
    border: 1px solid var(--neutral-stroke-rest);
}

.calendar-day-historico.success {
    color: white;
    font-weight: 600;
}

.calendar-day-historico.warning {
    color: #333;
    font-weight: 600;
}

.calendar-day-historico.alert {
    color: white;
    font-weight: 600;
}

.calendar-day-historico.fim-semana {
    color: white;
    font-weight: 600;
}

.calendar-day-historico.empty-day {
    background: transparent !important;
    cursor: not-allowed;
    border: none !important;
}

/* Popover para motivo */
.historico-popover {
    display: none;
    position: fixed;
    background-color: #323130;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.historico-popover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #323130;
}

/* Legenda */
.historico-legenda {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--surface-background);
    border-radius: 8px;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #323130;
}

.legenda-box {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Card */

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    position: relative;
    /* 🔥 ESSENCIAL */
}


.filter-group label {
    font-size: 12px;
    color: #605e5c;
}

.filter-select,
.filter-input {
    background: #ffffff;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    padding: 8px;
    color: #323130;
    font-size: 13px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #0078d4;
}

/* ── Combos (select) À PROVA DE OVERFLOW · defesa ÚNICA p/ TODA a app ────────────────────────────────
   Nenhum <select> estoura o contêiner: encolhe em flex/grid (min-width:0), respeita a largura do pai
   (max-width:100%) e conta o padding na largura (box-sizing). A opção selecionada é recortada pelo
   controle nativo + reticências — i18n longo (pt/es maiores que en) NÃO quebra o layout. Regra de
   ELEMENTO (baixa especificidade): qualquer classe com min-width/width próprio continua vencendo
   (ex.: .cr-foot-select min-width:120px), e onde não há nada definido, o select deixa de estourar. */
select {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-overflow: ellipsis;
}

/* Plataforma · Usuários — filtros em GRADE consistente (campos de largura igual, rótulo acima) +
   tabela larga (7 colunas) com min-width para ROLAR limpa dentro do .table-container em telas
   de baixa resolução, em vez de espremer/quebrar as colunas. */
.ua-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px 14px;
    align-items: end;
}
.ua-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ua-field .filter-select { width: 100%; box-sizing: border-box; }
.ua-field--action { justify-content: flex-end; }
.ua-field--action .btn-solicitar { width: 100%; height: 37px; white-space: nowrap; }
.ua-table { min-width: 880px; }

/* Calendário */
.week-calendar {
    background: #faf9f8;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #edebe9;
}

/* Header calendário */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-title {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
}

.calendar-nav {
    display: flex;
    gap: 6px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: #605e5c;
    cursor: pointer;
    font-size: 14px;
}

.nav-btn:hover {
    color: #0078d4;
}

/* Dias da semana */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-size: 11px;
    text-align: center;
    color: #605e5c;
    margin-bottom: 8px;
}

/* Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}


.calendar-grid span {
    text-align: center;
    padding: 8px 0;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #edebe9;
}

.calendar-grid span:hover {
    background: #f1f5f9;
}

.calendar-grid span.day-alert {
    background: #fde7e9;
    color: #a4262c;
    font-weight: 600;
}

.calendar-grid span.day-alert:hover {
    background: #f4c7c9;
}

.calendar-grid span.day-disabled {
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
    background: #fafafa;
}


/* Semana */
/* .calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding: 6px 0;
    border-radius: 6px;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #edebe9;
} */

.calendar-week span {
    font-size: 13px;
    color: #323130;
}

/* Hover */
/* .calendar-week:hover {
    background: #f3f2f1;
} */

/* Semana com pendência */
.week-alert {
    background: #fde7e9;
    border-color: #d13438;
}


.week-alert:hover {
    background: #f4c7c9;
}

.datepicker {
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    padding: 12px;
    display: none;
    z-index: 10;
}

.datepicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 8px;
}

.datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.datepicker-day {
    text-align: center;
    padding: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.datepicker-day:hover {
    background: #f1f5f9;
}

.datepicker-day.active {
    background: #2563eb;
    color: #fff;
}

.calendar-week.week-alert {
    background: #fde7e9;
    border-color: #d13438;
}

.calendar-week.week-alert:hover {
    background: #f4c7c9;
}

.calendar-week.week-alert span {
    color: #a4262c;
}

.calendar-week span.day-alert {
    background: #fde7e9;
    color: #a4262c;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

.calendar-week span.day-alert:hover {
    background: #f4c7c9;
}

.datepicker-day.day-alert {
    background: #fde7e9;
    color: #a4262c;
    font-weight: 600;
}

.datepicker-day.day-alert:hover {
    background: #f4c7c9;
}

.day-disabled {
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal {
    background: #fff;
    width: 420px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.modal-header h2 {
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

.modal-date {
    font-size: 13px;
    color: #605e5c;
    margin-bottom: 12px;
}


/* ===== DASHBOARD GESTOR ===== */
.dashboard-gestor-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-rh-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.gestor-section {
    background: var(--card-background);
    padding: 24px;
    border-radius: 8px;
    box-shadow: var(--elevation-shadow);
}

.gestor-section .section-title {
    margin-bottom: 20px;
}

/* ===== TABELA DE NÃO CONFORMIDADE ===== */
.team-table-container {
    overflow-x: auto;
    border-radius: 10px;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.team-table thead {
    background: #1e40af;
    color: white;
}

.team-table th {
    padding: 14px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #e5e7eb;
}

.team-table td {
    padding: 14px;
    text-align: center;
    border: 1px solid #e5e7eb;
    font-size: 15px;
}

.team-table tbody tr:hover {
    background-color: #f5f5f5;
}

.team-table tbody tr:last-child td {
    border-bottom: 1px solid #e5e7eb;
}

/* Badges de tipo */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
    height: 28px;
}

.badge-ausencia {
    background-color: #ffe0e0;
    color: #d32f2f;
}

.badge-atraso {
    background-color: #fff3e0;
    color: #f57c00;
}

.badge-justificativa {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-hora-extra {
    background-color: #e8f5e9;
    color: #388e3c;
}

/* Badges de Gravidade */
.badge-gravidade-alta {
    background-color: #ffebee;
    color: #c62828;
    font-weight: 600;
    min-width: 80px;
}

.badge-gravidade-media {
    background-color: #fff3e0;
    color: #e65100;
    font-weight: 600;
    min-width: 80px;
}

.badge-gravidade-baixa {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
    min-width: 80px;
}

/* Badges de Status */
.badge-pendente {
    background-color: #fff9c4;
    color: #f57f17;
    font-weight: 600;
    min-width: 140px;
}

.badge-nao-conforme {
    background-color: #ffebee;
    color: #c62828;
    font-weight: 600;
    min-width: 140px;
}

.badge-analise {
    background-color: #fff3e0;
    color: #e65100;
    font-weight: 600;
    min-width: 140px;
}

.badge-aprovado {
    background-color: #e8f5e9;
    color: #388e3c;
    font-weight: 600;
    min-width: 140px;
}

.badge-aguardando {
    background-color: #e3f2fd;
    color: #1565c0;
    font-weight: 600;
    min-width: 140px;
}

/* Forçar largura consistente para status reprovado */
.badge.badge-reprovado {
    min-width: 140px;
}

.day-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}


@media (max-width: 768px) {

    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 900;
        padding-left: 56px;
        /* espaço pro botão */
    }

    .app-container {
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    .navigation {
        position: fixed;
        left: -280px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        width: 280px;
        top: 0;
        overflow-y: auto;
        margin-left: 0 !important;
    }

    .navigation.collapsed {
        left: -280px;
    }

    .navigation:not(.collapsed) {
        left: 0;
    }

    /* Mostrar toggle button em mobile */
    .nav-toggle {
        display: flex !important;
        background-color: var(--alpargatas-blue);
        position: fixed;
        top: 7px;
        left: 16px;
        z-index: 1000;
    }

    .main-content {
        width: 100%;
        flex: 1;
        margin-left: 0;
        padding-top: 60px;
        overflow: hidden;
        min-height: 0;
        height: 100%;
    }

    .page-title {
        display: none;
    }

    .profile-info {
        justify-self: flex-end;
    }

    .adherence-grid {
        grid-template-columns: 1fr !important;
    }

    .conformidade-bars {
        flex-direction: column;
    }

    .team-table {
        font-size: 11px;
    }

    .team-table th,
    .team-table td {
        padding: 8px 12px;
    }

    .btn-action {
        padding: 4px 8px;
        margin-right: 4px;
        font-size: 10px;
    }

    .nav-content {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    .content-area {
        padding: 12px;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .adherence-card {
        padding: 16px;
        margin-bottom: 20px !important;
    }



    /* Fechar menu ao clicar em um link */
    .nav-link {
        cursor: pointer;
    }

    .nav-section-title {
        padding: 12px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {

        .bar-chart {
        scroll-snap-type: x mandatory;
    }

    .bar {
        scroll-snap-align: start;
        min-width: 48px;
        flex-shrink: 0;
    }

    .bar span {
        font-size: 0.75rem;
    }

    .bar label {
        font-size: 0.65rem;
        white-space: nowrap;
    }
    .header {
        padding: 0 12px;
    }

    .profile-info {
        width: auto;
        justify-content: flex-end;
        flex-shrink: 0;
    }

    .profile-name {
        font-size: 14px;
        white-space: nowrap;
    }

    .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
        flex-shrink: 0;
    }

    .page-title {
        display: none;
    }

    .adherence-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .adherence-card {
        padding: 12px;
    }

    .conformidade-section {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    /* Conformidade Simplificada Mobile */
    .conformidade-simplificada {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding: 16px;
    }
    
    .conformidade-valor {
        font-size: 36px;
    }
    
    .separador, .dias-max {
        font-size: 28px;
    }
    
    .farol-status {
        width: 100%;
        justify-content: center;
    }

    .nav-text {
        font-size: 13px;
    }

    .page-view {
        padding: 12px;
        gap: 15px;
    }

    .calendar {
        padding: 8px;
        gap: 4px;
        margin: 0 -4px;
    }

    .calendar .calendar-day-name {
        font-size: 10px;
        padding: 3px;
        min-height: 22px;
    }

    .calendar-day {
        font-size: 11px;
        padding: 3px;
        min-height: 28px;
    }

    .calendar-historico {
        padding: 8px;
        gap: 4px;
        margin: 0 -4px;
    }

    .calendar-historico .calendar-day-name {
        font-size: 10px;
        padding: 3px;
        min-height: 22px;
    }

    .calendar-day-historico {
        font-size: 11px;
        padding: 3px;
        min-height: 28px;
    }

    .calendar-historico {
        grid-template-columns: repeat(7, 1fr);
    }

    .team-table {
        font-size: 10px;
    }

    .team-table th,
    .team-table td {
        padding: 6px 8px;
    }
}

/* ===== HOVER BOTÕES JUSTIFICATIVA (GESTOR) ===== */
.justifications-panel .daily-override.submit-btn:hover {
    background: #ffe8a1;
    color: #7a5a2a;
}

.justifications-panel .daily-deny.submit-btn:hover {
    background: #f1b0b7;
    color: #6b1f2b;
}

@media (max-width: 768px) {
        .bar-chart {
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 32px;
        -webkit-overflow-scrolling: touch;
    }

    .bar-chart::-webkit-scrollbar {
        height: 6px;
    }

    .bar-chart::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 4px;
    }
    .overview {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
        padding: 12px;
    }

    .days-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch;
        width: 100%;
        overflow-x: visible;
    }

    .week-count {
        font-size: 1.6rem;
    }



    .just-weekly textarea {
        min-height: 140px;
    }
}

@media (max-width: 480px) {
    #detail-content h3 {
        font-size: 1rem;
        line-height: 1.3;
        padding: 0 8px;
        word-break: break-word;
    }

    .days-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .days-grid > * {
        min-width: 0;
    }

    .day-card {
        width: 100%;
        max-width: 100%;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    .day-header {
        font-size: 1rem;
        font-weight: 600;
    }

    .day-date {
        font-size: 0.85rem;
        opacity: 0.8;
    }

    .status {
        margin-top: 6px;
        font-size: 0.85rem;
    }

    .justifications-panel {
        margin-top: 20px;
        padding: 14px;
    }

    .justifications-panel small {
        display: block;
        margin-top: 6px;
        line-height: 1.4;
    }

    .just-weekly strong {
        display: block;
        margin-bottom: 6px;
        font-size: 0.9rem;
    }

    .just-weekly textarea {
        width: 100%;
        min-height: 120px;
        font-size: 0.85rem;
    }

    .submit-btn {
        width: 100%;
        margin-top: 16px;
        padding: 12px;
        font-size: 0.9rem;
    }



    .day-card {
        position: relative;
    }
}

.chart-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.chart-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #111827;
}

.chart-subtitle {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 20px;
}

/* Classes para layout do gráfico de áreas */
.chart-areas-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ===== DATE PICKER GESTOR ===== */
.date-picker-group-gestor {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.date-picker-wrapper-gestor {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.date-picker-wrapper-gestor label {
    display: block;
    color: #555;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.date-picker-input-gestor {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s ease;
}

.date-picker-input-gestor:hover {
    border-color: #0597F2;
}

.date-picker-input-gestor:focus {
    outline: none;
    border-color: #0597F2;
    box-shadow: 0 0 0 3px rgba(5, 151, 242, 0.1);
}

/* Dropdown Calendar Styles para Gestor */
.calendar-dropdown-gestor {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border: 2px solid #0597F2;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 280px;
    animation: slideDownGestor 0.2s ease;
}

.calendar-dropdown-gestor.active {
    display: block;
}

@keyframes slideDownGestor {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header-gestor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.dropdown-header-gestor button {
    background: #0597F2;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.dropdown-header-gestor button:hover {
    background: #0478c7;
}

.dropdown-header-gestor h3 {
    color: #333;
    font-size: 14px;
    flex: 1;
    text-align: center;
    margin: 0;
}

.dropdown-months-gestor {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.dropdown-month-btn-gestor {
    padding: 8px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    transition: all 0.2s ease;
}

.dropdown-month-btn-gestor:hover {
    border-color: #0597F2;
    color: #0597F2;
}

.dropdown-month-btn-gestor.active {
    background: #0597F2;
    color: white;
    border-color: #0597F2;
}

.filter-btn-gestor {
    padding: 12px 24px;
    background: #0597F2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    align-self: flex-end;
}

.filter-btn-gestor:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(5, 151, 242, 0.3);
    background: #0478c7;
}

.filter-btn-gestor:active {
    transform: translateY(0);
}

/* ===== FIM DATE PICKER GESTOR ===== */

/* Animações para mensagens de feedback */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.chart-canvas-wrapper {
    flex: 1;
    min-width: 250px;
}

.chart-canvas-container {
    position: relative;
    height: 350px;
    width: 100%;
}

canvas#graficoAreasChart {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-legend {
    width: 180px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    height: fit-content;
}

.chart-legend-title {
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 14px;
}

.checkboxes-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    height: 220px;
    padding: 0 6px 24px;
    /* 🔥 espaço para os labels */
    border-bottom: 1px solid #e5e7eb;
}


.bar {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-bottom: 22px;
    /* espaço pro label */
}





.bar::before {
    content: '';
    width: 100%;
    height: calc(var(--value) * 1%);
    background: #155e75;
    border-radius: 6px 6px 0 0;
    position: absolute;
    bottom: 0;
}


.bar span {
    position: absolute;
    bottom: calc(var(--value) * 1% + 6px);
    font-size: 20px;
    font-weight: 600;
    color: black;
    z-index: 2;
    pointer-events: none;
}



.bar label {
    position: absolute;
    bottom: 0;
    font-size: 20px;
    color: black;
    margin-top: 0;
}

/* Luiz implementação aaaaaa */

:root {
    --verde: #15803d;
    --verde-claro: #dcfce7;
    --amarelo: #b45309;
    --amarelo-claro: #fef3c7;
    --vermelho: #b91c1c;
    --vermelho-claro: #fee2e2;
    --azul: #1e40af;
    --azul-claro: #dbeafe;
    --bg: #f9fafb;
    --card: white;
    --border: #e2e8f0;
    --presencial: #1e40af;
    --remoto: #059669;
    --ausente: #991b1b;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: #1e293b;
    margin: 0;
    padding: 16px;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ESCOPADO (era `h1` global e pintava uma faixa azul em QUALQUER <h1> de QUALQUER módulo —
   este bloco veio de uma página de relatório legada; só vale dentro do .container dela) */
.container h1 {
    background: #1e40af;
    color: white;
    margin: 0;
    padding: 20px;
    text-align: center;
    font-size: clamp(1.5rem, 5vw, 1.8rem);
}

.resumo {
    padding: 14px 20px;
    background: #f0f9ff;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.alert {
    color: var(--vermelho);
    font-weight: bold;
}

.overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
}

.week-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border 0.25s ease;
    background: white;
    position: relative;
}

.week-card.active {
    transform: scale(1.05);
    border: 3px solid #2563eb;
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.25),
        0 12px 30px rgba(0, 0, 0, 0.18);
    z-index: 2;
}

.week-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.week-header {
    padding: 12px;
    font-weight: 600;
    text-align: center;
    font-size: 1.05rem;
}

.week-ok {
    background: var(--verde-claro);
    color: var(--verde);
}

/* .week-atencao {
    background: var(--amarelo-claro);
    color: var(--amarelo);
} */

.week-urgente {
    background: var(--vermelho-claro);
    color: var(--vermelho);
}

.week-justificada {
    border-color: var(--amarelo);
    background: var(--amarelo-claro);
}

.week-justificada .week-count {
    color: var(--amarelo);
}

.status-justificado {
    background: var(--amarelo-claro);
    color: var(--amarelo);
}


.week-justificado {
    background: var(--amarelo-claro);
    color: var(--amarelo);
    border-color: var(--amarelo);
}

.week-count {
    padding: 12px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
}

.justificado-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--verde);
    color: white;
    font-size: 1rem;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    display: none;
}

.week-justificado .justificado-icon {
    display: block;
}

#detail-panel {
    padding: 0 20px 40px;
    min-height: 200px;
}

.detail-content {
    display: none;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}

.detail-content.open {
    display: block;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin: 24px 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.day-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: white;
    position: relative;
}

.day-header {
    font-weight: 600;
    font-size: 1.1rem;
}

.day-date {
    font-size: 0.95rem;
    color: #64748b;
    margin: 6px 0;
}

.status {
    font-weight: bold;
    padding: 10px 6px;
    border-radius: 8px;
    font-size: 1.05rem;
}

.status-presencial {
    background: #dbeafe;
    color: var(--presencial);
}

.status-remoto {
    background: #d1fae5;
    color: var(--remoto);
}

.status-ausente {
    background: #fee2e2;
    color: var(--ausente);
}

.status-feriado {
    background: #dbeafe;
    color: #1d4ed8;
}

.day-header,
.day-date,
.status {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-card.just-btn {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.day-card.just-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220,38,38,0.25);
}

.day-card.just-btn.active {
    outline: 2px solid #15803d;
    outline-offset: 2px;
}


.day-card.edit-btn {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.day-card.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234,179,8,0.3);
}

.justifications-panel {
    margin-top: 32px;
    background: #fffbeb;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--amarelo);
}

.just-daily {
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.just-daily strong {
    display: block;
    margin-bottom: 6px;
    color: #374151;
}

.just-daily select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.just-daily textarea {
    width: 100%;
    min-height: 70px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    resize: vertical;
}

.just-weekly {
    margin-top: 24px;
}

.just-weekly strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.just-weekly textarea {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    border: 2px solid var(--amarelo);
    border-radius: 8px;
    resize: vertical;
    font-size: 1rem;
    box-sizing: border-box;
}

.submit-btn {
    margin-top: 24px;
    padding: 12px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.submit-btn:hover {
    background: #1d4ed8;
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.no-just {
    color: #64748b;
    text-align: center;
    margin: 16px 0;
    font-style: italic;
}

/* KPIs Relatórios RH - Grid Layout */
.kpi-summary {
    margin: 16px 0 24px 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    align-items: start;
}

.taxa-justificativa{
    width: 225px;
}

.kpi-row-flex {
    grid-column: 1 / -1;
    display: flex;
    gap: 16px;
    align-items: start;
}

.kpi-card.kpi-diretorias {
    flex: 0 0 66%;
    min-width: 0;
}

.kpi-row-right {
    flex: 0 0 34%;
    display: flex;
    /* flex-direction: column; */
    gap: 16px;
    min-width: 0;
}

.kpi-card {
    background: var(--card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 2px 0;
}

.kpi-card.medium .kpi-value,
.kpi-card.medium .kpi-label,
.kpi-card.medium .kpi-note {
    font-size: 0.85rem;
}

.kpi-card.medium .kpi-value {
    font-size: 1.1rem;
}

.kpi-value.small {
    font-size: 0.85rem;
    max-height: 80px;
    overflow-y: auto;
    text-align: left;
    line-height: 1.3;
}

.kpi-value.small ul {
    margin: 0;
    padding-left: 16px;
    list-style: none;
}

.kpi-value.small li {
    margin: 3px 0;
    font-size: 0.85rem;
}

.kpi-note {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 6px;
}

.kpi-low { color: var(--vermelho); font-weight:700; }
.kpi-high { color: var(--verde); font-weight:700; }

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .kpi-row-flex {
        flex-direction: column;
    }

    .kpi-card.kpi-diretorias {
        flex: 0 0 100%;
    }

    .kpi-row-right {
        flex: 0 0 100%;
        flex-direction: row;
    }

    .kpi-row-right .kpi-card {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .kpi-row-flex {
        flex-direction: column;
    }

    .kpi-card.kpi-diretorias {
        flex: 0 0 100%;
    }

    .kpi-row-right {
        flex: 0 0 100%;
        flex-direction: column;
    }

    .kpi-row-right .kpi-card {
        flex: 0 0 auto;
        min-width: 0;
        width: 100%;
    }

    .kpi-label {
        font-size: 0.65rem;
    }

    .kpi-value {
        font-size: 1.1rem;
    }

    .kpi-value.small {
        font-size: 0.75rem;
        max-height: 60px;
    }

    .kpi-note {
        font-size: 0.65rem;
    }
}

/* Responsividade para gráfico de áreas em mobile */
@media (max-width: 768px) {
    .chart-title {
        font-size: 14px;
    }

    .chart-subtitle {
        font-size: 12px;
        margin-bottom: 15px;
    }

    .chart-card {
        padding: 15px;
    }

    /* Ajustar checkboxes em tablet */
    .checkboxes-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .chart-legend {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .chart-canvas-container {
        height: 300px;
    }
}

@media (max-width: 640px) {
    /* Layout vertical em mobile */
    .chart-areas-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .chart-canvas-wrapper {
        min-width: 100%;
    }

    /* Checkboxes em tela pequena */
    .checkboxes-container {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
        max-height: 200px;
        overflow-y: auto;
    }

    /* Canvas responsivo */
    canvas#graficoAreasChart {
        max-width: 100%;
    }

    /* Altura do container do canvas em mobile */
    .chart-canvas-container {
        height: 250px;
    }

    /* Legenda do gráfico em mobile */
    .chart-legend {
        width: 100%;
        height: auto;
    }

    .chart-title {
        font-size: 13px;
    }

    .chart-subtitle {
        font-size: 11px;
    }

    .chart-card {
        padding: 12px;
    }
}


/* ===== JUSTIFICAR FALTA - COLABORADOR/GESTOR/RH ===== */
.justificar-falta-page .adherence-card {
    margin-bottom: 24px;
}

.justificar-falta-page .section-title {
    margin-bottom: 8px;
}

.justificar-falta-page .subtitle {
    color: #605e5c;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Formulário de Justificativa */
.justification-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
}

.form-group .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group .form-control:focus {
    outline: none;
    border-color: var(--alpargatas-blue);
    box-shadow: 0 0 0 2px rgba(5, 151, 242, 0.1);
}

.form-group .form-control:read-only {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Campo de exibição apenas (não editável) */
.form-control-display {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background-color: #f5f5f5;
    color: #605e5c;
    cursor: text;
    user-select: none;
    pointer-events: none;
}

.form-group select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23605e5c' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group select.form-control:not(:disabled) {
    cursor: pointer !important;
}

.form-group select.form-control option:disabled {
    color: #999;
}

.form-group textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Date picker na página Justificar Falta */
.justificar-falta-page .date-picker-wrapper-gestor {
    position: relative;
    width: 100%;
}

.justificar-falta-page .date-picker-input-gestor {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.justificar-falta-page .date-picker-input-gestor:hover {
    border-color: var(--alpargatas-blue);
}

.justificar-falta-page .date-picker-input-gestor:focus {
    outline: none;
    border-color: var(--alpargatas-blue);
    box-shadow: 0 0 0 2px rgba(5, 151, 242, 0.1);
}

.justificar-falta-page .calendar-dropdown-gestor {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-width: 320px;
    z-index: 1000;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

/* Calendário completo com dias */
.calendar-full {
    padding: 16px;
}

.calendar-full .dropdown-header-gestor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    margin-top: 12px;
}

.calendar-days-header div {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #605e5c;
    padding: 8px 4px;
}

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

.calendar-day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #323130;
}

.calendar-day-cell:not(.empty):not(.disabled):hover {
    background-color: #f0f8ff;
    color: var(--alpargatas-blue);
}

.calendar-day-cell.selected {
    background-color: var(--alpargatas-blue);
    color: white;
    font-weight: 600;
}

.calendar-day-cell.disabled {
    color: #c8c6c4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.calendar-day-cell.empty {
    cursor: default;
}

.month-year-display-gestor {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
    margin: 0;
    text-align: center;
    flex: 1;
}

.prev-month-btn-gestor,
.next-month-btn-gestor {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #605e5c;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.prev-month-btn-gestor:hover:not(:disabled),
.next-month-btn-gestor:hover:not(:disabled) {
    background-color: #f0f0f0;
}

/* Upload de arquivo */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload .upload-text {
    display: block;
    padding: 32px 16px;
    border: 2px dashed #d1d1d1;
    border-radius: 4px;
    text-align: center;
    color: #605e5c;
    font-size: 14px;
    background-color: #fafafa;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload:hover .upload-text {
    border-color: var(--alpargatas-blue);
    background-color: #f0f8ff;
    color: var(--alpargatas-blue);
}

/* Ações do formulário */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
}

/* Tabela de justificativas enviadas */
.justificar-falta-page .team-table-container {
    margin-top: 16px;
}

.justificar-falta-page .team-table {
    width: 100%;
    border-collapse: collapse;
}

.justificar-falta-page .team-table thead {
    background-color: #f5f5f5;
}

.justificar-falta-page .team-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #323130;
    border-bottom: 2px solid #d1d1d1;
}

.justificar-falta-page .team-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #323130;
    border-bottom: 1px solid #edebe9;
}

.justificar-falta-page .team-table tbody tr {
    transition: background-color 0.2s ease;
}

.justificar-falta-page .team-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Limitar tamanho da coluna de observações */
.obs-column {
    max-width: 300px;
}

.obs-text {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.obs-text:hover {
    white-space: normal;
    overflow: visible;
}

/* Responsividade */
@media (max-width: 768px) {
    .justificar-falta-page .form-actions {
        flex-direction: column;
    }

    .justificar-falta-page .btn-solicitar,
    .justificar-falta-page .btn-secondary {
        width: 100%;
    }

    .justificar-falta-page .team-table-container {
        overflow-x: auto;
    }

    .justificar-falta-page .team-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .justificar-falta-page .adherence-card {
        padding: 16px;
    }

    .justificar-falta-page .section-title {
        font-size: 18px;
    }

    .justificar-falta-page .subtitle {
        font-size: 13px;
    }

    .justificar-falta-page .form-group label {
        font-size: 13px;
    }

    .justificar-falta-page .form-group .form-control {
        font-size: 13px;
        padding: 8px 10px;
    }

    .justificar-falta-page .calendar-dropdown-gestor {
        max-width: 100%;
        left: 0;
        right: 0;
    }

    .calendar-full {
        padding: 12px;
    }

    .calendar-days-header div {
        font-size: 11px;
        padding: 6px 2px;
    }

    .calendar-day-cell {
        font-size: 13px;
    }

    .month-year-display-gestor {
        font-size: 13px;
    }
}

/* ============================================================
   UI STATE — loading / empty / error
   ============================================================ */

.ui-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 16px;
    text-align: center;
    color: #605e5c;
    font-size: 14px;
    min-height: 80px;
    width: 100%;
    box-sizing: border-box;
}

/* Loading */
.ui-state--loading {
    flex-direction: row;
    gap: 10px;
    padding: 16px;
    color: #0597F2;
    font-size: 13px;
}
.ui-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #cce4f7;
    border-top-color: #0597F2;
    border-radius: 50%;
    animation: ui-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes ui-spin {
    to { transform: rotate(360deg); }
}

/* Empty */
.ui-state--empty .ui-state__icon  { font-size: 28px; line-height: 1; }
.ui-state--empty .ui-state__msg   { color: #a0a0a0; font-size: 13px; }

/* Error */
.ui-state--error                  { color: #a4262c; }
.ui-state--error .ui-state__icon  { font-size: 22px; }
.ui-state--error .ui-state__msg   { font-size: 13px; }
.ui-retry-btn {
    margin-top: 6px;
    padding: 5px 16px;
    background: #fff;
    border: 1px solid #a4262c;
    border-radius: 4px;
    color: #a4262c;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s;
}
.ui-retry-btn:hover { background: #fdf3f3; }

/* Nav items controlados por role: ocultos por padrão, visíveis quando habilitados */
.nav-item:has(.nav-link-role-gated:not(.role-enabled)) {
    display: none;
}
.nav-link-role-gated {
    /* sem estilo de desabilitado — o item pai some completamente */
}
.nav-link-role-gated.role-enabled {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}


/* ============================================================
   NOTIFICAÇÕES — SINO + PAINEL + INBOX GESTOR
   ============================================================ */
.notif-bell-wrap {
    position: relative;
    margin-right: 12px;
}
.notif-bell-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    position: relative;
    line-height: 1;
    transition: background .15s;
}
.notif-bell-btn:hover { background: #f3f4f6; }
.notif-bell-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
}
.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 400px;
    max-height: 520px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.13);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}
.notif-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
}
.notif-panel-close:hover { background: #f3f4f6; color: #374151; }
.notif-panel-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;            /* permite o scroll dentro do flex container */
}
/* Ações do cabeçalho do painel · Limpar todas + fechar */
.notif-panel-actions { display: flex; align-items: center; gap: 6px; }
.notif-panel-clear {
    background: none; border: none; cursor: pointer;
    color: #6b7280; font-size: 12px; font-weight: 600;
    padding: 3px 8px; border-radius: 6px;
}
.notif-panel-clear:hover { background: #f3f4f6; color: #374151; }
/* Botão excluir por notificação (revela no hover; sempre visível em toque) */
.notif-panel-body .notif-card-del {
    flex-shrink: 0; align-self: flex-start;
    background: none; border: none; cursor: pointer;
    color: #c0c4cc; font-size: 13px; line-height: 1;
    padding: 4px 6px; border-radius: 6px;
    opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.notif-panel-body .notif-card:hover .notif-card-del,
.notif-panel-body .notif-card:focus-within .notif-card-del { opacity: 1; }
.notif-panel-body .notif-card-del:hover { background: #fee2e2; color: #b91c1c; }
@media (hover: none) { .notif-panel-body .notif-card-del { opacity: 1; } }
/* Mobile (SOTA): alvo de toque maior para excluir/limpar notificações. */
@media (max-width: 768px) {
  .notif-panel-body .notif-card-del { padding: 8px 10px; font-size: 16px; }
  .notif-panel-clear { padding: 7px 12px; min-height: 40px; }
}

/* Inbox card no dashboard do gestor */
.notif-inbox-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.notif-inbox-count {
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Card de mensagem individual */
.notif-msg-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: #fafafa;
    transition: border-color .15s;
}
.notif-msg-card:last-child { margin-bottom: 0; }
.notif-msg-card.unread { border-left: 3px solid #0597F2; background: #f0f9ff; }
.notif-msg-card.processed { opacity: .6; }
.notif-msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}
.notif-msg-sender {
    font-weight: 600;
    color: #111827;
    font-size: 13px;
}
.notif-msg-date-chip {
    background: #f3f4f6;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 11px;
}
.notif-msg-type-chip {
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 11px;
}
.notif-msg-body {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 8px 0;
    white-space: pre-wrap;
}
.notif-msg-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}
.notif-msg-actions input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
}
.btn-aprovar {
    padding: 5px 14px;
    background: #15803d;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-aprovar:hover { background: #166534; }
.btn-aprovar:disabled { opacity: .5; cursor: not-allowed; }
.btn-rejeitar {
    padding: 5px 14px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-rejeitar:hover { background: #b91c1c; }
.btn-rejeitar:disabled { opacity: .5; cursor: not-allowed; }

/* Botão editar justificativa no day-card */
.edit-justif-btn {
    margin-top: 4px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity .15s, transform .15s;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
}
.edit-justif-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    background: #f0f9ff;
}


/* ── AdminLTE-style Profile Dropdown ─────────────────────────────────────── */
/* ── Teams-style Profile Card ─────────────────────────────────────────────── */

.profile-dropdown-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Backdrop (fecha ao clicar fora).
   z-index ABAIXO do header (.header.teams-header é position:fixed z-index:100 no desktop, o que
   cria um stacking context; o card .tpc vive DENTRO do header, então seu z-index 9999 só vale
   dentro desse contexto z=100). Se o backdrop ficasse em 9998 (contexto raiz), cobriria o header
   E o card, interceptando todos os cliques. Mantendo o backdrop < 100, o header e o card ficam
   por cima; o dismiss ainda funciona (cobre o conteúdo + o listener global de clique). */
.tpc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: transparent;
    cursor: default;
}
.tpc-backdrop.open { display: block; }

/* Card container */
.tpc {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
    z-index: 9999;
    overflow: hidden;
    animation: tpcIn .18s cubic-bezier(.32,1,.24,1);
    border: 1px solid #e0e0e0;
}
.tpc.open { display: block; }

/* MOBILE: no celular o card podia ultrapassar a altura da tela SEM rolagem, deixando o fim (seletor de
   IDIOMA + logout) inacessível. NÃO mudamos posição/empilhamento (o card precisa continuar ACIMA do
   backdrop, senão o toque no <select> cai no backdrop e FECHA o card) — só o tornamos ROLÁVEL e com
   largura segura. Assim o idioma fica alcançável e o combo abre normalmente. */
@media (max-width: 768px) {
  .tpc {
    max-height: 80vh; max-height: 80dvh;
    overflow-x: hidden; overflow-y: auto;
    width: min(320px, calc(100vw - 24px));
  }
  /* No mobile o backdrop fica ACIMA do card (por contexto de empilhamento) → o toque no <select> caía
     NELE e fechava o card, sem abrir a lista nativa. Tornando-o só visual (pointer-events:none), os toques
     ATRAVESSAM até o card (o combo abre) e o fechar-ao-tocar-fora segue pelo listener de clique no document. */
  .tpc-backdrop { pointer-events: none; }
}

@keyframes tpcIn {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* Seta superior */
.tpc::before {
    content: '';
    position: absolute;
    top: -6px; right: 18px;
    width: 12px; height: 12px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    border-top: 1px solid #e0e0e0;
    transform: rotate(45deg);
    z-index: 1;
}

/* ── Cover / hero ── */
.tpc-cover {
    position: relative;
    height: 80px;
    margin-bottom: 44px;          /* espaço para o avatar transbordar */
}
.tpc-cover-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0078d4 0%, #2ea8e0 60%, #50e6ff 100%);
    /* padrão geométrico sutil, como o Teams */
    background-image:
        linear-gradient(135deg, #0078d4 0%, #1a4fa8 50%, #0f2d6b 100%);
}
/* Variante com padrão de pontos */
.tpc-cover-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 20px 20px;
}

.tpc-avatar-ring {
    position: absolute;
    bottom: -40px;
    left: 20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
    background: #fff;
    z-index: 2;
}

.tpc-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #0078d4, #2ea8e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: -1px;
}
.tpc-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Bolinha de presença */
.tpc-presence {
    position: absolute;
    bottom: 4px; right: 4px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #92c353;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    cursor: default;
}
.tpc-presence.away    { background: #f8d22a; }
.tpc-presence.busy    { background: #c4314b; }
.tpc-presence.offline { background: #8a8a8a; }

/* Tooltip da bolinha removido — informação exibida na linha de uptime abaixo do nome */

/* ── Identidade ── */
.tpc-identity {
    padding: 0 20px 12px;
}
.tpc-name {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tpc-jobtitle {
    font-size: 12px;
    color: #616161;
    margin-top: 3px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tpc-role-badge {
    display: inline-block;
    margin-top: 7px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: #eff6fc;
    color: #0078d4;
    border: 1px solid #c7e0f4;
    font-family: 'Segoe UI', system-ui, sans-serif;
}
/* Variantes de badge por role */
.tpc-role-badge[data-role="manager"]  { background: #f0f7ed; color: #107c10; border-color: #bad8a7; }
.tpc-role-badge[data-role="hr"]       { background: #fdf3f0; color: #c94f0a; border-color: #f4c7b1; }
.tpc-role-badge[data-role="admin"]    { background: #f3f0fc; color: #6b2fa0; border-color: #d3b8f0; }
.tpc-role-badge[data-role="employee"] { background: #eff6fc; color: #0078d4; border-color: #c7e0f4; }

/* ── Linha de uptime no cartão de perfil ── */
.tpc-uptime {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}
.tpc-uptime-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #8a8a8a; /* offline padrão */
}
.tpc-uptime-dot.online  { background: #92c353; }
.tpc-uptime-dot.offline { background: #8a8a8a; }

/* ── Quick actions ── */
.tpc-actions {
    display: flex;
    gap: 8px;
    padding: 0 20px 14px;
}
.tpc-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    background: #fff;
    color: #424242;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Segoe UI', system-ui, sans-serif;
    cursor: pointer;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.tpc-action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.tpc-action-btn:hover {
    background: #f5f5f5;
    border-color: #b0b0b0;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.tpc-action-btn--primary {
    background: #0078d4;
    border-color: #0078d4;
    color: #fff;
}
.tpc-action-btn--primary:hover {
    background: #106ebe;
    border-color: #106ebe;
}

/* ── Divider ── */
.tpc-divider {
    height: 1px;
    background: #ededed;
    margin: 0;
}

/* ── Section: campos org ── */
.tpc-section {
    padding: 6px 0;
}
.tpc-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 20px;
    cursor: default;
    transition: background .1s;
}
.tpc-field:hover { background: #f8f8f8; }

.tpc-field-icon {
    width: 16px; height: 16px;
    flex-shrink: 0;
    color: #616161;
    margin-top: 2px;
}
.tpc-field-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.tpc-field-label {
    font-size: 10px;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-weight: 600;
    margin-bottom: 1px;
}
.tpc-field-value {
    font-size: 13px;
    color: #242424;
    font-family: 'Segoe UI', system-ui, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tpc-field-value--link {
    color: #0078d4;
    cursor: pointer;
}
.tpc-field-value--link:hover { text-decoration: underline; }

/* ── Footer ── */
.tpc-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 20px 14px;
}
/* Botões do rodapé do perfil (Entrar com Microsoft / Sair) · MESMA base = MESMA altura, empilhados
   com gap consistente. Diferem só na cor/ícone. (Antes o "Entrar" era inline e o "Sair" por classe
   → alturas/larguras diferentes, feio no mobile.) */
.tpc-entra, .tpc-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.1;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    box-sizing: border-box;
}
.tpc-entra { color: #242424; }
.tpc-logout { color: #c4314b; }
.tpc-entra svg, .tpc-logout svg { width: 15px; height: 15px; flex-shrink: 0; }
.tpc-logout svg { color: #c4314b; }
.tpc-entra:hover { background: #f5f5f5; border-color: #c1c1c1; }
.tpc-logout:hover { background: #fdf3f4; border-color: #c4314b; }

/* Mobile: JANELA compacta ancorada no topo-direito (abaixo do avatar), não um
   bottom-sheet esticado · breakpoint alinhado ao do app = 768px */
@media (max-width: 768px) {
    .tpc {
        position: fixed;
        top: 56px; right: 8px; left: auto; bottom: auto;
        width: min(300px, calc(100vw - 24px));
        max-height: calc(100dvh - 80px);
        overflow-y: auto;
        border-radius: 12px;
        border: 1px solid rgba(0,0,0,.08);
        box-shadow: 0 12px 40px rgba(0,0,0,.24);
        animation: tpcDrop .18s cubic-bezier(.32,1,.24,1);
    }
    .tpc::before { display: none; }
    @keyframes tpcDrop {
        from { transform: translateY(-8px); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }
    .profile-dropdown-wrap { margin-left: 0; }

    /* Controles NÃO esticados · combo de idioma e botão Sair com largura natural */
    .tpc #tpcLang { width: auto !important; min-width: 150px; }
    /* Rodapé empilhado (coluna) · botões largura total e MESMA altura, sem esticar feio. */
    .tpc-footer { padding: 10px 16px 14px; }
}


/* ── Campo just-daily inline no mobile (após o card clicado) ──────────────── */
@media (max-width: 480px) {
    .days-grid .just-daily {
        background: #f0f9ff;
        border: 1px solid #bae6fd;
        border-radius: 10px;
        padding: 14px;
        margin: 0;
        animation: fadeInDown .18s ease;
    }

    @keyframes fadeInDown {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ── Mobile: oculta painel de justificativas abaixo dos cards ─────────────── */
@media (max-width: 480px) {
    .justifications-panel {
        display: none !important;
    }
    .days-grid .just-daily .just-daily-save-inline {
        display: block;
    }
}

/* ── Toast / Snackbar ─────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: max-content;
    max-width: calc(100vw - 32px);
}

.toast {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .22s ease, transform .22s ease;
    pointer-events: auto;
    cursor: pointer;
    max-width: 100%;
    text-align: center;
    line-height: 1.4;
}

.toast.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-info    { background: #0597F2; }

@media (max-width: 480px) {
    #toast-container {
        bottom: 80px; /* acima da nav mobile */
        width: calc(100vw - 32px);
    }
    .toast { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   PRESENCE MONITOR — Tabela de monitoramento admin
   ═══════════════════════════════════════════════════════════════ */

.presence-monitor-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.pm-filter-group { display: flex; flex-direction: column; gap: 4px; }
.pm-filter-label { font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.pm-filter-input,
.pm-filter-select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #111827;
    background: #fff;
    min-width: 160px;
}
.pm-filter-input:focus, .pm-filter-select:focus { outline: none; border-color: #0597F2; box-shadow: 0 0 0 2px rgba(5,151,242,.15); }
.pm-filter-toggle { justify-content: center; }
.pm-filter-actions { flex-direction: row; gap: 8px; align-items: flex-end; }

/* Toggle switch */
.pm-toggle-wrap { position: relative; display: inline-block; width: 40px; height: 22px; }
.pm-toggle-wrap input { opacity: 0; width: 0; height: 0; }
.pm-toggle-slider {
    position: absolute; inset: 0;
    background: #d1d5db; border-radius: 22px;
    cursor: pointer; transition: .2s;
}
.pm-toggle-slider::before {
    content: ''; position: absolute;
    width: 16px; height: 16px;
    left: 3px; top: 3px;
    background: #fff; border-radius: 50%;
    transition: .2s;
}
.pm-toggle-wrap input:checked + .pm-toggle-slider { background: #0597F2; }
.pm-toggle-wrap input:checked + .pm-toggle-slider::before { transform: translateX(18px); }

/* Sumário */
.pm-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.pm-summary-item {
    flex: 1;
    min-width: 90px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.pm-s-value { font-size: 22px; font-weight: 700; color: #111827; }
.pm-s-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.pm-s-online  .pm-s-value { color: #059669; }
.pm-s-office  .pm-s-value { color: #0597F2; }
.pm-s-remote  .pm-s-value { color: #7c3aed; }
.pm-s-offline .pm-s-value { color: #9ca3af; }

/* Tabela */
.pm-table-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow-x: auto;            /* 10 colunas: ROLA na horizontal em vez de CLIPAR (era overflow:hidden = ilegível) */
    -webkit-overflow-scrolling: touch;
}
.pm-empty {
    padding: 40px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}
.pm-table {
    width: 100%;
    min-width: 860px;           /* mantém as 10 colunas LEGÍVEIS; abaixo disso a .pm-table-wrap rola */
    border-collapse: collapse;
    font-size: 13px;
}
.pm-table thead th {
    background: #f3f4f6;
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.pm-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}
.pm-table tbody tr:hover { background: #f9fafb; }
.pm-table tbody tr:last-child { border-bottom: none; }
.pm-table td {
    padding: 10px 12px;
    vertical-align: middle;
    color: #374151;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dot de status */
.pm-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}
.pm-status-dot::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pm-status-dot.online::before   { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.pm-status-dot.offline::before  { background: #9ca3af; }

/* Badge de classificação */
.pm-class-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.pm-class-badge.office  { background: #eff6ff; color: #1d4ed8; }
.pm-class-badge.remote  { background: #f5f3ff; color: #6d28d9; }
.pm-class-badge.vpn     { background: #fef3c7; color: #92400e; }
.pm-class-badge.offline { background: #f3f4f6; color: #9ca3af; }
.pm-class-badge.absent  { background: #fef2f2; color: #991b1b; }

/* Dot de status sem rótulo (usado na legenda) — mantém só o ponto. */
.pm-status-dot:empty { gap: 0; }

/* VPN badge */
.pm-vpn-yes { color: #d97706; font-weight: 600; font-size: 12px; }
.pm-vpn-no  { color: #9ca3af; font-size: 12px; }

/* Cabeçalho da página · título + assinatura "ao vivo" pulsante */
.pm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.pm-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.pm-live-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16,185,129,.5);
    animation: pm-pulse 1.8s infinite;
}
@keyframes pm-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
    70%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* Legenda de status/classificação */
.pm-legend {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    gap: 14px;
    align-items: center;
}
.pm-legend-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pm-legend .legend-item { font-size: 12px; color: #374151; }

/* Cards (mobile) — escondidos no desktop; a tabela domina a visão larga. */
.pm-cards { display: none; }
.pm-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.pm-card:last-child { margin-bottom: 0; }
.pm-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pm-card-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pm-card-name { font-size: 14px; font-weight: 600; color: #111827; }
.pm-card-email { font-size: 12px; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}
.pm-card-grid > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pm-card-k { font-size: 10px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; }
.pm-card-v { font-size: 13px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tabela de 10 colunas só é legível em tela larga: abaixo de 1024px vira cards (antes 768 — deixava
   tablet/laptop estreito com a tabela clipada e ilegível). */
@media (max-width: 1024px) {
    .pm-table-wrap { display: none; }
    .pm-cards { display: block; }
}
@media (max-width: 768px) {
    .pm-filter-input, .pm-filter-select { min-width: 130px; }
    .pm-summary-item { min-width: calc(50% - 6px); }
}

/* ── Nav: botão Sair no rodapé do menu lateral ─────────────────────────────── */
.nav-logout-footer {
    margin-top: auto;
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}

.nav-logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: rgba(255,255,255,.75);
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-align: left;
}
.nav-logout-btn:hover,
.nav-logout-btn:active {
    background: rgba(196,49,75,.25);
    color: #ff8fa3;
}
.nav-logout-btn svg {
    flex-shrink: 0;
    opacity: .8;
}

/* Quando menu colapsado: mostra só ícone */
.navigation.collapsed .nav-logout-btn .nav-text { display: none; }
.navigation.collapsed .nav-logout-btn { justify-content: center; }

/* ── Mobile: .tpc · só reforça o scroll (posição = bottom-sheet acima) ───── */
@media (max-width: 768px) {
    .tpc {
        max-height: 85dvh;
        overflow-y: auto;
    }
}

/* ── Presença: linha offline esmaecida ───────────────────────────────────── */
.pm-row-offline { opacity: .55; }
.pm-row-offline:hover { opacity: 1; }

/* ── Presença: colunas compactas para caber tudo ─────────────────────────── */
.pm-table th, .pm-table td { white-space: nowrap; }
.pm-table td:nth-child(6) { /* Interface — única que pode quebrar */
    white-space: normal;
    max-width: 180px;
}

/* ── Classes utilitárias para substituir inline styles (CSP compliance) ── */
.is-hidden          { display: none !important; }
.flex-1             { flex: 1; }
.mt-8               { margin-top: 8px; }
.mt-10              { margin-top: 10px; }
.text-muted         { color: #9ca3af; }
.text-sm            { font-size: 12px; }
.text-nowrap        { white-space: nowrap; }
.btn-nowrap         { white-space: nowrap; }
.btn-self-start     { align-self: flex-start; }
.btn-sm             { padding: 6px 14px; font-size: 13px; }
.btn-sm.btn-solicitar { padding: 6px 18px; }
.input-full         { width: 100%; box-sizing: border-box; }
.tbody-clickable    { cursor: pointer; }

/* Admin card variantes */
.admin-card--future {
    border: 2px dashed #e5e7eb;
    background: #fafafa;
}
.admin-card-header--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* Form helpers */
.form-label-sm {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 6px;
}
.form-hint-sm {
    font-size: 12px;
    color: #6b7280;
    margin: 8px 0 0;
}
.admin-form-row--bottom {
    align-items: flex-end;
    gap: 12px;
}

/* Chart layout */
.chart-with-legend  { display: flex; gap: 16px; align-items: flex-start; }
/* Canvas RESPONSIVO · escala para a largura do container (nunca estoura) · a
   resolução do bitmap é definida no setupCanvas, o CSS só ajusta a exibição. */
.chart-with-legend .chart-canvas-fixed { flex: 1; min-width: 0; }
.app-container.teams-layout .chart-canvas-fixed { height: auto; }
.app-container.teams-layout .chart-canvas-fixed canvas { display: block; width: 100%; height: auto; max-width: 100%; }
.chart-legend-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}
.legend-title-sm    { font-size: 12px; font-weight: 700; color: #242424; margin-bottom: 10px;
    padding-bottom: 6px; border-bottom: 1px solid #e5e7eb; text-transform: uppercase; letter-spacing: .04em; }

/* Mobile: gráfico em cima, legenda (quadro "Membros") embaixo · largura total. */
@media (max-width: 768px) {
  .app-container.teams-layout .chart-with-legend { flex-direction: column; gap: 12px; }
  .app-container.teams-layout .chart-with-legend .evolucao-checkboxes-panel {
    max-width: none; width: 100%; max-height: none;
  }
}

/* Evolução checkboxes panel */
.evolucao-checkboxes-panel {
    min-width: 160px;
    max-width: 200px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    max-height: 320px;
    overflow-y: auto;
}

/* Section title variante */
.section-title--tight { margin-bottom: 4px; }

/* Painel state message */
.painel-state-msg {
    padding: 32px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}
#policyLoadState.painel-state-msg { padding: 20px; font-size: 13px; }

/* Routine result */
.routine-result { margin-top: 12px; font-size: 13px; color: #374151; }

/* Presence monitor filter selects */
.pm-filter-select--wide { min-width: 180px; }

/* Minhas Justificativas */
.mj-resumo  { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-label { font-size: 13px; color: #605e5c; font-weight: 500; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* Future flags section */
.future-flags-list  { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.future-flag-item   { padding: 12px 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; }
.future-flag-title  { font-weight: 600; font-size: 13px; color: #6b7280; }
.future-flag-desc   { font-size: 12px; color: #9ca3af; margin-top: 4px; }

/* Loading placeholder */
.loading-placeholder { padding: 20px; text-align: center; color: #6b7280; }

/* === Framework · Toolbar de exportação de relatórios ========================== */
.app-container.teams-layout .report-export-toolbar {
  display: inline-flex; gap: 6px; flex-wrap: wrap;
}
.app-container.teams-layout .report-export-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: #fff;
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  font-size: 12px; font-weight: 500;
  color: #424242;
  cursor: pointer;
  transition: all .12s ease;
}
.app-container.teams-layout .report-export-btn:hover {
  background: #fafafa; border-color: var(--product-accent, #003B6F); color: var(--product-accent, #003B6F);
}
/* Menu "Salvar como…" (Excel / Word) */
.app-container.teams-layout .report-save { position: relative; }
.app-container.teams-layout .report-save-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50;
  min-width: 168px; padding: 4px;
  background: #fff; border: 1px solid #d1d1d1; border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  display: flex; flex-direction: column; gap: 2px;
}
.app-container.teams-layout .report-save-menu[hidden] { display: none; }
.app-container.teams-layout .report-save-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; background: none; border: 0; border-radius: 4px;
  font-size: 12.5px; color: #333; cursor: pointer; text-align: left;
}
.app-container.teams-layout .report-save-menu button:hover {
  background: #f0f4f8; color: var(--product-accent, #003B6F);
}

/* === Framework · Página Integrações (cross-product) ============================ */
.app-container.teams-layout .integ-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.app-container.teams-layout .integ-card { padding: 14px 16px; background: #fff; border: 1px solid #ebebeb; border-radius: 6px; display: flex; flex-direction: column; gap: 8px; }
.app-container.teams-layout .integ-card-head { display: flex; align-items: center; gap: 10px; }
.app-container.teams-layout .integ-status { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #c1c1c1; }
.app-container.teams-layout .integ-status-online   { background: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.18); }
.app-container.teams-layout .integ-status-degraded { background: #c47e00; box-shadow: 0 0 0 2px rgba(196,126,0,.18); }
.app-container.teams-layout .integ-status-offline  { background: #a4262c; box-shadow: 0 0 0 2px rgba(164,38,44,.18); }
.app-container.teams-layout .integ-status-unknown  { background: #c1c1c1; }
.app-container.teams-layout .integ-title-block { flex: 1; min-width: 0; }
.app-container.teams-layout .integ-title { font-size: 13.5px; font-weight: 600; color: #242424; }
.app-container.teams-layout .integ-sub   { font-size: 11.5px; color: #707070; margin-top: 1px; }
.app-container.teams-layout .integ-status-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: #f3f4f6; color: #707070; }
.app-container.teams-layout .integ-status-label.is-online   { background: #ebf8f0; color: #0f6b3e; }
.app-container.teams-layout .integ-status-label.is-degraded { background: #fff4ce; color: #835900; }
.app-container.teams-layout .integ-status-label.is-offline  { background: #fde7e9; color: #a4262c; }
.app-container.teams-layout .integ-status-label.is-unknown  { background: #f3f4f6; color: #707070; }
.app-container.teams-layout .integ-detail { font-size: 12.5px; color: #424242; }
.app-container.teams-layout .integ-meta { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: #707070; }
.app-container.teams-layout .integ-meta-line strong { color: #424242; font-weight: 600; }
.app-container.teams-layout .integ-metrics { display: flex; gap: 8px; padding-top: 6px; border-top: 1px dashed #ebebeb; }
.app-container.teams-layout .integ-metric { font-size: 11.5px; color: #707070; padding: 3px 8px; background: #fafafa; border-radius: 4px; }
.app-container.teams-layout .integ-metric.is-warn { color: #835900; background: #fff4ce; }

/* Import SAP · dropzone + barra de ações + staged */
.app-container.teams-layout .integ-dropzone {
  border: 2px dashed #c3ccd6; border-radius: 12px; padding: 28px; text-align: center;
  cursor: pointer; transition: .15s; background: #f8fafc;
}
.app-container.teams-layout .integ-dropzone.is-drag { border-color: #2563eb; background: #eff6ff; }
.app-container.teams-layout .integ-dropzone-icon { font-size: 28px; line-height: 1; }
.app-container.teams-layout .integ-dropzone-title { margin-top: 8px; font-weight: 600; color: #334155; }
.app-container.teams-layout .integ-dropzone-hint { font-size: 13px; color: #64748b; }
.app-container.teams-layout .integ-staged { margin-top: 12px; }
.app-container.teams-layout .integ-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.app-container.teams-layout .integ-result { margin-top: 12px; }
.app-container.teams-layout .integ-btn-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* === Framework · Console de Permissões (PAP) ================================ */
/* Barra "escolher/criar tag" em grade: campos de largura igual + botão ao fim. */
.app-container.teams-layout .pc-tagbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.app-container.teams-layout .pc-tagbar-field { display: flex; flex-direction: column; gap: 5px; min-width: 200px; }
.app-container.teams-layout .pc-tagbar-field--grow { flex: 1; }
.app-container.teams-layout .pc-tagbar-field .form-control { width: 100%; box-sizing: border-box; }
.app-container.teams-layout .pc-tagbar .admin-btn { align-self: flex-end; white-space: nowrap; }
.app-container.teams-layout .pc-app-row { max-width: 360px; }
.app-container.teams-layout .pc-remove { background: #fff; color: #c0392b; border: 1px solid #f3dada; }
/* Botão excluir tag (ghost destrutivo) — só visível p/ tags custom. */
.app-container.teams-layout .pc-delete-btn {
  align-self: flex-end; white-space: nowrap; padding: 9px 14px; border-radius: 6px; font-weight: 600;
  background: #fff; color: #c0392b; border: 1px solid #f3dada; cursor: pointer;
}
.app-container.teams-layout .pc-delete-btn:hover { background: #fdf2f2; border-color: #e9b9b9; }
/* Resumo cross-app (features que a tag enxerga em todas as apps). */
.app-container.teams-layout .pc-ov-app { padding: 10px 0; border-bottom: 1px solid #f1f1f1; }
.app-container.teams-layout .pc-ov-app:last-child { border-bottom: 0; }
.app-container.teams-layout .pc-ov-app-name { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.app-container.teams-layout .pc-ov-feats { display: flex; flex-wrap: wrap; gap: 6px; }
.app-container.teams-layout .pc-ov-feat {
  font-size: 12px; color: var(--product-accent, #2B6394);
  background: color-mix(in srgb, var(--product-accent, #2B6394) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--product-accent, #2B6394) 22%, #fff);
  padding: 3px 9px; border-radius: 999px;
}
.app-container.teams-layout .pc-cell-actions { text-align: right; }

/* === Framework · ABAC Playground ============================================= */
.app-container.teams-layout .abac-subject { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.app-container.teams-layout .abac-subject code { background: #f3f4f6; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; }
.app-container.teams-layout .abac-k { display: inline-block; min-width: 130px; color: #707070; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.app-container.teams-layout .abac-empty { color: #9ca3af; font-style: italic; }
.app-container.teams-layout .abac-scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.app-container.teams-layout .abac-scenario { text-align: left; padding: 10px 12px; background: #fafafa; border: 1px solid #ebebeb; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: all .12s; }
.app-container.teams-layout .abac-scenario:hover { border-color: var(--product-accent, #003B6F); background: #fff; }
.app-container.teams-layout .abac-scenario-label { font-size: 12.5px; font-weight: 600; color: #242424; }
.app-container.teams-layout .abac-scenario-hint { font-size: 11px; color: #707070; }
.app-container.teams-layout .abac-decision { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 8px; }
.app-container.teams-layout .abac-decision.abac-allow { background: #ebf8f0; border: 1px solid #b7e4c8; }
.app-container.teams-layout .abac-decision.abac-deny  { background: #fde7e9; border: 1px solid #f2bcc3; }
.app-container.teams-layout .abac-decision-badge { font-size: 15px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.app-container.teams-layout .abac-allow .abac-decision-badge { color: #0f6b3e; }
.app-container.teams-layout .abac-deny  .abac-decision-badge { color: #a4262c; }
.app-container.teams-layout .abac-decision-reason { font-size: 13px; color: #242424; }
.app-container.teams-layout .abac-decision-policy { font-size: 11.5px; color: #707070; margin-top: 2px; }
.app-container.teams-layout .abac-request { margin-top: 12px; }
.app-container.teams-layout .abac-request summary { font-size: 12px; color: #707070; cursor: pointer; }
.app-container.teams-layout .abac-request pre { background: #1e1e1e; color: #e6e6e6; padding: 12px; border-radius: 6px; font-size: 11.5px; overflow-x: auto; margin-top: 8px; }

/* === Framework · Perfis de acesso (autoridade como dado) ===================== */
.app-container.teams-layout .ap-mode { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.app-container.teams-layout .ap-mode-shadow { background: #fff4e5; color: #835900; border: 1px solid #f5d9a8; }
.app-container.teams-layout .ap-mode-on { background: #ebf8f0; color: #0f6b3e; border: 1px solid #b7e4c8; }
.app-container.teams-layout .ap-mode-hint { background: #fafafa; }
.app-container.teams-layout .ap-mode-hint-on { background: #ebf8f0; border-color: #b7e4c8; }
.app-container.teams-layout .ap-caps { display: flex; flex-direction: column; gap: 12px; }
.app-container.teams-layout .ap-cap { border: 1px solid #ebebeb; border-radius: 8px; padding: 12px 14px; background: #fff; }
.app-container.teams-layout .ap-cap-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.app-container.teams-layout .ap-action { font-size: 11px; color: #707070; background: #f3f3f3; padding: 1px 6px; border-radius: 4px; }
.app-container.teams-layout .ap-cap-desc { font-size: 12px; color: #707070; }
.app-container.teams-layout .ap-cap-profiles { display: flex; flex-direction: column; gap: 6px; }
.app-container.teams-layout .ap-profile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 10px; background: #fafafa; border: 1px solid #eee; border-radius: 6px; }
.app-container.teams-layout .ap-profile.ap-inactive { opacity: .5; }
.app-container.teams-layout .ap-profile-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-container.teams-layout .ap-profile-name { font-size: 13px; font-weight: 600; color: #242424; }
.app-container.teams-layout .ap-profile-grants { font-size: 11.5px; color: #707070; }
.app-container.teams-layout .ap-role { background: #e5efff; color: #003B6F; }
.app-container.teams-layout .ap-profile-actions { display: flex; gap: 10px; white-space: nowrap; }
.app-container.teams-layout .ap-link { background: none; border: none; padding: 0; font-size: 12px; color: var(--product-accent, #003B6F); cursor: pointer; }
.app-container.teams-layout .ap-link:hover { text-decoration: underline; }
.app-container.teams-layout .ap-link.ap-danger { color: #a4262c; }
.app-container.teams-layout .ap-empty { font-size: 12px; color: #9ca3af; font-style: italic; }
.app-container.teams-layout .ap-msg { margin-top: 10px; font-size: 12.5px; padding: 8px 10px; border-radius: 6px; }
.app-container.teams-layout .ap-msg-ok  { background: #ebf8f0; color: #0f6b3e; border: 1px solid #b7e4c8; }
.app-container.teams-layout .ap-msg-err { background: #fde7e9; color: #a4262c; border: 1px solid #f2bcc3; }
.app-container.teams-layout .ap-msg-warn { background: #fff4e5; color: #835900; border: 1px solid #f5d9a8; margin-bottom: 10px; }
.app-container.teams-layout .ap-parity-cap { border: 1px solid #ebebeb; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.app-container.teams-layout .ap-parity-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12.5px; }
.app-container.teams-layout .ap-parity-badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.app-container.teams-layout .ap-parity-gain .ap-parity-badge { background: #ebf8f0; color: #0f6b3e; }
.app-container.teams-layout .ap-parity-loss .ap-parity-badge { background: #fde7e9; color: #a4262c; }
.app-container.teams-layout .ap-hist-body { margin-top: 10px; }
.app-container.teams-layout .ap-hist-table { width: 100%; font-size: 12px; }

/* Monitoramento de agentes · KPI strip */
.app-container.teams-layout .agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.app-container.teams-layout .agent-kpi  { padding: 12px 14px; background: #fafafa; border: 1px solid #ebebeb; border-radius: 6px; }
.app-container.teams-layout .agent-kpi-label { font-size: 11px; color: #707070; text-transform: uppercase; letter-spacing: .04em; }
.app-container.teams-layout .agent-kpi-value { font-size: 24px; font-weight: 700; color: #242424; margin-top: 4px; }
.app-container.teams-layout .agent-kpi-value.is-positive { color: #0f6b3e; }
.app-container.teams-layout .agent-kpi-value.is-warn     { color: #835900; }

/* ===========================================================================
   Flow timeline (framework · js/flow-timeline.js) · trilha imutável do fluxo
   de uma solicitação concluída. Compartilhada por Checkpoint e SmartSession.
   =========================================================================== */
.flow-tl { list-style: none; margin: 4px 0 0; padding: 0; }
.flow-tl-item { position: relative; padding: 0 0 18px 30px; }
.flow-tl-item:last-child { padding-bottom: 0; }
.flow-tl-dot {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; line-height: 1;
  box-shadow: 0 0 0 3px #fff;
}
.flow-tl-line {
  position: absolute; left: 10px; top: 22px; bottom: 0;
  width: 2px; background: #E1E1E1;
}
.flow-tl-create   { background: #2B6394; }
.flow-tl-route    { background: #8a8a8a; }
.flow-tl-approved { background: #0f6b3e; }
.flow-tl-rejected { background: #b3261e; }
.flow-tl-canceled { background: #8a8a8a; }
.flow-tl-pending  { background: #b58105; }
.flow-tl-item.is-live .flow-tl-dot { animation: flow-tl-pulse 1.6s ease-in-out infinite; }
@keyframes flow-tl-pulse { 0%,100% { box-shadow: 0 0 0 3px #fff; } 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(181,129,5,.25); } }

.flow-tl-body { padding-top: 1px; }
.flow-tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.flow-tl-actor { font-weight: 600; color: #242424; font-size: 13.5px; }
.flow-tl-role {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
  color: #2B6394; background: rgba(43,99,148,.10); border-radius: 4px; padding: 1px 6px;
}
.flow-tl-time { margin-left: auto; font-size: 11.5px; color: #8a8a8a; white-space: nowrap; }
.flow-tl-action { font-size: 13px; color: #444; margin-top: 2px; }
.flow-tl-reason { font-size: 12px; color: #b3261e; margin-top: 3px; }
.flow-tl-note   { font-size: 11.5px; color: #707070; margin-top: 3px; font-style: italic; }
.flow-tl-item.is-live .flow-tl-action { color: #835900; }
.flow-tl-caption {
  font-size: 11px; color: #8a8a8a; margin: 10px 0 0; padding-top: 8px;
  border-top: 1px dashed #E5E5E5;
}

/* ===== Catálogo de aplicativos (botão Apps na product-bar) ===== */
.appcat-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15,23,42,.42);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; transition: opacity .18s ease;
}
.appcat-overlay.appcat-open { opacity: 1; }
.appcat-modal {
  background: #fff; border-radius: 10px; width: 100%; max-width: 460px;
  max-height: calc(100dvh - 48px); display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.30); overflow: hidden;
}
.appcat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #ebebeb;
}
.appcat-title { font-size: 16px; font-weight: 600; color: #242424; margin: 0; }
.appcat-close {
  width: 30px; height: 30px; border: none; background: transparent; cursor: pointer;
  border-radius: 6px; color: #707070; font-size: 15px;
}
.appcat-close:hover { background: rgba(0,0,0,.06); color: #242424; }
.appcat-hint { font-size: 12px; color: #707070; margin: 0; padding: 12px 18px 4px; }
.appcat-list { list-style: none; margin: 0; padding: 8px 12px 14px; overflow-y: auto; }
.appcat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-bottom: 1px solid #f2f2f2;
}
.appcat-item:last-child { border-bottom: 0; }
.appcat-icon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c);
}
.appcat-icon svg { width: 20px; height: 20px; }
.appcat-meta { flex: 1; min-width: 0; }
.appcat-name { display: block; font-size: 14px; font-weight: 600; color: #242424; }
.appcat-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: #107c10; background: rgba(16,124,16,.1); padding: 1px 6px; border-radius: 999px; margin-left: 4px;
}
.appcat-sub { display: block; font-size: 12px; color: #707070; }
.appcat-action { flex-shrink: 0; }
.appcat-btn {
  border: 1px solid #d1d1d1; background: #fff; border-radius: 6px; cursor: pointer;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: #2B6394;
}
.appcat-btn:hover { background: #f5f8fb; border-color: #2B6394; }
.appcat-open { color: #107c10; }
.appcat-open:hover { border-color: #107c10; background: #f3faf3; }
.appcat-status { font-size: 12px; font-weight: 600; }
.appcat-pending { color: #835900; }
.appcat-locked  { color: #475569; }
/* Chave (admin) · liga/desliga o app na barra */
.appcat-switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.appcat-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.appcat-slider {
  position: absolute; inset: 0; border-radius: 999px; background: #cbd2d9; transition: background .15s ease;
}
.appcat-slider::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease;
}
.appcat-switch input:checked + .appcat-slider { background: #2B6394; }
.appcat-switch input:checked + .appcat-slider::before { transform: translateX(18px); }

@media (max-width: 768px) {
  .appcat-overlay { padding: 10px; align-items: flex-start; }
  .appcat-modal { max-height: calc(100dvh - 20px); }
}

/* ===== Seletor de ESCOPO padrão (Pessoal/Equipe/Global) · cross-produto ===== */
.app-container.teams-layout .scope-tabs-row {
  display: flex; justify-content: flex-start; align-items: center; margin-bottom: 12px;
}
.app-container.teams-layout .scope-tabs { display: inline-flex; gap: 4px; }
.app-container.teams-layout .scope-tab {
  padding: 6px 14px; background: #fafafa; border: 1px solid #ebebeb; border-radius: 4px;
  font-size: 12.5px; font-weight: 500; color: #242424; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.app-container.teams-layout .scope-tab:hover { background: #fff; }
.app-container.teams-layout .scope-tab.is-active {
  background: var(--product-accent, #2B6394); color: #fff;
  border-color: var(--product-accent, #2B6394);
}
/* Mobile (SOTA): abas de escopo full-width e com alvo de toque ≥44px · não estouram. */
@media (max-width: 768px) {
  .app-container.teams-layout .scope-tabs-row { width: 100%; }
  .app-container.teams-layout .scope-tabs { display: flex; width: 100%; gap: 6px; }
  .app-container.teams-layout .scope-tab { flex: 1; text-align: center; padding: 12px 8px; min-height: 44px; font-size: 13px; }
}

/* ===== Chips de aplicativo na tabela de Usuários (Plataforma) ===== */
.app-container.teams-layout .ua-app-chip {
  display: inline-block; font-size: 10.5px; font-weight: 600; line-height: 1.6;
  padding: 1px 8px; margin: 1px 0; border-radius: 999px;
  color: var(--c, #2B6394);
  background: color-mix(in srgb, var(--c, #2B6394) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--c, #2B6394) 30%, #fff);
}
/* Apps em SIGLA (2 letras + cor do produto): linhas estreitas; a LEGENDA abaixo da tabela dirime dúvida. */
.app-container.teams-layout .ua-app-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 18px; padding: 0 4px; margin: 1px 1px 1px 0;
  border-radius: 5px; font-size: 10px; font-weight: 800; letter-spacing: .03em;
  color: #fff; background: var(--c, #2B6394); cursor: default;
}
.app-container.teams-layout .ua-legend {
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
  margin-top: 10px; font-size: 12px; color: #64748b;
}
.app-container.teams-layout .ua-legend .ua-app-tag { margin: 0 4px 0 0; }

/* ===== Seletor de TIPO/SEÇÃO de relatório (sub-seletor) · cross-produto =====
   Mesmo idioma visual do scope-tab (fundo + contorno + ativo com accent) — só texto
   sublinhado não comunicava "isto é clicável" (feedback: abas dos relatórios do Checkpoint). */
.app-container.teams-layout .section-tabs {
  display: flex; flex-wrap: nowrap;   /* todas numa linha, lado a lado */
  gap: 4px; margin-bottom: 14px;
}
.app-container.teams-layout .section-tab {
  flex: 1 1 0; min-width: 0;          /* dividem a largura igualmente · podem encolher */
  white-space: normal;                /* o TÍTULO quebra em linhas p/ caber */
  text-align: center; line-height: 1.12;
  padding: 6px 3px; background: #fafafa; border: 1px solid #ebebeb; border-radius: 4px;
  font-size: 11.5px; font-weight: 500;
  color: #242424; cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.app-container.teams-layout .section-tab:hover { background: #fff; }
.app-container.teams-layout .section-tab.is-active {
  background: var(--product-accent, #2B6394); color: #fff;
  border-color: var(--product-accent, #2B6394);
  font-weight: 600;
}

/* ===== Fila de solicitações de app na Pendências (autorizador) ===== */
.app-req-card { border-left: 3px solid #2B6394; }
.app-req-list { list-style: none; margin: 12px 0 0; padding: 0; }
.app-req-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f2f2f2;
}
.app-req-item:last-child { border-bottom: 0; }
.app-req-avatar {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  background: #2B6394; color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.app-req-meta { flex: 1; min-width: 0; }
.app-req-name { display: block; font-size: 14px; font-weight: 600; color: #242424; }
.app-req-text { display: block; font-size: 12.5px; color: #707070; }
.app-req-actions { display: flex; gap: 8px; flex-shrink: 0; }
.app-req-actions button { padding: 6px 14px; font-size: 12.5px; font-weight: 600; border-radius: 6px; cursor: pointer; }
@media (max-width: 768px) {
  .app-req-item { flex-wrap: wrap; }
  .app-req-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }
}

/* ── Gráfico de áreas (Evolução divisional) no MOBILE ──────────────────────────
   Empilha gráfico (largura cheia) + legenda embaixo em linhas que quebram, para
   caber e ser selecionável; canvas em paisagem (altura proporcional via charts.js). */
@media (max-width: 768px) {
  .chart-areas-wrapper { flex-direction: column; gap: 12px; }
  .chart-canvas-wrapper { min-width: 0; width: 100%; flex: 1 1 auto; }
  .chart-canvas-container { height: auto; }
  .chart-canvas-container canvas { display: block; max-width: 100%; }
  .chart-legend { width: 100%; padding: 12px; box-sizing: border-box; }
  .chart-legend .checkboxes-container,
  .checkboxes-container {
    display: flex; flex-direction: row; flex-wrap: wrap;
    gap: 6px 14px; max-height: none; overflow: visible;
    grid-template-columns: none;            /* anula o grid do bloco antigo */
  }
  .chart-legend .checkboxes-container label { font-size: 12px; }
}

/* ── Card de Relatórios · padding REDUZIDO À METADE p/ aproveitar a largura ──
   (24→12 desktop · 6→3 mobile). Abas, grade do Painel e gráfico ganham largura. */
.adherence-card.rep-content-card { padding: 12px; }
@media (max-width: 768px) {
  .app-container.teams-layout .adherence-card.rep-content-card { padding: 3px !important; }
}

/* ── Evolução divisional · gráfico empilhado (canvas cheio + legenda 2 colunas) ── */
#rep-global-pane .chart-areas-wrapper { flex-direction: column; gap: 12px; margin: 0; }
#rep-global-pane .chart-canvas-wrapper { flex: 1 1 auto; min-width: 0; width: 100%; }
#rep-global-pane .chart-canvas-container {
  width: 100%; height: auto; border: 0; border-radius: 0; padding: 0; box-sizing: border-box;
}
#rep-global-pane .chart-canvas-container canvas { display: block; max-width: 100%; }
#rep-global-pane .chart-legend {            /* sem caixa/borda · cabe no card */
  width: 100%; max-width: 100%; box-sizing: border-box;
  background: none; padding: 0; border-radius: 0;
}
#rep-global-pane .chart-legend .checkboxes-container {
  display: grid; grid-template-columns: 1fr 1fr;   /* 2 colunas iguais */
  gap: 6px 16px; max-height: none; overflow: visible;
  width: 100%; box-sizing: border-box;
}
#rep-global-pane .chart-legend .checkboxes-container label {
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
#rep-global-pane .chart-legend .checkboxes-container label .legend-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#rep-global-pane .chart-legend .checkboxes-container label > span:not(.legend-name) {
  flex: 0 0 auto;   /* swatch de cor não encolhe */
}
