:root {
    --bg: #f4f5f7;
    --card-bg: #ffffff;
    --border: #e2e4e9;
    --text: #1f2430;
    --text-muted: #6b7280;
    --accent: #3b82f6;
    --alta: #ef4444;
    --media: #f59e0b;
    --baixa: #22c55e;
    --col-header: #e9ebf0;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ─── LOGIN ─────────────────────────────────────────── */
#login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
#login-box {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    width: 320px;
}
#login-box h1 { font-size: 20px; margin: 0 0 4px; }
#login-box p { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; }
#login-box input {
    width: 100%; padding: 10px 12px; margin-bottom: 10px;
    border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
#login-box button {
    width: 100%; padding: 10px; border: none; border-radius: 8px;
    background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
    cursor: pointer;
}
#login-error { color: var(--alta); font-size: 13px; margin-top: 8px; min-height: 16px; }

/* ─── LAYOUT GERAL ─────────────────────────────────────── */
#app { display: none; min-height: 100vh; }
header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; background: var(--card-bg); border-bottom: 1px solid var(--border);
}
header h1 { font-size: 18px; margin: 0; }
.tabs { display: flex; gap: 4px; }
.tab-btn {
    padding: 8px 16px; border: none; background: transparent; border-radius: 8px;
    font-size: 14px; cursor: pointer; color: var(--text-muted);
}
.tab-btn.active { background: var(--accent); color: #fff; }
#logout-btn { border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; }

main { padding: 20px 24px; }
.view { display: none; }
.view.active { display: block; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); }
#new-task-btn {
    margin-left: auto; padding: 8px 16px; border: none; border-radius: 8px;
    background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}

/* ─── KANBAN ────────────────────────────────────────── */
#kanban {
    display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px;
}
.kanban-col {
    background: var(--col-header); border-radius: var(--radius);
    min-width: 260px; max-width: 260px; padding: 10px; flex-shrink: 0;
}
.kanban-col h2 {
    font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); margin: 4px 6px 10px;
}
.kanban-cards { min-height: 40px; }

.card {
    background: var(--card-bg); border-radius: 8px; padding: 10px 12px;
    margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: grab;
    border-left: 4px solid var(--media);
}
.card.prio-alta { border-left-color: var(--alta); }
.card.prio-media { border-left-color: var(--media); }
.card.prio-baixa { border-left-color: var(--baixa); }
.card .titulo { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.card .meta { font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; }
.card .projeto-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.card .subtask-progress { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.sortable-ghost { opacity: .4; }

/* ─── HOJE / PRÓXIMAS ──────────────────────────────────── */
.plano-header { display: flex; justify-content: space-between; align-items: baseline; }
.plano-header h2 { margin: 0 0 4px; }
.orcamento-info { color: var(--text-muted); font-size: 13px; }
.aviso-atrasada {
    background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
    padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 13px;
}
.lista-simples { list-style: none; padding: 0; margin: 10px 0 0; }
.lista-simples li {
    background: var(--card-bg); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
    display: flex; justify-content: space-between; align-items: center;
    border-left: 4px solid var(--media); box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.lista-simples li.prio-alta { border-left-color: var(--alta); }
.lista-simples li.prio-media { border-left-color: var(--media); }
.lista-simples li.prio-baixa { border-left-color: var(--baixa); }
.lista-simples .titulo { font-weight: 600; font-size: 13.5px; }
.lista-simples .meta { font-size: 12px; color: var(--text-muted); }
section.plano-secao { margin-bottom: 28px; }
.vazio { color: var(--text-muted); font-size: 13px; padding: 12px 0; }

/* ─── MODAL ─────────────────────────────────────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4);
    align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--card-bg); border-radius: var(--radius); padding: 24px;
    width: 420px; max-height: 85vh; overflow-y: auto;
}
.modal h2 { margin: 0 0 16px; font-size: 17px; }
.modal label { display: block; font-size: 12px; color: var(--text-muted); margin: 12px 0 4px; }
.modal input, .modal select, .modal textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.modal textarea { resize: vertical; min-height: 60px; }
.checklist { margin-top: 8px; }
.checklist-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; }
.checklist-item input[type="checkbox"] { width: auto; }
.checklist-item.done .titulo-item { text-decoration: line-through; color: var(--text-muted); }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; }
.modal-actions button {
    flex: 1; padding: 10px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--col-header); color: var(--text); }
.btn-danger { background: #fee2e2; color: #991b1b; }
