/* ============================================
   KANBAN MODULE - CSS PREMIUM v2.1
   ERP Elo Base - Design System
   ============================================ */

/* ============================================
   VARIÁVEIS CSS
   ============================================ */
:root {
    --kb-bg: #f8fafc;
    --kb-surface: #ffffff;
    --kb-surface-solid: #ffffff;
    --kb-surface-hover: #f8fafc;
    --kb-surface-active: #f1f5f9;
    --kb-surface-glass: rgba(255, 255, 255, 0.2);
    --kb-surface-glass-hover: rgba(255, 255, 255, 0.3);
    --kb-card-bg: rgba(255, 255, 255, 0.6);
    --kb-card-hover: rgba(255, 255, 255, 0.75);
    --kb-border: #e2e8f0;
    --kb-border-hover: #cbd5e1;
    --kb-text: #111827;
    --kb-text-secondary: #374151;
    --kb-text-muted: #6b7280;
    --kb-primary: #3b82f6;
    --kb-primary-hover: #2563eb;
    --kb-primary-light: rgba(59, 130, 246, 0.1);
    --kb-primary-lighter: rgba(59, 130, 246, 0.05);
    --kb-success: #10b981;
    --kb-success-light: rgba(16, 185, 129, 0.1);
    --kb-warning: #f59e0b;
    --kb-warning-light: rgba(245, 158, 11, 0.1);
    --kb-danger: #ef4444;
    --kb-danger-light: rgba(239, 68, 68, 0.1);
    --kb-radius: 16px;
    --kb-radius-sm: 12px;
    --kb-radius-xs: 8px;
    --kb-radius-lg: 24px;
    --kb-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --kb-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --kb-shadow-lg: 0 12px 28px rgba(0,0,0,0.12);
    --kb-shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    --kb-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --kb-blur: blur(16px);
    --kb-blur-lg: blur(24px);
}

/* ============================================
   MÓDULO PRINCIPAL
   ============================================ */
.kanban-module {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    min-height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    margin: -24px;
    padding: 0;
}

/* ============================================
   TOOLBAR
   ============================================ */
.kanban-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
    background: var(--kb-surface);
    border-bottom: 1px solid var(--kb-border);
    box-shadow: var(--kb-shadow-sm);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Board Selector */
.board-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

.board-selector select {
    padding: 6px 32px 6px 12px;
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius-xs);
    background: var(--kb-surface);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--kb-text);
    min-width: 160px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: var(--kb-transition);
}

.board-selector select:hover {
    border-color: var(--kb-primary);
}

.board-selector select:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

/* Toolbar Buttons */
.kanban-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--kb-radius-xs);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--kb-transition);
}

.kanban-toolbar .btn svg {
    width: 14px;
    height: 14px;
}

.kanban-toolbar .btn-primary {
    background: linear-gradient(135deg, var(--kb-primary) 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.kanban-toolbar .btn-primary:hover {
    background: linear-gradient(135deg, var(--kb-primary-hover) 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.kanban-toolbar .btn-secondary {
    background: var(--kb-surface);
    color: var(--kb-text-secondary);
    border: 2px solid var(--kb-border);
}

.kanban-toolbar .btn-secondary:hover {
    background: var(--kb-surface-hover);
    border-color: var(--kb-primary);
    color: var(--kb-primary);
}

.kanban-toolbar .btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
}

.kanban-toolbar .btn-ghost {
    background: transparent;
    border: none;
    color: var(--kb-text-secondary);
}

.kanban-toolbar .btn-ghost:hover {
    background: var(--kb-surface-hover);
    color: var(--kb-text);
}

.kanban-toolbar .btn-ghost.active {
    background: var(--kb-primary-light);
    color: var(--kb-primary);
}

/* ============================================
   FILTROS
   ============================================ */
.kanban-filters {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 16px;
    background: var(--kb-surface);
    border-bottom: 1px solid var(--kb-border);
    align-items: flex-end;
}

.kanban-filters.active,
.kanban-filters[style*="flex"] {
    display: flex !important;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.filter-group label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--kb-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group input,
.filter-group select {
    padding: 5px 8px;
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius-xs);
    font-size: 0.75rem;
    background: var(--kb-surface);
    color: var(--kb-text);
    min-width: 110px;
    transition: var(--kb-transition);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

/* ============================================
   BOARD CONTAINER - SCROLL ARRASTÁVEL
   ============================================ */
.kanban-board-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.kanban-board-container {
    display: flex;
    gap: 12px;
    padding: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    align-items: flex-start;
    cursor: grab;
    user-select: none;
}

.kanban-board-container:active {
    cursor: grabbing;
}

.kanban-board-container.dragging-board {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* Scrollbar personalizada */
.kanban-board-container::-webkit-scrollbar {
    height: 12px;
}

.kanban-board-container::-webkit-scrollbar-track {
    background: var(--kb-border);
    border-radius: 6px;
    margin: 0 20px;
}

.kanban-board-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    border-radius: 6px;
    border: 2px solid var(--kb-border);
}

.kanban-board-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* ============================================
   LISTAS (COLUNAS)
   ============================================ */
.kanban-list {
    flex: 0 0 260px;
    min-width: 260px;
    max-width: 260px;
    background: var(--kb-surface-glass);
    backdrop-filter: var(--kb-blur-lg);
    -webkit-backdrop-filter: var(--kb-blur-lg);
    border-radius: var(--kb-radius-sm);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
    box-shadow: var(--kb-shadow);
    transition: var(--kb-transition);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
}

.kanban-list:hover {
    box-shadow: var(--kb-shadow-lg);
    background: var(--kb-surface-glass-hover);
}

.kanban-list.over-limit {
    border: 2px solid var(--kb-danger);
}

.kanban-list.list-dragging {
    opacity: 0.7;
    transform: rotate(2deg) scale(1.02);
}

/* List Header */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 8px 0;
    cursor: grab;
    flex-shrink: 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--kb-border);
    position: relative;
}

.list-header::before {
    display: none;
}

.list-header:active {
    cursor: grabbing;
}

.list-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.list-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.list-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--kb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    cursor: text;
    padding: 2px 0;
}

.list-title:hover {
    color: var(--kb-primary);
}

.list-title-edit {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--kb-text);
    border: 1px solid var(--kb-primary);
    border-radius: var(--kb-radius-xs);
    padding: 4px 8px;
    background: white;
    width: 100%;
    outline: none;
}

.list-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--kb-text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.list-done-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--kb-success) 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
}

.list-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kanban-list:hover .list-actions {
    opacity: 1;
}

.list-actions .btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kb-text-muted);
    transition: var(--kb-transition);
}

