* { box-sizing: border-box; margin: 0; }

:root {
  --bg: #12151c;
  --panel: #1a1f2a;
  --panel-2: #222939;
  --text: #dbe2ef;
  --muted: #8792a8;
  --accent: #4f8cff;
  --border: #2c3548;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }

input, textarea, select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  width: 100%;
}

.hidden { display: none !important; }

/* login */
.login {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  width: 320px;
  display: grid; gap: 12px;
}
.login-error { color: #ff7b7b; min-height: 1em; }

/* topbar / fleet */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .04em; }
.fleet { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.env-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12.5px;
  cursor: default;
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.green { background: #3ecf6e; box-shadow: 0 0 6px #3ecf6e88; }
.dot.yellow { background: #e8c33c; }
.dot.red { background: #e05252; }
.topbar-actions { display: flex; gap: 8px; }

/* board */
.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 10px;
  padding: 14px;
  align-items: start;
  overflow-x: auto;
}
.column {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-height: 140px;
}
.column.drag-over { border-color: var(--accent); }
.column h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 10px;
  display: flex; justify-content: space-between;
}
.count { color: var(--text); }
.cards { display: grid; gap: 8px; }

.card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  cursor: grab;
}
.card:hover { border-color: var(--accent); }
.card-title { margin-bottom: 7px; word-break: break-word; }
.card-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.badge {
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 6px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge.env { color: #7fd0ff; }
.badge.session { color: #8fe8b0; font-family: ui-monospace, monospace; }
.badge.project { color: #b8a7ff; }
.badge.prio.p1 { color: #fff; background: #c0392b; border-color: #c0392b; }
.badge.prio.p2 { color: #ffb27f; }
.badge.prio.p3 { color: var(--muted); }
.badge.prio.p4, .badge.prio.p5 { color: #6d7891; }

/* drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 20;
  width: min(460px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.drawer-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.drawer-head h2 { font-size: 16px; }
.drawer-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-bit {
  font-size: 12px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px;
}
.drawer-body, .drawer-result pre {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px;
  white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, monospace; font-size: 12.5px;
}
.drawer h3 { font-size: 12px; text-transform: uppercase; color: var(--muted); }
.events { list-style: none; display: grid; gap: 8px; }
.events li {
  border-left: 2px solid var(--border);
  padding-left: 10px; font-size: 12.5px;
}
.ev-kind { color: var(--accent); font-weight: 600; }
.ev-env { color: #7fd0ff; }
.ev-when { color: var(--muted); }
.ev-detail { color: var(--text); white-space: pre-wrap; }
.comment-form { display: flex; gap: 8px; margin-top: auto; }

/* dialog */
dialog {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 22px; width: min(430px, 92vw);
}
dialog::backdrop { background: #000a; }
dialog form { display: grid; gap: 10px; }
dialog label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 6px; }

/* toast */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #c0392b; color: #fff;
  border-radius: 8px; padding: 10px 16px; z-index: 60;
}
