:root {
    --bg: #0f1115;
    --panel: #181b22;
    --panel-2: #1f2430;
    --border: #2a2f3a;
    --text: #e6e9ef;
    --muted: #98a1b3;
    --accent: #1a73e8;
    --accent-hover: #1558b8;
    --ok: #3fb950;
    --warn: #d29922;
    --bad: #f85149;
    --radius: 10px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1 0 auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 16px; background: var(--panel);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.topbar .brand:hover { text-decoration: none; }
.brand-logo { height: 26px; width: auto; display: inline-block; }
.brand-text { font-weight: 800; letter-spacing: -.01em; }
.brand-product { padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; text-transform: lowercase; }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar .user { color: var(--muted); font-size: .9rem; }
.topbar .role { color: var(--accent); }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

main { padding: 16px; max-width: 1280px; margin: 0 auto; }

/* Forms */
.card-form { max-width: 420px; margin: 8vh auto; background: var(--panel); padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.card-form.wide { max-width: 640px; }
.card-form h1 { margin-top: 0; }
label { display: block; margin: 12px 0; font-size: .9rem; color: var(--muted); }
input, select, textarea {
    width: 100%; margin-top: 6px; padding: 10px; background: var(--panel-2);
    border: 1px solid var(--border); border-radius: 8px; color: var(--text); font: inherit;
}
textarea { resize: vertical; }
button { padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.error { color: var(--bad); background: rgba(248,81,73,.1); padding: 8px 10px; border-radius: 8px; }
.muted { color: var(--muted); }

/* Board */
.board-title { margin: 4px 0 16px; }
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.column { flex: 0 0 260px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; }
.column-head { display: flex; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 600; }
.column-head .count { color: var(--muted); }
.cards { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.empty { color: var(--muted); text-align: center; margin: 6px 0; }

.ticket { background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 8px; padding: 10px; }
.ticket.prio-high { border-left-color: var(--bad); }
.ticket.prio-normal { border-left-color: var(--accent); }
.ticket.prio-low { border-left-color: var(--muted); }
.ticket-title { display: block; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.ticket-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ticket-foot { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.move-form { margin-top: 8px; }
.move-form select { padding: 6px; font-size: .82rem; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; background: var(--panel); border: 1px solid var(--border); color: var(--muted); }
.badge.type-feature { color: #7ee787; }
.badge.type-bug { color: #ff7b72; }
.badge.type-improvement { color: #d2a8ff; }
.badge.status { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Detail */
.detail { max-width: 820px; margin: 0 auto; }
.back { display: inline-block; margin-bottom: 12px; }
.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head h1 { margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.panel.highlight { border-color: var(--warn); }
.panel h2 { margin-top: 0; font-size: 1rem; }
.prose { white-space: normal; }
.brief { white-space: pre-wrap; background: var(--panel-2); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: .85rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row select, .row input[type=text] { width: auto; flex: 1 1 160px; margin-top: 0; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.timeline .t-when { color: var(--muted); flex: 0 0 84px; }

.comments { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.comment.dev { border-left: 3px solid var(--accent); }
.c-head { font-size: .85rem; margin-bottom: 4px; }
.comment-form textarea { margin-bottom: 8px; }

/* Footer */
.site-footer {
    flex-shrink: 0;
    margin-top: 24px;
    padding: 18px 16px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    font-size: .82rem;
    color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.foot-brand strong { color: var(--text); }
.foot-tagline { margin-left: 8px; color: var(--accent); }
.foot-legal { margin-left: auto; display: flex; gap: 14px; }

@media (max-width: 640px) {
    main { padding: 12px; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .column { flex-basis: 80vw; }
    .site-footer { flex-direction: column; align-items: flex-start; }
    .foot-legal { margin-left: 0; }
}