.list-actions .btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--kb-text);
}

.list-actions .btn svg {
    width: 12px;
    height: 12px;
}

/* List Body */
.list-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 40px;
    position: relative;
}

.list-body::-webkit-scrollbar {
    width: 6px;
}

.list-body::-webkit-scrollbar-track {
    background: transparent;
}

.list-body::-webkit-scrollbar-thumb {
    background: var(--kb-border);
    border-radius: 3px;
}

.list-body.drag-over {
    background: var(--kb-primary-light);
}

/* Empty State - Só aparece quando não tem cards */
.list-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    color: var(--kb-text-muted);
    font-size: 0.7rem;
    text-align: center;
    border: 1px dashed var(--kb-border);
    border-radius: var(--kb-radius-xs);
    background: var(--kb-surface-hover);
}

/* Quando tem cards, o list-empty some automaticamente via JS */
.list-body:not(:empty) .list-empty {
    display: none;
}

/* List Footer */
.list-footer {
    padding: 6px;
    flex-shrink: 0;
    border-top: 1px solid var(--kb-border);
    background: var(--kb-surface-hover);
}

.btn-add-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 10px;
    border: none;
    border-radius: var(--kb-radius-xs);
    background: transparent;
    color: var(--kb-text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--kb-transition);
}

.btn-add-card:hover {
    background: var(--kb-primary-light);
    color: var(--kb-primary);
}

.btn-add-card svg {
    width: 12px;
    height: 12px;
}

/* ============================================
   QUICK ADD CARD
   ============================================ */
.quick-add-form {
    display: none;
}

.quick-add-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--kb-primary);
    border-radius: var(--kb-radius-xs);
    font-size: 0.75rem;
    font-family: inherit;
    resize: none;
    min-height: 50px;
    background: var(--kb-surface);
    color: var(--kb-text);
    transition: var(--kb-transition);
    box-shadow: 0 0 0 2px var(--kb-primary-light);
}

.quick-add-form textarea:focus {
    outline: none;
}

.quick-add-form textarea::placeholder {
    color: var(--kb-text-muted);
}

.quick-add-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
}

.quick-add-actions .btn {
    padding: 5px 10px;
    border-radius: var(--kb-radius-xs);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--kb-transition);
    border: none;
}

.quick-add-actions .btn-primary {
    background: linear-gradient(135deg, var(--kb-primary) 0%, #8b5cf6 100%);
    color: white;
}

.quick-add-actions .btn-primary:hover {
    background: linear-gradient(135deg, var(--kb-primary-hover) 0%, #7c3aed 100%);
}

.quick-add-actions .btn-ghost {
    background: transparent;
    color: var(--kb-text-secondary);
}

.quick-add-actions .btn-ghost:hover {
    background: var(--kb-bg);
    color: var(--kb-text);
}

.quick-add-actions .btn-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   CARDS
   ============================================ */
.kanban-card {
    background: var(--kb-card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--kb-radius-xs);
    padding: 10px;
    cursor: grab;
    transition: var(--kb-transition);
    border: 1px solid var(--kb-border);
    box-shadow: var(--kb-shadow-sm);
}

.kanban-card:hover {
    background: var(--kb-card-hover);
    box-shadow: var(--kb-shadow);
    border-color: var(--kb-border-hover);
    transform: translateY(-2px);
}

.kanban-card.dragging {
    opacity: 0.6;
    transform: rotate(2deg) scale(1.02);
    cursor: grabbing;
    box-shadow: var(--kb-shadow-lg);
}

.kanban-card.completed {
    opacity: 0.6;
}

.kanban-card.completed .card-title {
    text-decoration: line-through;
    color: var(--kb-text-muted);
}

/* Card Cover */
.card-cover {
    height: 4px;
    margin: -10px -10px 8px;
    border-radius: var(--kb-radius-xs) var(--kb-radius-xs) 0 0;
}

/* Card Tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Card Title */
.card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--kb-text);
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: break-word;
}

/* Card Description */
.card-description {
    font-size: 0.68rem;
    color: var(--kb-text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Meta */
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    margin-top: 2px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.card-meta-left,
.card-meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Due Date */
.card-due {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    background: var(--kb-bg);
    color: var(--kb-text-secondary);
}

.card-due svg {
    width: 10px;
    height: 10px;
}

.card-due.overdue {
    background: var(--kb-danger-light);
    color: var(--kb-danger);
}

.card-due.today {
    background: var(--kb-warning-light);
    color: var(--kb-warning);
}

.card-due.soon {
    background: #fefce8;
    color: #ca8a04;
}

/* Due Date Badge - Design Premium */
.card-due-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--kb-text-secondary);
    border: 1px solid var(--kb-border-light);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card-due-badge svg {
    width: 10px;
    height: 10px;
    opacity: 0.7;
}

.card-due-badge span {
    line-height: 1;
}

.card-due-badge.overdue {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #b91c1c;
    border-color: #fecaca;
}

.card-due-badge.overdue svg {
    stroke: #dc2626;
    opacity: 1;
}

.card-due-badge.today {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #b45309;
    border-color: #fde68a;
    animation: pulse-today 2s ease-in-out infinite;
}

.card-due-badge.today svg {
    stroke: #f59e0b;
    opacity: 1;
}

@keyframes pulse-today {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1); }
}

.card-due-badge.soon {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    color: #a16207;
    border-color: #fde047;
}

.card-due-badge.soon svg {
    stroke: #ca8a04;
    opacity: 1;
}

/* Attachments Badge - MELHORADO E DESTACADO */
.card-attachments {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
    color: #1e40af;
    border: 1px solid #bfdbfe;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.1);
}

.card-attachments:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.card-attachments svg {
    width: 10px;
    height: 10px;
    stroke: #3b82f6;
    opacity: 1;
    flex-shrink: 0;
}

.card-attachments span {
    line-height: 1;
    font-weight: 700;
    color: #1e40af;
}

/* Checklist Badge */
.card-checklist {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    background: var(--kb-bg);
    color: var(--kb-text-secondary);
    transition: all 0.2s ease;
}

.card-checklist svg {
    width: 10px;
    height: 10px;
    transition: all 0.2s ease;
}

.card-checklist span {
    line-height: 1;
}

