:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #6b7385; --line: #e2e5eb;
  --accent: #1f4e79; --red: #c62828; --red-bg: #fdecea; --orange: #b45309; --orange-bg: #fff4e5;
  --ok: #2e7d32;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --panel: #1d2128; --text: #e6e8ec; --muted: #9aa1ae; --line: #2c313a;
    --accent: #6ea8dc; --red: #ff7b72; --red-bg: #3a1d1d; --orange: #f0a35e; --orange-bg: #3a2a17; --ok: #7ccf83; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 -apple-system, system-ui, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
button { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.hidden { display: none !important; }
.top { display: flex; gap: 12px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-size: 16px; }
#tabs { display: flex; gap: 4px; }
#tabs button { background: transparent; color: var(--muted); }
#tabs button.active { background: var(--accent); color: #fff; }
#search { flex: 1; min-width: 160px; }
main { padding: 16px; }
.banner { margin: 8px 16px 0; padding: 8px 12px; border-radius: 6px; background: var(--red-bg); color: var(--red); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.hot-item { display: flex; gap: 8px; padding: 6px 8px; border-radius: 6px; margin-bottom: 4px; cursor: pointer; }
.hot-item.red { background: var(--red-bg); }
.hot-item.orange { background: var(--orange-bg); }
.hot-item .when { font-weight: 600; min-width: 48px; }
.muted { color: var(--muted); }
.stages { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-pill { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.board { display: flex; gap: 10px; overflow-x: auto; align-items: flex-start; padding-bottom: 8px; }
.col { flex: 0 0 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-height: 120px; }
.col.collapsed { flex-basis: 140px; opacity: .8; }
.col.drop { outline: 2px dashed var(--accent); }
.col h3 { font-size: 12px; margin: 0 0 8px; color: var(--muted); }
.deal { border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 6px; background: var(--bg); cursor: grab; }
.deal .t { font-weight: 600; }
.deal.red { border-left: 4px solid var(--red); }
.deal.orange { border-left: 4px solid var(--orange); }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr.red td { background: var(--red-bg); }
tr.orange td { background: var(--orange-bg); }
tr.click { cursor: pointer; }
.task { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.task.overdue .txt { color: var(--red); }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); width: min(720px, 96vw); padding: 16px; }
dialog::backdrop { background: rgba(0,0,0,.4); }
.form { display: grid; grid-template-columns: 160px 1fr; gap: 8px; align-items: center; }
.form textarea { min-height: 70px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.log { font-size: 12px; color: var(--muted); max-height: 140px; overflow: auto; }
.error { color: var(--red); }
body.login { display: grid; place-items: center; min-height: 100vh; }
.login-box { display: grid; gap: 10px; width: 280px; background: var(--panel); padding: 24px; border-radius: 10px; border: 1px solid var(--line); }
@media (max-width: 768px) {
  .grid2 { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  #tabs { order: 3; width: 100%; overflow-x: auto; }
  table { font-size: 13px; }
  .hide-m { display: none; }
}
