:root {
    --bg-soft: #f4f6fb;
    --card-shadow: 0 .125rem .5rem rgba(0,0,0,.06);
}

body {
    background: var(--bg-soft);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
}

.navbar-brand i { font-size: 1.4rem; }

/* ----- Navbar ----- */
.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .75rem;
    border-radius: .375rem;
    white-space: nowrap;
}
.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: #fff;
}
.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, .12);
}
.navbar-nav .nav-text { font-size: .9rem; }
.dropdown-menu-nav {
    border: none;
    border-radius: .5rem;
    padding: .35rem;
    min-width: 13rem;
}
.dropdown-menu-nav .dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .85rem;
    border-radius: .35rem;
    font-size: .9rem;
}
.dropdown-menu-nav .dropdown-item.active,
.dropdown-menu-nav .dropdown-item:active {
    background: rgba(13, 110, 253, .12);
    color: #0d6efd;
}
.dropdown-menu-nav .dropdown-header {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    padding: .35rem .85rem .15rem;
}
.navbar-nav-user .nav-user-toggle {
    max-width: 14rem;
}
.navbar-nav-user .nav-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 10rem;
}
.nav-clock { opacity: .85; padding: .25rem .5rem; }
@media (max-width: 991.98px) {
    .navbar-nav .nav-link { padding: .55rem .5rem; }
    .dropdown-menu-nav { border: 1px solid rgba(0,0,0,.08); margin-bottom: .5rem; }
}

.card {
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: .75rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f5;
    border-radius: .75rem .75rem 0 0 !important;
    font-weight: 600;
}

.stat-card {
    border-left: 4px solid var(--bs-primary);
    transition: transform .15s ease;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: #6c757d; text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; }
.stat-card .stat-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: #fff;
}