.card-checklist.complete {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.card-checklist.complete svg {
    stroke: #10b981;
}

/* Client Badge */
.card-client {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border-radius: var(--kb-radius-xs);
    background: var(--kb-bg);
    color: var(--kb-text-muted);
}

/* Priority - Cores corretas */
.card-priority {
    font-size: 0.7rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.card-priority.priority-low {
    background: var(--kb-success-light);
}

.card-priority.priority-medium {
    background: #fefce8;
}

.card-priority.priority-high {
    background: var(--kb-warning-light);
}

.card-priority.priority-urgent {
    background: var(--kb-danger-light);
}

/* Assignees */
.card-assignees {
    display: flex;
    align-items: center;
}

.assignee-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-size: 0.55rem;
    font-weight: 600;
    margin-left: -6px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.assignee-avatar:first-child {
    margin-left: 0;
}

.assignee-avatar:nth-child(2) {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.assignee-avatar:nth-child(3) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.assignee-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: var(--kb-text-secondary);
    font-size: 0.55rem;
    font-weight: 600;
    margin-left: -6px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* ============================================
   ADD LIST BUTTON
   ============================================ */
.kanban-add-list {
    flex: 0 0 240px;
    min-width: 240px;
}

.btn-add-list {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 2px dashed var(--kb-border);
    border-radius: var(--kb-radius-sm);
    background: rgba(255,255,255,0.5);
    color: var(--kb-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--kb-transition);
}

.btn-add-list:hover {
    border-color: var(--kb-primary);
    background: var(--kb-primary-light);
    color: var(--kb-primary);
}

.btn-add-list svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.kanban-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    background: var(--kb-surface);
    border-radius: var(--kb-radius-sm);
    box-shadow: var(--kb-shadow);
    max-width: 400px;
    margin: 30px auto;
}

.empty-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kb-primary-light);
    border-radius: 12px;
    margin-bottom: 16px;
}

.empty-icon svg {
    width: 24px;
    height: 24px;
    color: var(--kb-primary);
}

.kanban-empty-state h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--kb-text);
    margin: 0 0 8px;
}

.kanban-empty-state p {
    font-size: 0.85rem;
    color: var(--kb-text-secondary);
    margin: 0 0 16px;
    max-width: 280px;
}

.kanban-empty-state .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* No Lists */
.kanban-no-lists {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--kb-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton-box {
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--kb-radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-list {
    flex: 0 0 260px;
    min-width: 260px;
    padding: 10px;
    background: var(--kb-surface);
    border-radius: var(--kb-radius-sm);
    box-shadow: var(--kb-shadow-sm);
}

/* ============================================
   MODAIS - BASE (Escopo: modais do Kanban/Tarefas)
   IDs: #boardModal, #listModal, #cardModal, #tagsModal,
        #taskModal, #columnModal, #labelsModal
   ============================================ */
#boardModal,
#listModal,
#cardModal,
#tagsModal,
#taskModal,
#columnModal,
#labelsModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#boardModal.show,
#listModal.show,
#cardModal.show,
#tagsModal.show,
#taskModal.show,
#columnModal.show,
#labelsModal.show {
    opacity: 1;
    visibility: visible;
}

#boardModal .modal,
#listModal .modal,
#cardModal .modal,
#tagsModal .modal,
#taskModal .modal,
#columnModal .modal,
#labelsModal .modal {
    background: var(--kb-surface-solid);
    border-radius: var(--kb-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--kb-shadow-xl);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

#boardModal.show .modal,
#listModal.show .modal,
#cardModal.show .modal,
#tagsModal.show .modal,
#taskModal.show .modal,
#columnModal.show .modal,
#labelsModal.show .modal {
    transform: translateY(0) scale(1);
}

#boardModal .modal-sm,
#listModal .modal-sm,
#cardModal .modal-sm,
#tagsModal .modal-sm,
#taskModal .modal-sm,
#columnModal .modal-sm,
#labelsModal .modal-sm { max-width: 420px; }

#boardModal .modal-md,
#listModal .modal-md,
#cardModal .modal-md,
#tagsModal .modal-md,
#taskModal .modal-md,
#columnModal .modal-md,
#labelsModal .modal-md { max-width: 560px; }

#boardModal .modal-lg,
#listModal .modal-lg,
#cardModal .modal-lg,
#tagsModal .modal-lg,
#taskModal .modal-lg,
#columnModal .modal-lg,
#labelsModal .modal-lg { max-width: 720px; }

#boardModal .modal-xl,
#listModal .modal-xl,
#cardModal .modal-xl,
#tagsModal .modal-xl,
#taskModal .modal-xl,
#columnModal .modal-xl,
#labelsModal .modal-xl { max-width: 750px; }

/* Modal Header - Escopo Kanban/Tarefas */
#boardModal .modal-header,
#listModal .modal-header,
#cardModal .modal-header,
#tagsModal .modal-header,
#taskModal .modal-header,
#columnModal .modal-header,
#labelsModal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--kb-border);
    background: linear-gradient(180deg, var(--kb-surface) 0%, var(--kb-surface-hover) 100%);
}

#boardModal .modal-header h3,
#listModal .modal-header h3,
#cardModal .modal-header h3,
#tagsModal .modal-header h3,
#taskModal .modal-header h3,
#columnModal .modal-header h3,
#labelsModal .modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--kb-text);
    margin: 0;
}

#boardModal .modal-header-content,
#listModal .modal-header-content,
#cardModal .modal-header-content,
#tagsModal .modal-header-content,
#taskModal .modal-header-content,
#columnModal .modal-header-content,
#labelsModal .modal-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

#boardModal .modal-icon,
#listModal .modal-icon,
#cardModal .modal-icon,
#tagsModal .modal-icon,
#taskModal .modal-icon,
#columnModal .modal-icon,
#labelsModal .modal-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--kb-primary-light) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--kb-radius-xs);
    color: var(--kb-primary);
}

#boardModal .modal-icon.edit,
#listModal .modal-icon.edit,
#cardModal .modal-icon.edit,
#tagsModal .modal-icon.edit,
#taskModal .modal-icon.edit,
#columnModal .modal-icon.edit,
#labelsModal .modal-icon.edit {
    background: linear-gradient(135deg, var(--kb-warning-light) 0%, rgba(245, 158, 11, 0.15) 100%);
    color: var(--kb-warning);
}

#boardModal .modal-icon.new,
#listModal .modal-icon.new,
#cardModal .modal-icon.new,
#tagsModal .modal-icon.new,
#taskModal .modal-icon.new,
#columnModal .modal-icon.new,
#labelsModal .modal-icon.new {
    background: linear-gradient(135deg, var(--kb-success-light) 0%, rgba(16, 185, 129, 0.15) 100%);
    color: var(--kb-success);
}

#boardModal .modal-subtitle,
#listModal .modal-subtitle,
#cardModal .modal-subtitle,
#tagsModal .modal-subtitle,
#taskModal .modal-subtitle,
#columnModal .modal-subtitle,
#labelsModal .modal-subtitle {
    font-size: 0.85rem;
    color: var(--kb-text-muted);
    margin: 4px 0 0;
}

