/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    transition: margin-left 0.25s;
    overflow-y: auto;
}
.sidebar .nav-link {
    border-radius: 0.375rem;
    margin-bottom: 2px;
    font-size: 0.9rem;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}
.sidebar .menu-group-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.75rem 0.75rem 0.25rem;
    margin-top: 0.5rem;
    font-weight: 600;
}
.sidebar .menu-group-title:first-child {
    margin-top: 0;
}

#page-content {
    min-width: 0;
}

/* Kanban */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
}
.kanban-column {
    min-width: 280px;
    max-width: 320px;
    width: 280px;
    flex: 0 0 280px;
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.75rem;
}
.kanban-cards {
    min-height: 120px;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: background 0.15s;
}
.kanban-card {
    background: #fff;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card.dragging {
    opacity: 0.45;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.kanban-card.atrasada {
    border-left: 3px solid #dc3545;
}
.kanban-card a {
    cursor: pointer;
}
.kanban-cards.drag-over {
    background: #e7f1ff;
    outline: 2px dashed #0d6efd;
}
.kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        z-index: 1040;
        margin-left: -260px;
    }
    .sidebar.show {
        margin-left: 0;
    }
}


/* Reordenar colunas do Kanban */
.kanban-column.dragging-column {
    opacity: 0.5;
    outline: 2px dashed #0d6efd;
}
.kanban-column.drag-over-column {
    box-shadow: 0 0 0 2px #0d6efd;
}
.kanban-col-handle {
    cursor: grab;
}
.kanban-col-handle:active {
    cursor: grabbing;
}
.kanban-column-header {
    cursor: grab;
    user-select: none;
}

.flash-stack {
    position: sticky;
    top: 0.75rem;
    z-index: 1050;
    margin-bottom: 1rem;
}
.flash-stack .alert {
    margin-bottom: 0.5rem;
}

/* Preferências de interface (CSS variables) */
body.app-shell {
    font-family: var(--fonte-familia, system-ui, sans-serif);
    font-size: var(--fonte-tamanho, 16px);
    background-color: var(--cor-fundo, #f8f9fa);
}
body.app-shell .sidebar {
    background-color: var(--cor-sidebar, #212529) !important;
    color: var(--cor-sidebar-texto, #fff);
}
body.app-shell .sidebar .nav-link {
    color: color-mix(in srgb, var(--cor-sidebar-texto, #fff) 70%, transparent);
}
body.app-shell .sidebar .nav-link:hover,
body.app-shell .sidebar .nav-link.active {
    color: var(--cor-sidebar-texto, #fff) !important;
}
body.app-shell .btn-primary {
    background-color: var(--cor-primaria, #0d6efd);
    border-color: var(--cor-primaria, #0d6efd);
}
body.app-shell .btn-primary:hover {
    filter: brightness(0.92);
}
body.app-shell[data-tema="escuro"] {
    background-color: #1a1d21;
    color: #e9ecef;
}
body.app-shell[data-tema="escuro"] #page-content,
body.app-shell[data-tema="escuro"] .navbar,
body.app-shell[data-tema="escuro"] .card {
    background-color: #212529;
    color: #e9ecef;
}
body.app-shell[data-tema="escuro"] .table {
    color: #e9ecef;
}