.bg-soft-primary  { background: rgba(13,110,253,.12); color: #0d6efd; }
.bg-soft-success  { background: rgba(25,135,84,.12);  color: #198754; }
.bg-soft-warning  { background: rgba(255,193,7,.18);  color: #b08900; }
.bg-soft-danger   { background: rgba(220,53,69,.12);  color: #dc3545; }
.bg-soft-info     { background: rgba(13,202,240,.15); color: #0dcaf0; }
.bg-soft-secondary{ background: rgba(108,117,125,.15);color: #6c757d; }

.checklist-item, .checklist-row { transition: background-color .2s, border-color .2s, box-shadow .2s; }
.checklist-item.checklist-ok,
.checklist-row.checklist-ok {
    background-color: rgba(25,135,84,.22) !important;
    border-left: 4px solid #198754 !important;
    border-color: #198754 !important;
    box-shadow: 0 0 0 1px rgba(25,135,84,.35), 0 2px 6px rgba(25,135,84,.18);
}
.checklist-item.checklist-ok .checklist-text {
    color: #0f5132 !important;
}
.checklist-item.checklist-ok .checklist-obs,
.checklist-row.checklist-ok .txt-observacao {
    background-color: #f1faf4;
    border-color: rgba(25,135,84,.5);
}
.checklist-item.checklist-alerta,
.checklist-row.checklist-alerta {
    background-color: rgba(220,53,69,.22) !important;
    border-left: 4px solid #dc3545 !important;
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 1px rgba(220,53,69,.35), 0 2px 6px rgba(220,53,69,.18);
}
.checklist-item.checklist-alerta .checklist-text,
.checklist-row.checklist-alerta .txt-observacao {
    color: #842029;
}
.checklist-item.checklist-alerta .checklist-obs,
.checklist-row.checklist-alerta .txt-observacao {
    background-color: #fff5f5;
    border-color: rgba(220,53,69,.5);
}

.status-badge {
    display: inline-block; padding: .3em .65em;
    font-size: .75rem; font-weight: 600;
    border-radius: 50rem;
}
.status-nao_iniciado { background: rgba(108,117,125,.18); color:#495057; }
.status-em_execucao  { background: rgba(13,110,253,.15); color:#0a58ca; }
.status-finalizado   { background: rgba(25,135,84,.15);  color:#146c43; }
.status-planejado    { background: rgba(13,202,240,.18); color:#055160; }
.status-em_andamento { background: rgba(13,110,253,.15); color:#0a58ca; }
.status-pausado      { background: rgba(255,193,7,.20);  color:#856404; }
.status-concluido    { background: rgba(25,135,84,.15);  color:#146c43; }
.status-cancelado    { background: rgba(220,53,69,.15);  color:#842029; }

.progress { height: .55rem; border-radius: 50rem; }
.progress-thick { height: .9rem; }

.table thead th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .04em;
    color: #6c757d;
    background: #fafbfd;
    border-bottom: 1px solid #e9ecef;
}

.gantt-container {
    overflow: auto;
    max-height: min(28rem, 52vh);
    background: #fff;
    border-radius: .5rem;
    padding: .75rem;
    border: 1px solid #e9ecef;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.gantt-container::-webkit-scrollbar { height: 8px; width: 8px; }
.gantt-container::-webkit-scrollbar-thumb {
    background: #c5cdd8;
    border-radius: 4px;
}
.gantt-container svg {
    display: block;
    max-width: none;
}
.gantt-toolbar-hint {
    font-size: .8rem;
    color: #6c757d;
}
.gantt-container .gantt .grid-row { fill: #fff; }
.gantt .bar-finalizado .bar-progress { fill: #198754; }
.gantt .bar-finalizado .bar { fill: #d1e7dd; }
.gantt .bar-execucao .bar-progress { fill: #0d6efd; }
.gantt .bar-execucao .bar { fill: #cfe2ff; }
.gantt .bar-naoiniciado .bar-progress { fill: #6c757d; }
.gantt .bar-naoiniciado .bar { fill: #e9ecef; }
.gantt .bar-pausado .bar-progress { fill: #ffc107; }
.gantt .bar-pausado .bar { fill: #fff3cd; }
.gantt .bar-cancelado .bar-progress { fill: #dc3545; }
.gantt .bar-cancelado .bar { fill: #f8d7da; }
.gantt .bar-atrasada .bar-progress { fill: #dc3545; }
.gantt .bar-atrasada .bar { fill: #f8d7da; stroke: #dc3545; stroke-width: 1.5; }
.gantt .bar-atrasada .bar-label { fill: #842029; font-weight: 700; }
.gantt .bar-label { fill: #212529; font-weight: 500; }
.gantt .grid-row:nth-child(even) { fill: #fafbfd; }
.gantt .today-highlight { fill: rgba(13,110,253,.08); }

.range-percent {
    width: 100%;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}
.empty-state i { font-size: 3rem; opacity: .35; }

/* ----- Sinalização de tarefas/projetos atrasados/finalizados ----- */
.row-atrasada {
    background: rgba(220, 53, 69, 0.06) !important;
    box-shadow: inset 4px 0 0 #dc3545;
}
.row-atrasada td:first-child { position: relative; }

.row-finalizada {
    background: rgba(25, 135, 84, 0.07) !important;
    box-shadow: inset 4px 0 0 #198754;
}
.row-finalizada td:first-child { position: relative; }
.row-finalizada > td strong { color: #146c43; }
.icone-finalizada { color: #198754; margin-right: .25rem; }
.text-finalizada { color: #146c43; font-weight: 600; }
.badge-atraso {
    display: inline-block;
    background: #dc3545;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: .15em .5em;
    border-radius: 50rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-left: .35rem;
    vertical-align: middle;
    animation: pulse-atraso 1.6s ease-in-out infinite;
}
@keyframes pulse-atraso {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, .55); }
    50%      { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}
.card-atrasado {
    border-left: 4px solid #dc3545 !important;
    background: linear-gradient(0deg, rgba(220,53,69,.03), rgba(220,53,69,.03));
}
.text-atraso { color: #dc3545; font-weight: 600; }

/* ----- Barra de ações fixa no rodapé (seleção de empresas) ----- */
.actions-bar-empresas {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid var(--bs-primary);
    box-shadow: 0 -4px 14px rgba(13,110,253,.12);
    padding: .75rem 1rem;
    margin: 1.25rem -1rem -1rem;
    z-index: 50;
    border-radius: 0;
}
.actions-bar-empresas .btn[disabled] { cursor: not-allowed; opacity: .6; }
.check-empresa, #check-todos { cursor: pointer; }

.fc .fc-button-primary { background: #0d6efd; border-color: #0d6efd; }
.fc .fc-button-primary:hover { background: #0b5ed7; border-color: #0a58ca; }
.fc-event { cursor: pointer; }
