:root {
  --bg: #0A0A0A;
  --panel: #131313;
  --line: #232323;
  --text: #E0E0E0;
  --muted: #8a8a8a;
  --accent: #B8A9C9;
  --danger: #c96a6a;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 8px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }

/* nav */
.topnav {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 500; letter-spacing: .3px; }
.brand b { color: var(--accent); }
.topnav a { color: var(--text); opacity: .75; }
.topnav a.on, .topnav a:hover { opacity: 1; color: var(--accent); }
.who { color: var(--muted); font-size: 13px; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 22px 80px; }

.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

/* buttons + forms */
.btn {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: #0A0A0A; border: none; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); color: #0A0A0A; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 2px 7px; font-size: 11px; border-radius: 6px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input, .quick-add input {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; width: 260px;
}
input:focus { outline: none; border-color: var(--accent); }

/* login */
.login-wrap { display: flex; justify-content: center; padding-top: 12vh; }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 34px 38px; width: 360px;
}
.login-card h1 { font-size: 26px; margin-bottom: 4px; }
.login-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.login-card input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 12px; margin-top: 5px;
}
.login-card .btn { width: 100%; margin-top: 18px; }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; }

/* dashboard */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.proj-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 18px 14px; display: block; color: var(--text);
}
.proj-card:hover { border-color: var(--accent); }
.bar { height: 5px; background: #1e1e1e; border-radius: 3px; overflow: hidden; margin: 10px 0 8px; }
.bar-fill { height: 100%; border-radius: 3px; }

/* board */
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, 1fr); } }
.col {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; min-height: 200px;
}
.col.over { border-color: var(--accent); }
.col h3 { display: flex; justify-content: space-between; align-items: center; }
.count {
  background: #1e1e1e; border-radius: 20px; padding: 1px 8px; font-size: 11px;
}
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.quick-add { margin-top: 10px; }
.quick-add input { width: 100%; font-size: 12px; }

.task {
  background: #171717; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; cursor: grab; transition: border-color .1s;
}
.task:hover { border-color: var(--accent); }
.task.dragging { opacity: .4; }
.task-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.task-title { font-size: 13.5px; font-weight: 500; }
.task-desc { color: var(--muted); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-bot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.due { font-size: 11px; color: var(--muted); }
.due.late { color: var(--danger); }
.who-chip {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #0A0A0A;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.prio { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; padding: 1px 7px; border-radius: 20px; background: #1e1e1e; color: var(--muted); }
.p-low { background: #1e241e; color: #7fc97f; }
.p-medium { background: #24241e; color: #c9b37f; }
.p-high { background: #241e1e; color: #c97f7f; }
.p-urgent { background: #2a1616; color: #ff8f8f; border-color: #4a2020; }

/* calendar */
.calendar {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--panel);
}
.cal-dow { display: contents; }
.cal-dow div {
  padding: 10px; text-align: center; font-size: 11px; text-transform: uppercase;
  color: var(--muted); background: #101010; border-bottom: 1px solid var(--line);
}
.cal-cell {
  min-height: 110px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.today { background: #15131a; }
.day-num { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cal-empty { background: #0d0d0d; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-item {
  display: block; font-size: 11.5px; background: #171717;
  border-radius: 5px; padding: 3px 6px; margin-bottom: 4px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-item:hover { border-left-width: 4px; }
.cal-item.done { opacity: .4; text-decoration: line-through; }
.cal-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cal-label { font-size: 15px; font-weight: 600; min-width: 150px; text-align: center; }

/* AI panel (dashboard) */
.ai-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 22px;
}
.ai-panel p { margin: 4px 0 12px; }
.ai-form { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-form input[name="brief"] { flex: 1 1 320px; }
.ai-form input, .ai-form button { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.ai-form input:focus { outline: none; border-color: var(--accent); }
.ai-name { flex: 0 1 220px; }
.ai-status { margin-top: 10px; font-size: 13px; }
.ai-status.working { color: var(--accent); }
.ai-status.err { color: var(--danger); }
.ai-badge {
  font-size: 9px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
  background: #1c2a24; color: #7fc9a4; border: 1px solid #2a4a3a;
  padding: 1px 6px; border-radius: 20px; margin-right: 5px;
}

/* activity feed */
.feed-wrap { margin-top: 28px; }
.feed { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.feed-item {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
.feed-item.ai { border-left-color: #7fc9a4; }
.feed-item .feed-detail { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* comments modal */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  width: 480px; max-width: 92vw; max-height: 80vh; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px; overflow-y: auto;
}
.comments { display: flex; flex-direction: column; gap: 8px; }
.comment { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.comment.ai { border-left: 3px solid #7fc9a4; }
