/* Tuesday */
:root {
  --ink: #1f2430; --muted: #6b7280; --line: #e3e6ec; --bg: #f6f7fb; --card: #fff;
  --brand: #3b5bdb; --brand-dk: #2f4ac0; --danger: #c92a2a;
  --name-w: 380px; --cell-w: 150px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 24px; }

/* top bar */
.top { display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 52px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo .dot { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, #3b5bdb, #00c875); }
.logo.big { font-size: 26px; justify-content: center; margin-bottom: 8px; }
.logo.big .dot { width: 20px; height: 20px; border-radius: 6px; }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.top nav a.on, .top nav a:hover { background: #eef1fb; color: var(--brand); }
.top .out { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 13px; }

/* buttons + fields */
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 6px; padding: 7px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--brand-dk); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #eef1fb; }
.btn.small { padding: 4px 10px; font-size: 13px; }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c5d0fa; border-color: var(--brand); }
.linkbtn { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 4px; text-decoration: none; font-size: 13px; }

/* login */
body.login { display: grid; place-items: center; min-height: 100vh; }
.card { background: var(--card); padding: 32px; border-radius: 12px; border: 1px solid var(--line); width: 320px; display: grid; gap: 14px; }
.card label { display: grid; gap: 6px; font-weight: 500; }
.err { color: var(--danger); margin: 0; }

/* plain pages */
.page { max-width: 900px; margin: 0 auto; padding: 28px 20px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { margin: 0; font-size: 24px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.boards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.boards a { display: grid; gap: 4px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.boards a:hover { border-color: var(--brand); }
.boards span { color: var(--muted); font-size: 13px; }
.plist { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.plist th, .plist td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.plist input[type=color] { width: 34px; height: 28px; padding: 2px; }
.plist td input:not([type]) { width: 100%; border-color: transparent; }
.plist td input:not([type]):hover { border-color: var(--line); }
.plist tr.off { opacity: .5; }

/* board */
.boardhead { padding: 18px 20px 6px; position: sticky; top: 52px; background: var(--bg); z-index: 10; }
.boardhead h1 { margin: 0 0 12px; font-size: 24px; cursor: text; display: inline-block; padding: 2px 6px; margin-left: -6px; border-radius: 6px; }
.boardhead h1:hover { background: #eaedf5; }
.boardhead .inl { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tools #search { width: 200px; }
#groups { padding: 6px 20px 80px; }
.group { margin: 18px 0 26px; }
.ghead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--gc); }
.ghead .tog { background: none; border: 0; cursor: pointer; color: var(--gc); font-size: 14px; width: 22px; padding: 0; }
.ghead .gname { font-weight: 600; font-size: 16px; cursor: text; padding: 1px 4px; border-radius: 4px; }
.ghead .gname:hover { background: #eaedf5; }
.ghead .gcount { color: var(--muted); font-size: 13px; }
.ghead .mn { opacity: .5; }
.ghead:hover .mn { opacity: 1; }
.tw { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; }
th, td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); height: 38px; padding: 0; }
th { font-weight: 500; color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; background: #fafbfd; }
th:hover { background: #eef1fb; }
tbody tr:last-child td { border-bottom: 0; }
.c-bar { width: 6px; min-width: 6px; border-right: 0; padding: 0; position: sticky; left: 0; z-index: 2; }
.c-name { width: var(--name-w); min-width: var(--name-w); max-width: var(--name-w); text-align: left; position: sticky; left: 6px; background: #fff; z-index: 2; }
th.c-name { padding-left: 34px; cursor: default; background: #fafbfd; }
th.c-name:hover { background: #fafbfd; }
.nmw { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 8px; height: 37px; }
.c-cell, th.t-status, th.t-person, th.t-date, th.t-text, th.t-link { width: var(--cell-w); min-width: var(--cell-w); max-width: var(--cell-w); }
.c-end { width: 44px; min-width: 44px; border-right: 0; }
.addcol { background: none; border: 0; font-size: 18px; color: var(--muted); cursor: pointer; width: 100%; height: 100%; }
.row:hover td { background: #f7f8fc; }
.row:hover td.c-bar { filter: brightness(.95); }
.grip { color: #b7bdc9; cursor: grab; font-size: 13px; visibility: hidden; width: 14px; flex: none; }
.row:hover .grip { visibility: visible; }
.nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; padding: 2px 4px; border-radius: 4px; }
.nm:hover { outline: 1px solid var(--line); }
.mn { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; padding: 0 6px; border-radius: 4px; line-height: 24px; }
.row .mn { visibility: hidden; }
.row:hover .mn { visibility: visible; }
.mn:hover { background: #e7eaf2; }
.inl { flex: 1; padding: 4px 6px; }
.c-cell { cursor: pointer; text-align: center; overflow: hidden; }
.st { height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 500; font-size: 13px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st.empty { background: #e9ebf0; }
.c-cell:hover .st.empty { background: #dfe2ea; }
.pp { display: flex; justify-content: center; align-items: center; height: 100%; }
.av { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; margin-left: -6px; border: 2px solid #fff; flex: none; }
.av:first-child { margin-left: 0; }
.av.none { background: #e9ebf0; color: #9aa1b0; font-size: 15px; }
.tx { display: block; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.lk { display: block; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addrow td { height: 36px; }
.addrow td.c-name { padding: 0 8px 0 30px; }
.additem { border: 0; width: 100%; padding: 6px 4px; background: transparent; }
.additem:focus { outline: 0; background: #f2f4fa; }
.dragging { opacity: .4; }
.dropbefore td { box-shadow: inset 0 2px 0 var(--brand); }

/* popover */
.pop { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 30, 60, .16); padding: 10px; min-width: 200px; max-width: 320px; display: grid; gap: 6px; }
.pop .wide { width: 280px; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.ptitle { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.labels { display: grid; gap: 5px; width: 200px; }
.lbl { border: 0; border-radius: 4px; padding: 7px; color: #fff; font-weight: 500; cursor: pointer; }
.lbl:hover { filter: brightness(1.08); }
.lbl.clear { background: #fff; color: var(--muted); border: 1px dashed var(--line); }
.plist label { display: flex; align-items: center; gap: 8px; padding: 4px 2px; cursor: pointer; }
.pop .plist { max-height: 280px; overflow: auto; border: 0; width: 240px; }
.pop .plist .av { margin-left: 0; }
.mi { background: none; border: 0; text-align: left; padding: 7px 8px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.mi:hover:not([disabled]) { background: #eef1fb; }
.mi[disabled] { color: #b6bccb; cursor: default; }
.mi.danger { color: var(--danger); }
.gdot { width: 10px; height: 10px; border-radius: 3px; }
.lrows { display: grid; gap: 6px; }
.lrow { display: flex; gap: 6px; align-items: center; }
.lrow input { flex: 1; }
.sw { width: 22px; height: 22px; border-radius: 5px; border: 0; cursor: pointer; flex: none; }
.swatches { display: grid; grid-template-columns: repeat(8, 22px); gap: 5px; }

/* toast */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1f2430; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
#toast button { background: none; border: 0; color: #8fb0ff; font-weight: 600; cursor: pointer; margin-left: 8px; }

@media (max-width: 700px) {
  :root { --name-w: 220px; --cell-w: 120px; }
  .top { gap: 12px; }
}
