:root {
    --primary: #FF9900;
    --primary-light: #FFB347;
    --secondary: #2563eb;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-main: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Variáveis de Layout Ultra Slim (Efeito 75% Real) */
    --sidebar-width: 220px;
    /* Reduzido de 280px original */
    --sidebar-collapsed-width: 60px;
    /* Reduzido de 80px original */
    --transition-speed: 0.3s;
}

/* Padronização de Dados (MAIÚSCULAS) */
input[type="text"]#inputResponsavelNome,
input[type="text"]#inputResponsavelNomeFull,
input[type="text"]#inputObraNome,
input[type="text"]#inputFornecedorNome,
input[type="text"]#inputInsumoDescricao,
input[type="text"]#inputInsumoUnidade,
input[type="text"]#inputFornecedorCidade,
input[type="text"]#inputFornecedorEstado,
input[type="text"]#colabNome,
input[type="text"]#colabCargo,
input[type="text"]#equipeFornNome,
input[type="text"]#equipeFornContato,
input[type="text"]#equipeFornCidade,
input[type="text"]#equipeFornEstado,
input[type="text"]#equipeFornEndereco,
input[type="text"]#ativNome {
    text-transform: uppercase;
}


/* View Toggle */
.view-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.view-btn {
    border: none;
    background: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    color: var(--primary);
}

.view-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-container {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 1.5rem;
}

.card-actions,
.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.card-actions {
    justify-content: flex-start;
}

.table-actions {
    justify-content: flex-end;
    white-space: nowrap;
}

html {
    font-size: 13px;
    /* Reduzido drasticamente de 16px original */
}

/* Tela de Login */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Ajustes Driver.js */
.driver-popover {
    z-index: 100000 !important;
    pointer-events: auto !important;
}

.driver-popover * {
    pointer-events: auto !important;
}

.driver-overlay {
    z-index: 90000 !important;
}

.driver-active-element {
    z-index: 90001 !important;
}