#boardModal .modal-close,
#listModal .modal-close,
#cardModal .modal-close,
#tagsModal .modal-close,
#taskModal .modal-close,
#columnModal .modal-close,
#labelsModal .modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--kb-bg);
    border-radius: var(--kb-radius-sm);
    color: var(--kb-text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--kb-transition);
}

#boardModal .modal-close:hover,
#listModal .modal-close:hover,
#cardModal .modal-close:hover,
#tagsModal .modal-close:hover,
#taskModal .modal-close:hover,
#columnModal .modal-close:hover,
#labelsModal .modal-close:hover {
    background: var(--kb-danger);
    color: white;
}

#boardModal .modal-body,
#listModal .modal-body,
#cardModal .modal-body,
#tagsModal .modal-body,
#taskModal .modal-body,
#columnModal .modal-body,
#labelsModal .modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

#boardModal .modal-footer,
#listModal .modal-footer,
#cardModal .modal-footer,
#tagsModal .modal-footer,
#taskModal .modal-footer,
#columnModal .modal-footer,
#labelsModal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--kb-border);
    background: var(--kb-bg);
}

/* ============================================
   TAGS MODAL - PREMIUM
   ============================================ */
.tag-create-section {
    background: linear-gradient(135deg, var(--kb-primary-lighter) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 1px solid var(--kb-primary-light);
    border-radius: var(--kb-radius);
    padding: 24px;
    margin-bottom: 28px;
}

.tag-create-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--kb-primary);
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-create-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tag-name-input-wrapper {
    position: relative;
}

.tag-name-input-wrapper input {
    width: 100%;
    padding: 14px 60px 14px 16px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    font-size: 1rem;
    background: var(--kb-surface);
    transition: var(--kb-transition);
}

.tag-name-input-wrapper input:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

.char-count {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--kb-text-muted);
}

.tag-color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tag-color-picker label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--kb-text-secondary);
}

.color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: var(--kb-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-btn span {
    opacity: 0;
    font-size: 0.8rem;
    font-weight: 700;
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    border-color: var(--kb-text);
    transform: scale(1.15);
}

.color-btn.active span {
    opacity: 1;
}

.tag-preview-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tag-preview-section label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--kb-text-secondary);
}

.tag-preview-large {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tag-create-form > .btn {
    align-self: flex-start;
    padding: 12px 24px;
}

/* Tags Existing Section */
.tags-existing-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--kb-text);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-count-badge {
    background: var(--kb-bg);
    color: var(--kb-text-secondary);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 10px;
}

.tags-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--kb-text-muted);
}

.tags-empty svg {
    opacity: 0.3;
    margin-bottom: 12px;
}

.tags-empty p {
    margin: 0;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.tag-card {
    background: var(--kb-surface);
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    overflow: hidden;
    transition: var(--kb-transition);
}

.tag-card:hover {
    box-shadow: var(--kb-shadow);
    border-color: var(--kb-border-hover);
}

.tag-card-header {
    padding: 14px 16px;
    text-align: center;
    transition: var(--kb-transition);
}

.tag-card-name {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: var(--kb-transition);
}

.tag-card-body {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--kb-surface-hover);
    border-top: 1px solid var(--kb-border);
}

.tag-card-colors {
    display: flex;
    gap: 6px;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--kb-transition);
}

.color-dot:hover {
    transform: scale(1.2);
}

.color-dot.active {
    border-color: var(--kb-text);
    transform: scale(1.1);
}

.btn-delete-tag {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--kb-text-muted);
    border-radius: var(--kb-radius-xs);
    cursor: pointer;
    transition: var(--kb-transition);
}

.btn-delete-tag:hover {
    background: transparent;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%));
    background-size: 200% auto;
    background-position: 99% center;
    color: white;
    transform: scale(1.1);
}

/* ============================================
   CARD MODAL - PREMIUM
   ============================================ */
.card-modal-header {
    background: linear-gradient(180deg, var(--kb-surface) 0%, #fafbfc 100%);
}

.card-modal-body {
    padding: 0;
    max-height: calc(90vh - 140px);
    overflow: hidden;
}

.card-form-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    min-height: 500px;
    max-height: calc(90vh - 140px);
}

.card-form-main {
    padding: 28px;
    border-right: 1px solid var(--kb-border);
    overflow-y: auto;
}

.card-form-sidebar {
    padding: 24px;
    background: var(--kb-surface-hover);
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.form-section {
    margin-bottom: 28px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-label-lg {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--kb-text);
    margin-bottom: 12px;
}

.form-label-lg svg {
    color: var(--kb-text-secondary);
}

.input-lg {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    font-size: 1.1rem;
    font-weight: 500;
    background: var(--kb-surface);
    transition: var(--kb-transition);
}

.input-lg:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

.input-lg::placeholder {
    color: var(--kb-text-muted);
    font-weight: 400;
}

.textarea-rich {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--kb-surface);
    resize: vertical;
    min-height: 120px;
    transition: var(--kb-transition);
}

.textarea-rich:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--kb-border);
}

.sidebar-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--kb-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 14px;
}

.sidebar-title svg {
    opacity: 0.7;
}

.form-group-compact {
    margin-bottom: 16px;
}

.form-group-compact:last-child {
    margin-bottom: 0;
}

.form-group-compact label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--kb-text-secondary);
    margin-bottom: 8px;
}

.form-group-compact label svg {
    opacity: 0.6;
}

.select-styled {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-xs);
    font-size: 0.9rem;
    background: var(--kb-surface);
    cursor: pointer;
    transition: var(--kb-transition);
}

.select-styled:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

/* Input Date - Design Premium */
.input-date {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    background: linear-gradient(180deg, var(--kb-surface) 0%, #fafbfc 100%);
    cursor: pointer;
    transition: var(--kb-transition);
    color: var(--kb-text);
}

.input-date:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

.input-date::-webkit-calendar-picker-indicator {
    background: transparent;
    cursor: pointer;
    padding: 4px;
    margin-right: -4px;
    border-radius: 4px;
    transition: var(--kb-transition);
    filter: opacity(0.6);
}

.input-date:hover::-webkit-calendar-picker-indicator,
.input-date:focus::-webkit-calendar-picker-indicator {
    filter: opacity(1);
    background: var(--kb-primary-light);
}

.input-sm {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-xs);
    font-size: 0.9rem;
    background: var(--kb-surface);
    transition: var(--kb-transition);
}

.input-sm:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

/* Priority Selector */
.priority-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.priority-option {
    display: flex;
    cursor: pointer;
}

