*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sidebar-w: 220px;
    --topbar-h: 56px;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --sidebar-bg: #06080f;
    --sidebar-hover: rgba(99,179,237,.07);
    --sidebar-active: #1d4ed8;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --blue: #3b82f6;
    --green: #22c55e;
    --orange: #f59e0b;
    --red: #ef4444;
    --purple: #a855f7;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; color: var(--text); }
svg { fill: currentColor; width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* Layout */
.app { display: flex; height: 100vh; overflow: hidden; }
.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.app-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ── Sidebar futurística (desktop only) ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    border-right: 1px solid rgba(59,130,246,.12);

    /* Grade de pontos sutis */
    background-image:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(59,130,246,.13) 0%, transparent 70%),
        radial-gradient(circle at 1px 1px, rgba(99,179,237,.06) 1px, transparent 0);
    background-size: 100% 100%, 24px 24px;
}

/* Barra luminosa na borda direita */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(59,130,246,.5) 40%, rgba(139,92,246,.4) 70%, transparent);
    pointer-events: none;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 18px 18px;
    border-bottom: 1px solid rgba(59,130,246,.1);
    position: relative;
}

.logo-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px; flex-shrink: 0;
    box-shadow: 0 0 12px rgba(59,130,246,.5), 0 0 24px rgba(59,130,246,.2);
    letter-spacing: .5px;
}

.logo-text {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: .3px;
}

/* Nav */
.sidebar-nav {
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #64748b;
    position: relative;
    overflow: hidden;
    transition: color .2s;
}

/* Fundo deslizante no hover */
.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--sidebar-hover);
    border-radius: 8px;
    border: 1px solid transparent;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .2s, transform .2s;
}

.nav-item:hover { color: #cbd5e1; }
.nav-item:hover::before { opacity: 1; transform: translateX(0); }

/* Item ativo */
.nav-item.active {
    color: #fff;
}
.nav-item.active::before {
    opacity: 1;
    transform: translateX(0);
    background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(99,102,241,.15));
    border-color: rgba(99,130,246,.35);
}