.btn-help-tour {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.btn-help-tour:hover {
    color: var(--primary-hover);
    transform: scale(1.1);
    opacity: 1;
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.login-card label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--white);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-card input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-card .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Indicadores de Atraso e Ritmo */
.atividade-card.delayed {
    border-left: 5px solid var(--error) !important;
    background: #fffafa !important;
}

.atividade-card.delayed h4 {
    color: #b91c1c;
}

.unit-cell.delayed {
    border: 2px solid var(--error) !important;
    animation: pulse-red 2s infinite;
}

.unit-cell.delayed-blink {
    border: 2px solid var(--error) !important;
    background: #fee2e2 !important;
    animation: blink-red 1s infinite alternate;
}

@keyframes blink-red {
    from {
        background: #fee2e2;
        border-color: var(--error);
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }

    to {
        background: #ffffff;
        border-color: transparent;
        box-shadow: none;
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.ritmo-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.obra-arquivada {
    opacity: 0.6;
    filter: grayscale(0.85);
    transition: all 0.3s ease;
}

.obra-arquivada:hover {
    opacity: 0.8;
    filter: grayscale(0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-body);
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 1rem 0.5rem;
    /* Ajustado para Ultra Slim */
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    position: relative;
    transition: all 0.3s ease;
    overflow: visible;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    padding: 1rem 0;
    /* Ajustado para Ultra Slim */
    align-items: center;
    overflow: visible !important;
}

.main-content {
    flex-grow: 1;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    /* Compactação agressiva de padding lateral e superior */
    /* Ajustado para consistência */
}

.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
    border: 2px solid #fff;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle {
    right: -15px;
    z-index: 1001;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
    background: #e68a00;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    /* Compactado */
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    /* Reduzido */
    transition: all 0.3s ease;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar.collapsed .logo {
    justify-content: center;
    padding: 0;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    width: 100%;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    margin: 1px 4px;
    /* Área de navegação ultra compacta */
}

nav a i {
    font-size: 1.25rem;
    width: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
    z-index: 2;
}

nav a span {
    z-index: 2;
    transition: opacity 0.2s ease;
}

nav a:hover,
nav a.active {
    background: transparent;
    color: var(--primary);
    font-weight: 600;
}

nav a.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-group-title {
    font-size: 0.70rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0.6rem 0.25rem 0.6rem;
    margin-top: 0.25rem;
}

.sidebar.collapsed .nav-group-title {
    display: none !important;
}

/* Unificado para evitar redundância */

/* ========================================
   ESTILOS PARA O MENU COLAPSADO (FINAL)
   ======================================== */

/* 1. PROTEÇÃO DE PERMISSÕES: Se o JS escondeu o item, o CSS não desesconde */
.sidebar.collapsed nav a[style*="display: none"],
.sidebar.collapsed nav a[style*="display:none"] {
    display: none !important;
}

.sidebar.collapsed .logo {
    justify-content: center;
    padding: 0;
}

/* 2. CENTRALIZAÇÃO E LAYOUT DO LINK */
.sidebar.collapsed nav a {
    margin: 4px auto;
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex !important;
    /* Forçado para centralizar, mas protegido pela regra acima */
    justify-content: center !important;
    align-items: center !important;
    gap: 0;
    border-radius: 10px;
    position: relative;
    overflow: visible;
    font-size: 0 !important;
    /* Estratégia ZERO FONT: Esconde textos mesmo que estejam fora de spans */
}

/* 3. PADRONIZAÇÃO DO ÍCONE (1.25rem FORCE) */
.sidebar.collapsed nav a i {
    margin: 0 !important;
    min-width: unset;
    font-size: 1.25rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4. OCULTAÇÃO ABSOLUTA DE TEXTOS (SEM VAZAMENTOS) */
.sidebar.collapsed nav a span,
.sidebar.collapsed .logo span,
.sidebar.collapsed .sidebar-footer div,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed span {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
}

/* 5. INDICADOR ATIVO (BARRA LARANJA) PRESA NA BORDA ESQUERDA */
.sidebar.collapsed nav a.active::before {
    left: -9px !important;
    /* (60px sidebar / 2) - (42px item / 2) = 9px para encostar */
    height: 24px !important;
    width: 4px !important;
    background: var(--primary) !important;
    z-index: 50 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 6. BOTÕES DO FOOTER */
.sidebar.collapsed .sidebar-footer button {
    padding: 0;
    width: 42px;
    height: 42px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto;
}

.sidebar.collapsed .sidebar-footer button i {
    margin: 0 !important;
    font-size: 1.25rem !important;
}


#navMarketplace i {
    color: #2ecc71;
    /* Mantém o ícone verde apenas, mas herda todo o resto */
}

#navMarketplace:hover i,
#navMarketplace.active i {
    color: var(--primary);
    /* No hover/ativo, segue o padrão laranja */
}

.sidebar-footer {
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 153, 0, 0.1);
    outline: none;
}

.btn-secondary {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* Main Content */

/* Tabs System */
.tabs-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.875rem 1.75rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tab-btn i {
    font-size: 1.1rem;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Sub-tabs for specific pages (like Ativos) */
.tabs-sub-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    /* Reduzido de 2rem */
    background: #f1f5f9;
    padding: 0.3rem;
    /* Reduzido de 0.4rem */
    border-radius: 12px;
    width: fit-content;
}

.tab-sub-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.25rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.tab-sub-btn:hover {
    color: var(--text-main);
}

.tab-sub-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hub-section {
    display: none;
}

.hub-section.active {
    display: block;
}

.notif-badge {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-left: 4px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.search-bar {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 400px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.header-selector {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.header-selector:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.header-selector i {
    color: var(--primary);
}

.header-selector select {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    font-weight: 500;
}

/* ========================================
   SINO DE NOTIFICAÇÕES
   ======================================== */
.notification-bell {
    position: relative;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 1rem;
    z-index: 1001;
    /* Maior que o perfil do usuário (que é relativo sem z-index) */
}

.notification-bell:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.notification-bell i {
    pointer-events: none;
}

/* Animação de "chacoalhar" quando há notificações novas */
.notification-bell.has-new i {
    animation: bell-shake 0.5s ease infinite alternate;
    color: var(--primary);
}

@keyframes bell-shake {
    0% {
        transform: rotate(-15deg);
    }

    100% {
        transform: rotate(15deg);
    }
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    pointer-events: none;
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

/* Dropdown de notificações */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -10px;
    width: 380px;
    max-height: 480px;
    background: white;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    z-index: 10002;
    /* Muito alto para ficar por cima de tudo */
    overflow: hidden;
}

.notification-dropdown.open {
    display: flex;
    animation: dropdown-enter 0.2s ease;
}

@keyframes dropdown-enter {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

.btn-link-mini {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn-link-mini:hover {
    opacity: 0.7;
}

#notificationList {
    overflow-y: auto;
    max-height: 400px;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.notification-empty i {
    font-size: 2rem;
    color: #22c55e;
    opacity: 0.5;
}

/* Cards de Notificação */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.2s;
    position: relative;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: #eff6ff;
    border-left: 3px solid var(--primary);
}

.notification-item.unread:hover {
    background: #dbeafe;
}

.notification-unread-dot {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.notification-icon.convite {
    background: #dbeafe;
    color: var(--primary);
}

.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    margin-bottom: 0.15rem;
}

.notification-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.notification-time {
    font-size: 0.7rem;
    color: #94a3b8;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-aceitar {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-aceitar:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-recusar {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-recusar:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Perfil do Usuário e Dropdown */
.user-profile {
    position: relative;
    cursor: pointer;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all 0.3s ease;
    user-select: none;
}

.profile-trigger:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    background: #fff7ed;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

.profile-info-header {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.dropdown-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 5px;
    transition: transform 0.3s ease;
}

#userProfileDropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    z-index: 1000;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#userProfileDropdown.active .profile-dropdown {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.dropdown-header {
    padding: 0.75rem 1rem;
}

.dropdown-user-email {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-company-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.profile-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 5px 0;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.logout-item {
    color: #ef4444;
}

.logout-item:hover {
    background: #fef2f2;
}

.btn-icon.delete {
    color: #ef4444;
}

.btn-icon.delete:hover {
    background: #fee2e2;
}

/* Estilos para o Triple Panel de Contratos */
.side-panel-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.side-panel-item {
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.side-panel-item:hover {
    border-color: var(--primary);
    background: #f1f5f9;
}

.side-panel-item.active {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.side-panel-item b {
    color: var(--text-main);
    font-size: 0.95rem;
}

.side-panel-item small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.asset-detail-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.asset-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.asset-detail-info h5 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.asset-detail-info p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

/* Settings Page Redesign */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.settings-card:hover {
    box-shadow: var(--shadow-md);
}

.settings-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-header i {
    font-size: 1.5rem;
    color: var(--primary);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.info-group {
    margin-bottom: 1.25rem;
}

.info-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.info-group p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Billing Card Styles */
.plan-status-badge {
    background: #fff7ed;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    border: 1px dashed var(--primary);
}

.badge-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
}

.plan-status-badge h2 {
    color: var(--primary);
    margin: 5px 0 0;
}

.unidade-cell .ocupante-tag {
    font-size: 0.65rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
    background: rgba(37, 99, 235, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Marcador de Comentário Sutil (três pontos) */
.comment-indicator {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    line-height: 0.5;
    color: #94a3b8;
    letter-spacing: 2px;
    opacity: 0.5;
    pointer-events: none;
    font-weight: bold;
}

.status-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
}

.billing-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.upgrade-btn {
    width: 100%;
}

.members-intro {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 1.6rem;
    /* Mais compacto */
    margin-bottom: 0.15rem;
}

.content-header p {
    color: var(--text-muted);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-card i {
    font-size: 2.2em;
    color: var(--primary);
    background: #fff7ed;
    padding: 15px;
    border-radius: 16px;
}

.stat-card.warning i {
    color: var(--warning);
    background: #fffbeb;
}

.stat-card.danger i {
    color: #ef4444;
    background: #fef2f2;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-card .label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stat-card .value {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--text-main);
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--primary);
    color: var(--primary);
}

.item-card.devolved {
    opacity: 0.5;
    transform: scale(0.98);
}

.item-card.devolved:hover {
    opacity: 0.8;
}

.badge-devol {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.item-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.item-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.item-id {
    font-size: 0.75rem;
    background: rgba(255, 153, 0, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
    font-weight: 600;
}

.item-desc {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.ativo-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.75rem;
    border-radius: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item i {
    color: var(--primary);
    margin-right: 4px;
}

.ativo-dates {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0.5rem;
}

.date-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.date-item i {
    color: var(--text-muted);
    margin-right: 4px;
}

.ativo-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.croqui-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: stretch;
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
}

.pavimento-label {
    background: #f8fafc;
    border-right: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}


.metric-box {
    padding: 0.75rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
}

.metric-box.obra-days {
    background: rgba(50, 152, 220, 0.1);
    color: #209cee;
    border: 1px solid rgba(50, 152, 220, 0.2);
}

.metric-box.idle-days {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.metric-box.use-days {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.metric-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.8;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 800;
}

.metric-value small {
    font-size: 0.75rem;
    font-weight: 500;
}

.devolucao-real-row {
    font-size: 0.85rem;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-stock {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-use {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
}

/* Estilos para Agrupamento por Obra */
.obra-group-header {
    grid-column: 1 / -1;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: fadeIn 0.5s ease;
}

.obra-group-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.obra-group-count {
    font-size: 0.85rem;
    background: rgba(255, 153, 0, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* Modern Table */
.table-container {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.modern-table th {
    background: #f8fafc;
    padding: 1.25rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.modern-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.modern-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Modal e Forms */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--border);
    margin: 2% auto;
    padding: 3rem;
    width: 90%;
    max-width: 850px;
    max-height: 90vh;
    border-radius: 32px;
    position: relative;
    box-shadow: 0 25px 70px -12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-main);
    outline: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.modern-input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    outline: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.modern-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modern-input:read-only {
    background-color: #f1f5f9;
    color: var(--text-muted);
    cursor: not-allowed;
}

.modern-input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.modern-input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.croqui-config-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: stretch;
    margin-top: 1rem;
    height: 100%;
}

.floor-config-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 40px 40px;
    gap: 0.75rem;
    background: white;
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    margin-bottom: 0.5rem;
    align-items: center;
    transition: all 0.2s ease;
}

.floor-config-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.floor-config-row input[type="text"],
.floor-config-row input[type="number"] {
    padding: 0.5rem 0.75rem !important;
    height: 38px !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
}

.floor-config-row .checkbox-group {
    display: flex;
    justify-content: center;
    align-items: center;
}

.floor-config-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-remove-floor {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #fee2e2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-floor:hover {
    background: #ef4444;
    color: white;
}

.btn-replicate-floor {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #e0f2fe;
    color: #0ea5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-replicate-floor:hover {
    background: #0ea5e9;
    color: white;
}

.floors-list-container::-webkit-scrollbar {
    width: 6px;
}

.floors-list-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.floors-list-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.badge-stock {
    background: #ecfdf5;
    color: #059669;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-use {
    background: #fffbeb;
    color: #d97706;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-returned {
    background: #f1f5f9;
    color: #64748b;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Alertas de Atraso */
.delayed-card {
    border: 2px solid #ff4d4d !important;
    position: relative;
    overflow: hidden;
}

.alert-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(255, 77, 77, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 1.2rem;
    z-index: 10;
    pointer-events: none;
    border: 3px solid white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.return-badge {
    position: absolute;
    top: 20px;
    right: -35px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 8px 45px;
    transform: rotate(45deg);
    font-size: 0.65rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Estilos de Botão Pequeno */
.btn-sm {
    padding: 4px 12px !important;
    font-size: 0.82rem !important;
    height: auto !important;
    width: auto !important;
    min-height: unset !important;
    border-radius: 8px !important;
}

/* Popover Tabs */
.popover-tab-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.popover-tab-btn:hover {
    color: var(--primary);
}

.popover-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.popover-section {
    animation: fadeIn 0.3s ease;
}

.unidade-popover {
    z-index: 10000;
    width: 1055px !important;
    max-width: 95vw !important;
}

.template-item-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 10px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    font-weight: 600;
}

.template-item-btn:hover {
    border-color: var(--primary);
    background: #f0f9ff;
    color: var(--primary);
}

.template-item-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========================================
   MOBILE RESPONSIVENESS SYSTEM
   ======================================== */

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

/* Sidebar Overlay (criado via JS em app.js) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

/* ========================================
   BREAKPOINT: TABLET (≤992px)
   ======================================== */
@media (max-width: 992px) {

    /* --- SIDEBAR --- */
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 280px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .sidebar.active {
        left: 0;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.15);
    }

    /* Esconder o botão de collapse (seta) em mobile — só o hamburger */
    .sidebar-toggle {
        display: none !important;
    }

    .sidebar.collapsed {
        width: 280px;
        padding: 1rem 0.5rem;
        align-items: stretch;
    }

    .sidebar.collapsed nav a {
        width: auto;
        height: auto;
        padding: 0.5rem 0.6rem;
        font-size: inherit !important;
        justify-content: flex-start !important;
    }

    .sidebar.collapsed nav a span,
    .sidebar.collapsed .logo span,
    .sidebar.collapsed .sidebar-footer div {
        display: inline !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        opacity: 1 !important;
        position: static !important;
    }

    .sidebar.collapsed nav a i {
        min-width: 24px;
    }

    .sidebar.collapsed nav a.active::before {
        left: -8px !important;
    }

    /* --- MOBILE MENU TOGGLE --- */
    .mobile-menu-toggle {
        display: flex;
    }

    /* --- HEADER --- */
    header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: center;
        margin-bottom: 1.5rem;
    }

    .search-bar {
        width: 100%;
        order: 10;
    }

    .header-selector {
        width: 100%;
        order: 11;
    }

    /* --- CONTEÚDO --- */
    .main-content {
        padding: 0.75rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .content-header .actions {
        width: 100%;
    }

    .content-header .actions .btn-primary,
    .content-header .actions .btn-secondary {
        flex: 1;
    }

    /* --- STATS GRID --- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
        border-radius: 16px;
    }

    .stat-card i {
        font-size: 1.6em;
        padding: 10px;
        border-radius: 12px;
    }

    .stat-card .value {
        font-size: 1.4em;
    }

    /* --- CHARTS --- */
    .charts-grid {
        grid-template-columns: 1fr !important;
    }

    /* --- INVENTORY --- */
    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    /* --- TABS --- */
    .tabs-header {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .tabs-header::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.82rem;
        flex-shrink: 0;
    }

    .tabs-sub-header {
        overflow-x: auto;
        width: 100%;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .tabs-sub-header::-webkit-scrollbar {
        display: none;
    }

    .tab-sub-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* --- TABELAS --- */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }

    .modern-table {
        min-width: 600px;
    }

    .modern-table th,
    .modern-table td {
        padding: 0.9rem 1rem;
    }

    /* --- FILTROS --- */
    .filters-bar {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .filters-bar select,
    .filters-bar input,
    .filters-bar .modern-select,
    .filters-bar .modern-input {
        width: 100% !important;
        min-width: unset !important;
    }

    .filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* --- MODAIS --- */
    .modal-content {
        width: 95% !important;
        margin: 3% auto;
        padding: 1.5rem;
        border-radius: 20px;
        max-height: 92vh;
    }

    /* --- SETTINGS --- */
    .settings-grid {
        grid-template-columns: 1fr;
    }

    /* --- EQUIPES LAYOUT --- */
    .equipes-layout {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1rem;
    }

    .equipes-sidebar {
        min-width: unset;
        max-height: 300px;
        overflow-y: auto;
    }

    .equipes-board {
        height: auto;
        min-height: 500px;
    }

    /* --- KANBAN --- */
    .kanban-board {
        grid-template-columns: 1fr;
        overflow-x: visible;
        padding: 0.5rem;
    }

    .kanban-column {
        min-height: 200px;
    }

    /* --- PRODUTIVIDADE --- */
    #equipes-view-produtividade>div:nth-child(2) {
        flex-direction: column !important;
    }

    #equipes-view-produtividade>div:nth-child(2)>aside {
        width: 100% !important;
        min-width: 100% !important;
    }

    /* --- HUB EMPREITEIROS --- */
    .hierarchy-split-layout {
        grid-template-columns: 1fr;
    }

    .hierarchy-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }

    /* --- SPRINT/PLANNING --- */
    .sprint-summary-card {
        grid-column: 1;
    }

    .planning-banner {
        grid-column: 1;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .sprint-progress-grid {
        grid-template-columns: 1fr;
    }

    .planning-controls {
        justify-content: center;
    }

    /* --- POPOVER --- */
    .unidade-popover {
        width: 95vw !important;
        max-width: 95vw !important;
        left: 2.5vw !important;
        right: 2.5vw !important;
    }

    /* --- NOTIFICATION DROPDOWN --- */
    .notification-dropdown {
        width: calc(100vw - 2rem);
        right: -60px;
        max-height: 70vh;
    }

    /* --- CROQUI CONFIG --- */
    .croqui-config-layout {
        grid-template-columns: 1fr;
    }

    /* --- HEATMAP --- */
    #dashboardHeatmapCard>div:first-child {
        flex-direction: column;
        gap: 1rem;
    }

    /* --- CHAMADA FILTROS --- */
    #page-chamada .card>div {
        flex-direction: column !important;
    }

    #page-chamada .card>div>div {
        min-width: unset !important;
        width: 100% !important;
    }
}

/* ========================================
   BREAKPOINT: MOBILE (≤768px)
   ======================================== */
@media (max-width: 768px) {

    /* --- BASE --- */
    html {
        font-size: 14px;
    }

    .main-content {
        padding: 0.5rem;
    }

    /* --- HEADER COMPACTO --- */
    header {
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .search-bar {
        padding: 0.5rem 1rem;
        border-radius: 10px;
    }

    /* Perfil compacto — esconder nome/role */
    .profile-info-header {
        display: none;
    }

    .profile-trigger {
        padding: 0.35rem 0.5rem;
        gap: 0.5rem;
    }

    .dropdown-icon {
        display: none;
    }

    .avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    /* Sino ajustado */
    .notification-bell {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        margin-right: 0.5rem;
    }

    .notification-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        max-height: 80vh;
        border-radius: 20px 20px 0 0;
        animation: slide-up 0.3s ease;
    }

    @keyframes slide-up {
        from {
            transform: translateY(100%);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* --- CONTENT --- */
    .content-header h1 {
        font-size: 1.3rem;
    }

    .content-header p {
        font-size: 0.8rem;
    }

    /* --- STAT CARDS --- */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
        border-radius: 14px;
    }

    .stat-card i {
        font-size: 1.3em;
        padding: 8px;
        border-radius: 10px;
    }

    .stat-card .label {
        font-size: 0.7em;
    }

    .stat-card .value {
        font-size: 1.2em;
    }

    /* --- INVENTORY --- */
    .inventory-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .item-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    /* --- MODAIS MOBILE (BOTTOM SHEET) --- */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        margin-top: auto;
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        padding: 1.25rem;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .modal {
        display: none;
        align-items: flex-end;
    }

    .modal[style*="display: block"] {
        display: flex !important;
    }

    .close {
        right: 1rem;
        top: 1rem;
        font-size: 1.25rem;
    }

    /* --- POPOVER BOTTOM SHEET --- */
    .unidade-popover {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 85vh;
        overflow-y: auto;
        animation: slide-up 0.3s ease;
    }

    .unidade-popover::after {
        display: none;
    }

    .unidade-popover.macro-view {
        width: 100% !important;
    }

    /* --- TABS COMPACTAS --- */
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.78rem;
        gap: 0.4rem;
    }

    .tab-btn i {
        font-size: 0.9rem;
    }

    .tab-sub-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.78rem;
    }

    /* --- TOUCH TARGETS --- */
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 36px !important;
    }

    .btn-icon {
        min-width: 38px;
        min-height: 38px;
    }

    .filter-btn {
        min-height: 38px;
        padding: 0.5rem 1rem;
    }

    nav a {
        padding: 0.65rem 0.75rem;
        min-height: 44px;
    }

    /* --- VIEW TOGGLE --- */
    .view-toggle {
        order: -1;
    }

    /* --- ATTENDANCE MOBILE --- */
    .attendance-mobile-grid {
        grid-template-columns: 1fr;
    }

    /* --- SETTINGS --- */
    .settings-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .asset-detail-grid {
        grid-template-columns: 1fr;
    }

    /* --- EQUIPES SIDEBAR --- */
    .equipes-sidebar {
        max-height: 250px;
    }

    /* --- ATIVIDADE RESUMO STATS --- */
    .atividade-resumo-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-item {
        padding: 12px 8px;
        border-radius: 14px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    /* --- TOAST --- */
    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .toast {
        min-width: unset;
        max-width: 100%;
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }

    /* --- PRODUTIVIDADE FILTROS --- */
    #equipes-view-produtividade>div:first-child {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    #equipes-view-produtividade>div:first-child>div:last-child {
        flex-direction: column !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    /* --- CHAMADA STATS --- */
    #page-chamada .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* --- PROFILE DROPDOWN --- */
    .profile-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        animation: slide-up 0.3s ease;
        z-index: 10003;
    }

    /* --- CROQUI HEADER TABS --- */
    .croqui-header-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-tabs-box {
        width: 100%;
    }

    .croqui-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* --- FLOOR CONFIG ROW (CROQUI EDIT) --- */
    .floor-config-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    /* --- INVITE BANNER --- */
    #invite-banner {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 0.75rem !important;
        text-align: center;
    }

    #invite-banner p {
        font-size: 0.85rem !important;
    }
}

/* ========================================
   BREAKPOINT: SMALL MOBILE (≤480px)
   ======================================== */
@media (max-width: 480px) {

    .main-content {
        padding: 0.35rem;
    }

    /* Stats em coluna única */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        flex-direction: row;
        padding: 12px 14px;
    }

    /* Header ultra compacto */
    .content-header h1 {
        font-size: 1.15rem;
    }

    /* Attendance buttons */
    .attendance-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .att-btn {
        padding: 14px 4px;
        font-size: 0.6rem;
    }

    /* Atividade stats 2 col */
    .atividade-resumo-stats {
        grid-template-columns: 1fr 1fr;
    }

    /* Chamada stats stacked */
    #page-chamada .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Login card */
    .login-card {
        padding: 1.5rem;
        border-radius: 16px;
        margin: 0 0.5rem;
    }

    .login-card h2 {
        font-size: 1.4rem;
    }

    /* Kanban column header */
    .column-header span {
        font-size: 0.75rem;
    }

    /* Toolbar */
    .croqui-toolbar {
        flex-direction: column;
        gap: 1rem;
    }

    .toolbar-group {
        width: 100%;
        max-width: 100%;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .toolbar-actions button {
        flex: 1;
    }
}

/* Estilos para Impressão */
@media print {

    .sidebar,
    header,
    .filters-bar,
    .actions,
    .btn-icon,
    .card-actions,
    #debug-panel,
    .btn-primary,
    .btn-secondary,
    .btn-sm {
        display: none !important;
    }

    .app-container {
        display: block !important;
        width: 100% !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .modern-table {
        box-shadow: none !important;
        border: 1px solid #333 !important;
        width: 100% !important;
    }

    .page {
        display: none !important;
    }

    .page.active {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .badge {
        border: 1px solid #000 !important;
        color: black !important;
        print-color-adjust: exact;
    }

    .no-print {
        display: none !important;
    }
}

/* Notificações (Toasts) */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 10002;
    pointer-events: none;
}

.toast {
    background: #ffffff;
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    pointer-events: auto;
    animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 5px solid var(--primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: #ff4d4d;
}

.toast.warning {
    border-left-color: #f39c12;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-exit {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

/* Customização do Calendário no Dash */
.fc {
    --fc-border-color: var(--border) !important;
    --fc-button-bg-color: var(--primary) !important;
    --fc-button-border-color: var(--primary) !important;
    --fc-today-bg-color: rgba(255, 153, 0, 0.05) !important;
}

.fc .fc-toolbar-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
}

.fc-event {
    cursor: pointer;
    border: none !important;
    padding: 2px 4px;
    font-size: 0.75rem;
}

.fc .fc-toolbar {
    margin-bottom: 0.5rem !important;
}

.fc .fc-button {
    padding: 2px 8px !important;
    font-size: 0.7rem !important;
    border-radius: 8px !important;
}

.fc-event-title-container {
    font-size: 0.7rem !important;
}

/* Gestão de Equipes */
.equipes-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    /* Sincronizado com min-width da sidebar */
    /* Largura percentual para fluidez total */
    gap: 2rem;
    /* Aumentado para dar respiro entre quadros */
    height: calc(100vh - 180px);
    /* Ganhamos altura com os paddings menores */
    min-height: 400px;
    width: 100%;
    margin-bottom: 0;
}

.equipes-sidebar {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 260px;
    /* Ajustado para bater com o grid */
}

.equipes-board {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    /* Garante que preencha o layout */
}

.card-header-mini {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.card-header-mini h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header-mini p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empreiteiros-container,
.atividades-board-container {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

/* Accordion de Empreiteiros */
.empreiteiro-item {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.empreiteiro-header {
    background: #fff;
    padding: 0.85rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.empreiteiro-name-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.empreiteiro-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.empreiteiro-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.meta-divider {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #cbd5e1;
}

.team-size-badge {
    background: #f1f5f9;
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.empreiteiro-header:hover {
    background: #f1f5f9;
}

.colaboradores-list {
    padding: 0.5rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.colaboradores-list.collapsed {
    display: none;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

/* Histórico de OS na Sidebar */
.os-history-section {
    margin-top: 8px;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
}

.os-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    transition: background 0.2s;
}

.os-history-header:hover {
    background: #e2e8f0;
}

.os-history-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.os-history-list.collapsed {
    display: none;
}

.os-item-sidebar {
    background: white;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.os-item-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
}

.os-item-sidebar-title {
    font-weight: 700;
    color: var(--primary);
}

.os-item-sidebar-desc {
    font-size: 0.65rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-item-sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.os-item-sidebar-date {
    font-size: 0.6rem;
    color: #94a3b8;
}

/* Card de Colaborador (Draggable) */
.colaborador-card {
    background: #fff;
    padding: 0.5rem;
    /* Reduzido de 0.75rem */
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Reduzido de 10px */
    transition: all 0.2s;
}

.colaborador-card:active {
    cursor: grabbing;
}

.colaborador-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.colaborador-card .avatar-mini {
    width: 28px;
    /* Reduzido de 32px */
    height: 28px;
    /* Reduzido de 32px */
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    /* Reduzido de 0.8rem */
    font-weight: 700;
}

.colaborador-info b {
    display: block;
    font-size: 0.8rem;
}

.colaborador-info span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Atividade Card (Drop Zone) */
/* Kanban Board Gamificado */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 1fr));
    /* Reduzido minmax de 280px */
    /* Minimal width for columns */
    gap: 0.75rem;
    /* Reduzido de 1rem */
    padding: 0.75rem 0.5rem;
    /* Adicionado padding lateral */
    flex: 1;
    /* Ocupa o espaço restante do painel */
    min-height: 0;
    /* Permite encolher sem forçar scroll externo */
    align-items: stretch;
    /* Garante que as colunas tenham a mesma altura */
    overflow-x: auto;
    /* Allow horizontal scroll if columns too wide */
}

.kanban-column {
    background: rgba(248, 250, 252, 0.5);
    border-radius: 20px;
    padding: 1rem 0.65rem;
    /* Reduzido levemente */
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    /* Segue a altura do board stretch */
    min-height: 0;
    /* Removido min-height fixo */
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    overflow: hidden;
    /* Force children to stay within bounds */
}

.column-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.column-header i {
    font-size: 1.2rem;
}

.column-header span {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

/* Temas das Colunas */
.column-header.missions {
    color: #3b82f6;
}

.column-header.combat {
    color: #f59e0b;
}

.column-header.victory {
    color: #10b981;
}


.unidade-popover {
    max-height: 90vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.column-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    /* Proper padding for hover effect WITHOUT negative margins */
    padding: 10px;
    margin: 0;
}


/* Custom Scrollbars para as Colunas */
.column-cards::-webkit-scrollbar {
    width: 6px;
}

.column-cards::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

.column-cards::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.column-cards::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Efeito Turbo Mode (Sprint Ativo) */
.atividade-card.turbo-active {
    border: 2px solid transparent;
    background-image: linear-gradient(#fff, #fff), linear-gradient(45deg, #f0abfc, #3b82f6, #06b6d4);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    animation: turbo-pulse 2s infinite ease-in-out;
}

@keyframes turbo-pulse {
    0% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
    }

    100% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    }
}

.atividade-card.turbo-active .card-body h4::after {
    content: ' 🚀';
    font-size: 0.9em;
}

/* Gamified Card Style */
.atividade-card {
    background: #fff;
    border-radius: 12px;
    padding: 0.6rem;
    /* Reduzido de 0.75rem */
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: visible;
    /* Prevent internal clipping */
    cursor: grab;
    height: auto;
    /* Allow growth */
    display: flex;
    flex-direction: column;
}

.atividade-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    z-index: 10;
    /* Bring to front on hover to avoid overlap issues */
}

/* Combat Mode (Em execução) */
.kanban-column#col-progress .atividade-card {
    border-left: 5px solid #f59e0b;
    background: linear-gradient(to right, #ffffff, #fffdfa);
}

.kanban-column#col-progress .atividade-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 15px rgba(245, 158, 11, 0.05);
    pointer-events: none;
}

/* Victory Mode (Concluído) */
.kanban-column#col-done .atividade-card {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.kanban-column#col-done .atividade-card h4 {
    color: #065f46;
}

/* XP Bar (Gamified Progress) */
.xp-bar-container {
    margin-top: 0.6rem;
    /* Reduzido de 0.75rem */
    background: #f1f5f9;
    height: 6px;
    /* Reduzido de 8px */
    border-radius: 3px;
    /* Ajustado de 4px */
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.xp-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.kanban-column#col-progress .xp-bar-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.kanban-column#col-done .xp-bar-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.xp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0) 100%);
    animation: xp-shine 2s infinite linear;
}

@keyframes xp-shine {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

.atividade-card .card-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.atividade-card:hover .card-actions {
    opacity: 1;
}

.status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pendente {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.em_andamento {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.concluido {
    background: #dcfce7;
    color: #166534;
}

/* Layout do Croqui 2.0 com Sidebar */
/* Layout do Croqui 2.0 com Abas */
.croqui-tabs-wrapper {
    background: #fff;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.croqui-header-tabs {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.croqui-header-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.search-tabs-box {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    gap: 0.75rem;
    width: 220px;
    flex-shrink: 0;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.search-tabs-box:focus-within {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-tabs-box i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-tabs-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-main);
}

.croqui-tabs-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    /* Garantir que fiquem em uma linha */
    padding: 0.25rem 0.5rem;
    flex: 1;
    cursor: grab;
    /* Cursor de mão para arraste */
    scrollbar-width: none;
    /* Ocultar scrollbar no Firefox */
    -ms-overflow-style: none;
    /* Ocultar no IE/Edge */
    user-select: none;
    /* Evitar seleção de texto durante arraste */
}

.croqui-tabs-container:active {
    cursor: grabbing;
}

.croqui-tabs-container::-webkit-scrollbar {
    display: none;
    /* Ocultar scrollbar no Chrome/Safari */
}

.croqui-tab-item {
    padding: 0.6rem 1.2rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    /* Impedir que as abas encolham */
}

.croqui-tab-item i {
    font-size: 0.8rem;
    opacity: 0.7;
}

.croqui-tab-item:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.croqui-tab-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.croqui-tab-item.active i {
    opacity: 1;
}

/* Turbo Mode nas Abas */
.croqui-tab-item.turbo-active {
    border-color: #f59e0b;
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    /* Texto em branco */
    position: relative;
    overflow: hidden;
}

.croqui-tab-item.turbo-active i {
    color: white;
    /* Ícone em branco */
    opacity: 1;
}

.croqui-layout-full {
    display: flex;
    flex-direction: column;
    height: auto;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.croqui-main-content {
    flex: 1;
    padding: 1rem;
    overflow: visible;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.loading-placeholder-mini {
    padding: 0.5rem;
    color: var(--primary);
}

/* Removemos .activity-nav-item pois agora usamos abas */

.croqui-container {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: none;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.croqui-grid-wrapper {
    flex: 1;
    overflow: visible;
    background: transparent;
    border-radius: 0;
    border: none;
    padding: 0;
}

.mini-dropzone {
    margin-top: 0.75rem;
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    min-height: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border: 1px dashed rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
    /* Ensure content stays within and expands vertically */
    overflow: visible;
}

.mini-dropzone:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--primary-light);
}

.colaborador-tag.compact {
    padding: 3px 8px;
    /* Slightly more breathe room */
    font-size: 0.65rem;
    border-radius: 6px;
    gap: 4px;
    max-width: 100%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.colaborador-tag.compact .tag-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    /* Allow to grow and be truncated */
    min-width: 0;
}

.colaborador-tag.compact .remove-btn {
    flex-shrink: 0;
    /* Never hide the remove button */
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.7;
}

.colaborador-tag.compact i {
    font-size: 0.6rem;
}

.mini-dropzone .drop-placeholder {
    font-size: 0.6rem;
    padding: 4px;
    opacity: 0.5;
}

/* Animação para novos cards no Kanban */
@keyframes card-entrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.atividade-card {
    animation: card-entrance 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.croqui-container {
    display: grid;
    grid-template-columns: 1fr;
    /* Full width now! */
    gap: 1.5rem;
    height: auto;
    min-height: 500px;
    overflow: visible;
    padding-bottom: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.croqui-toolbar {
    grid-column: 1;
    background: #fff;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.croqui-toolbar .form-group label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

#btnStartPlanning {
    background: linear-gradient(135deg, var(--secondary) 0%, #d97706 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
    transition: all 0.3s ease;
}

#btnStartPlanning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.3);
    filter: brightness(1.1);
}

.toolbar-group {
    margin: 0;
    min-width: 180px;
    flex: 1;
    max-width: 350px;
}

.toolbar-group label {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.card-header-mini .btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
}

.croqui-grid-wrapper {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: auto;
    /* Mudamos para auto para suportar croquis largos */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centraliza as rows */
    gap: 0;
    /* As rows já tem padding e border */
    min-height: 400px;
    width: 100%;
}


/* Animação de Celebração (100% concluído) */
@keyframes celebrate-glow {
    0% {
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(34, 197, 94, 0.8), 0 0 10px rgba(250, 204, 21, 0.5);
    }

    100% {
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.4);
    }
}

.celebrate-meta {
    animation: celebrate-glow 2s infinite ease-in-out;
    border: 2px solid #22c55e !important;
}

.unidades-container {
    display: grid;
    /* Usa a variável --grid-cols injetada pelo JS ou padrão 4 */
    grid-template-columns: repeat(var(--grid-cols, 4), 80px);
    gap: 12px;
    padding: 10px;
    width: fit-content;
    margin: 0 auto;
}

.croqui-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    /* Largura fixa para o label */
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    transition: background 0.3s ease;
}

.croqui-row:hover {
    background: rgba(248, 250, 252, 0.8);
}

.pavimento-label {
    min-width: 120px;
    text-align: right;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Grid Livre e Edição */
.croqui-free-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    justify-content: center;
    min-height: 200px;
}

.grid-edit-mode .unidade-cell {
    cursor: move;
    border: 2px dashed #94a3b8;
}

.grid-edit-mode .unidade-cell:hover {
    border-color: var(--primary);
    background: #f0f9ff;
}

.grid-ghost {
    opacity: 0.3;
    background: var(--primary-light) !important;
}

.dragging {
    opacity: 0.5;
}

.croqui-row.special-pav .unidades-container {
    background: rgba(30, 64, 175, 0.05);
    /* Um azul sutil para diferenciar */
    border-radius: 12px;
    padding: 5px;
    width: fit-content;
    margin: 0 auto;
}

.unidade-cell {
    width: 80px;
    /* Reduzido de 100px para caber mais unidades por linha */
    height: 80px;
    /* Reduzido de 100px */
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    /* Ajustado */
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Efeito Bouncy */
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    user-select: none;
}

.unidade-cell:hover {
    border-color: var(--primary);
    background: #fff;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.unidade-cell:active {
    transform: scale(0.95);
}

.unidade-cell.drag-over {
    background: #fffbeb;
    border: 2px dashed #f59e0b;
}

.unidade-cell b {
    font-size: 0.75rem;
}

/* Unidade Especial: Escada / Hall */
.unidade-cell.special-unit {
    background: #f1f5f9;
    width: 70px;
    /* Mais estreito para não atrapalhar o grid */
    border-style: dashed;
    color: #475569;
}

.unidade-cell.special-unit b {
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 1px;
}

.unidade-cell .ocupante-tag {
    background: var(--primary);
    color: #fff;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    margin-top: 6px;
    max-width: 75px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.unidade-cell .remove-ocupante {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    cursor: pointer;
    z-index: 10;
}

.unidade-cell:hover .remove-ocupante {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* --- Estilos para Assinatura e Fotos --- */
.signature-container {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    position: relative;
}

.signature-pad {
    width: 100%;
    height: 150px;
    cursor: crosshair;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    touch-action: none;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 5px;
}

.photo-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .remove-photo {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 77, 77, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Removido ícone azul (toggle-done-unidade) conforme solicitado para evitar sobreposição */
/* Restaurado ícone de conclusão (toggle-done-unidade) no canto superior esquerdo */
.toggle-done-unidade {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 22px;
    height: 22px;
    background: #3b82f6;
    /* Azul vibrante */
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    z-index: 15;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid #fff;
}

.unidade-cell:hover .toggle-done-unidade {
    display: flex;
}

.toggle-done-unidade:hover {
    transform: scale(1.2);
    background: #2563eb;
}

.unidade-cell.concluido {
    background: #f0fdf4;
    border-color: #22c55e;
    animation: success-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes success-pop {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.unidade-cell.ocupado {
    background: #fffbeb;
    border-color: #f59e0b;
    animation: status-change 0.3s ease-out;
}

.unidade-cell.nao-se-aplica {
    background: #f1f5f9;
    border-color: #94a3b8;
    opacity: 0.7;
}

.unidade-cell.nao-se-aplica .ocupante-tag {
    background: #94a3b8;
    color: white;
}

@keyframes status-change {
    0% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

.unidade-cell.concluido .ocupante-tag {
    background: #22c55e;
}

.unidade-cell.concluido .toggle-done-unidade {
    background: #10b981;
    /* Verde ao estar concluído */
    display: flex;
    /* Sempre visível se concluído */
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.unidade-cell:hover .toggle-done-unidade {
    display: flex;
}

/* Estilos para Alocação por Equipe */
.colaborador-card.team-drag-card {
    background: #f0f7ff;
    border: 2px dashed var(--primary);
}

.colaborador-tag.team-tag {
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Estilos para EAP Inteligente e Progresso */
.atividade-progress-section {
    margin: 1rem 0;
}

.progress-bar-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.5s ease-out;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.alert-status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Estilos para Planejamento de Metas (Sprints) */
.planning-banner {
    grid-column: span 2;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 6px solid var(--secondary);
    animation: slideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.planning-info h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

/* --- Drag & Drop Hub --- */
.hub-sidebar-drop-zone {
    min-height: 20px;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s;
}

.colab-pill-list {
    min-height: 40px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px dashed rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.colab-pill-list:empty::after {
    content: 'Arraste para cá';
    font-size: 0.7rem;
    color: #94a3b8;
    width: 100%;
    text-align: center;
    padding: 10px 0;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-light) !important;
    border: 2px dashed var(--primary) !important;
}

.tree-node-colab.sortable-chosen,
.colab-pill.sortable-chosen {
    background: #e0f2fe;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    cursor: grabbing !important;
}

.colab-pill-list.sortable-drag {
    background: rgba(37, 99, 235, 0.05);
    border-color: var(--primary);
}

.planning-info h3 {
    margin: 0;
    color: var(--secondary);
    font-size: 1.2rem;
}

.planning-info p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.planning-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.planning-controls .date-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.planning-controls .modern-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
}

/* Efeito no Mapa em Modo Planejamento */
.planning-active .unidade-cell {
    opacity: 0.5;
    filter: grayscale(0.4);
    transform: scale(0.96);
    transition: all 0.2s;
}

.planning-active .unidade-cell.selected-for-sprint {
    opacity: 1 !important;
    filter: none !important;
    transform: scale(1.08) !important;
    background: #ecfdf5 !important;
    border: 4px solid #10b981 !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    z-index: 50;
    color: #065f46;
}

.unidade-cell.in-active-sprint {
    border: 3px solid var(--secondary) !important;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
    animation: pulse-glow 2s infinite alternate;
}

/* Unidade planejada para ser executada na semana corrente (sutil) */
.unidade-cell.planned-this-week:not(.concluido):not(.reservado-contrato) {
    border: 2px dashed #f59e0b !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}


@keyframes pulse-glow {
    from {
        box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
    }

    to {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.progress-bar {
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite linear;
}

/* Celebrate State para Sprint 100% */
.sprint-summary-card.celebrate {
    border: 2px solid #fbbf24;
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.2);
    position: relative;
    overflow: hidden;
}

.sprint-summary-card.celebrate::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.1) 0%, transparent 70%);
    animation: rotate-glow 10s linear infinite;
    pointer-events: none;
}

@keyframes rotate-glow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.sprint-summary-card.celebrate #executionProgressBar {
    background-color: #fbbf24;
    background-image: linear-gradient(90deg, #fbbf24, #f59e0b, #fbbf24);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

/* Removido ícone de sprint (::after) conforme solicitado */

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Card de Resumo do Sprint Ativo */
.sprint-summary-card {
    grid-column: span 2;
    /* Ocupar largura total para não empurrar croqui */
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.4s ease-out;
}

.sprint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.sprint-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #fff;
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.sprint-title h4 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
}

.badge-date {
    font-size: 0.75rem;
    color: #64748b;
    background: #f8fafc;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
}


/* Popover de Unidade (Balão) */
.unidade-popover {
    display: none;
    position: fixed;
    z-index: 10000;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    gap: 12px;
    width: 850px;
    max-width: 95vw;
    border: 1px solid #e2e8f0;
    animation: popover-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: top center;
}

@keyframes popover-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.unidade-popover h5 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unidade-popover .close-popover {
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.unidade-popover .close-popover:hover {
    color: #ef4444;
}

.unidade-popover-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.unidade-popover-form label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin: 0;
}

.unidade-popover-form select,
.unidade-popover-form textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 8px;
    font-size: 0.85rem;
    transition: border-color 0.2s;
}

.unidade-popover-form select:focus,
.unidade-popover-form textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.popover-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}

.popover-actions button {
    flex: 1;
}

/* Seta do Balão */
.unidade-popover::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg) translateX(-50%);
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.05);
}

.sprint-progress-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.progress-item .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.modern-progress-bar {
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-fill.execution {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-fill.time {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Efeito de Destaque no Croqui */
.croqui-container.has-active-sprint .unidade-cell:not(.in-active-sprint):not(.concluido) {
    opacity: 0.6;
    /* Menos opaco que antes */
    filter: grayscale(0.5);
    /* Menos cinza que antes */
}

/* Unidades concluídas devem ser bem visíveis mesmo fora do sprint */
.croqui-container.has-active-sprint .unidade-cell.concluido {
    opacity: 1 !important;
    filter: none !important;
}

/* Estilos Histórico de Metas */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-bottom: 15px;
}

.history-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-info strong {
    color: #1e293b;
    font-size: 1rem;
}

.history-info span {
    font-size: 0.8rem;
    color: #64748b;
}

.history-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.badge-ativo {
    background: #dcfce7;
    color: #166534;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-encerrado {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.mini-progress-bar {
    width: 100px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
}

.croqui-container.has-active-sprint .unidade-cell.in-active-sprint {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
    transform: scale(1.02);
}

/* --- NOVOS ESTILOS POP-OVER E CHECKLIST --- */
.unidade-popover {
    width: 850px;
    max-width: 95vw;
    /* Largura ajustada para o formato horizontal */
    min-height: auto;
    /* Removido min-height fixo */
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: fixed;
    z-index: 1000;
    padding: 1.2rem;
    display: none;
    flex-direction: column;
}

.checklist-input-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.checklist-container {
    flex: 1;
    /* Ocupar espaço disponível */
    max-height: 250px;
    overflow-y: auto;
    margin-top: 12px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Visão Macro: Remover scroll interno para evitar barras duplas */
.unidade-popover.macro-view {
    overflow-y: auto;
    width: 550px !important;
    /* Largura ajustada para acomodar abas e lista de medição */
}

.unidade-popover.macro-view .popover-grid {
    grid-template-columns: 1fr !important;
}

.unidade-popover.macro-view .popover-grid .popover-item,
.unidade-popover.macro-view .checklist-input-group,
.unidade-popover.macro-view .popover-header-macro-hide,
.unidade-popover.macro-view .popover-actions,
.unidade-popover.macro-view input,
.unidade-popover.macro-view select,
.unidade-popover.macro-view textarea,
.unidade-popover.macro-view .popover-tabs,
.unidade-popover.macro-view button[onclick="openModalMovimentacaoEstoque()"] {
    display: none !important;
}

/* Estilos para Medição por Unidade (Fluxo Inverso) */
.medicao-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 5px;
}

.medicao-item {
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.medicao-item:hover {
    border-color: var(--primary) !important;
    background: #f0f7ff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.status-badge-toggle {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.status-badge-toggle:active {
    transform: scale(0.95);
}

.status-badge-toggle.status-pendente {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.status-badge-toggle.status-andamento {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-badge-toggle.status-concluido {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Estilos para o Mapa de Calor */
.heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
}

.heatmap-table th,
.heatmap-table td {
    border: 1px solid #e2e8f0;
    padding: 10px;
    text-align: center;
    white-space: nowrap;
}

.heatmap-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    font-size: 0.65rem;
    height: 140px;
    vertical-align: bottom;
    padding: 10px 5px;
}

.heatmap-table th div {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: left;
    margin: 0 auto;
    white-space: nowrap;
}

.heatmap-table th:first-child {
    left: 0;
    z-index: 20;
    background: #f1f5f9;
    writing-mode: horizontal-tb;
    transform: none;
    height: auto;
    vertical-align: middle;
}

.heatmap-table td:first-child {
    position: sticky;
    left: 0;
    background: #f8fafc;
    font-weight: 700;
    color: #1e293b;
    z-index: 5;
    text-align: left;
    white-space: nowrap;
}

.heatmap-cell {
    min-width: 35px;
    width: 35px;
    height: 35px;
    transition: transform 0.2s;
    cursor: default;
    border-radius: 4px;
    padding: 0 !important;
    position: relative !important;
}

.heatmap-cell .hm-text {
    font-size: 0.7rem;
    font-weight: 800;
    color: #1e293b;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.heatmap-cell.hm-status-concluido .hm-text {
    color: white !important;
}

.heatmap-cell .hm-indicator-restriction {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 0.55rem;
    color: #ef4444;
    /* Vermelho de alerta */
    pointer-events: none;
}

.heatmap-cell .hm-indicator-sprint {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.55rem;
    color: #2563eb;
    /* Azul para metas */
    pointer-events: none;
}

.heatmap-cell .hm-indicator-overdue {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 0.55rem;
    color: #ef4444;
    /* Vermelho para atraso */
    pointer-events: none;
}

.heatmap-cell.planned-now {
    border: 2px dashed #f59e0b !important;
    /* Destaque de execução na semana */
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.heatmap-cell:hover {
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.hm-status-concluido {
    background-color: #10b981 !important;
    color: white;
}

.hm-status-progresso {
    background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 6px, #fbbf24 6px, #fbbf24 12px) !important;
    color: white;
}

.hm-status-parado {
    background: repeating-linear-gradient(45deg, #ef4444, #ef4444 6px, #f87171 6px, #f87171 12px) !important;
    color: white;
}

.hm-status-pendente {
    background-color: #f1f5f9 !important;
    color: #94a3b8;
}

.hm-status-nao-aplicavel {
    background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 6px, #e2e8f0 6px, #e2e8f0 12px) !important;
    color: #cbd5e1;
}

.hm-status-nao-aplica {
    background: #f1f5f9 !important;
    color: #94a3b8;
    border: 1px solid #e2e8f0 !important;
}

.hm-status-nao-aplica .hm-text {
    color: #94a3b8;
}

.unidade-popover.macro-view .checklist-container {
    max-height: none;
    overflow-y: visible;
    background: transparent;
    padding: 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 10px;
    /* Mais fofinho */
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.checklist-item:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.checklist-pill small {
    margin-left: 4px;
    opacity: 0.8;
    font-style: italic;
}

.checklist-item span.done {
    text-decoration: line-through;
    color: #94a3b8;
}

.checklist-item .remove-item {
    margin-left: auto;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.6;
}

.checklist-item .remove-item:hover {
    opacity: 1;
}

/* Estilos de Impressão OS (Checklist) */
.print-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.checklist-pill {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #e2e8f0;
}

.checklist-pill.done {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

/* --- ESTILOS DE IMPRESSÃO OS (HIGHLIGHT SPRINTS) --- */
.unit-print.in-scope.in-sprint {
    border: 2px solid #f59e0b !important;
    background: #fffbeb !important;
    position: relative;
}

.sprint-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    color: #f59e0b;
}

.unit-print.done .sprint-icon {
    color: #10b981;
}

/* Estilos para o CRUD de Empreiteiros */
.btn-edit-equipe {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit-equipe:hover {
    color: var(--primary);
    background: rgba(255, 153, 0, 0.1);
    transform: scale(1.1);
}

.empreiteiro-header {
    transition: background 0.2s ease;
}

.empreiteiro-header:hover {
    background: #f8fafc;
}

/* --- MODERN DROPDOWN SYSTEM --- */
.modern-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    display: none;
    min-width: 180px;
    padding: 0.5rem 0;
    margin: 0.5rem 0 0;
    background-color: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: fadeInScale 0.2s ease-out;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0.75rem 1.25rem;
    clear: both;
    font-weight: 500;
    color: var(--text-main);
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.dropdown-item i {
    width: 16px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.dropdown-item:hover {
    background-color: #f8fafc;
    color: var(--primary);
}

.dropdown-item:hover i {
    opacity: 1;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   MODAL DETALHES DA ATIVIDADE
   ======================================== */
.atividade-resumo-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 25px;
}

.stat-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 18px 12px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: #fff;
    border-color: var(--primary-light);
}

.stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    display: block;
}

/* Estilos para Itens de OS (Usados no Sidebar e no Modal Detalhes) */
.os-item-sidebar {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.os-item-sidebar:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.os-item-sidebar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.os-item-sidebar-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary);
}

.os-item-sidebar-desc {
    font-size: 0.75rem;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.3;
}

.os-item-sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
}

.os-item-sidebar-date {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Estilos de Paginao */
.pagination-container {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    width: 100%;
}

.btn-load-more {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.btn-load-more:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-load-more i {
    font-size: 0.9rem;
}

/* ========================================
   VISUALIZAÇÃO HIERÁRQUICA DO EFETIVO (HUB)
   ======================================== */
.workforce-hierarchy-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.obra-workforce-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.obra-workforce-card:hover {
    box-shadow: var(--shadow-md);
}

.obra-workforce-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f5f9;
    padding: 0.5rem 0.8rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    border-radius: 8px;
}

.obra-workforce-header:hover {
    background-color: #f8fafc;
}

.collapse-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    color: #64748b;
}

.obra-workforce-header h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.obra-workforce-header .workforce-badge {
    background: #fff7ed;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid #ffedd5;
}

.equipe-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.equipe-subgroup {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.2rem;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.equipe-subgroup-header {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.equipe-subgroup-header .count {
    background: #fff;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    border: 1px solid #e2e8f0;
}

.colab-pill-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.colab-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
    cursor: default;
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
}

.colab-pill span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.colab-pill:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.colab-pill:hover i.fa-pen {
    opacity: 1 !important;
    color: var(--primary);
}

.colab-pill i {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Novo Layout de Hierarquia HUB */
.hierarchy-split-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1rem;
}

.hierarchy-sidebar {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.25rem;
    position: sticky;
    top: 10px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.hierarchy-sidebar h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.sidebar-tree-item {
    margin-bottom: 15px;
}

.tree-node-emp {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-node-func {
    margin-left: 15px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 5px;
    border-left: 2px solid #e2e8f0;
    padding-left: 10px;
}

.tree-node-colab {
    margin-left: 25px;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.tree-node-colab:hover {
    background: #f8fafc;
    color: var(--primary);
}

.hierarchy-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .hierarchy-split-layout {
        grid-template-columns: 1fr;
    }

    .hierarchy-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }
}

/* --- SISTEMA DE CHAMADA (MOBILE-FRIENDLY) --- */
.attendance-mobile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.attendance-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.2s;
}

.attendance-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.attendance-colab-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.attendance-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary);
    font-size: 1rem;
    border: 1px solid #e2e8f0;
}

.attendance-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.att-btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 10px 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    transition: all 0.2s;
    text-align: center;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.att-btn:active {
    transform: scale(0.95);
}

.att-btn.active-PRESENTE {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #10b981 !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.att-btn.active-FALTA {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #ef4444 !important;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

@media (max-width: 600px) {
    .attendance-mobile-grid {
        grid-template-columns: 1fr;
    }

    .att-btn {
        padding: 12px 2px;
        font-size: 0.85rem;
    }
}

/* --- BARRA DE EQUIPES NA CHAMADA --- */
.attendance-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.team-attendance-card {
    background: white;
    border-radius: 14px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.team-attendance-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.team-attendance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.team-attendance-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-attendance-stats {
    display: flex;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 800;
}

.stat-pill {
    padding: 2px 8px;
    border-radius: 12px;
}

.stat-pill.p {
    background: #dcfce7;
    color: #166534;
}

.stat-pill.f {
    background: #fee2e2;
    color: #991b1b;
}

.stat-pill.total {
    background: #f1f5f9;
    color: #64748b;
}

.team-attendance-progress {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.team-attendance-progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

@media (max-width: 600px) {
    .attendance-teams-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   MEDICAO MOBILE-FRIENDLY
   ======================================== */
@media (max-width: 900px) {

    /* Stack as colunas do modal de unidade */
    #modalUnidadeDetalhes .modal-body {
        flex-direction: column !important;
        gap: 20px !important;
        overflow-y: auto !important;
        height: auto !important;
    }

    #modalUnidadeDetalhes .modal-body>div:first-child {
        width: 100% !important;
        border-right: none !important;
        padding-right: 0 !important;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 20px;
    }

    #modalUnidadeDetalhes .modal-body>div:last-child {
        padding-left: 0 !important;
    }

    /* Aumentar itens de medição para toque */
    .medicao-item {
        padding: 16px !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .medicao-item>div:first-child {
        width: 100%;
    }

    .medicao-item .status-badge-toggle {
        width: 100% !important;
        padding: 12px !important;
        font-size: 0.9rem !important;
    }

    /* Seletor de data e equipe em linha ou coluna */
    #modal-section-medicao>div:nth-child(2) {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #modal-section-medicao>div:nth-child(2)>div {
        width: 100% !important;
    }
}

/* ==========================================================================
   Estilização do Prazo e Duração nas Células do Croqui
   ========================================================================== */
.unidade-prazo {
    font-size: 0.6rem;
    color: #64748b;
    margin-top: 4px;
    font-weight: 600;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.unidade-prazo.atrasado {
    color: #ef4444;
    font-weight: 700;
}

.unidade-prazo.concluido {
    color: #94a3b8;
    font-weight: 500;
}

/* ==========================================================================
   CSS Responsivo Mobile (Qualidade & Medição Financeira)
   ========================================================================== */
@media (max-width: 768px) {

    /* Abas Secundárias Deslizantes */
    .tabs-sub {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 8px !important;
        padding-bottom: 8px !important;
        margin-bottom: 15px !important;
        scrollbar-width: none;
    }

    .tabs-sub::-webkit-scrollbar {
        display: none;
    }

    .tab-sub-btn {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
    }

    /* Quadro Kanban com Carrossel Lateral e Scroll-Snap */
    .kanban-board {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        gap: 12px !important;
        padding: 10px 5px !important;
        scrollbar-width: thin;
        margin-bottom: 15px;
    }

    .kanban-column {
        min-width: 85vw !important;
        max-width: 85vw !important;
        flex-shrink: 0 !important;
        scroll-snap-align: start !important;
        min-height: 450px !important;
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    /* Tabelas */
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px !important;
        margin-top: 1rem !important;
    }

    .modern-table {
        min-width: 600px;
        /* Garante que a tabela tenha scroll e não esprema */
    }

    /* Cabeçalhos de Página e Controles */
    .content-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 1.5rem 1rem !important;
    }

    .content-header>div {
        text-align: left !important;
    }

    .content-header .flex,
    .content-header div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .content-header button,
    .content-header select,
    .content-header a {
        width: 100% !important;
        justify-content: center !important;
    }

    /* KPIs / Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stat-card {
        padding: 12px !important;
    }

    .stat-card h3 {
        font-size: 1.25rem !important;
    }

    /* Croqui e Filtros */
    .croqui-tab-item {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
    }

    .croqui-pavimento-row {
        min-width: 500px !important;
    }

    .croqui-unit-cell {
        padding: 6px 2px !important;
        font-size: 0.7rem !important;
    }

    .croqui-unit-value {
        font-size: 0.55rem !important;
    }

    /* Ajustes específicos do Tooltip Bottom-Sheet */
    .croqui-bottom-sheet-tooltip {
        position: fixed !important;
        left: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15) !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        border-bottom: none !important;
        transform: translateY(100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s !important;
        z-index: 100000 !important;
        background: white !important;
        padding: 20px 16px 30px 16px !important;
        pointer-events: auto !important;
    }

    .croqui-bottom-sheet-tooltip.active {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
}

/* ============================================
   HOME DASHBOARD — PAINEL EXECUTIVO
   ============================================ */

.home-greeting {
    margin-bottom: 1.5rem;
}

.home-greeting h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.home-greeting h1 .wave {
    display: inline-block;
    animation: wave-anim 2.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave-anim {

    0%,
    60%,
    100% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }
}

.home-greeting .home-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 6px 0 0;
    font-weight: 500;
}

.home-greeting .home-date {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 2px;
}

/* Barra de Alertas Críticos */
.home-alerts-bar {
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 14px 20px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    animation: fadeSlideIn 0.5s ease-out;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-alerts-bar .alert-icon {
    background: #ef4444;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.home-alert-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #991b1b;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 8px;
    transition: background 0.2s;
    white-space: nowrap;
}

.home-alert-item:hover {
    background: rgba(239, 68, 68, 0.08);
}

.home-alert-item .alert-count {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 99px;
    min-width: 20px;
    text-align: center;
}

.home-alert-item.warning {
    color: #92400e;
}

.home-alert-item.warning .alert-count {
    background: #f59e0b;
}

/* Grid de Módulos */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
}

/* Card de Módulo */
.home-module-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.home-module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.home-module-card .card-header {
    padding: 18px 22px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-module-card .card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.home-module-card .card-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.home-module-card .card-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
}

.home-module-card .card-body {
    padding: 0 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Cada métrica */
.home-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.home-module-card:hover .home-metric {
    background: #f1f5f9;
}

.home-metric .metric-label {
    font-size: 0.8rem;
    color: #475569;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-metric .metric-label i {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
    opacity: 0.6;
}

.home-metric .metric-value {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.home-metric .metric-value.success {
    color: #10b981;
}

.home-metric .metric-value.warning {
    color: #f59e0b;
}

.home-metric .metric-value.danger {
    color: #ef4444;
}

.home-metric .metric-value.info {
    color: #3b82f6;
}

.home-metric .metric-value.currency {
    font-size: 0.9rem;
}

/* Navigate hint */
.home-module-card .card-footer {
    padding: 10px 22px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
}

.home-module-card:hover .card-footer {
    opacity: 1;
}

/* ============================================
   COCKPIT GERENCIAL (HOME DASHBOARD v2)
   ============================================ */

.cockpit-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.cockpit-row {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

.cockpit-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cockpit-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.cockpit-card-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cockpit-card-title i {
    color: var(--primary);
}

.cockpit-table {
    width: 100%;
    border-collapse: collapse;
}

.cockpit-table th,
.cockpit-table td {
    padding: 8px 4px;
    text-align: left;
    font-size: 0.8rem;
    border-bottom: 1px solid #f1f5f9;
}

.cockpit-table th {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.cockpit-table tr:last-child td {
    border-bottom: none;
}

.cockpit-table .amount {
    font-weight: 700;
    color: #10b981;
    text-align: right;
}

/* Responsivo */
@media (max-width: 768px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .cockpit-row {
        flex-direction: column;
    }

    .home-greeting h1 {
        font-size: 1.4rem;
    }

    .home-alerts-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ==========================================================================
   MÓDULO DE ORÇAMENTO DE OBRAS (EAP & COMPOSIÇÕES)
   ========================================================================== */

.eap-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', 'Outfit', sans-serif;
    margin-top: 10px;
}

.eap-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 15px;
}

.eap-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

.eap-table tr {
    transition: background 0.15s ease;
}

.eap-table tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.4);
}

/* Linha de Composição (Insumos) */
.composicao-row {
    background: #fafbfc;
    transition: background 0.15s ease;
}

.composicao-row:hover {
    background: #f1f5f9 !important;
}

/* Edição Inline */
.edit-inline-text {
    border-bottom: 1px dashed #cbd5e1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.edit-inline-text:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #1e3a8a;
    border-bottom-color: #3b82f6;
}

.edit-inline-text input {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Badges de Status do Orçamento */
.status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.status-rascunho {
    color: #64748b;
    background: #f1f5f9;
}

.status-badge.status-ativo {
    color: #10b981;
    background: #d1fae5;
}

.status-badge.status-revisao {
    color: #f59e0b;
    background: #fef3c7;
}

.status-badge.status-fechado {
    color: #ef4444;
    background: #fee2e2;
}

/* Cards de Orçamento na listagem */
.orcamento-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
    transition: all 0.2s ease-in-out;
}

.orcamento-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

/* Estilos de Impressão */
@media print {
    body * {
        visibility: hidden;
    }

    #page-orcamento,
    #page-orcamento * {
        visibility: visible;
    }

    #page-orcamento {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .content-header,
    .tabs-sub-container,
    .planilha-header button,
    .planilha-header select,
    .eap-table th:last-child,
    .eap-table td:last-child {
        display: none !important;
    }

    .eap-table {
        font-size: 10pt;
    }
}

/* Autocomplete Inline de Insumos na Planilha */
.autocomplete-container-inline {
    position: relative;
    width: 100%;
}

.autocomplete-input-inline {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    outline: none;
    font-size: 0.85rem;
    box-sizing: border-box;
    background: #ffffff;
    color: #1e293b;
}

.autocomplete-suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    z-index: 999;
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

.autocomplete-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #334155;
    transition: background 0.15s ease;
}

.autocomplete-suggestion-item:last-child {
    border-bottom: none;
}

.autocomplete-suggestion-item:hover,
.autocomplete-suggestion-item.active {
    background-color: #eff6ff;
    color: #1e3a8a;
}

/* Ajustes de estilo do botão discreto */
.btn-discrete-add {
    background: #10b981;
    color: white;
    border: none;
    padding: 3px 8px;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-discrete-add:hover {
    background: #059669;
}

/* Sidebar de Grupos de Insumos */
.sidebar-grupos {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid #f1f5f9;
    padding-right: 15px;
}

.arvore-grupo-item {
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    user-select: none;
    font-size: 0.85rem;
}

.arvore-grupo-item:hover {
    background: #f1f5f9;
    color: #1e3a8a;
}

.arvore-grupo-item.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.arvore-grupo-item i {
    font-size: 0.9rem;
}

/* --- DRAWER DE ANOTAÇÕES & RESTRIÇÕES --- */

.croqui-layout-full {
    position: relative;
    overflow: hidden;
    /* Mantém o drawer dentro da área do croqui */
}

/* Botão discreto para abrir/fechar o drawer */
.annotations-toggle-btn {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    background: var(--primary, #2563eb);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.annotations-toggle-btn:hover {
    background: #1d4ed8;
    width: 28px;
}

.annotations-toggle-btn.open {
    right: 360px;
    /* Move-se junto com o drawer */
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

/* Drawer deslizante */
.croqui-annotations-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid var(--border, #e2e8f0);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
    z-index: 140;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.croqui-annotations-drawer.open {
    transform: translateX(0);
}

.croqui-annotations-drawer .drawer-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.croqui-annotations-drawer .drawer-title-area h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.croqui-annotations-drawer .drawer-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
    display: block;
    margin-top: 4px;
}

.croqui-annotations-drawer .btn-close-drawer {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: color 0.2s;
    outline: none;
}

.croqui-annotations-drawer .btn-close-drawer:hover {
    color: #ef4444;
}

.croqui-annotations-drawer .drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.croqui-annotations-drawer .drawer-section {
    display: flex;
    flex-direction: column;
}

.croqui-annotations-drawer .section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.croqui-annotations-drawer .section-title i {
    color: var(--primary, #2563eb);
}

.croqui-annotations-drawer .modern-textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    resize: none;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.croqui-annotations-drawer .modern-textarea:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.croqui-annotations-drawer .drawer-divider {
    border: none;
    border-top: 1px solid var(--border, #e2e8f0);
    margin: 0.5rem 0;
    opacity: 0.6;
}

/* Nova Restrição Form */
.croqui-annotations-drawer .new-restriction-form {
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

/* Lista de Restrições */
.croqui-annotations-drawer .restrictions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.croqui-annotations-drawer .restriction-item {
    background: #ffffff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: all 0.2s;
}

.croqui-annotations-drawer .restriction-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
}

.croqui-annotations-drawer .restriction-checkbox {
    margin-top: 3px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #10b981;
}

.croqui-annotations-drawer .restriction-content {
    flex: 1;
    min-width: 0;
}

.croqui-annotations-drawer .restriction-text {
    font-size: 0.85rem;
    color: #1e293b;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.3;
}

.croqui-annotations-drawer .restriction-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
}

.croqui-annotations-drawer .restriction-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.croqui-annotations-drawer .restriction-meta i {
    font-size: 0.65rem;
}

/* Status: Resolvido */
.croqui-annotations-drawer .restriction-item.resolvida {
    background: #f8fafc;
    border-color: #e2e8f0;
    opacity: 0.7;
}

.croqui-annotations-drawer .restriction-item.resolvida .restriction-text {
    text-decoration: line-through;
    color: #64748b;
}

.croqui-annotations-drawer .restriction-item.resolvida .badge-resolved {
    color: #10b981;
    background: #ecfdf5;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.65rem;
}

/* Status: Vencido */
.croqui-annotations-drawer .restriction-item.vencida .restriction-meta .meta-date {
    color: #ef4444;
    background: #fee2e2;
    padding: 1px 5px;
    border-radius: 4px;
}

.croqui-annotations-drawer .btn-delete-restriction {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.8rem;
    transition: color 0.2s;
    outline: none;
    align-self: center;
}

.croqui-annotations-drawer .btn-delete-restriction:hover {
    color: #ef4444;
}

.croqui-annotations-drawer .empty-list-text {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
    padding: 15px 0;
}

/* ==========================================================================
   Quadro de Restrições (Look-ahead Board) Centralizado
   ========================================================================== */

.restricoes-kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.restricoes-kanban-col {
    display: flex;
    flex-direction: column;
    min-height: 450px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.restricoes-kanban-col .col-cards-container {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 600px;
}

/* Card de Restrição no Quadro */
.restricao-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    position: relative;
    cursor: default;
}

.restricao-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.restricao-card .card-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #10b981;
    cursor: pointer;
    margin-top: 3px;
    flex-shrink: 0;
}

.restricao-card .card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
}

.restricao-card .card-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    word-break: break-word;
    line-height: 1.4;
}

.restricao-card .card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.restricao-card .badge-ativ {
    background: #eef2ff;
    color: #4f46e5;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restricao-card .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    align-items: center;
}

.restricao-card .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.restricao-card .meta-item.overdue {
    color: #ef4444;
    background: #fee2e2;
    padding: 1px 5px;
    border-radius: 4px;
}

.restricao-card .card-actions {
    display: flex;
    gap: 6px;
    align-self: center;
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 5px;
}

.restricao-card:hover .card-actions {
    opacity: 1;
}

.restricao-card .btn-action {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 0.8rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.restricao-card .btn-action:hover {
    color: var(--text-dark);
    background: #f1f5f9;
}

.restricao-card .btn-action.delete:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Modificadores de Status do Card */
.restricao-card.resolved {
    background: #f8fafc;
    opacity: 0.7;
    border-color: #e2e8f0;
}

.restricao-card.resolved .card-text {
    text-decoration: line-through;
    color: #64748b;
}

.restricao-card.overdue {
    border-left: 4px solid #ef4444;
}

.restricao-card.pending {
    border-left: 4px solid #3b82f6;
}

.restricao-card.resolved-border {
    border-left: 4px solid #22c55e;
}

/* Responsividade do Kanban de Restrições */
@media (max-width: 992px) {
    .restricoes-kanban-board {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* Badges de Restrição (Tag e Atividade Antecessora) */
.restricao-card .badge-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.restricao-card .badge-tag.tag-material {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.restricao-card .badge-tag.tag-projeto {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.restricao-card .badge-tag.tag-mao-de-obra {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.restricao-card .badge-tag.tag-equipamento {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.restricao-card .badge-tag.tag-outros {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.restricao-card .badge-antecessora {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecdd3;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================================
   IMPRESSÃO DO QUADRO DE RESTRIÇÕES (LOOK-AHEAD)
   ======================================================== */
@media print {
    body.printing-restricoes * {
        visibility: hidden;
    }

    body.printing-restricoes #page-equipes,
    body.printing-restricoes #page-equipes *,
    body.printing-restricoes #equipes-view-restricoes,
    body.printing-restricoes #equipes-view-restricoes * {
        visibility: visible;
    }

    body.printing-restricoes {
        background: white !important;
        color: black !important;
    }

    body.printing-restricoes .sidebar,
    body.printing-restricoes header,
    body.printing-restricoes .tabs-sub-header,
    body.printing-restricoes .content-header,
    body.printing-restricoes .filters-container-restricoes,
    body.printing-restricoes .card-header-mini button,
    body.printing-restricoes .card-actions,
    body.printing-restricoes .card-checkbox,
    body.printing-restricoes #debug-panel {
        display: none !important;
    }

    body.printing-restricoes #page-equipes {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    body.printing-restricoes #equipes-view-restricoes {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    body.printing-restricoes .card-mini {
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.printing-restricoes .card-header-mini {
        border-bottom: 2px solid #333 !important;
        padding-bottom: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    body.printing-restricoes .restricoes-kanban-board {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
        width: 100% !important;
        margin-top: 1rem !important;
    }

    body.printing-restricoes .restricoes-kanban-col {
        box-shadow: none !important;
        border: 1px solid #94a3b8 !important;
        background: #f8fafc !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        page-break-inside: avoid;
    }

    body.printing-restricoes .restricoes-kanban-col.limit-overdue {
        border-color: #fca5a5 !important;
        background: #fff5f5 !important;
    }

    body.printing-restricoes .restricoes-kanban-col.limit-overdue .col-title {
        background: #fee2e2 !important;
        border-bottom: 1px solid #fca5a5 !important;
        color: #991b1b !important;
    }

    body.printing-restricoes .restricoes-kanban-col:not(.limit-overdue) .col-title {
        background: #f1f5f9 !important;
        border-bottom: 1px solid #cbd5e1 !important;
        color: #334155 !important;
    }

    body.printing-restricoes .restricao-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        margin-bottom: 10px !important;
        background: white !important;
        page-break-inside: avoid;
    }

    body.printing-restricoes .restricao-card.overdue {
        border-left: 4px solid #ef4444 !important;
    }

    body.printing-restricoes .restricao-card.pending {
        border-left: 4px solid #3b82f6 !important;
    }

    body.printing-restricoes .restricao-card.resolved-border {
        border-left: 4px solid #22c55e !important;
    }
}

/* ========================================
   SEARCHABLE SELECT CUSTOM COMPONENT
   ======================================== */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.searchable-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0.4rem 0.8rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.searchable-select-trigger:after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

.searchable-select-wrapper.open .searchable-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

.searchable-select-wrapper.open .searchable-select-trigger:after {
    transform: rotate(180deg);
}

.searchable-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 8px;
    box-sizing: border-box;
    animation: slideDown 0.15s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.searchable-select-wrapper.open .searchable-select-dropdown {
    display: block;
}

.searchable-select-search-input {
    width: 100% !important;
    height: 32px !important;
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    margin-bottom: 8px !important;
    outline: none !important;
    box-sizing: border-box !important;
    background: white !important;
}

.searchable-select-search-input:focus {
    border-color: var(--primary) !important;
}

.searchable-select-options {
    max-height: 180px !important;
    overflow-y: auto !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
}

.searchable-select-option {
    display: block !important;
    position: relative !important;
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
    padding: 8px 12px !important;
    margin: 0 0 2px 0 !important;
    line-height: 1.4 !important;
    font-size: 0.85rem !important;
    color: #334155 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

.searchable-select-option:hover {
    background: #f1f5f9 !important;
}

.searchable-select-option.selected {
    background: #eff6ff !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.searchable-select-option.hidden {
    display: none !important;
}

.searchable-select-no-results {
    padding: 12px !important;
    font-size: 0.8rem !important;
    color: #94a3b8 !important;
    text-align: center !important;
}

.searchable-select-wrapper.disabled .searchable-select-trigger {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   SORTABLE ACTIVITIES ORDER COMPONENT
   ======================================== */
.sortable-activity-item {
    display: flex !important;
    align-items: center !important;
    padding: 10px 14px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    cursor: grab !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    user-select: none !important;
    transition: background 0.15s, border-color 0.15s !important;
    box-sizing: border-box !important;
}

.sortable-activity-item:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.sortable-activity-item:active {
    cursor: grabbing !important;
}

.sortable-activity-item .handle {
    margin-right: 12px !important;
    color: #94a3b8 !important;
    cursor: grab !important;
}

.sortable-ghost {
    opacity: 0.4 !important;
    background: #e0e7ff !important;
    border-color: #6366f1 !important;
}

/* ========================================
   DRAGGABLE HEATMAP COLUMNS
   ======================================== */
.heatmap-header-draggable {
    cursor: grab !important;
    user-select: none !important;
    transition: background-color 0.2s ease !important;
}

.heatmap-header-draggable:hover {
    background-color: #e2e8f0 !important;
}

.heatmap-header-draggable:active {
    cursor: grabbing !important;
}

/* ========================================
   EAP KANBAN BOARD SEARCH BAR
   ======================================== */
.search-input-wrapper input {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    outline: none !important;
    background-color: #ffffff !important;
    color: #334155 !important;
    transition: all 0.2s ease-in-out !important;
}

.search-input-wrapper input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.15) !important;
    background-color: #ffffff !important;
}

.search-input-wrapper i {
    transition: color 0.2s ease-in-out !important;
}

.search-input-wrapper input:focus+i,
.search-input-wrapper input:focus~i {
    color: var(--primary) !important;
}

/* ========================================
   PRINT STYLES FOR WEEKLY BRIEFING
   ======================================== */
@media print {

    /* Forçar o fluxo normal de blocos na impressão e remover o limite de 100vh e flexbox scroll-locked */
    body.printing-briefing,
    body.printing-briefing html,
    body.printing-briefing .app-container,
    body.printing-briefing .main-content {
        position: relative !important;
        display: block !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Sobrescrever a regra global 'body * { visibility: hidden }' herdada de outras telas */
    body.printing-briefing #page-equipes,
    body.printing-briefing #page-equipes *,
    body.printing-briefing #equipes-view-briefing,
    body.printing-briefing #equipes-view-briefing * {
        visibility: visible !important;
    }

    body.printing-briefing {
        background: white !important;
        color: black !important;
    }

    body.printing-briefing .sidebar,
    body.printing-briefing header,
    body.printing-briefing .tabs-sub-header,
    body.printing-briefing .content-header,
    body.printing-briefing button,
    body.printing-briefing .no-print,
    body.printing-briefing .btn-secondary,
    body.printing-briefing .btn-primary {
        display: none !important;
    }

    body.printing-briefing #page-equipes,
    body.printing-briefing #equipes-view-briefing {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.printing-briefing .card-mini {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    body.printing-briefing .table-container {
        border: 1px solid #cbd5e1 !important;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }

    body.printing-briefing table {
        border-collapse: collapse !important;
        width: 100% !important;
    }

    body.printing-briefing th,
    body.printing-briefing td {
        border: 1px solid #cbd5e1 !important;
        padding: 8px !important;
        text-align: left !important;
    }
}


/* ================================================
   RADAR PANEL — Painel Lateral Retrátil
   ================================================ */

/* Animação de entrada do painel */
@keyframes radarSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#radarPanel {
    animation: radarSlideIn 0.25s ease forwards;
}

/* Esconder scrollbar do radar mas manter funcional */
#radarHeatmapContainer::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

#radarHeatmapContainer::-webkit-scrollbar-track {
    background: transparent;
}

#radarHeatmapContainer::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Compactar a matriz do heatmap dentro do radar */
#radarHeatmapContainer .hm-activity-header {
    font-size: 0.55rem !important;
    padding: 2px 3px !important;
    max-width: 70px !important;
}

#radarHeatmapContainer .hm-cell {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.5rem !important;
}

#radarHeatmapContainer .hm-pav-label {
    font-size: 0.6rem !important;
    max-width: 80px !important;
}

/* Ocultar o radar durante impressão */
@media print {

    #radarPanel,
    #radarToggleBtn {
        display: none !important;
    }
}

/* Responsivo: em telas < 1200px, painel sobrepõe (não comprime) */
@media (max-width: 1200px) {
    #radarPanel {
        position: fixed !important;
        top: 0;
        right: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 12px 0 0 12px;
        z-index: 1000;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
    }

    #radarToggleBtn {
        position: fixed !important;
        right: 0;
        top: 50vh;
        z-index: 999;
    }
}

/* Estilos adicionais para Retrabalhos */
.unidade-cell.retrabalho-ativo {
    background: #fef2f2 !important;
    border: 2px dashed #ef4444 !important;
    animation: success-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), pulse-retrabalho 2s infinite !important;
}

.unidade-cell.retrabalho-ativo:hover {
    border-color: #dc2626 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3) !important;
}

@keyframes pulse-retrabalho {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.unidade-cell.retrabalho-ativo .ocupante-tag {
    border: 1px dashed #ef4444;
    color: #ef4444 !important;
    background: #fef2f2 !important;
    font-weight: bold;
}

.heatmap-cell .hm-indicator-retrabalho {
    position: absolute;
    bottom: 2px;
    left: 2px;
    font-size: 0.65rem;
    color: #2563eb;
    pointer-events: none;
}

/* ========================================================
   ORQUESTRA PRO: SISTEMA DE GAMIFICAÇÃO & MEDALHAS
   ======================================================== */

/* Badge de Ofensiva no Header */
.streak-badge-header {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.streak-badge-header:hover {
    transform: scale(1.05);
}

.streak-badge-header i {
    animation: flame-flicker 1.5s ease-in-out infinite alternate;
}

/* Animações e cores de chamas */
.fire-active {
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.fire-cooling {
    animation: flame-pulse 2s infinite ease-in-out;
    background: linear-gradient(135deg, #78716c, #a8a29e) !important;
}

.fire-ice {
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
    animation: ice-pulse 2s infinite ease-in-out;
}

@keyframes flame-flicker {
    0% { transform: scale(1) rotate(-2deg); }
    100% { transform: scale(1.1) rotate(2deg); filter: brightness(1.2); }
}

@keyframes flame-pulse {
    0% { box-shadow: 0 0 0 0 rgba(168, 162, 158, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(168, 162, 158, 0); }
    100% { box-shadow: 0 0 0 0 rgba(168, 162, 158, 0); }
}

@keyframes ice-pulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

/* Estilos de Quests (Home Dashboard) */
.quest-item {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.quest-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.quest-item.concluida {
    background: rgba(240, 253, 250, 0.6) !important;
    border-color: #a7f3d0 !important;
}

.quest-checkbox-circle.checked {
    background: #10b981;
    border-color: #10b981 !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Card de Celebridade de Medalhas */
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pop-up {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ========================================================
   EVOLUÇÃO DO FOCO SEMANAL (BRIEFING) E MODO DDS
   ======================================================== */

/* Widget de Clima */
.clima-widget-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clima-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.clima-title-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #334155;
    font-size: 0.9rem;
}

.clima-forecast-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

@media (max-width: 576px) {
    .clima-forecast-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
}

.clima-day-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.clima-day-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
}

.clima-icon {
    font-size: 1.25rem;
    margin: 4px 0;
}

.clima-temp {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
}

.clima-rain-prob {
    font-size: 0.65rem;
    color: #2563eb;
    font-weight: bold;
}

/* Banner de Alerta Climático */
.clima-alert-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #92400e;
    font-weight: 600;
}

/* Gantt Semanal Visual (Cronograma) */
.gantt-semanal-container {
    display: flex;
    gap: 4px;
    align-items: center;
}

.gantt-day-bubble {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    user-select: none;
    transition: all 0.15s ease;
}

.gantt-day-bubble.active {
    background: #2563eb;
    color: white;
    border: 1px solid #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.gantt-day-bubble.inactive {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

/* Bloco SESMT DDS */
.dds-sesmt-alert {
    background: white;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.78rem;
    color: #78350f;
    display: flex;
    gap: 8px;
    align-items: start;
    line-height: 1.4;
}

.dds-sesmt-alert i {
    color: #d97706;
    margin-top: 2px;
}

/* Bloco Social Aniversariantes */
.dds-social-item {
    background: white;
    border: 1px solid #fce7f3;
    border-left: 4px solid #ec4899;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.78rem;
    color: #9d174d;
    display: flex;
    gap: 8px;
    align-items: center;
}

.dds-social-item.birthday {
    animation: success-pop 0.5s ease-out;
}

/* Ocultações para Impressão */
@media print {
    body.printing-briefing .tabs-sub-header,
    body.printing-briefing #briefingClimaWidget,
    body.printing-briefing td button,
    body.printing-briefing .clima-alert-banner,
    body.printing-briefing .restricao-card button {
        display: none !important;
    }
}

/* ============================================================================
   PAINEL DE LINHA DO TEMPO / ATIVIDADES MARCOS (GANTT MULTIOBRA)
   ============================================================================ */
.timeline-wrapper {
    width: 100%;
    min-width: 100%;
    background: #ffffff;
    font-family: 'Outfit', sans-serif;
}

.timeline-header {
    user-select: none;
}

.timeline-head-week {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #cbd5e1;
    font-weight: 700;
}

.timeline-head-day {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.timeline-head-day.weekend-column {
    background: #f8fafc;
}

.timeline-row-label {
    box-sizing: border-box;
    border-right: 2px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 700;
}

.timeline-row-grid {
    box-sizing: border-box;
    position: relative;
}

.timeline-grid-cell {
    box-sizing: border-box;
}

.timeline-grid-cell.weekend-grid-cell {
    background: #fafafa;
}

/* Barras Gantt */
.timeline-gantt-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    cursor: pointer;
    box-sizing: border-box;
    z-index: 5;
}

.timeline-gantt-bar:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
    z-index: 10;
}

.timeline-gantt-label {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Marcos Pontuais (Diamante) */
.timeline-milestone-point {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 6;
}

.timeline-milestone-point i {
    font-size: 1.1rem;
    color: #eab308; /* Amarelo ouro */
    filter: drop-shadow(0 2px 4px rgba(234, 179, 8, 0.4));
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.timeline-milestone-point:hover i {
    transform: rotate(45deg) scale(1.3);
    color: #f59e0b;
    filter: drop-shadow(0 3px 8px rgba(245, 158, 11, 0.6));
}

.timeline-milestone-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 800;
    color: #1e293b;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #cbd5e1;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    pointer-events: none;
}

/* Tooltip do Gantt (Estilo Premium) */
.timeline-gantt-bar .timeline-tooltip,
.timeline-milestone-point .timeline-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 100;
    pointer-events: none;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
}

.timeline-gantt-bar .timeline-tooltip strong,
.timeline-milestone-point .timeline-tooltip strong {
    font-size: 0.78rem;
    font-weight: 700;
    display: block;
    color: #3b82f6;
}

.timeline-gantt-bar .timeline-tooltip span,
.timeline-milestone-point .timeline-tooltip span {
    font-size: 0.7rem;
    color: #94a3b8;
    display: block;
}

/* Triângulo do Tooltip */
.timeline-gantt-bar .timeline-tooltip::after,
.timeline-milestone-point .timeline-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.timeline-gantt-bar:hover .timeline-tooltip,
.timeline-milestone-point:hover .timeline-tooltip {
    display: flex;
}

/* Status-specific Gantt Bars styling */
.timeline-gantt-bar.status-concluido {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.timeline-gantt-bar.status-concluido .timeline-gantt-label {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.timeline-gantt-bar.status-em-andamento {
    background: #f1f5f9;
    color: #0f172a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid #cbd5e1;
}
.timeline-gantt-bar.status-em-andamento .timeline-gantt-label {
    color: #0f172a;
    text-shadow: 0 1px 1px #ffffff;
}

.timeline-gantt-bar.status-pendente {
    background: #f8fafc;
    color: #64748b;
    box-shadow: none;
    border: 1px dashed #cbd5e1;
}
.timeline-gantt-bar.status-pendente .timeline-gantt-label {
    color: #64748b;
    text-shadow: none;
}

/* Inner progress fill for in-progress bars */
.timeline-gantt-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(135deg, #93c5fd 0%, #3b82f6 100%);
    opacity: 0.85;
    border-radius: 6px 0 0 6px;
    z-index: 1;
}

/* Status-specific Milestone Diamonds styling */
.timeline-milestone-point.status-concluido i {
    color: #10b981;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.4));
}
.timeline-milestone-point.status-concluido:hover i {
    color: #059669;
    filter: drop-shadow(0 3px 8px rgba(5, 150, 105, 0.6));
}

.timeline-milestone-point.status-em-andamento i {
    color: #eab308;
    filter: drop-shadow(0 2px 4px rgba(234, 179, 8, 0.4));
}
.timeline-milestone-point.status-em-andamento:hover i {
    color: #ca8a04;
    filter: drop-shadow(0 3px 8px rgba(202, 138, 4, 0.6));
}

.timeline-milestone-point.status-pendente i {
    color: #94a3b8;
    filter: drop-shadow(0 2px 4px rgba(148, 163, 184, 0.4));
}
.timeline-milestone-point.status-pendente:hover i {
    color: #64748b;
    filter: drop-shadow(0 3px 8px rgba(100, 116, 139, 0.6));
}

/* Fix tooltip overlay clipping by raising z-index on row hover */
.timeline-row:hover {
    z-index: 30 !important;
}
.timeline-row:hover .timeline-row-grid {
    z-index: 30 !important;
}
.timeline-row:hover .timeline-bars-container {
    z-index: 30 !important;
}