.priority-option input {
    display: none;
}

.priority-badge {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 6px;
    border: 1.5px solid var(--kb-border);
    border-radius: var(--kb-radius-xs);
    font-size: 0.6rem;
    font-weight: 600;
    background: var(--kb-surface);
    transition: var(--kb-transition);
}

.priority-option:hover .priority-badge {
    border-color: var(--kb-border-hover);
    background: var(--kb-surface-hover);
}

.priority-option.selected .priority-badge.low {
    border-color: var(--kb-success);
    background: var(--kb-success-light);
    color: var(--kb-success);
}

.priority-option.selected .priority-badge.medium {
    border-color: #eab308;
    background: #fefce8;
    color: #ca8a04;
}

.priority-option.selected .priority-badge.high {
    border-color: var(--kb-warning);
    background: var(--kb-warning-light);
    color: var(--kb-warning);
}

.priority-option.selected .priority-badge.urgent {
    border-color: var(--kb-danger);
    background: var(--kb-danger-light);
    color: var(--kb-danger);
}

/* Assignees List */
.assignees-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
}

.empty-assignees {
    padding: 20px;
    text-align: center;
    color: var(--kb-text-muted);
    font-size: 0.85rem;
    background: var(--kb-bg);
    border-radius: var(--kb-radius-xs);
}

.assignee-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    cursor: pointer;
    transition: var(--kb-transition);
    background: var(--kb-surface);
}

.assignee-item:hover {
    border-color: var(--kb-border-hover);
    background: var(--kb-surface-hover);
}

.assignee-item.selected {
    border-color: var(--kb-primary);
    background: var(--kb-primary-light);
}

.assignee-item input {
    display: none;
}

.assignee-avatar-md {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--kb-primary) 0%, #8b5cf6 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.assignee-info {
    flex: 1;
    min-width: 0;
}

.assignee-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--kb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assignee-email {
    display: block;
    font-size: 0.7rem;
    color: var(--kb-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assignee-check {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--kb-border);
    color: transparent;
    transition: var(--kb-transition);
}

.assignee-item.selected .assignee-check {
    background: var(--kb-primary);
    color: white;
}

/* Tags Selector Grid */
.tags-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.empty-tags {
    width: 100%;
    padding: 20px;
    text-align: center;
    background: var(--kb-bg);
    border-radius: var(--kb-radius-xs);
}

.empty-tags p {
    margin: 0 0 10px;
    color: var(--kb-text-muted);
    font-size: 0.85rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.tag-chip input {
    display: none;
}

.tag-chip span {
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--tag-bg);
    color: var(--tag-color);
    border: 1.5px solid transparent;
    transition: var(--kb-transition);
}

.tag-chip:hover span {
    border-color: var(--tag-border);
}

.tag-chip.selected span {
    border-color: var(--tag-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Checklist in Modal */
.checklist-wrapper {
    background: var(--kb-bg);
    border-radius: var(--kb-radius-sm);
    padding: 16px;
}

.checklist-progress {
    font-size: 0.75rem;
    color: var(--kb-text-muted);
    background: var(--kb-bg);
    padding: 4px 10px;
    border-radius: 10px;
    margin-left: auto;
}

.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--kb-surface);
    border-radius: var(--kb-radius-xs);
    border: 1px solid var(--kb-border);
    transition: var(--kb-transition);
}

.checklist-item:hover {
    border-color: var(--kb-border-hover);
}

.checklist-item.completed {
    background: var(--kb-success-light);
    border-color: transparent;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--kb-primary);
}

.checklist-item span {
    flex: 1;
    font-size: 0.8rem;
    color: var(--kb-text);
}

.checklist-item span.checked {
    text-decoration: line-through;
    color: var(--kb-text-muted);
}

.btn-delete-checklist {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--kb-text-muted);
    border-radius: var(--kb-radius-xs);
    cursor: pointer;
    opacity: 0;
    transition: var(--kb-transition);
}

.checklist-item:hover .btn-delete-checklist {
    opacity: 1;
}

.btn-delete-checklist:hover {
    background: transparent;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%));
    background-size: 200% auto;
    background-position: 99% center;
    color: white;
    transform: scale(1.1);
}

.checklist-add {
    display: flex;
    gap: 10px;
}

.checklist-add input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-xs);
    font-size: 0.9rem;
    background: var(--kb-surface);
    transition: var(--kb-transition);
}

.checklist-add input:focus {
    outline: none;
    border-color: var(--kb-primary);
}

/* ============================================
   ATTACHMENTS
   ============================================ */
.attachments-wrapper {
    background: var(--kb-bg);
    border-radius: var(--kb-radius-sm);
    padding: 16px;
}

.attachments-count {
    font-size: 0.75rem;
    color: var(--kb-text-muted);
    background: var(--kb-bg);
    padding: 4px 10px;
    border-radius: 10px;
    margin-left: auto;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--kb-surface);
    border-radius: var(--kb-radius-xs);
    border: 1px solid var(--kb-border);
    transition: var(--kb-transition);
}

.attachment-item:hover {
    border-color: var(--kb-border-hover);
    background: #fafafa;
}

.attachment-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kb-bg);
    border-radius: 6px;
    flex-shrink: 0;
}

.attachment-icon svg {
    width: 18px;
    height: 18px;
}

.attachment-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.attachment-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--kb-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-name:hover {
    color: var(--kb-primary);
    text-decoration: underline;
}

.attachment-meta {
    font-size: 0.75rem;
    color: var(--kb-text-muted);
}

.btn-delete-attachment {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--kb-text-muted);
    border-radius: var(--kb-radius-xs);
    cursor: pointer;
    opacity: 0;
    transition: var(--kb-transition);
}

.attachment-item:hover .btn-delete-attachment {
    opacity: 1;
}

.btn-delete-attachment:hover {
    background: transparent;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%));
    background-size: 200% auto;
    background-position: 99% center;
    color: white;
    transform: scale(1.1);
}

.attachment-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-upload .btn-block {
    width: 100%;
    justify-content: center;
}

.upload-hint {
    font-size: 0.7rem;
    color: var(--kb-text-muted);
    text-align: center;
}

/* Card Modal Footer */
.card-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left,
.footer-right {
    display: flex;
    gap: 12px;
}

.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    color: var(--kb-danger);
    border: 2px solid var(--kb-danger-light);
    border-radius: var(--kb-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--kb-transition);
}

.btn-danger-outline:hover {
    background: transparent;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%));
    background-size: 200% auto;
    background-position: 99% center;
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* ============================================
   CONTEXT MENU
   ============================================ */
