:root {
    --bg-main: #f9fafb;
    --bg-white: #ffffff;
    --primary: #524ade; /* Azul/Roxo Broad Agency */
    --primary-hover: #4038c5;
    
    --text-dark: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border-light: #e5e7eb;
    
    /* Labels Broad Agency */
    --label-purple-bg: #f3e8ff;
    --label-purple-text: #7e22ce;
    --label-red-bg: #fee2e2;
    --label-red-text: #ef4444;
    --label-orange-bg: #ffedd5;
    --label-orange-text: #ea580c;
    --label-green-bg: #dcfce7;
    --label-green-text: #16a34a;
    --label-blue-bg: #e0f2fe;
    --label-blue-text: #0284c7;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.app-layout {
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
    display: flex;
    overflow: hidden;
}

/* ================== SIDEBAR ================== */
.sidebar {
    width: 80px;
    background-color: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.logo-box {
    width: 48px;
    height: 48px;
    background-color: white;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-bottom: 40px;
}

.nav-menu { display: flex; flex-direction: column; gap: 32px; width: 100%; }
.nav-item {
    color: rgba(255,255,255,0.6);
    font-size: 1.25rem;
    text-decoration: none;
    display: flex; justify-content: center; align-items: center;
    height: 40px; width: 100%;
    transition: color 0.2s, background 0.2s;
    border-left: 3px solid transparent;
}
.nav-item:hover, .nav-item.active {
    color: white;
    border-left-color: white;
    background-color: rgba(255,255,255,0.1);
}

/* ================== SUB-SIDEBAR ================== */
.sub-sidebar {
    width: 260px;
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    overflow-y: auto;
}

.sub-sidebar-header h2 { font-size: 1.25rem; color: var(--text-dark); margin-bottom: 32px; }

.projects-section { margin-bottom: 32px; }
.projects-section h3 {
    font-size: 0.75rem; color: var(--text-light);
    font-weight: 600; margin-bottom: 16px; letter-spacing: 0.05em;
}
.float-right { float: right; cursor: pointer; }

.project-item {
    display: flex; align-items: center;
    padding: 10px 12px; margin-bottom: 4px;
    border-radius: 8px; color: var(--text-muted);
    font-size: 0.9rem; font-weight: 500; cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.project-item.active {
    background-color: #f3f4f6; color: var(--text-dark); font-weight: 600;
}
.project-item:hover { background-color: #f9fafb; color: var(--text-dark); }

.proj-icon { margin-right: 12px; font-size: 1rem; }
.proj-icon.red { color: #ef4444; }
.proj-icon.purple { color: #8b5cf6; }
.proj-icon.orange { color: #f97316; }
.proj-icon.blue { color: #0ea5e9; }
.proj-icon.dark { color: #374151; }

.proj-badge {
    margin-left: auto; background-color: #e0e7ff; color: var(--primary);
    padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600;
}

.btn-create-proj {
    background: transparent; border: none; color: var(--text-light);
    font-size: 0.9rem; font-weight: 500; margin-top: 12px; cursor: pointer;
    display: flex; align-items: center; gap: 8px; padding-left: 12px;
}
.btn-create-proj:hover { color: var(--text-dark); }

.upgrade-card {
    margin-top: auto; background-color: #f8fafc; border: 1px solid var(--border-light);
    border-radius: 12px; padding: 16px;
}
.upgrade-header { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--text-dark); }
.upgrade-header h4 { font-size: 0.9rem; font-weight: 600; }
.upgrade-card p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.4; }
.btn-upgrade {
    background-color: var(--text-dark); color: white; border: none; border-radius: 8px;
    padding: 10px; width: 100%; font-weight: 500; cursor: pointer;
}

/* ================== MAIN CONTENT ================== */
.main-content {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* Top Header */
.top-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 24px 40px; background-color: var(--bg-white); border-bottom: 1px solid var(--border-light);
}

.search-bar {
    display: flex; align-items: center; background-color: #f9fafb;
    border: 1px solid var(--border-light); border-radius: 8px; padding: 8px 16px; width: 300px;
}
.search-bar i { color: var(--text-light); margin-right: 8px; }
.search-bar input { border: none; background: transparent; outline: none; flex: 1; font-size: 0.9rem; color: var(--text-dark); }
.kbd { font-size: 0.75rem; color: var(--text-light); background: var(--bg-white); border: 1px solid var(--border-light); padding: 2px 6px; border-radius: 4px; }

.header-right { display: flex; align-items: center; gap: 24px; }
.user-dropdown { display: flex; align-items: center; gap: 12px; cursor: pointer; border: 1px solid var(--border-light); padding: 6px 12px; border-radius: 20px; font-weight: 500; font-size: 0.9rem; color: var(--text-dark); }
.user-dropdown img { width: 28px; height: 28px; border-radius: 50%; }
.user-dropdown i { color: var(--text-muted); font-size: 0.8rem; }
.btn-icon { background: transparent; border: none; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; }

/* Project Header Area */
.project-header {
    padding: 32px 40px 0; background-color: var(--bg-white);
    display: flex; justify-content: space-between; align-items: flex-end;
}
.project-title-area h1 { font-size: 1.8rem; color: var(--text-dark); font-weight: 700; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.project-title-area h1 i { font-size: 1.2rem; color: var(--text-light); cursor: pointer; }
.project-progress { color: var(--primary); font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }

.project-meta { display: flex; gap: 32px; align-items: center; }
.meta-avatars { display: flex; align-items: center; }
.meta-avatars img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid white; margin-left: -8px; }
.meta-avatars img:first-child { margin-left: 0; }
.avatar-more { background: #f3f4f6; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid white; margin-left: -8px; }
.btn-circle { width: 32px; height: 32px; border-radius: 50%; border: 1px dashed var(--text-light); background: transparent; color: var(--text-light); cursor: pointer; margin-left: 8px; display: flex; align-items: center; justify-content: center; }

.meta-info { display: flex; flex-direction: column; gap: 4px; }
.meta-info small { font-size: 0.65rem; color: var(--text-light); font-weight: 600; letter-spacing: 0.05em; }
.meta-info span { font-size: 0.85rem; color: var(--text-dark); font-weight: 500; }

/* Toolbar com abas e filtros */
.board-toolbar {
    padding: 24px 40px; background-color: var(--bg-white);
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.tabs { display: flex; gap: 32px; }
.tab {
    background: transparent; border: none; font-size: 0.95rem; font-weight: 500;
    color: var(--text-muted); cursor: pointer; padding-bottom: 24px; margin-bottom: -25px;
    border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 8px;
}
.tab.active { color: var(--text-dark); border-bottom-color: var(--text-dark); font-weight: 600; }
.tab .badge { background: #e0e7ff; color: var(--primary); padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; }

.toolbar-actions { display: flex; align-items: center; gap: 16px; }
.view-toggles { display: flex; background: #f3f4f6; border-radius: 8px; padding: 4px; }
.view-toggles .view-btn { background: transparent; border: none; padding: 6px 10px; border-radius: 6px; cursor: pointer; color: var(--text-muted); }
.view-toggles .view-btn.active { background: white; color: var(--text-dark); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

.btn-outline { background: white; border: 1px solid var(--border-light); color: var(--text-dark); padding: 8px 16px; border-radius: 8px; font-weight: 500; cursor: pointer; font-size: 0.875rem; display: flex; gap: 8px; align-items: center; }
.btn-primary { background: var(--text-dark); border: none; color: white; padding: 8px 16px; border-radius: 8px; font-weight: 500; cursor: pointer; font-size: 0.875rem; display: flex; align-items: center; gap: 8px; }


/* ================== BOARD ================== */
.board {
    flex: 1; display: flex; gap: 24px; padding: 32px 40px;
    overflow-x: auto; overflow-y: hidden; background-color: var(--bg-main);
}
.board::-webkit-scrollbar { height: 8px; }
.board::-webkit-scrollbar-track { background: transparent; }
.board::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.column { min-width: 320px; width: 320px; display: flex; flex-direction: column; }
.column-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding: 0 8px; }
.column-title { font-weight: 600; color: var(--text-dark); font-size: 1rem; display: flex; align-items: center; gap: 8px;}
.column-title i { font-size: 0.5rem; }
.column-title i.blue { color: #3b82f6; }
.column-title i.orange { color: #f97316; }
.column-title i.green { color: #22c55e; }

.column-badge { background: #e0e7ff; color: var(--primary); padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.col-add-btn { background: transparent; border: none; color: var(--text-light); font-size: 1rem; cursor: pointer; }

.card-list { flex: 1; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; padding-bottom: 20px; padding-right: 4px; }

/* Cards Broad Agency */
.card {
    background-color: var(--bg-white); border: 1px solid var(--border-light);
    border-radius: 12px; padding: 20px; cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column; gap: 12px;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.06); border-color: #d1d5db; }
.card:active { cursor: grabbing; }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-labels { display: flex; gap: 8px; flex-wrap: wrap; }
.label { padding: 4px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; }
.card-options { color: var(--text-light); cursor: pointer; }

.add-column-btn {
    min-width: 300px;
    height: 48px;
    margin-top: 2px;
    background: rgba(82, 74, 222, 0.05);
    border: 2px dashed rgba(82, 74, 222, 0.3);
    border-radius: 12px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.add-column-btn:hover {
    background: rgba(82, 74, 222, 0.1);
    border-color: var(--primary);
}

.backlog-column {
    background-color: rgba(241, 245, 249, 0.6) !important;
    border: 2px dashed #cbd5e1;
}
.backlog-column .column-header {
    border-bottom: 2px dashed #cbd5e1;
    opacity: 0.8;
}

.card-title { font-weight: 600; font-size: 1.05rem; color: var(--text-dark); line-height: 1.3; }
.card-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

.card-middle { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.card-avatars { display: flex; align-items: center; }
.card-avatars img { width: 24px; height: 24px; border-radius: 50%; border: 1px solid white; margin-left: -6px; }
.card-avatars img:first-child { margin-left: 0; }
.card-stats { display: flex; gap: 12px; font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.card-stats span { display: flex; align-items: center; gap: 4px; }

.card-progress-area { margin-top: 8px; }
.progress-texts { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.progress-bar-bg { width: 100%; height: 6px; background-color: #f3f4f6; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background-color: var(--primary); border-radius: 4px; }


/* Drag and Drop */
.card.dragging { opacity: 0.8; transform: scale(1.02) rotate(2deg); box-shadow: 0 20px 40px rgba(0,0,0,0.1); border-color: var(--primary); }
.card-list.drag-over { background-color: rgba(82, 74, 222, 0.03); border-radius: 12px; outline: 2px dashed var(--primary); outline-offset: -2px; }

/* Modal Light */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(17, 24, 39, 0.5); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content { background-color: var(--bg-white); border-radius: 16px; width: 90%; max-width: 600px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); display: flex; flex-direction: column; transform: translateY(20px); transition: transform 0.2s; }
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header { padding: 24px 32px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 1.4rem; font-weight: 600; color: var(--text-dark); }
.btn-close { background: transparent; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
.modal-body { padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.modal-meta { display: flex; gap: 16px; font-size: 0.9rem; color: var(--text-muted); align-items: center; }
.stage-badge { padding: 4px 12px; border-radius: 20px; font-weight: 600; font-size: 0.8rem; }
.notes-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.note-item { background: #f9fafb; border: 1px solid var(--border-light); padding: 16px; border-radius: 12px; font-size: 0.95rem; color: var(--text-dark); }
.note-item .note-date { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; font-weight: 500;}
/* Modal Fullscreen & Quill */
.fullscreen-modal {
    width: 95vw !important;
    max-width: 1400px !important;
    height: 95vh;
}
.modal-columns {
    display: flex;
    gap: 32px;
    height: calc(100vh - 180px);
}
.modal-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding-right: 8px;
}
.modal-col h3 {
    margin-bottom: 16px;
    color: var(--text-dark);
}
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    background: #fff;
    min-height: 200px;
}
.editor-container .ql-container {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    overflow-y: auto;
}
.notes-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 16px;
    background: #f9fafb;
}
.card-actions { margin-left: auto; display: flex; gap: 8px; }
.card-delete { color: #ef4444; cursor: pointer; font-size: 0.9rem; transition: color 0.2s; padding: 4px; }
.card-delete:hover { color: #b91c1c; }
