/* --- CONFIGURAÇÕES GERAIS --- */
:root {
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --primary: #4f46e5;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 30px;
    display: flex;
    justify-content: center;
}

.main-container { width: 100%; max-width: 1200px; }

/* HEADER & CONTROLS */
header {
    background: var(--white);
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-brand { display: flex; align-items: center; gap: 10px; }
.header-brand i { font-size: 1.5rem; color: var(--primary); }
h1 { font-size: 1.25rem; font-weight: 700; margin: 0; color: #111827; }

.header-controls { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.filter-controls { display: flex; gap: 10px; }
.filter-controls input, .filter-controls select { padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 8px; outline: none; }

.user-area { display: flex; align-items: center; gap: 10px; border-left: 1px solid #e5e7eb; padding-left: 15px; }
.btn-action { border: none; padding: 8px 12px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; gap: 5px; }
.btn-logout { background: #fee2e2; color: #991b1b; }
.btn-backup { background: #d1fae5; color: #065f46; }

/* DASHBOARD */
.dashboard-panel {
    background: var(--white); padding: 20px; border-radius: 12px; box-shadow: var(--shadow-sm); margin-bottom: 30px; display: flex; gap: 20px; flex-wrap: wrap;
}
.stats-cards { display: flex; gap: 15px; flex: 2; flex-wrap: wrap; }
.stat-card { background: var(--white); border: 1px solid #f3f4f6; padding: 15px; border-radius: 12px; flex: 1; min-width: 130px; display: flex; align-items: center; gap: 10px; }
.stat-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.stat-info h3 { margin: 0; font-size: 0.75rem; color: #6b7280; text-transform: uppercase; }
.stat-info span { font-size: 1.3rem; font-weight: 700; }
.chart-container { flex: 1; height: 160px; max-width: 300px; display: flex; justify-content: center; }

/* INPUT */
.input-group { display: flex; gap: 10px; margin-bottom: 30px; }
#taskTitle { flex: 1; padding: 15px; font-size: 1rem; border: none; background: var(--white); box-shadow: var(--shadow-sm); border-radius: 10px; }
#addBtn { background: var(--primary); color: white; border: none; padding: 0 25px; border-radius: 10px; font-weight: 600; cursor: pointer; }

/* KANBAN */
.kanban-board { display: flex; gap: 20px; align-items: flex-start; }
.column { flex: 1; background: #f9fafb; border-radius: 12px; padding: 15px; min-height: 400px; border: 1px solid #e5e7eb; min-width: 280px; }
.col-title { margin: 0 0 15px 0; padding-bottom: 10px; border-bottom: 2px solid #e5e7eb; font-size: 0.95rem; color: #374151; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.title-todo i { color: #f59e0b; } .title-doing i { color: #3b82f6; } .title-done i { color: #10b981; }

/* CARD (CORREÇÃO DOS BOTÕES AQUI) */
.card {
    background: var(--white); padding: 15px; margin-bottom: 12px; border-radius: 10px;
    box-shadow: var(--shadow-sm); cursor: grab; border: 1px solid #f3f4f6; border-left: 4px solid #d1d5db; position: relative;
}
.priority-low { border-left-color: #10b981; } 
.priority-medium { border-left-color: #f59e0b; } 
.priority-high { border-left-color: #ef4444; }

.category-badge { display: inline-block; font-size: 0.65rem; padding: 3px 8px; border-radius: 10px; font-weight: 700; margin-bottom: 8px; }
.card-content strong { display: block; margin-bottom: 8px; font-size: 0.95rem; line-height: 1.4; }

/* BOTÕES DE AÇÃO (CORRIGIDO: SEMPRE VISÍVEIS) */
.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 1; /* Antes era 0, agora é 1 para garantir visibilidade */
    background: rgba(255,255,255,0.9);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    gap: 5px;
    z-index: 10; /* Garante que fique acima do texto */
}

.btn-icon { background: none; border: none; cursor: pointer; color: #9ca3af; font-size: 0.9rem; padding: 2px 5px; }
.btn-icon:hover { color: var(--primary); transform: scale(1.1); } 
.btn-icon.del:hover { color: #ef4444; }

/* FOOTER DO CARD */
.card-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px; }
.meta-group { display: flex; gap: 5px; flex-wrap: wrap; }
.task-meta-tag { font-size: 0.7rem; color: #6b7280; background: #f3f4f6; padding: 3px 6px; border-radius: 4px; display: flex; align-items: center; gap: 4px; }
.user-avatar { width: 22px; height: 22px; border-radius: 50%; color: white; font-size: 0.6rem; display: flex; align-items: center; justify-content: center; font-weight: bold; }

/* MODAL */
.modal-overlay { background: rgba(0,0,0,0.4); backdrop-filter: blur(2px); z-index: 1000; display: none; position: fixed; top:0; left:0; width:100%; height:100%; justify-content: center; align-items: center; }
.modal-content { background: white; width: 500px; border-radius: 16px; box-shadow: var(--shadow-md); max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px 25px; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 1.1rem; }
.close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999; }
.modal-body { padding: 20px 25px; }
.modal-input, .modal-textarea { width: 100%; padding: 10px; border: 1px solid #e5e7eb; border-radius: 6px; margin-top: 5px; box-sizing: border-box; }
.modal-footer { padding: 20px 25px; background: #f9fafb; text-align: right; border-top: 1px solid #f3f4f6; }
.btn-save { background: var(--primary); color: white; padding: 10px 20px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; }
.btn-cancel { background: white; border: 1px solid #d1d5db; padding: 10px 15px; border-radius: 6px; cursor: pointer; margin-right: 10px; }

/* CHECKLIST & CHAT */
.section-divider { margin-top: 20px; border-top: 1px solid #f3f4f6; padding-top: 15px; }
.checklist-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f9fafb; }
.comments-box { background: #f9fafb; border: 1px solid #e5e7eb; height: 150px; overflow-y: auto; padding: 10px; border-radius: 6px; margin-bottom: 10px; }
.comment-item { margin-bottom: 8px; font-size: 0.9rem; }
.comment-header { font-weight: 700; font-size: 0.8rem; }
.btn-small { padding: 8px 12px; background: #3b82f6; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.checklist-input-group, .comment-input-group { display: flex; gap: 8px; }

/* MOBILE */
@media (max-width: 768px) {
    body { padding: 10px; }
    header { flex-direction: column; align-items: flex-start; }
    .header-controls, .filter-controls, .kanban-board, .dashboard-panel { width: 100%; flex-direction: column; }
    .stat-card, .chart-container { width: 100%; }
    .column { width: 100%; min-width: 0; }
    .modal-content { width: 95%; margin: 10px; }
}