.context-menu {
    position: fixed;
    background: var(--kb-surface);
    border-radius: var(--kb-radius-xs);
    box-shadow: var(--kb-shadow-lg);
    border: 1px solid var(--kb-border);
    min-width: 140px;
    padding: 4px;
    z-index: 10000;
}

.context-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--kb-text);
    cursor: pointer;
    text-align: left;
    transition: var(--kb-transition);
}

.context-menu button:hover {
    background: var(--kb-bg);
}

.context-menu button svg {
    width: 12px;
    height: 12px;
    color: var(--kb-text-secondary);
}

.context-menu-divider {
    height: 1px;
    background: var(--kb-border);
    margin: 4px 0;
}

/* ============================================
   BUTTONS - GLOBAL
   ============================================ */
.modal-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: var(--kb-radius-xs);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--kb-transition);
    border: none;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--kb-primary) 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, var(--kb-primary-hover) 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.modal-footer .btn-secondary {
    background: var(--kb-surface);
    color: var(--kb-text-secondary);
    border: 2px solid var(--kb-border);
}

.modal-footer .btn-secondary:hover {
    background: var(--kb-surface-hover);
    border-color: var(--kb-border-hover);
}

.btn-danger {
    background: transparent !important;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%)) !important;
    background-size: 200% auto !important;
    background-position: 0% center !important;
    color: white !important;
    border: none !important;
    transition: background-position 0.3s ease, box-shadow 0.2s ease, transform 0.15s ease !important;
}

.btn-danger:hover {
    background-position: 99% center !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-xs {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
}

.btn-sm {
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
}

.btn-icon {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--kb-radius-xs);
    cursor: pointer;
    color: var(--kb-text-secondary);
}

.btn-icon:hover {
    background: var(--kb-bg);
    color: var(--kb-text);
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 1024px) {
    .card-form-layout {
        grid-template-columns: 1fr;
    }
    
    .card-form-main {
        border-right: none;
        border-bottom: 1px solid var(--kb-border);
    }
    
    .card-form-sidebar {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .kanban-module {
        height: calc(100vh - 120px);
        margin: -16px;
    }
    
    .kanban-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }
    
    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }
    
    .toolbar-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .board-selector select {
        width: 100%;
    }
    
    .kanban-board-container {
        padding: 16px;
    }
    
    .kanban-filters {
        flex-direction: column;
        padding: 16px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .kanban-list {
        flex: 0 0 320px;
        min-width: 320px;
        max-width: 320px;
    }
    
    .modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .tags-grid {
        grid-template-columns: 1fr;
    }
    
    .priority-selector {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kanban-list,
    .kanban-add-list {
        flex: 0 0 280px;
        min-width: 280px;
        max-width: 280px;
    }
    
    .modal-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .modal-icon {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.hidden {
    display: none !important;
}

body.kanban-modal-open {
    overflow: hidden;
}

/* Form Group - Escopo Kanban/Tarefas (legacy support) */
#boardModal .form-group,
#listModal .form-group,
#cardModal .form-group,
#tagsModal .form-group,
#taskModal .form-group,
#columnModal .form-group,
#labelsModal .form-group {
    margin-bottom: 14px;
}

#boardModal .form-group:last-child,
#listModal .form-group:last-child,
#cardModal .form-group:last-child,
#tagsModal .form-group:last-child,
#taskModal .form-group:last-child,
#columnModal .form-group:last-child,
#labelsModal .form-group:last-child {
    margin-bottom: 0;
}

#boardModal .form-group label,
#listModal .form-group label,
#cardModal .form-group label,
#tagsModal .form-group label,
#taskModal .form-group label,
#columnModal .form-group label,
#labelsModal .form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--kb-text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#boardModal .form-group input,
#boardModal .form-group select,
#boardModal .form-group textarea,
#listModal .form-group input,
#listModal .form-group select,
#listModal .form-group textarea,
#cardModal .form-group input,
#cardModal .form-group select,
#cardModal .form-group textarea,
#tagsModal .form-group input,
#tagsModal .form-group select,
#tagsModal .form-group textarea,
#taskModal .form-group input,
#taskModal .form-group select,
#taskModal .form-group textarea,
#columnModal .form-group input,
#columnModal .form-group select,
#columnModal .form-group textarea,
#labelsModal .form-group input,
#labelsModal .form-group select,
#labelsModal .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    font-size: 0.85rem;
    color: var(--kb-text);
    background: var(--kb-surface);
    transition: var(--kb-transition);
    box-sizing: border-box;
}

#boardModal .form-group input:focus,
#boardModal .form-group select:focus,
#boardModal .form-group textarea:focus,
#listModal .form-group input:focus,
#listModal .form-group select:focus,
#listModal .form-group textarea:focus,
#cardModal .form-group input:focus,
#cardModal .form-group select:focus,
#cardModal .form-group textarea:focus,
#tagsModal .form-group input:focus,
#tagsModal .form-group select:focus,
#tagsModal .form-group textarea:focus,
#taskModal .form-group input:focus,
#taskModal .form-group select:focus,
#taskModal .form-group textarea:focus,
#columnModal .form-group input:focus,
#columnModal .form-group select:focus,
#columnModal .form-group textarea:focus,
#labelsModal .form-group input:focus,
#labelsModal .form-group select:focus,
#labelsModal .form-group textarea:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

#boardModal .form-group textarea,
#listModal .form-group textarea,
#cardModal .form-group textarea,
#tagsModal .form-group textarea,
#taskModal .form-group textarea,
#columnModal .form-group textarea,
#labelsModal .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ============================================
   TAGS DROPDOWN (ESTILO TRELLO)
   ============================================ */
.tags-dropdown {
    position: fixed;
    width: 240px;
    background: var(--kb-surface-solid);
    border-radius: var(--kb-radius-xs);
    box-shadow: var(--kb-shadow-xl);
    border: 1px solid var(--kb-border);
    z-index: 10001;
    max-height: 70vh;
    overflow-y: auto;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--kb-border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--kb-text);
}

.dropdown-close {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 1rem;
    color: var(--kb-text-muted);
    cursor: pointer;
    transition: var(--kb-transition);
}

.dropdown-close:hover {
    background: var(--kb-danger-light);
    color: var(--kb-danger);
}

.dropdown-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--kb-border);
}

.dropdown-search input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--kb-border);
    border-radius: 4px;
    font-size: 0.75rem;
    transition: var(--kb-transition);
}

.dropdown-search input:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 2px var(--kb-primary-light);
}

.dropdown-section {
    padding: 8px 10px;
}

.dropdown-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--kb-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.dropdown-tags-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
}

