
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;font-family:'DM Sans','Segoe UI',system-ui,sans-serif;background:#f4f5f7;color:#111}
#app{display:flex;height:100vh;overflow:hidden}
/* SIDEBAR */
#sidebar{width:220px;background:#0f0f10;display:flex;flex-direction:column;flex-shrink:0}
.sb-brand{padding:20px 18px 14px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #1c1c1e}
.sb-logo{width:32px;height:32px;border-radius:8px;background:linear-gradient(135deg,#6366f1,#8b5cf6);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:14px;color:#fff;flex-shrink:0}
.sb-title{font-size:13px;font-weight:700;color:#fff;letter-spacing:-.02em}
.sb-sub{font-size:10px;color:#6b7280;margin-top:1px}
.sb-nav{flex:1;padding:10px 10px;overflow-y:auto}
.sb-btn{width:100%;display:flex;align-items:center;gap:9px;padding:8px 10px;border:none;border-radius:7px;cursor:pointer;margin-bottom:2px;text-align:left;background:transparent;color:#9ca3af;font-size:13px;font-weight:400;transition:all .13s;font-family:inherit}
.sb-btn:hover{background:#1c1c1e;color:#e5e7eb}
.sb-btn.active{background:#1c1c1e;color:#fff;font-weight:600}
.sb-footer{padding:14px 18px;border-top:1px solid #1c1c1e}
.sb-footer-label{font-size:10px;color:#6b7280;font-weight:700;text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px}
.sb-prog-bar{height:4px;background:#1c1c1e;border-radius:4px;overflow:hidden;margin-bottom:4px}
.sb-prog-fill{height:100%;background:linear-gradient(90deg,#6366f1,#8b5cf6);border-radius:4px;transition:width .5s}
.sb-prog-pct{font-size:18px;font-weight:800;color:#fff;letter-spacing:-.03em}
/* MAIN */
#main{flex:1;overflow-y:auto}
#content{padding:28px 32px;max-width:1200px;margin:0 auto}
/* COMMON */
.card{background:#fff;border-radius:12px;border:1px solid #e5e7eb}
.page-title{font-size:22px;font-weight:800;color:#111;letter-spacing:-.02em;margin-bottom:4px}
.page-sub{font-size:13px;color:#6b7280;margin-bottom:20px}
.btn-primary{display:inline-flex;align-items:center;gap:6px;padding:9px 18px;background:#111;color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:13px;font-weight:700;font-family:inherit;transition:background .13s}
.btn-primary:hover{background:#333}
.btn-outline{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;background:#fff;color:#374151;border:1px solid #e5e7eb;border-radius:8px;cursor:pointer;font-size:12px;font-weight:500;font-family:inherit;transition:background .13s}
.btn-outline:hover{background:#f9fafb}
.btn-ghost{background:none;border:none;cursor:pointer;color:#9ca3af;padding:4px;display:flex;align-items:center;transition:color .12s}
.btn-ghost:hover{color:#374151}
.badge{padding:3px 9px;border-radius:20px;font-size:10px;font-weight:700;white-space:nowrap;border:1px solid}
.badge-ni{background:#f9fafb;color:#6b7280;border-color:#e5e7eb}
.badge-run{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}
.badge-done{background:#f0fdf4;color:#15803d;border-color:#bbf7d0}
.badge-late{background:#fef2f2;color:#b91c1c;border-color:#fecaca}
.field-label{font-size:11px;font-weight:700;color:#6b7280;display:block;margin-bottom:5px;text-transform:uppercase;letter-spacing:.04em}
input[type=text],input[type=date],input[type=number],input[type=password],select,textarea{padding:8px 12px;border:1px solid #e5e7eb;border-radius:8px;font-size:13px;font-family:inherit;color:#111;background:#fff;outline:none;width:100%;transition:border-color .12s}
input:focus,select:focus,textarea:focus{border-color:#6366f1}
textarea{resize:vertical}
.inp-sm{padding:7px 10px;font-size:12px}
.header-row{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:20px}
/* MODAL */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1000;display:none;align-items:center;justify-content:center;padding:24px}
.modal-overlay.open{display:flex}
.modal{background:#fff;border-radius:16px;width:100%;max-width:600px;max-height:90vh;overflow-y:auto;box-shadow:0 24px 64px rgba(0,0,0,.2)}
.modal-head{padding:24px 28px 0;display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}
.modal-head h2{font-size:18px;font-weight:700;color:#111}
.modal-body{padding:0 28px 28px}
.modal-field{margin-bottom:16px}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;padding-top:14px;border-top:1px solid #f3f4f6}
/* GANTT */
.gantt-wrap{border-radius:12px;border:1px solid #e5e7eb;background:#fff;overflow-x:auto}
.gantt-inner{min-width:1000px}
.gantt-head{display:flex;border-bottom:1px solid #e5e7eb;background:#f9fafb;flex-direction:column;height:auto;padding:0}
.gantt-label-col{width:220px;flex-shrink:0;padding:0 16px;font-size:10px;font-weight:700;color:#6b7280;text-transform:uppercase;letter-spacing:.04em;border-right:1px solid #e5e7eb;display:flex;align-items:center}
.gantt-timeline{flex:1;position:relative}
.gantt-row{display:flex;align-items:center;border-bottom:1px solid #f3f4f6}
.gantt-row-label{width:220px;flex-shrink:0;padding:0 16px;display:flex;align-items:center;gap:6px;height:36px;border-right:1px solid #f3f4f6}
.gantt-row-chart{flex:1;position:relative;height:36px}
.gantt-macro-row{background:#fafafa;cursor:pointer}
.gantt-macro-row:hover{background:#f5f5f5}
.gantt-bar{position:absolute;top:50%;transform:translateY(-50%);border-radius:6px;min-width:4px}
.gantt-today{position:absolute;top:0;bottom:0;width:1.5px;background:#ef4444;opacity:.6;pointer-events:none}
.gantt-legend{padding:8px 16px;display:flex;gap:16px;flex-wrap:wrap;border-top:1px solid #f3f4f6;background:#f9fafb}
.gantt-legend-item{display:flex;align-items:center;gap:5px;font-size:11px;color:#6b7280}
.gantt-legend-dot{width:10px;height:10px;border-radius:3px}
/* MACRO BLOCKS */
.macro-block{background:#fff;border-radius:12px;border:1px solid #e5e7eb;margin-bottom:12px;overflow:hidden}
.macro-header{display:flex;align-items:center;gap:12px;padding:14px 18px;cursor:pointer;user-select:none}
.macro-header:hover{background:#fafafa}
.macro-dot{width:12px;height:12px;border-radius:4px;flex-shrink:0}
.macro-body{border-top:1px solid #f3f4f6;display:none}
.macro-body.open{display:block}
.sub-header{padding:9px 18px 9px 34px;display:flex;align-items:center;gap:8px;background:#fafafa;border-bottom:1px solid #f9fafb}
.sub-name{font-size:12px;font-weight:700;color:#374151;flex:1}
.sub-count{font-size:11px;color:#9ca3af}
.add-task-row{padding:10px 18px 10px 34px;display:flex;gap:10px}
.btn-dashed{display:inline-flex;align-items:center;gap:5px;background:none;border:1px dashed #d1d5db;border-radius:8px;padding:6px 12px;cursor:pointer;color:#9ca3af;font-size:12px;font-family:inherit}
.btn-dashed:hover{border-color:#6366f1;color:#6366f1}
.effort-bars{display:flex;gap:2px}
.effort-bar{width:6px;height:14px;border-radius:2px}
.avatar{width:24px;height:24px;border-radius:50%;background:#eef2ff;display:inline-flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;color:#6366f1;flex-shrink:0}
.avatar-lg{width:28px;height:28px;font-size:11px}
.progress-track{height:5px;background:#f3f4f6;border-radius:4px;overflow:hidden}
.progress-fill{height:100%;border-radius:4px;transition:width .5s}
.table-wrap{border-radius:12px;border:1px solid #e5e7eb;overflow:hidden}
table{width:100%;border-collapse:collapse;font-size:12px}
th{padding:10px 14px;text-align:left;font-weight:700;color:#6b7280;font-size:11px;text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid #e5e7eb;background:#f9fafb;white-space:nowrap}
td{padding:10px 14px;border-bottom:1px solid #f3f4f6}
tr:last-child td{border-bottom:none}
/* CHECKLIST */
.checklist-item{display:flex;align-items:center;gap:8px;margin-bottom:7px}
.check-toggle{width:20px;height:20px;border-radius:5px;border:1.5px solid #d1d5db;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .12s}
.check-toggle.done{background:#10b981;border-color:#10b981}
/* LINEAR */
.priority-urgent{color:#ef4444;font-weight:700;font-size:11px}
.priority-high{color:#f97316;font-weight:700;font-size:11px}
.priority-medium{color:#eab308;font-weight:700;font-size:11px}
.priority-low{color:#6b7280;font-weight:700;font-size:11px}
.priority-none{color:#d1d5db;font-weight:700;font-size:11px}
.label-pill{padding:2px 6px;border-radius:10px;background:#eff6ff;color:#1d4ed8;font-size:10px;font-weight:600;margin-right:4px}
.search-wrap{position:relative;flex:1 1 200px}
.search-wrap svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);pointer-events:none}
.search-wrap input{padding-left:30px}
.settings-hint{font-size:11px;color:#9ca3af;margin-top:5px}
/* PROJECTS */
.proj-card{background:#fff;border-radius:12px;border:1px solid #e5e7eb;padding:20px;cursor:pointer;transition:all .15s;position:relative}
.proj-card:hover{border-color:#6366f1;box-shadow:0 4px 16px rgba(99,102,241,.12)}
.proj-card-name{font-size:15px;font-weight:700;color:#111;margin-bottom:6px}
.proj-card-meta{font-size:12px;color:#9ca3af;margin-bottom:14px}
.proj-card-bar{height:5px;background:#f3f4f6;border-radius:4px;overflow:hidden;margin-bottom:6px}
.proj-card-fill{height:100%;border-radius:4px;background:#6366f1;transition:width .5s}
.proj-card-pct{font-size:11px;font-weight:700;color:#6366f1}
/* TABS */
.tab-bar{display:flex;gap:2px;border-bottom:2px solid #e5e7eb;margin-bottom:24px}
.tab-btn{padding:10px 18px;border:none;background:none;cursor:pointer;font-size:13px;font-weight:500;color:#6b7280;font-family:inherit;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all .13s}
.tab-btn.active{color:#6366f1;font-weight:700;border-bottom-color:#6366f1}
.tab-btn:hover:not(.active){color:#374151}
/* SCROLL */
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:10px}
/* DASHBOARD TABLE */
.dash-table th{background:#f9fafb;white-space:nowrap}
.dash-table td{vertical-align:middle}
.week-cell{font-size:11px;font-weight:600;color:#374151;text-align:center}
.week-badge{display:inline-block;background:#eef2ff;color:#6366f1;border-radius:12px;padding:2px 7px;font-size:11px;font-weight:700;min-width:24px;text-align:center}

/* ── ALLOC MODULE ─────────────────────────────────────────────── */
.tag { font-size:11px; padding:3px 9px; border-radius:20px; font-weight:600; display:inline-block; }
.tag-farmer{background:#f5f3ff;color:#7c3aed}
.tag-auditoria{background:#ecfdf5;color:#065f46}
.tag-ds{background:#eff6ff;color:#1e40af}
.tag-dev{background:#fff7ed;color:#c2410c}
.tag-fde{background:#fdf2f8;color:#9d174d}
.tag-faturamento{background:#fffbeb;color:#92400e}
.tag-suporte{background:#e0f2fe;color:#075985}
.tag-neg{background:#fffbeb;color:#b45309}
.tag-imp{background:#eff6ff;color:#1e40af}
.tag-ado{background:#ecfdf5;color:#065f46}
.tag-gv{background:#f5f3ff;color:#7c3aed}
.tag-exp{background:#fdf2f8;color:#9d174d}
.vac-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:20px;position:relative;overflow:hidden;transition:border-color .15s}
.vac-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;border-radius:12px 12px 0 0}
.vac-card.open::before{background:#f59e0b}
.vac-card.closed::before{background:#10b981}
.vac-card:hover{border-color:#d1d5db}
.badge-vac-open{background:#fffbeb;color:#b45309;border:1px solid #fef08a;padding:3px 9px;border-radius:20px;font-size:10px;font-weight:700}
.badge-vac-closed{background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0;padding:3px 9px;border-radius:20px;font-size:10px;font-weight:700}
.person-tag{display:inline-flex;align-items:center;gap:6px;background:#f3f4f6;border-radius:20px;padding:3px 10px 3px 4px}
.alloc-dot{width:10px;height:10px;border-radius:50%;display:inline-block;flex-shrink:0}
.matrix-table{border-collapse:collapse;font-size:12px;min-width:100%}
.matrix-table th,.matrix-table td{border:1px solid #e5e7eb;padding:0}
.matrix-table thead th{background:#f9fafb;padding:7px 8px;font-size:10px;text-transform:uppercase;letter-spacing:.5px;color:#6b7280;font-weight:700;white-space:nowrap;position:sticky;top:0;z-index:2}
.matrix-table .row-header{background:#f9fafb;padding:8px 12px;white-space:nowrap;position:sticky;left:0;z-index:1;min-width:150px;font-size:12px;color:#374151}
.matrix-table .cell{width:52px;height:38px;text-align:center;vertical-align:middle}
.matrix-table .cell.alloc{background:rgba(99,102,241,.06)}
.matrix-group-header td{background:#f4f5f7;padding:5px 12px;font-size:10px;font-weight:700;color:#9ca3af;text-transform:uppercase;letter-spacing:.8px;position:sticky;left:0}
.stat-card-sm{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:18px 20px}
.stat-value-lg{font-size:28px;font-weight:800;letter-spacing:-.03em}
.btn-edit-sm{background:transparent;color:#6366f1;border:1px solid rgba(99,102,241,.3);padding:5px 10px;font-size:12px;border-radius:6px;cursor:pointer;font-family:inherit;transition:background .12s}
.btn-edit-sm:hover{background:#eef2ff}
.btn-del-sm{background:transparent;color:#ef4444;border:1px solid rgba(239,68,68,.3);padding:5px 10px;font-size:12px;border-radius:6px;cursor:pointer;font-family:inherit;transition:background .12s}
.btn-del-sm:hover{background:#fef2f2}
.filter-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px;align-items:center}
.filter-row select,.filter-row input{padding:7px 10px;font-size:12px;width:auto;flex:0 0 auto}
.filter-row .search-input{flex:1 1 180px;max-width:240px}


/* AUTH */
.auth-screen{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0f0f10,#1f2937);padding:24px}
.auth-screen.hidden{display:none}
.auth-card{width:100%;max-width:380px;background:#fff;border-radius:18px;padding:30px;box-shadow:0 24px 80px rgba(0,0,0,.28);text-align:center}
.auth-logo{width:48px;height:48px;margin:0 auto 16px;border-radius:12px;background:linear-gradient(135deg,#6366f1,#8b5cf6);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:18px}
.auth-card h1{font-size:22px;font-weight:800;color:#111;margin-bottom:8px;letter-spacing:-.02em}
.auth-card p{font-size:13px;color:#6b7280;line-height:1.45;margin-bottom:18px}
.auth-btn{width:100%;border:none;border-radius:10px;background:#111;color:#fff;font-weight:700;font-size:14px;padding:11px 16px;cursor:pointer;font-family:inherit;display:flex;align-items:center;justify-content:center;gap:10px;transition:background .15s}
.auth-btn:hover{background:#333}
.google-icon{width:22px;height:22px;border-radius:50%;background:#fff;color:#111;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:13px}
.auth-error{min-height:18px;color:#ef4444!important;font-size:12px!important;margin:12px 0 0!important}
.auth-userbar{padding:10px 14px;border-bottom:1px solid #1c1c1e;display:flex;align-items:center;gap:8px;color:#9ca3af;font-size:11px}
.auth-userbar span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.auth-userbar button{background:#1c1c1e;color:#e5e7eb;border:1px solid #2b2b2d;border-radius:6px;padding:4px 8px;font-size:11px;cursor:pointer;font-family:inherit}
@keyframes spin{to{transform:rotate(360deg)}}
@media (max-width:760px){#app{flex-direction:column;overflow:auto}#sidebar{width:100%;height:auto}.sb-nav{display:flex;overflow-x:auto;gap:4px}.sb-btn{white-space:nowrap;margin-bottom:0}#main{overflow:visible}#content{padding:20px 16px}.header-row{flex-direction:column;gap:12px}.modal-overlay{padding:12px}.gantt-inner{min-width:860px}}
