body.staff { background: var(--bg); overflow: hidden; }
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.side { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel); padding: 14px 10px; overflow-y: auto; }
.side .brand { padding: 4px 8px 16px; }
.nav-sec { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.nav a .count { margin-left: auto; font-size: 11.5px; min-width: 22px; text-align: center; padding: 0 6px; border-radius: 99px; background: var(--panel-3); color: var(--muted); }
.nav a .count.hot { background: var(--grad); color: #fff; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.side .me div { min-width: 0; flex: 1; }
.side .me b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me small { color: var(--muted); text-transform: capitalize; font-size: 11.5px; }

.work { overflow-y: auto; height: 100vh; }
.work.split { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; overflow: hidden; }
.qpane { border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; background: color-mix(in srgb, var(--panel) 60%, var(--bg)); }
.qtools { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.qtools .row { flex-wrap: nowrap; }
.qtools select, .qtools input { padding: 7px 10px; font-size: 13px; }
.qlist { overflow-y: auto; flex: 1; }
.qitem { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text); position: relative; }
.qitem:hover { background: var(--panel-2); text-decoration: none; }
.qitem.active { background: var(--accent-soft); }
.qitem.unread::before { content: ''; position: absolute; left: 5px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.qitem .top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--dim); }
.qitem b { display: block; font-size: 13.5px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qitem p { margin: 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qitem .tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tagc { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--panel-3); color: var(--muted); border: 1px solid var(--line); }
.tagc.ai { color: #67e8f9; border-color: #164e63; }
.tagc.wait { color: #fcd34d; border-color: #713f12; }
.tagc.pin { color: #c4b5fd; }

.detail { display: grid; grid-template-columns: 1fr 290px; overflow: hidden; height: 100vh; }
.detail .chatcol { display: flex; flex-direction: column; overflow: hidden; }
.dhead { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.dhead h2 { margin: 0 0 6px; font-size: 18px; }
.dhead .row { gap: 6px; }
.detail .msgs { background: var(--bg); }
.infocol { border-left: 1px solid var(--line); overflow-y: auto; padding: 14px; background: var(--panel); display: grid; gap: 14px; align-content: start; }
.infocol section { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel-2); }
.infocol h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 82px 1fr; gap: 6px 8px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; display: flex; gap: 4px; align-items: center; }
.stack { display: grid; gap: 8px; }
.stack select { padding: 7px 10px; font-size: 13px; }
.scomposer { border-top: 1px solid var(--line); background: var(--panel); padding: 10px 12px; display: grid; gap: 8px; }
.scomposer.note textarea { border-color: #4a3d0a; background: #120f04; }
.scomposer textarea { min-height: 70px; max-height: 260px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 5px 12px; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 500; }
.seg button[aria-pressed=true] { background: var(--panel-3); color: var(--text); }
.seg button.note[aria-pressed=true] { color: var(--note); }
.savek { margin-left: auto; font-size: 11.5px; color: var(--dim); background: none; border: 0; cursor: pointer; padding: 0; }
.savek:hover { color: var(--accent); }

.wpage { max-width: 1100px; padding: 26px 30px 60px; }
.wpage h1 { font-size: 24px; margin-bottom: 4px; }
.wpage > p.muted { margin: 0 0 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { padding: 16px; }
.tile small { color: var(--muted); font-size: 12px; }
.tile b { display: block; font-size: 26px; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.bars div { flex: 1; background: linear-gradient(180deg, var(--g3), var(--g2) 55%, color-mix(in srgb, var(--g1) 50%, transparent)); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars div:hover { filter: brightness(1.3); }
.bar-labels { display: flex; gap: 4px; font-size: 10.5px; color: var(--dim); margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.actions { text-align: right; white-space: nowrap; }
.hbar { height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; min-width: 80px; }
.hbar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fieldrow { display: grid; grid-template-columns: 1fr 130px 90px auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--panel-2); }
.fieldrow input, .fieldrow select { padding: 7px 9px; font-size: 13px; }
.fieldrow .opts { grid-column: 1 / -1; }
.keybox { font-family: ui-monospace, Consolas, monospace; padding: 12px; border-radius: 10px; background: #0a0c12; border: 1px dashed var(--accent); word-break: break-all; margin: 10px 0; }
.playreply { white-space: pre-wrap; padding: 14px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line); margin-top: 12px; }
.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; overflow-y: auto; }
.auth > div { width: min(400px, 100%); }
.auth .card { width: 100%; }
.auth h1 { font-size: 24px; }
.mobile-menu { display: none; }
@media (max-width: 1100px) { .detail { grid-template-columns: 1fr; } .infocol { display: none; } .detail.show-info .infocol { display: grid; } }
@media (max-width: 820px) {
  body.staff { overflow: auto; }
  .shell { grid-template-columns: 1fr; height: auto; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 20px 0 60px #000a; }
  .mobile-menu { display: flex; position: sticky; top: 0; z-index: 30; padding: 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .work, .detail { height: auto; min-height: calc(100vh - 56px); }
  .work.split { grid-template-columns: 1fr; }
  .work.split.has-ticket .qpane { display: none; }
  .work.split:not(.has-ticket) .detail-wrap { display: none; }
  .wpage { padding: 18px 14px 40px; }
  .fieldrow { grid-template-columns: 1fr 1fr; }
}