.dropdown-empty {
    padding: 12px;
    text-align: center;
    color: var(--kb-text-muted);
    font-size: 0.7rem;
}

.dropdown-tag-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-tag-checkbox {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.dropdown-tag-checkbox input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--kb-primary);
}

.dropdown-tag-color {
    flex: 1;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    min-height: 24px;
    display: flex;
    align-items: center;
}

.dropdown-tag-edit,
.dropdown-tag-delete {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: var(--kb-text-muted);
    cursor: pointer;
    transition: var(--kb-transition);
    opacity: 0;
}

.dropdown-tag-item:hover .dropdown-tag-edit,
.dropdown-tag-item:hover .dropdown-tag-delete {
    opacity: 1;
}

.dropdown-tag-edit:hover {
    background: var(--kb-primary-light);
    color: var(--kb-primary);
}

.dropdown-tag-delete:hover {
    background: transparent;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%));
    background-size: 200% auto;
    background-position: 99% center;
    color: white;
    transform: scale(1.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--kb-border);
    margin: 0;
}

.dropdown-create {
    background: var(--kb-surface-hover);
}

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

.dropdown-create-form input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--kb-border);
    border-radius: 4px;
    font-size: 0.75rem;
    transition: var(--kb-transition);
}

.dropdown-create-form input[type="text"]:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 2px var(--kb-primary-light);
}

.dropdown-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dropdown-color-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--kb-transition);
}

.dropdown-color-btn:hover {
    transform: scale(1.1);
}

.dropdown-color-btn.active {
    border-color: var(--kb-text);
    transform: scale(1.1);
}

.btn-block {
    width: 100%;
}

/* Edit form dentro do dropdown */
.dropdown-edit-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: var(--kb-bg);
    border-radius: 4px;
    width: 100%;
}

.dropdown-edit-form input[type="text"] {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--kb-border);
    border-radius: 4px;
    font-size: 0.7rem;
}

.dropdown-edit-form input[type="text"]:focus {
    outline: none;
    border-color: var(--kb-primary);
}

.dropdown-edit-actions {
    display: flex;
    gap: 6px;
}

/* Botão de gerenciar tags no título */
.btn-manage-tags {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: var(--kb-text-muted);
    cursor: pointer;
    transition: var(--kb-transition);
    margin-left: auto;
}

.btn-manage-tags:hover {
    background: var(--kb-primary-light);
    color: var(--kb-primary);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Modal footer split para excluir */
.modal-footer-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-footer-right {
    display: flex;
    gap: 8px;
}

/* ============================================
   FILTERS DROPDOWN
   ============================================ */
.filters-dropdown {
    position: fixed;
    width: 220px;
    background: var(--kb-surface-solid);
    border-radius: var(--kb-radius-xs);
    box-shadow: var(--kb-shadow-xl);
    border: 1px solid var(--kb-border);
    z-index: 10001;
}

.filters-dropdown-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-field label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--kb-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-field input,
.filter-field select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--kb-border);
    border-radius: 4px;
    font-size: 0.7rem;
    background: var(--kb-surface);
    color: var(--kb-text);
    transition: var(--kb-transition);
}

.filter-field input:focus,
.filter-field select:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 2px var(--kb-primary-light);
}

.filter-date-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-date-row input {
    flex: 1;
    padding: 5px 8px;
    font-size: 0.7rem;
}

.filter-date-row span {
    font-size: 0.65rem;
    color: var(--kb-text-muted);
}

.filters-dropdown-footer {
    padding: 8px 10px;
    border-top: 1px solid var(--kb-border);
    background: var(--kb-surface-hover);
    border-radius: 0 0 var(--kb-radius-xs) var(--kb-radius-xs);
}

.filters-dropdown-footer .btn {
    width: 100%;
    justify-content: center;
}

/* Badge de filtro ativo */
#filtersToggle.has-filters {
    color: var(--kb-primary);
    background: var(--kb-primary-light);
}

.filter-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--kb-danger);
    border-radius: 50%;
}

#filtersToggle {
    position: relative;
}

/* Spinner Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}
/* ============================================
   MODAL COM ABAS - DESIGN MELHORADO
   ============================================ */

/* Modal com abas */
.card-modal-tabs {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.card-modal-tabs .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Navegação das abas */
.card-modal-tabs-nav {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    background: var(--kb-surface-active);
    border-bottom: 2px solid var(--kb-border);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--kb-text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: var(--kb-transition);
    border-bottom: 3px solid transparent;
}

.tab-btn svg {
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--kb-text);
    background: var(--kb-surface-hover);
}

.tab-btn.active {
    color: var(--kb-primary);
    border-bottom-color: var(--kb-primary);
    background: var(--kb-surface);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--kb-primary-light);
    color: var(--kb-primary);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.tab-btn.active .tab-badge {
    background: var(--kb-primary);
    color: white;
}

/* Conteúdo das abas */
.card-modal-body-tabs {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.tab-content-inner {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

/* Grid de configurações */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.settings-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-section {
    background: var(--kb-surface-active);
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius);
    padding: 20px;
}

.settings-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--kb-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-title svg {
    color: var(--kb-text-secondary);
}

/* Priority selector compacto */
.priority-selector-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.priority-selector-compact .priority-option {
    padding: 10px;
    border-radius: var(--kb-radius-xs);
}

.priority-selector-compact .priority-badge {
    font-size: 0.85rem;
}

/* Assignees compacto */
.assignees-list-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.assignee-item-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 2px solid var(--kb-border);
    border-radius: var(--kb-radius-xs);
    cursor: pointer;
    transition: var(--kb-transition);
    background: var(--kb-surface);
}

.assignee-item-compact:hover {
    border-color: var(--kb-primary);
    background: var(--kb-primary-lighter);
}

.assignee-item-compact.selected {
    border-color: var(--kb-primary);
    background: var(--kb-primary-light);
}

.assignee-item-compact input {
    display: none;
}