/* Traço lateral esquerdo no ativo */
.nav-item.active::after {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(to bottom, #3b82f6, #818cf8);
    box-shadow: 0 0 8px rgba(99,130,246,.8);
}

.nav-icon {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.nav-item.active .nav-icon svg {
    filter: drop-shadow(0 0 4px rgba(99,179,237,.7));
}

.nav-label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .2px;
    position: relative;
    z-index: 1;
}

/* Topbar */
.topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-date { color: var(--text-muted); font-size: 13px; }
.topbar-search { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; }
.topbar-search svg { width: 16px; height: 16px; color: var(--text-muted); }
.topbar-search input { border: none; background: none; outline: none; width: 180px; font-size: 13px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; border: 1px solid transparent; transition: .15s; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: #2563eb; }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-ghost { background: none; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 7px; font-size: 11px; }
.btn-link { font-size: 12px; color: var(--blue); background: none; border: none; padding: 0; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.link-btn { background: none; border: none; font-size: 13px; padding: 0; color: var(--text-muted); }
.link-btn.danger { color: var(--red); }
.link-btn:hover { text-decoration: underline; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-body { padding: 16px 20px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--text-muted); }
.prio-baixa { background: #dcfce7; color: #166534; }
.prio-media { background: #dbeafe; color: #1e40af; }
.prio-alta { background: #ffedd5; color: #9a3412; }
.prio-critica { background: #fee2e2; color: #991b1b; }
.status-proj { background: #eff6ff; color: #3b82f6; }

/* Tables */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th { background: var(--bg); padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafafa; }
.table td.actions { display: flex; gap: 6px; align-items: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.link-strong { font-weight: 500; color: var(--blue); }
.link-strong:hover { text-decoration: underline; }

/* Forms */
.form-page { max-width: 760px; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.form-group input, .form-group select, .form-group textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; outline: none; transition: border-color .15s; background: var(--surface); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.form-group input[type=color] { padding: 3px; height: 36px; }
.toggle-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; font-weight: 400; text-transform: none; letter-spacing: 0; }
.toggle-label input[type=checkbox] { width: 14px; height: 14px; cursor: pointer; accent-color: var(--blue); }
.form-group input:disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Page actions */
.page-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.filter-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-form input[type=text], .filter-form select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--surface); }
.search-form { display: flex; gap: 8px; }
.search-form input { padding: 7px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; width: 220px; }

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: box-shadow .15s; }
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card.danger { border-color: #fecaca; background: #fff5f5; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 24px; height: 24px; color: #fff; }
.stat-icon.blue { background: var(--blue); }
.stat-icon.green { background: var(--green); }
.stat-icon.orange { background: var(--orange); }
.stat-icon.red { background: var(--red); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item { display: flex; align-items: center; gap: 10px; }
.task-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.task-info { flex: 1; }
.task-title { font-weight: 500; font-size: 13px; }
.task-meta { font-size: 11px; color: var(--text-muted); }
.agenda-list { display: flex; flex-direction: column; gap: 14px; }
.agenda-day { }
.agenda-date { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; }
.agenda-event { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.event-title { flex: 1; font-size: 13px; }
.event-type { font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
.type-execução { background: #fef3c7; color: #92400e; }
.type-teste { background: #ede9fe; color: #5b21b6; }
.type-entrega { background: #dcfce7; color: #166534; }
.empty-state { color: var(--text-muted); font-size: 13px; padding: 16px 0; }
.empty-page { text-align: center; padding: 60px 20px; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* Progress */
.progress-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.progress-bar.big { height: 8px; margin: 12px 0 6px; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width .3s; }
.progress-label { font-size: 11px; color: var(--text-muted); }

/* Projects grid */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.project-card.overdue { border-color: #fca5a5; }
.project-card-color { height: 4px; }
.project-card-body { padding: 16px; flex: 1; }
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.project-card-title { font-weight: 600; font-size: 14px; color: var(--text); }
.project-card-title:hover { color: var(--blue); }
.project-card-client { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.project-date { font-size: 11px; color: var(--text-muted); }
.project-card-actions { display: flex; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg); }
.project-card-actions a, .project-card-actions button { font-size: 12px; color: var(--text-muted); background: none; border: none; cursor: pointer; }
.project-card-actions a:hover, .project-card-actions button:hover { color: var(--blue); }

/* Detail pages */
.detail-page { }
.detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.detail-info { display: flex; align-items: center; gap: 14px; }
.detail-info h2 { font-size: 20px; font-weight: 700; }
.detail-avatar { width: 48px; height: 48px; border-radius: 12px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.detail-actions { display: flex; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.detail-card.wide { grid-column: 2; }
.detail-card h4 { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
dt { font-size: 12px; color: var(--text-muted); font-weight: 500; }
dd { font-size: 13px; }
.color-swatch { width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0; }
.project-meta-strip { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.meta-item { font-size: 13px; color: var(--text-muted); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 12px; }
.section-header h3 { font-size: 15px; font-weight: 600; }
.project-list { display: flex; flex-direction: column; gap: 8px; }
.project-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.project-item:last-child { border-bottom: none; }
.project-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.project-main { flex: 1; }
.project-meta { font-size: 11px; color: var(--text-muted); }

/* Task groups */
.task-group { margin-bottom: 12px; }
.task-group-header { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.task-group-name { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.task-group-count { background: var(--bg); color: var(--text-muted); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; }
.task-row-info { flex: 1; }
.task-row-title { font-size: 13px; font-weight: 500; }
.task-responsible { font-size: 11px; color: var(--text-muted); }
.task-row-dates { display: flex; gap: 6px; }
.date-tag { font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.date-tag.exec { background: #fef3c7; color: #92400e; }
.date-tag.test { background: #ede9fe; color: #5b21b6; }
.date-tag.delivery { background: #dcfce7; color: #166534; }
.task-row-actions { display: flex; gap: 6px; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--red); }

/* Kanban */
.kanban-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; min-height: calc(100vh - 180px); }
.kanban-col { flex: 0 0 220px; display: flex; flex-direction: column; background: var(--bg); border-radius: var(--radius); overflow: hidden; }
.kanban-col-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.col-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.col-name { flex: 1; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.col-count { background: var(--border); color: var(--text-muted); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.kanban-cards { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.kanban-cards.drag-over { background: rgba(59,130,246,.06); border-radius: 6px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; cursor: grab; transition: box-shadow .15s; display: flex; overflow: hidden; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; box-shadow: var(--shadow-md); }
.kcard-color { width: 4px; flex-shrink: 0; }
.kcard-body { padding: 10px; flex: 1; }
.kcard-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.kcard-project { font-size: 11px; color: var(--text-muted); }
.kcard-responsible { font-size: 11px; color: var(--text-muted); }
.kcard-dates { margin-top: 6px; }
.kcard-date { font-size: 10px; color: var(--text-muted); }
.kcard-actions { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; opacity: 0; transition: opacity .15s; }
.kanban-card:hover .kcard-actions { opacity: 1; }
.kcard-actions a { font-size: 13px; color: var(--text-muted); }

/* Agenda */
.agenda-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.agenda-month-label { font-size: 15px; font-weight: 600; padding: 0 8px; min-width: 140px; text-align: center; }
.vis-toggle { display: flex; gap: 4px; }
.calendar-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-header { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.cal-dow { padding: 10px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 100px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.other-month .cal-day { opacity: .3; }
.cal-cell.today { background: #eff6ff; }
.cal-day { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.cal-day.today-mark { width: 22px; height: 22px; background: var(--blue); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cal-event { font-size: 10px; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cal-event.ev-execucao { background: #dcfce7; color: #166534; }
.cal-event.ev-teste    { background: #ede9fe; color: #5b21b6; }
.cal-event.ev-entrega  { background: #fef9c3; color: #854d0e; }
.cal-event.ev-vencida  { background: #fee2e2; color: #991b1b; }
.ev-hora { font-weight: 700; opacity: .85; margin-right: 1px; }
.ev-empresa { font-weight: 700; opacity: .75; margin-right: 2px; }
.agenda-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0 4px; margin-bottom: 4px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend-dot { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 10px; font-weight: 700; }
.status-dropdown { position: relative; display: inline-block; }
.status-dropdown-btn { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.status-dropdown-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 200; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 0; min-width: 150px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.status-dropdown-menu.hidden { display: none; }
.status-check-item { display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.status-check-item:hover { background: var(--hover); }
.status-check-item input { cursor: pointer; width: 14px; height: 14px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-content { background: var(--surface); border-radius: var(--radius); width: 400px; max-width: 95vw; box-shadow: var(--shadow-md); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; padding: 0 4px; }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.modal-body p { font-size: 13px; }

/* Cronograma / Gantt */
.cronograma-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.cronograma-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cronograma-filters select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--surface); }
#filterProjeto { min-width: 220px; max-height: 120px; }
#filterProjeto:not([disabled]) { size: auto; }
.zoom-controls, .nav-controls { display: flex; align-items: center; gap: 6px; }
#ganttPeriod { font-size: 14px; font-weight: 600; min-width: 160px; text-align: center; }
.gantt-wrapper { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.gantt-chart { min-width: 800px; }
.gantt-loading { padding: 40px; text-align: center; color: var(--text-muted); }
.gantt-header { display: flex; border-bottom: 2px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 10; }
.gantt-label-col { width: 240px; flex-shrink: 0; padding: 8px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-right: 1px solid var(--border); }
.gantt-timeline { flex: 1; display: flex; }
.gantt-tick { flex: 1; padding: 8px 4px; font-size: 10px; font-weight: 600; color: var(--text-muted); text-align: center; border-right: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.gantt-tick.today-tick { background: #eff6ff; color: var(--blue); }
.gantt-row { display: flex; border-bottom: 1px solid var(--border); min-height: 36px; }
.gantt-row:hover { background: #fafafa; }
.gantt-row.proj-row { background: #f8fafc; }
.gantt-row-label { width: 240px; flex-shrink: 0; padding: 8px 12px; font-size: 13px; border-right: 1px solid var(--border); display: flex; align-items: center; gap: 8px; overflow: hidden; }
.gantt-row-label .proj-name { font-weight: 600; }
.gantt-row-label .task-name { color: var(--text-muted); font-size: 12px; padding-left: 16px; }
.gantt-bars { flex: 1; position: relative; }
.gantt-bar { position: absolute; height: 20px; top: 8px; border-radius: 4px; min-width: 4px; opacity: .85; }
.gantt-bar:hover { opacity: 1; }
.gantt-bar.bar-exec { background: var(--orange); }
.gantt-bar.bar-test { background: var(--purple); }
.gantt-bar.bar-delivery { background: var(--green); }
.gantt-bar.bar-proj { background: var(--blue); height: 8px; top: 14px; }
.today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); opacity: .5; z-index: 5; }
.btn-sm.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Responsive */
@media (max-width: 768px) {
    :root { --sidebar-w: 60px; }
    .logo-text, .nav-label { display: none; }
    .logo-icon { margin: 0 auto; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}

.modal-body { padding: 1.25rem 1.5rem; flex: 1; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Checklist de projetos no modal */
.projetos-checklist {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.checklist-group { padding: .5rem 0; border-bottom: 1px solid #f1f5f9; }
.checklist-group:last-child { border-bottom: none; }

.checklist-grupo-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    padding: .4rem 1rem .2rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem 1rem;
    cursor: pointer;
    font-size: .875rem;
    color: #334155;
    transition: background .1s;
}

.checklist-item:hover { background: #f8fafc; }
.checklist-item input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

/* ── Modal tabs ── */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    gap: .25rem;
}
.modal-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: .65rem .75rem;
    font-size: .875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.modal-tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; }
.modal-tab:hover:not(.active) { color: #334155; }

/* ── Link cards no modal ── */
.link-card {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}
.link-card:last-child { border-bottom: none; }
.link-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .6rem;
}
.link-card-titulo { font-weight: 600; font-size: .9rem; color: #1e293b; }
.link-card-meta   { font-size: .78rem; color: #94a3b8; margin-top: .15rem; }
.link-card-emails { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

/* ── Email chips ── */
.email-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: .15rem .6rem;
    font-size: .78rem;
    font-weight: 500;
}
.email-chip-del {
    background: none;
    border: none;
    color: #93c5fd;
    cursor: pointer;
    font-size: .9rem;
    line-height: 1;
    padding: 0;
    transition: color .1s;
}
.email-chip-del:hover { color: #dc2626; }

/* ── Email gate (página pública) ── */
.email-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}
.email-gate-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    text-align: center;
}

/* ── Topbar user ── */
.topbar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
    color: #64748b;
}

/* ── Sidebar footer (usuário) ── */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 18px;
    border-top: 1px solid rgba(59,130,246,.1);
    margin-top: auto;
}

.sidebar-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(99,130,246,.45);
}

.sidebar-user-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { font-size: 11px; color: #475569; transition: color .15s; }
.sidebar-logout:hover { color: #ef4444; }
