:root { --bg:#0f1115; --card:#181b22; --text:#e7e9ee; --muted:#9aa0ab; --accent:#6366f1; --ok:#22c55e; }
[data-theme="light"] { --bg:#f7f7f5; --card:#fff; --text:#1a1a1a; --muted:#666; --accent:#6366f1; --ok:#16a34a; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font-family:system-ui,sans-serif; }
#app { display:grid; grid-template-columns:200px 1fr; min-height:100vh; }
#sidebar { display:flex; flex-direction:column; gap:.5rem; padding:1rem; background:var(--card); }
#sidebar button { background:none; border:none; color:var(--muted); text-align:left; padding:.6rem .8rem; border-radius:8px; cursor:pointer; font-size:1rem; }
#sidebar button.active, #sidebar button:hover { background:var(--bg); color:var(--text); }
#content { padding:2rem; }
.card { background:var(--card); border-radius:14px; padding:1.2rem; }
.error { color:#ef4444; }
#login { display:grid; place-items:center; min-height:100vh; }
#login-form { display:flex; flex-direction:column; gap:.6rem; min-width:280px; }
#login-form input, #login-form button { padding:.6rem; border-radius:8px; border:1px solid var(--muted); background:var(--card); color:var(--text); }
#content > .card { margin:.6rem 0; }
#content button { background:var(--bg); color:var(--text); border:1px solid var(--muted); border-radius:8px; padding:.4rem .7rem; cursor:pointer; }
.habit-row { display:flex; align-items:center; gap:.6rem; }
.streak { color:#f59e0b; margin-left:auto; }
.empty { color:var(--muted); font-style:italic; }

/* view header */
.view-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:1rem; gap:.6rem; }

/* habits */
.habit-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:1rem; }
.habit-title { display:flex; align-items:center; gap:.5rem; }
.habit-title button { margin-left:auto; }
.heatmap { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; margin-top:.6rem; }
.heat-cell { aspect-ratio:1; border-radius:3px; background:var(--bg); }

/* modal */
.modal-bg { position:fixed; inset:0; background:#0008; display:grid; place-items:center; z-index:10; }
.modal { display:flex; flex-direction:column; gap:.6rem; min-width:280px; }
.modal input, .modal select { padding:.5rem; border-radius:8px; border:1px solid var(--muted); background:var(--bg); color:var(--text); }

/* goals */
.progress { position:relative; height:22px; background:var(--bg); border-radius:11px; margin:.6rem 0; overflow:hidden; }
.progress-fill { height:100%; background:var(--accent); }
.progress span { position:absolute; inset:0; display:grid; place-items:center; font-size:.8rem; }
.milestones { display:flex; flex-direction:column; gap:.3rem; }
.linked { margin-top:.6rem; color:var(--muted); font-size:.9rem; }
.muted { color:var(--muted); }

/* kanban */
.kanban { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; }
.kcol { background:var(--card); border-radius:14px; padding:1rem; min-height:200px; }
.todo { margin:.6rem 0; border-left:4px solid var(--muted); }
.prio-alta { border-left-color:#ef4444; } .prio-media { border-left-color:#f59e0b; } .prio-baja { border-left-color:#22c55e; }
.chip { background:var(--accent); color:#fff; border-radius:10px; padding:.1rem .5rem; font-size:.7rem; }

@media (max-width:640px){
  #app { grid-template-columns:1fr; }
  #sidebar { position:fixed; bottom:0; left:0; right:0; flex-direction:row; justify-content:space-around; padding:.4rem; }
  #content { padding:1rem 1rem 5rem; }
  .kanban { grid-template-columns:1fr; }
}