.assignee-avatar-sm {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--kb-primary) 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.assignee-info-compact {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.assignee-info-compact .assignee-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--kb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assignee-info-compact .assignee-email {
    font-size: 0.75rem;
    color: var(--kb-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Checklist wrapper tab */
.checklist-wrapper-tab {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-checklist,
.empty-attachments {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--kb-text-secondary);
}

.empty-checklist svg,
.empty-attachments svg {
    color: var(--kb-text-muted);
    margin-bottom: 16px;
}

.empty-checklist p,
.empty-attachments p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--kb-text);
    margin: 0 0 8px 0;
}

.empty-checklist span,
.empty-attachments span {
    font-size: 0.9rem;
    color: var(--kb-text-secondary);
}

/* Attachments wrapper tab */
.attachments-wrapper-tab {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.attachments-wrapper-tab .attachments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attachments-wrapper-tab .attachment-upload {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border: 2px dashed var(--kb-border);
    border-radius: var(--kb-radius);
    text-align: center;
}

.attachments-wrapper-tab .upload-hint {
    font-size: 0.85rem;
    color: var(--kb-text-secondary);
}

/* Tags empty state compacto */
.empty-tags-compact {
    padding: 20px;
    text-align: center;
}

.empty-tags-compact p {
    margin: 0 0 12px 0;
    color: var(--kb-text-secondary);
    font-size: 0.9rem;
}

/* Responsivo */
@media (max-width: 768px) {
    .card-modal-tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
    
    .tab-content-inner {
        padding: 16px;
    }
}

/* ============================================
   MODAL UNIFICADO (SEM ABAS)
   ============================================ */

.modal-overlay .modal.card-modal-unified,
.card-modal-unified {
    width: 90vw;
    max-width: 700px !important;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.card-modal-body-unified {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.card-modal-content {
    padding: 18px;
    overflow-x: hidden;
}

/* Seções do Modal */
.modal-section {
    margin-bottom: 24px;
    overflow: hidden;
    max-width: 100%;
}

.modal-section:last-child {
    margin-bottom: 0;
}

/* Headers de Seção */
.section-header-unified {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--kb-border);
}

.section-title-unified {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--kb-text);
}

.section-title-unified svg {
    color: var(--kb-primary);
    flex-shrink: 0;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--kb-primary);
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: auto;
}

/* Grid de Configurações Unificado */
.settings-grid-unified {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .settings-grid-unified {
        grid-template-columns: 1fr;
    }
}

.settings-section-unified {
    background: var(--kb-surface-hover);
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius);
    padding: 16px;
}

.settings-title-unified {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--kb-text);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--kb-border);
}

.settings-title-unified svg {
    color: var(--kb-primary);
    flex-shrink: 0;
}

/* Checklist Unificada */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--kb-surface);
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    transition: var(--kb-transition);
}

.checklist-item:hover {
    background: var(--kb-surface-hover);
    border-color: var(--kb-primary);
}

.checklist-item.completed {
    opacity: 0.6;
    background: var(--kb-surface-active);
}

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.checklist-item span {
    flex: 1;
    font-size: 0.8rem;
    color: var(--kb-text);
}

.checklist-item span.checked {
    text-decoration: line-through;
    color: var(--kb-text-secondary);
}

.btn-delete-checklist {
    padding: 6px;
    background: none;
    border: none;
    border-radius: var(--kb-radius-xs);
    color: var(--kb-text-muted);
    cursor: pointer;
    transition: var(--kb-transition);
    flex-shrink: 0;
}

.btn-delete-checklist:hover {
    background: transparent;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%));
    background-size: 200% auto;
    background-position: 99% center;
    color: white;
    transform: scale(1.1);
}

.checklist-add {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--kb-surface-hover);
    border: 1px dashed var(--kb-border);
    border-radius: var(--kb-radius-sm);
}

.checklist-add input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius-xs);
    font-size: 0.9rem;
    background: white;
}

.checklist-add input:focus {
    outline: none;
    border-color: var(--kb-primary);
    box-shadow: 0 0 0 3px var(--kb-primary-light);
}

/* Anexos Unificados */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--kb-surface);
    border: 1px solid var(--kb-border);
    border-radius: var(--kb-radius-sm);
    transition: var(--kb-transition);
}

.attachment-item:hover {
    background: var(--kb-surface-hover);
    box-shadow: var(--kb-shadow-sm);
}

.attachment-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kb-surface-active);
    border-radius: var(--kb-radius-xs);
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--kb-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.attachment-name:hover {
    text-decoration: underline;
}

.attachment-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--kb-text-secondary);
}

.btn-delete-attachment {
    padding: 6px;
    background: none;
    border: none;
    border-radius: var(--kb-radius-xs);
    color: var(--kb-text-muted);
    cursor: pointer;
    transition: var(--kb-transition);
    flex-shrink: 0;
}

.btn-delete-attachment:hover {
    background: transparent;
    background-image: linear-gradient(to right, hsl(0 84.2% 60.2%), hsl(0 84.2% 60.2% / 0.6), hsl(0 84.2% 60.2%));
    background-size: 200% auto;
    background-position: 99% center;
    color: white;
    transform: scale(1.1);
}

.attachment-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: var(--kb-surface-hover);
    border: 2px dashed var(--kb-border);
    border-radius: var(--kb-radius);
    text-align: center;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--kb-text-secondary);
}

/* Estado Vazio Compacto */
.empty-state-compact {
    padding: 32px 20px;
    text-align: center;
    color: var(--kb-text-secondary);
}

.empty-state-compact p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Botão de Bloco */
.btn-block {
    width: 100%;
    justify-content: center;
}

/* ============================================
   SEÇÃO DE ATIVIDADES
   ============================================ */
.activities-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    width: 100%;
}

.activities-list::-webkit-scrollbar {
    width: 6px;
}

.activities-list::-webkit-scrollbar-track {
    background: var(--kb-surface-hover);
    border-radius: 3px;
}

.activities-list::-webkit-scrollbar-thumb {
    background: var(--kb-border);
    border-radius: 3px;
}

.activities-list::-webkit-scrollbar-thumb:hover {
    background: var(--kb-text-muted);
}

.activities-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--kb-text-muted);
    font-size: 0.875rem;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--kb-border);
    border-top-color: var(--kb-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--kb-surface-hover);
    border-radius: var(--kb-radius-sm);
    transition: var(--kb-transition);
    max-width: 100%;
    overflow: hidden;
}

.activity-item:hover {
    background: var(--kb-surface-active);
}

.activity-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--kb-primary), var(--kb-primary-hover));
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    text-transform: uppercase;
}

.activity-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.activity-message {
    font-size: 0.875rem;
    color: var(--kb-text);
    line-height: 1.4;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.activity-message strong {
    font-weight: 600;
    color: var(--kb-text);
}

.activity-highlight {
    display: inline-block;
    padding: 2px 8px;
    background: var(--kb-primary-light);
    color: var(--kb-primary);
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8rem;
    word-break: break-word;
    max-width: 100%;
}

.activity-highlight.success {
    background: var(--kb-success-light);
    color: var(--kb-success);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--kb-text-muted);
}

/* Responsivo do Modal Unificado */
@media (max-width: 768px) {
    .card-modal-unified {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .card-modal-content {
        padding: 16px;
    }

    .modal-section {
        margin-bottom: 24px;
    }

    .activities-list {
        max-height: 200px;
    }
}
