:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1c2230; --muted: #6b7384; --line: #e3e6ec;
  --brand: #2557d6; --green: #1f9d57; --amber: #d98b0b; --red: #d64545;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; }
.err { color: var(--red); min-height: 1.2em; margin: 4px 0 0; }
.muted { color: var(--muted); }

.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { background: var(--card); padding: 28px; border-radius: 12px; border: 1px solid var(--line); width: 320px; display: grid; gap: 12px; }

.topbar { display: flex; gap: 12px; align-items: center; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-size: 16px; }
.search { flex: 1; min-width: 160px; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); width: 100%; }
textarea { min-height: 70px; resize: vertical; }
.btn { font: inherit; padding: 7px 12px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.btn:hover { background: #f0f2f6; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: #1c47b3; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.tab { font: inherit; border: 0; background: none; padding: 6px 10px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.tab.active { background: #e8eefc; color: var(--brand); font-weight: 600; }

.nudge-bar { margin: 12px 16px 0; padding: 10px 14px; background: #fff7e6; border: 1px solid #f1d9a3; border-radius: 10px; }
.nudge-bar strong { display: block; margin-bottom: 4px; }
.nudge-item { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; cursor: pointer; }
.nudge-item:hover { text-decoration: underline; }

main { padding: 16px; }
.board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.col { background: #eceef3; border-radius: 10px; padding: 8px; min-height: 120px; }
.col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 6px 8px; display: flex; justify-content: space-between; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; cursor: pointer; }
.card:hover { border-color: var(--brand); }
.card .t { font-weight: 600; }
.card .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.green { background: var(--green); } .dot.amber { background: var(--amber); } .dot.red { background: var(--red); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.bar-row .lbl { width: 110px; }
.bar { height: 10px; background: var(--brand); border-radius: 5px; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--card); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.08); overflow-y: auto; z-index: 20; padding: 16px; }
.drawer-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 10px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #e8eefc; color: var(--brand); font-size: 12px; font-weight: 600; text-transform: capitalize; }
.nudge { border: 1px solid var(--line); border-left-width: 5px; border-radius: 9px; padding: 10px 12px; margin: 10px 0; background: #fafbfc; }
.nudge.green { border-left-color: var(--green); } .nudge.amber { border-left-color: var(--amber); } .nudge.red { border-left-color: var(--red); }
.nudge .row { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0; }
.tabs .tab { border-radius: 7px 7px 0 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 .full { grid-column: 1 / -1; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.tl-item { border-left: 2px solid var(--line); padding: 2px 0 10px 12px; margin-left: 4px; }
.tl-item .meta { font-size: 12px; color: var(--muted); }
.tl-item .type { font-weight: 600; text-transform: capitalize; }

.task { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.task.done .ttl { text-decoration: line-through; color: var(--muted); }
.progress { height: 8px; background: #e6e9f0; border-radius: 4px; overflow: hidden; margin: 6px 0 12px; }
.progress div { height: 100%; background: var(--green); }

.modal { position: fixed; inset: 0; background: rgba(15,20,35,.45); display: grid; place-items: center; z-index: 30; padding: 12px; }
.modal-card { background: var(--card); border-radius: 12px; padding: 18px; width: min(640px, 100%); max-height: 92vh; overflow-y: auto; }
.modal-card h2 { margin-bottom: 12px; }

.tl-body { white-space: pre-wrap; word-break: break-word; }
.tl-item.in { border-left-color: var(--brand); }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
