body.admin { overflow: hidden; height: 100vh; }

/* Login */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; }
.login__bg { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(80% 60% at 50% 110%, #5b1048 0%, transparent 60%), var(--bg); }
.login__grid { position: absolute; left: -50%; right: -50%; bottom: -10%; height: 60%; transform: perspective(500px) rotateX(62deg); transform-origin: bottom;
  background-image: linear-gradient(rgba(255,46,136,.55) 2px, transparent 2px), linear-gradient(90deg, rgba(45,226,255,.45) 2px, transparent 2px); background-size: 60px 60px;
  animation: gridmove 3s linear infinite; mask-image: linear-gradient(0deg, #000, transparent 85%); -webkit-mask-image: linear-gradient(0deg, #000, transparent 85%); }
@keyframes gridmove { to { background-position: 0 60px; } }
.login__card { position: relative; width: min(420px, 100%); padding: 38px; border-radius: 28px; background: rgba(15,9,25,.7); backdrop-filter: blur(24px); border: 1px solid var(--line2); display: grid; gap: 14px; animation: rise .6s var(--ease); box-shadow: 0 40px 120px rgba(0,0,0,.6); }
.login__card .logo__mark { width: 52px; height: 52px; }
.login__card h1 { font-family: var(--display); font-size: 24px; }
.login__err { color: #ff6b8b; font-size: 14px; min-height: 18px; }
.back { font-size: 13px; text-align: center; }

/* App */
.app { display: grid; grid-template-columns: 260px 1fr; height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; background: var(--bg2); overflow: auto; }
.me { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.ava { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; font-family: var(--display); color: #12061f; flex: none; position: relative; }
.ava.on::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); border: 3px solid var(--bg2); }
.me b { display: block; } .me small { color: var(--muted); }
.snav { display: grid; gap: 4px; }
.snav button { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 13px; font-weight: 700; color: var(--muted); text-align: left; transition: background .2s, color .2s; }
.snav button:hover { background: var(--card); color: var(--text); }
.snav button.on { background: var(--card2); color: var(--text); box-shadow: inset 3px 0 0 var(--pink); }
.snav b { margin-left: auto; font-size: 12px; min-width: 24px; height: 22px; border-radius: 11px; display: grid; place-items: center; background: var(--card2); padding: 0 6px; }
.snav b.hot { background: var(--grad); color: #fff; }
.team h5 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 10px; }
.mate { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; font-weight: 600; }
.mate .ava { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.mate.off { opacity: .45; }
#logout { margin-top: auto; }

.work { display: grid; grid-template-columns: 400px 1fr; min-width: 0; height: 100vh; }
.list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.list__head { padding: 20px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.list__head h2 { font-family: var(--display); font-size: 20px; }
.list__head input { background: var(--card); border: 1px solid var(--line2); border-radius: 12px; height: 42px; padding: 0 14px; outline: 0; }
.list__body { overflow: auto; padding: 10px; flex: 1; }
.tk { padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); margin-bottom: 8px; cursor: pointer; transition: border-color .2s, transform .25s var(--ease), opacity .3s; position: relative; }
.tk:hover { border-color: var(--line2); }
.tk.on { border-color: var(--pink); background: rgba(255,46,136,.07); }
.tk.enter { animation: tkin .6s var(--ease); }
@keyframes tkin { from { opacity: 0; transform: translateX(-30px) scale(.96); background: rgba(255,46,136,.3); } }
.tk.leave { opacity: 0; transform: translateX(40px) scale(.95); }
.tk__top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.tk__top b { font-family: var(--display); font-size: 14px; }
.tk__name { font-weight: 700; margin: 6px 0 2px; }
.tk__items { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk__bot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; }
.tk__bot .muted { font-size: 12px; }
.unread { position: absolute; right: 12px; top: -6px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 10px; }
.owner { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.owner i { width: 8px; height: 8px; border-radius: 50%; }
.list-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.list-empty div { font-size: 42px; margin-bottom: 8px; }

.detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.placeholder { margin: auto; text-align: center; color: var(--muted); max-width: 360px; padding: 20px; }
.placeholder div { font-size: 56px; margin-bottom: 10px; }
.placeholder p { color: var(--text); font-weight: 700; margin-bottom: 6px; }
.dhead { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.dhead h3 { font-family: var(--display); font-size: 20px; }
.dacts { display: flex; gap: 8px; flex-wrap: wrap; }
.dbody { display: grid; grid-template-columns: 1fr 320px; min-height: 0; flex: 1; }
.dchat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.dinfo { padding: 20px; overflow: auto; display: grid; gap: 16px; align-content: start; }
.box { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.box h5 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 5px 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; word-break: break-word; font-weight: 600; }
.kv a { color: var(--cyan); }
.iline { font-size: 13px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.iline:last-child { border: 0; }
.iline small { color: var(--muted); display: block; }
.claim-banner { margin: 20px; padding: 26px; border-radius: 20px; text-align: center; background: linear-gradient(135deg, rgba(255,46,136,.15), rgba(255,154,60,.08)); border: 1px solid rgba(255,46,136,.35); }
.claim-banner h4 { font-family: var(--display); font-size: 18px; margin-bottom: 6px; }
.claim-banner p { color: var(--muted); margin-bottom: 16px; font-size: 14px; }
.lock { margin: 20px; padding: 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-align: center; color: var(--muted); }
.quick { display: flex; gap: 6px; padding: 0 24px 8px; flex-wrap: wrap; }
.quick button { font-size: 12px; padding: 6px 10px; border-radius: 9px; background: var(--card2); font-weight: 600; }
.quick button:hover { background: rgba(255,255,255,.14); }
.btn--danger { background: rgba(255,77,109,.12); color: #ff8aa0; border: 1px solid rgba(255,77,109,.3); }
.btn--ok { background: rgba(61,255,168,.14); color: var(--green); border: 1px solid rgba(61,255,168,.35); }

.profile { padding: 30px; overflow: auto; max-width: 760px; }
.profile h2 { font-family: var(--display); font-size: 26px; margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat { padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.stat b { font-family: var(--display); font-size: 24px; display: block; }
.stat span { color: var(--muted); font-size: 13px; }
.pform { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pform .field input[type=color] { height: 48px; padding: 4px; }
.pform h4 { grid-column: span 2; margin-top: 10px; }

.back-mobile { display: none; }
@media (max-width: 1200px) { .dbody { grid-template-columns: 1fr; } .dinfo { order: -1; max-height: 260px; border-bottom: 1px solid var(--line); } .dchat { border-right: 0; } .work { grid-template-columns: 340px 1fr; } }
@media (max-width: 860px) {
  body.admin { overflow: auto; height: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 10px; }
  .snav { display: flex; overflow-x: auto; flex-basis: 100%; }
  .snav button { white-space: nowrap; }
  .team, .me small { display: none; }
  #logout { margin: 0 0 0 auto; width: auto; }
  .work { grid-template-columns: 1fr; height: calc(100vh - 130px); }
  .work.has-detail .list { display: none; }
  .work:not(.has-detail) .detail { display: none; }
  .back-mobile { display: inline-flex; }
  .stats { grid-template-columns: 1fr 1fr; }
  .pform { grid-template-columns: 1fr; } .pform h4 { grid-column: auto; }
}
.quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.quick button { white-space: nowrap; flex: none; }
.dbody{grid-template-columns:minmax(0,1fr) 320px}.dchat,.detail{min-width:0}.work{grid-template-columns:400px minmax(0,1fr)}
@media (max-width:1200px){.dbody{grid-template-columns:minmax(0,1fr)}.work{grid-template-columns:340px minmax(0,1fr)}}
@media (max-width:860px){.work{grid-template-columns:minmax(0,1fr)}}
/* v2 */
.work.solo { grid-template-columns: minmax(0, 1fr) !important; }
.work.solo .list { display: none !important; }
.work.solo .detail { display: flex !important; }
.profile { width: 100%; max-width: 900px; }
.promo-form { grid-template-columns: 1fr 120px 1fr auto; align-items: end; margin-bottom: 24px; }
.promo-list { display: grid; gap: 8px; }
.promo-row { display: grid; grid-template-columns: 1fr 80px 100px auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.promo-row b { font-family: var(--display); letter-spacing: .04em; display: block; }
.promo-row small { font-size: 12px; }
.promo-row.off { opacity: .5; }
.promo-pct { font-family: var(--display); font-weight: 800; color: var(--pink); }
.promo-acts { display: flex; gap: 6px; }
.tk__promo { font-size: 12px; }
.composer textarea { max-height: 220px; }
@media (max-width: 860px) { .promo-form, .promo-row { grid-template-columns: 1fr; } }
.att-prev { padding: 8px 24px 0; }
