@font-face { font-family: "NotoGe"; src: url("/fonts/ge-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F; }
@font-face { font-family: "NotoGe"; src: url("/fonts/ge-600.woff2") format("woff2"); font-weight: 500 600; font-display: swap; unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F; }
@font-face { font-family: "NotoGe"; src: url("/fonts/ge-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F; }
@font-face { font-family: "NotoGe"; src: url("/fonts/lat-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2116, U+2122; }
@font-face { font-family: "NotoGe"; src: url("/fonts/lat-600.woff2") format("woff2"); font-weight: 500 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2116, U+2122; }
@font-face { font-family: "NotoGe"; src: url("/fonts/lat-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2116, U+2122; }

:root {
  --purple: #6A0DAD; --purple-600: #59099a; --purple-50: #f6f0fc; --purple-100: #ece0f8;
  --accent: #E8472A;
  --ink: #17151c; --ink-2: #45424d; --muted: #8b8794; --faint: #b4b1bb;
  --line: #ebe9ef; --line-2: #f3f2f6; --hover: #f7f6fa;
  --bg: #ffffff; --panel: #fbfbfc; --card: #fff;
  --danger: #d23b3b; --ok: #2c9a5c; --warn: #c27a06;
  /* status: text + soft background */
  --s-open: #77737f;        --sb-open: #f1f0f3;
  --s-todo: #2f6fd6;        --sb-todo: #eaf1fc;
  --s-in_progress: #7a2fc0; --sb-in_progress: #f3ebfb;
  --s-done: #c27a06;        --sb-done: #fdf4e3;
  --s-closed: #2c9a5c;      --sb-closed: #e9f6ef;
  --s-blocked: #d23b3b;     --sb-blocked: #fcecec;
  --p-urgent: #d23b3b; --p-high: #ee7a3a; --p-normal: #5b8def; --p-low: #c3c0ca;
  --r: 8px; --r-sm: 6px;
  --shadow: 0 1px 2px rgba(20,16,28,.04), 0 6px 24px rgba(20,16,28,.07);
  --side: 232px; --rowh: 36px;
  font-family: "NotoGe", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--purple); text-decoration: none; }
.boot { display: grid; place-items: center; height: 60vh; color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #dedce3; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c9c6d0; background-clip: content-box; border: 3px solid transparent; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; font-size: 12.5px; white-space: nowrap; transition: background .1s, border-color .1s, color .1s; }
.btn:hover { background: var(--hover); border-color: #dfdce5; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.primary:hover { background: var(--purple-600); }
.btn.danger { color: var(--danger); border-color: #f2d3d3; }
.btn.danger:hover { background: #fdf3f3; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.icon { width: 30px; padding: 0; }
.btn.sm.icon { width: 26px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; outline: none; transition: border-color .1s, box-shadow .1s; }
select { padding-right: 6px; }
textarea { height: auto; min-height: 72px; padding: 7px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #b98be0; box-shadow: 0 0 0 3px var(--purple-50); }
input:disabled, select:disabled { background: var(--panel); color: var(--muted); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
label.f > span i { color: var(--accent); font-style: normal; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input, input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--purple); margin: 0; }
.seg { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--line-2); gap: 2px; }
.seg button { border: 0; background: transparent; height: 26px; padding: 0 11px; cursor: pointer; border-radius: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- brand ---------- */
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 22px; width: auto; display: block; }
.logo .app { font-size: 11px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; line-height: 1.2; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--panel); }
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; box-shadow: var(--shadow); }
.auth-card .logo { margin-bottom: 22px; }
.auth-card .logo img { height: 26px; }
.auth-card h1 { margin: 0 0 4px; font-size: 19px; font-weight: 600; }
.auth-card p { margin: 0 0 20px; color: var(--muted); }
.err { color: var(--danger); font-size: 12.5px; min-height: 16px; margin: 4px 0 10px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 16px 16px 14px; }
.nav { padding: 4px 8px 12px; }
.nav h4 { margin: 16px 8px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--faint); font-weight: 600; display: flex; align-items: center; }
.nav a { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: var(--r-sm); color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; }
.nav a > span:not(.ico):not(.cnt):not(.sw):not(.car) { overflow: hidden; text-overflow: ellipsis; }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.on { background: var(--purple-50); color: var(--purple); font-weight: 600; }
.nav a .cnt { margin-left: auto; background: var(--accent); color: #fff; font-size: 10.5px; border-radius: 9px; padding: 0 6px; line-height: 17px; font-weight: 600; }
.nav a .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.nav .ico { width: 16px; height: 16px; flex: none; display: grid; place-items: center; color: var(--muted); }
.nav a.on .ico { color: var(--purple); }
.nav .ico svg { width: 15px; height: 15px; }
.nav .car { width: 16px; flex: none; display: grid; place-items: center; color: var(--faint); font-size: 10px; transition: transform .12s; border-radius: 4px; }
.nav .car:hover { color: var(--ink); background: #e9e7ee; }
.nav .pgrp.shut .car { transform: rotate(-90deg); }
.nav .pgrp.shut .deps { display: none; }
.nav .car.none { visibility: hidden; }
.nav a.dep { padding-left: 32px; font-size: 12.5px; height: 28px; color: var(--muted); }
.nav a.dep.on { color: var(--purple); }
.side .foot { margin-top: auto; padding: 10px 16px; font-size: 11px; color: var(--faint); border-top: 1px solid var(--line); display: flex; justify-content: space-between; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); height: 50px; padding: 0 20px; display: flex; align-items: center; gap: 8px; }
.top h2 { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.top h2 .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.burger { display: none; }
.content { padding: 14px 20px 32px; min-width: 0; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--purple-100); color: var(--purple); display: inline-grid; place-items: center; font-size: 9.5px; font-weight: 700; flex: none; letter-spacing: .2px; }
.avatar.lg { width: 28px; height: 28px; font-size: 11px; }
.bell { position: relative; }
.bell .badge { position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 9.5px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.top svg { width: 16px; height: 16px; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { width: 220px; height: 28px; }
.filters select { width: auto; min-width: 120px; height: 28px; font-size: 12.5px; }
.filters .sep { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 11.5px; white-space: nowrap; color: var(--ink-2); }
.chip:hover { border-color: #dcd9e2; }
.chip.on { background: var(--purple-50); border-color: #d9c2f0; color: var(--purple); }
.chip .sd { width: 7px; height: 7px; border-radius: 50%; }

/* ---------- badges ---------- */
.st { display: inline-flex; align-items: center; gap: 5px; height: 19px; padding: 0 7px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: .4px; white-space: nowrap; text-transform: uppercase; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.open { color: var(--s-open); background: var(--sb-open); } .st.todo { color: var(--s-todo); background: var(--sb-todo); }
.st.in_progress { color: var(--s-in_progress); background: var(--sb-in_progress); } .st.blocked { color: var(--s-blocked); background: var(--sb-blocked); }
.st.done { color: var(--s-done); background: var(--sb-done); } .st.closed { color: var(--s-closed); background: var(--sb-closed); }
.st.cancelled { color: #8b8794; background: #f1f0f3; text-decoration: line-through; }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.pr { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; white-space: nowrap; color: var(--ink-2); }
.pr::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: currentColor; }
.pr.urgent { color: var(--p-urgent); } .pr.high { color: var(--p-high); } .pr.normal { color: var(--p-normal); } .pr.low { color: #9e9aa6; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 18px; padding: 0 6px; border-radius: 4px; background: var(--line-2); color: var(--ink-2); font-size: 11px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.tag .sw { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.tag.warn { background: #fdf4e3; color: #8a5600; }
.due { font-size: 12px; white-space: nowrap; color: var(--ink-2); }
.due.over { color: var(--danger); font-weight: 600; }
.due.soon { color: var(--warn); font-weight: 600; }
.prog { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------- list view (tree) ---------- */
.group { margin-bottom: 14px; }
.group > h3 { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 0 0 4px; padding: 4px 2px; cursor: pointer; user-select: none; font-weight: 600; }
.group > h3 .n { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.group > h3 .caret { transition: transform .12s; display: inline-block; color: var(--faint); font-size: 10px; width: 12px; }
.group.collapsed > h3 .caret { transform: rotate(-90deg); }
.group.collapsed > .rows, .group.collapsed > .group-body { display: none; }
.group.dept > h3 { font-size: 13px; padding: 6px 2px; border-bottom: 1px solid var(--line); margin-bottom: 6px; border-radius: 0; }
.group.dept > .group-body { padding-left: 14px; }
.rows { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.trow { display: grid; grid-template-columns: 3px 1fr auto; gap: 10px; align-items: center; min-height: var(--rowh); padding: 0 12px 0 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--hover); }
.trow .bar { align-self: stretch; }
.trow .t { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.trow .t .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.trow .t .meta { display: flex; gap: 6px; align-items: center; flex: none; overflow: hidden; }
.trow .r { display: flex; align-items: center; gap: 12px; }
.trow.child { background: #fdfdfe; }
.trow.child .t { padding-left: 22px; }
.trow.child .t::before { content: ""; width: 10px; height: 10px; border-left: 1px solid #d5d2db; border-bottom: 1px solid #d5d2db; border-bottom-left-radius: 3px; margin: -8px -4px 0 -14px; flex: none; }
.tw { width: 16px; height: 16px; flex: none; display: grid; place-items: center; border-radius: 4px; color: var(--muted); font-size: 9px; cursor: pointer; transition: transform .12s; border: 0; background: none; padding: 0; }
.tw:hover { background: #ebe9f0; color: var(--ink); }
.tw.shut { transform: rotate(-90deg); }
.tw.none { visibility: hidden; cursor: default; }
.idn { color: var(--faint); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r); }

/* ---------- table view ---------- */
.tablewrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.grid th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; height: 34px; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--panel); white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; }
table.grid th.sorted { color: var(--purple); }
table.grid td { height: var(--rowh); padding: 0 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: var(--hover); }
table.grid td.tt { max-width: 380px; min-width: 220px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
table.grid td.tt .ttin { display: flex; align-items: center; gap: 6px; min-width: 0; }
table.grid td.tt .ttin > span.x { overflow: hidden; text-overflow: ellipsis; }
table.grid tr.child td.tt .ttin { padding-left: 22px; }
table.grid tr.child { background: #fdfdfe; }
table.plain tbody tr { cursor: default; }
table.plain td { white-space: normal; }
.pager { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding: 8px 0 0; font-size: 12px; color: var(--muted); }
.pager .info { margin-right: auto; }
.pager button { min-width: 28px; height: 26px; padding: 0 6px; border-radius: 5px; border: 1px solid transparent; background: none; cursor: pointer; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pager button:hover:not(:disabled) { background: var(--line-2); }
.pager button.on { border-color: var(--line); background: #fff; color: var(--purple); font-weight: 700; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager .gap { padding: 0 2px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px; min-height: 120px; }
.col.drop { outline: 2px dashed #c9a6eb; outline-offset: -2px; background: var(--purple-50); }
.col > h3 { display: flex; align-items: center; gap: 8px; margin: 2px 4px 8px; font-size: 12px; }
.col > h3 .n { margin-left: auto; color: var(--muted); font-weight: 500; }
.card { background: #fff; border-radius: 7px; padding: 9px 10px; margin-bottom: 6px; border: 1px solid var(--line); cursor: grab; position: relative; }
.card::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--pc, transparent); }
.card:hover { border-color: #ddd0ec; box-shadow: 0 2px 8px rgba(20,16,28,.05); }
.card.dragging { opacity: .5; }
.card .title { font-weight: 500; margin-bottom: 6px; word-break: break-word; line-height: 1.35; }
.card .meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.card .subs-t { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 11.5px; color: var(--muted); background: var(--line-2); border: 0; border-radius: 4px; padding: 2px 6px; cursor: pointer; }
.card .subs-t:hover { color: var(--ink); }
.card .subs { margin-top: 6px; border-top: 1px solid var(--line-2); padding-top: 4px; }
.card .subs .s { display: flex; align-items: center; gap: 6px; padding: 4px 2px; font-size: 12px; border-radius: 4px; cursor: pointer; }
.card .subs .s:hover { background: var(--hover); }
.card .subs .s .x { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .subs .s.closed .x { text-decoration: line-through; color: var(--muted); }

/* ---------- drawer (task) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(23,21,28,.22); z-index: 50; display: flex; justify-content: flex-end; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer { width: min(1140px, 100%); height: 100%; background: #fff; display: flex; flex-direction: column; animation: slide .16s ease-out; box-shadow: -8px 0 32px rgba(0,0,0,.12); }
.dhead { border-bottom: 1px solid var(--line); padding: 12px 20px 10px; }
.dhead .crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.dhead .crumbs .sep { color: var(--faint); }
.dhead h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; word-break: break-word; }
.dhead .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.dtabs { display: none; }
.dbody { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 380px; }
.dleft { overflow-y: auto; padding: 14px 20px 40px; }
.dright { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.sec { padding: 12px 0 14px; border-bottom: 1px solid var(--line-2); }
.sec:last-child { border-bottom: 0; }
.sec > h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; text-transform: none; }
.sec > h4 .r { margin-left: auto; display: flex; gap: 6px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; }
.fields .k { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.fields .v { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 500; }
.banner { border-radius: var(--r); padding: 10px 12px; margin: 4px 0 8px; display: flex; gap: 12px; align-items: flex-start; font-size: 12.5px; }
.banner.red { background: #fdf3f3; border: 1px solid #f5d6d6; }
.banner.amber { background: #fdf8ee; border: 1px solid #f3e3c1; }
.banner.green { background: #f1f9f4; border: 1px solid #d3ecdd; }
.banner.purple { background: var(--purple-50); border: 1px solid var(--purple-100); }
.banner .b { flex: 1; min-width: 0; }
.banner .b strong { display: block; margin-bottom: 2px; }
.pre { white-space: pre-wrap; word-break: break-word; }
.clist .it { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 5px; cursor: pointer; user-select: none; }
.clist .it.ro { cursor: default; }
.clist .it:hover { background: var(--hover); }
.clist .it.done .tx { text-decoration: line-through; color: var(--muted); }
.clist .it .tx { flex: 1; word-break: break-word; }
.clist .it .x { opacity: 0; }
.clist .it:hover .x { opacity: 1; }
.clist .it input { pointer-events: none; }
.clist .add { margin-top: 4px; }
.clist .add input { border-style: dashed; }
.pbar { height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.pbar > i { display: block; height: 100%; background: var(--ok); transition: width .2s; }
.sub { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 6px; border-bottom: 1px solid var(--line-2); }
.sub:last-child { border-bottom: 0; }
.sub.link { cursor: pointer; } .sub.link:hover { background: var(--hover); }
.sub .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line-2); }
.att:last-child { border-bottom: 0; }
.att .ic { width: 28px; height: 28px; border-radius: 6px; background: var(--purple-50); color: var(--purple); display: grid; place-items: center; font-size: 9.5px; font-weight: 700; flex: none; }
.att .tx { flex: 1; min-width: 0; }
.att .tx a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 2px; border-radius: 14px; background: var(--line-2); font-size: 12px; }
.person button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; }
.hist { font-size: 12px; }
.hist .e { padding: 4px 0; border-bottom: 1px dashed var(--line-2); display: flex; gap: 10px; }
.hist .e .w { color: var(--muted); white-space: nowrap; width: 108px; flex: none; }

/* ---------- chat ---------- */
.chat-h { height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; gap: 8px; align-items: flex-start; }
.msg .bub { background: #fff; border: 1px solid var(--line); border-radius: 3px 10px 10px 10px; padding: 6px 10px; max-width: 85%; word-break: break-word; white-space: pre-wrap; }
.msg.me { flex-direction: row-reverse; }
.msg.me .bub { background: var(--purple-50); border-color: var(--purple-100); border-radius: 10px 3px 10px 10px; }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.msg.me .who { text-align: right; }
.msg .mention { color: var(--purple); font-weight: 600; }
.sysmsg { align-self: center; font-size: 11px; color: var(--muted); text-align: center; max-width: 92%; padding: 1px 8px; }
.daysep { align-self: center; font-size: 10.5px; color: var(--muted); background: var(--line-2); border-radius: 10px; padding: 1px 10px; }
.composer { border-top: 1px solid var(--line); padding: 10px; position: relative; background: #fff; }
.composer textarea { min-height: 40px; max-height: 160px; height: 40px; resize: none; }
.composer .row { margin-top: 6px; }
.mentions { position: absolute; bottom: calc(100% - 4px); left: 10px; right: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 220px; overflow-y: auto; z-index: 5; padding: 4px; }
.mentions div { padding: 6px 8px; cursor: pointer; display: flex; gap: 8px; align-items: center; border-radius: 5px; }
.mentions div.on, .mentions div:hover { background: var(--purple-50); }
.mentions div.none { cursor: default; color: var(--muted); background: none; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(23,21,28,.32); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .1s; }
.modal { background: #fff; border-radius: 12px; width: min(540px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0,0,0,.18); }
.modal.wide { width: min(720px, 100%); }
.modal .mh { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal .mh h3 { margin: 0; font-size: 15px; font-weight: 600; flex: 1; }
.modal .mb { padding: 14px 18px; overflow-y: auto; }
.modal .mf { padding: 10px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.warnbox { background: #fdf8ee; border: 1px solid #f3e3c1; color: #7a4a00; border-radius: var(--r-sm); padding: 7px 10px; font-size: 12.5px; margin-bottom: 12px; }
.infobox { background: var(--purple-50); border: 1px solid var(--purple-100); border-radius: var(--r-sm); padding: 7px 10px; font-size: 12.5px; margin-bottom: 12px; }
.optline { display: flex; align-items: center; gap: 8px; margin: -2px 0 12px; font-size: 12.5px; color: var(--ink-2); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 17px; background: var(--line-2); padding: 10px 14px; border-radius: 8px; letter-spacing: 1px; text-align: center; user-select: all; }

/* ---------- color swatches ---------- */
.swatches { display: grid; grid-template-columns: repeat(8, 30px); gap: 8px; }
.swatches button { width: 30px; height: 30px; border-radius: 7px; border: 1px solid rgba(0,0,0,.06); cursor: pointer; padding: 0; position: relative; }
.swatches button:hover { transform: scale(1.08); }
.swatches button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.swatches label { width: 30px; height: 30px; border-radius: 7px; border: 1px dashed #cfccd6; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 14px; position: relative; overflow: hidden; }
.swatches label.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); border-style: solid; }
.swatches label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- picker ---------- */
.picker { position: relative; }
.picker .val { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer; }
.picker .val .ph { color: var(--muted); }
.picker .dd { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.picker .dd input { border: 0; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; box-shadow: none; }
.picker .opts { max-height: 240px; overflow-y: auto; padding: 4px; }
.picker .opt { padding: 6px 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; border-radius: 5px; }
.picker .opt:hover, .picker .opt.on { background: var(--purple-50); }
.picker .opt .pos { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.picker .opt.sel::after { content: "✓"; color: var(--purple); margin-left: 6px; font-weight: 700; }

/* ---------- popover ---------- */
.pop { position: fixed; z-index: 90; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 36px rgba(0,0,0,.12); min-width: 190px; padding: 4px; }
.pop .mi { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.pop .mi:hover { background: var(--line-2); }
.pop .mi.danger { color: var(--danger); }
.notifs { width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; padding: 0; }
.notifs .nh { display: flex; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.notifs .n { padding: 9px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; display: flex; gap: 10px; }
.notifs .n:hover { background: var(--hover); }
.notifs .n.unread { background: #fbf7fe; }
.notifs .n .d { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; visibility: hidden; }
.notifs .n.unread .d { visibility: visible; }

/* ---------- admin / pages ---------- */
.page-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.page-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; }
.pcard .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; margin-top: 4px; }
.pcard:hover { border-color: #dcd7e4; }
.pcard.on { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-50); }
.pill { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 9px; background: var(--line-2); color: var(--ink-2); }
.pill.on { background: var(--sb-closed); color: var(--ok); }
.pill.off { background: var(--sb-blocked); color: var(--danger); }
.pill.purple { background: var(--purple-50); color: var(--purple); }
.inbox-sec { margin-bottom: 20px; }
.inbox-sec h3 { font-size: 13px; font-weight: 600; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; }
.panel > h4 { margin: 0 0 10px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.panel > h4 .r { margin-left: auto; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: min(520px, calc(100vw - 32px)); animation: fade .15s; font-size: 12.5px; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .dbody { grid-template-columns: 1fr 330px; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 60; transform: translateX(-100%); transition: transform .2s; background: #fff; }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 55; }
  .burger { display: inline-flex; }
  .top { padding: 0 12px; }
  .content { padding: 12px 12px 32px; }
  .dtabs { display: flex; border-bottom: 1px solid var(--line); }
  .dtabs button { flex: 1; height: 38px; border: 0; background: none; border-bottom: 2px solid transparent; cursor: pointer; font-weight: 600; color: var(--muted); }
  .dtabs button.on { color: var(--purple); border-color: var(--purple); }
  .dbody { grid-template-columns: 1fr; }
  .dbody.tab-chat .dleft, .dbody.tab-info .dright { display: none; }
  .dright { border-left: 0; }
  .dhead { padding: 10px 14px; }
  .dleft { padding: 8px 14px 40px; }
  .filters input[type=search] { width: 100%; }
  .filters select { flex: 1; min-width: 0; }
  .grid2 { grid-template-columns: 1fr; }
  .trow .r .hide-m, .trow .t .meta { display: none; }
  .top .hide-m { display: none; }
}
@media (max-width: 560px) {
  .trow .r .avatar { display: none; }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal { border-radius: 12px 12px 0 0; max-height: 92vh; }
  .swatches { grid-template-columns: repeat(6, 30px); }
}
