/* Каркас приложений: панель клиента и админка. */
.app { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 100vh; }

/* ---------- меню слева ---------- */
.side {
  position: sticky; top: 0; height: 100vh; width: 252px; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--side); transition: width .2s ease; z-index: 40;
}
.side-head { display: flex; align-items: center; gap: 8px; padding: 16px 14px 14px 18px; min-height: 64px; }
.side-head .brand { font-size: 15px; flex: 1; min-width: 0; }
.side-head .brand img { width: 26px; height: 26px; border-radius: 50%; }
.side-head .brand small { color: var(--dim); font-weight: 500; font-size: 13px; margin-left: 2px; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.grp { margin-bottom: 10px; }
.grp-h { width: 100%; display: flex; align-items: center; justify-content: space-between; background: none; border: 0; cursor: pointer; color: var(--text); font-weight: 600; font-size: 13.5px; padding: 8px 8px 6px; }
.grp-h svg { width: 14px; height: 14px; color: var(--dim); transition: transform .15s; transform: rotate(180deg); }
.grp.closed .grp-h svg { transform: none; }
.grp.closed .grp-b { display: none; }
.grp-b { display: grid; gap: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 9px; color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: nowrap; border: 1px solid transparent; transition: background .12s, color .12s; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.on { color: var(--text); background: var(--surface-2); border-color: var(--line-2); }
.nav-item .count { margin-left: auto; }
.nav-item.on .count { background: var(--text); color: var(--bg); }
.nav-link { display: flex; align-items: center; gap: 12px; height: 32px; padding: 0 10px; color: var(--muted); font-size: 13.5px; border-radius: 8px; white-space: nowrap; }
.nav-link i { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); margin: 0 6px; flex: none; }
.nav-link:hover { color: var(--text); background: var(--surface); }
.side-foot { padding: 10px 12px 14px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.collapse-btn svg { width: 17px !important; height: 17px !important; }

.app.mini .side { width: 64px; }
.app.mini .side-head { padding: 16px 0 14px; flex-direction: column; justify-content: center; }
.app.mini .side-head .brand span, .app.mini .nav-item .lbl, .app.mini .nav-item .count, .app.mini .grp-h, .app.mini .grp[data-grp="Ссылки"] { display: none; }
.app.mini .grp.closed .grp-b { display: grid; }
.app.mini .side-nav, .app.mini .side-foot { padding-left: 10px; padding-right: 10px; }
.app.mini .nav-item { width: 42px; padding: 0; justify-content: center; }
.app.mini .nav-item .badge-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- верх и страница ---------- */
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(14, 14, 15, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.gsearch { position: relative; display: flex; align-items: center; gap: 8px; width: min(340px, 40vw); height: 36px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); }
.gsearch:focus-within { border-color: rgba(var(--accent-rgb), .6); }
.gsearch > svg { width: 15px; height: 15px; color: var(--dim); flex: none; }
.gsearch input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 13.5px; }
.gsearch input::placeholder { color: var(--dim); }
.gsearch kbd { font: 500 11px var(--font); color: var(--dim); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); white-space: nowrap; }
.gs-res { position: absolute; left: 0; top: calc(100% + 6px); width: min(420px, 90vw); padding: 6px; border-radius: 12px; background: #171719; border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); z-index: 70; }
.gs-res a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.gs-res a.sel, .gs-res a:hover { background: var(--surface-3); }
.gs-res a > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.gs-res b { display: block; font-weight: 500; font-size: 13.5px; }
.gs-res small { color: var(--dim); font-size: 12px; }
.gs-empty { padding: 12px; color: var(--dim); font-size: 13.5px; }
.top-links { display: flex; gap: 20px; margin-left: auto; font-size: 13.5px; font-weight: 500; }
.top-links a { color: var(--muted); }
.top-links a:hover { color: var(--text); }
.top-right { display: flex; align-items: center; gap: 8px; }
.crumbbar { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 28px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.crumbbar a:hover { color: var(--text); }
.crumbbar span:last-child { color: var(--text); }
.crumbbar svg { width: 13px; height: 13px; color: var(--dim); }
.page { flex: 1; padding: 0 28px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; min-height: 76px; margin-bottom: 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.page-head h1 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.ph-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); }
.ph-ico svg { width: 16px; height: 16px; }
.ph-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.app-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.balance-chip { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-weight: 500; font-size: 13.5px; }
.balance-chip i { display: grid; place-items: center; color: var(--muted); }
.balance-chip i svg { width: 15px; height: 15px; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; height: 36px; }
.user-btn .avatar { width: 28px; height: 28px; }
.user-btn b { font-weight: 500; font-size: 13.5px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn > svg { width: 14px; height: 14px; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 6px; z-index: 60; background: #171719; border-color: var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); animation: rise .12s ease; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--text); font-size: 14px; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-3); }
.menu svg { width: 17px; height: 17px; color: var(--muted); }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who b { display: block; font-size: 14px; font-weight: 500; }
.menu .who small { color: var(--dim); }
.burger { display: none; }
.view { animation: viewin .18s ease; }
@keyframes viewin { from { opacity: 0; } }

/* контейнер с вкладками-таблетками, как в референсе */
.panel-box { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.panel-box > .pb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel-box > .pb-body { padding: 14px; }
.pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pills button { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500; }
.pills button:hover { color: var(--text); }
.pills button.on { background: var(--surface-3); border-color: var(--line-2); color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.scard { position: relative; display: grid; gap: 10px; padding: 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-2); transition: border-color .15s; cursor: pointer; }
.scard:hover { border-color: #3a3a40; }
.scard .sc-top { display: flex; align-items: center; gap: 8px; }
.scard .sc-top .tag:first-child { margin-right: auto; }
.scard .sc-top svg { width: 16px; height: 16px; color: var(--dim); }
.scard b { font-weight: 600; font-size: 14.5px; }
.scard .ip { color: var(--accent); font-family: var(--mono); font-size: 12.5px; }
.scard .sc-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12.5px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- компоненты вьюх ---------- */
.stat { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.stat .sh { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .si2 { display: grid; place-items: center; color: var(--dim); }
.stat .si2 svg { width: 17px; height: 17px; }
.stat .val { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.stat .val small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat .foot { font-size: 13px; color: var(--dim); }
.stat .foot a { color: var(--accent); }
.stack { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--dim); }
.toolbar .search .input { padding-left: 36px; height: 38px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.ico-box { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); flex: none; }
.ico-box svg { width: 16px; height: 16px; }

.srv-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; position: relative; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); }
.srv-ico svg { width: 19px; height: 19px; }
.srv-ico .dot { position: absolute; right: -2px; bottom: -2px; box-shadow: 0 0 0 3px var(--surface); }
.srv-ico.mc { background: #18201a; border-color: #273a2b; color: #8fd19e; }

.srv-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; }
.srv-hero .srv-ico { width: 52px; height: 52px; border-radius: 13px; }
.srv-hero .srv-ico svg { width: 25px; height: 25px; }
.srv-hero h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.srv-hero .meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.srv-hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.srv-hero .meta svg { width: 15px; height: 15px; }
.srv-hero .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; word-break: break-word; }
.gauge { display: grid; gap: 10px; }
.gauge .gh { display: flex; justify-content: space-between; align-items: baseline; }
.gauge .gh b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.gauge .gh span { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px 0; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); cursor: pointer; font-weight: 500; position: relative; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs button svg { width: 16px; height: 16px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.xterm-box { height: 520px; padding: 10px; border-radius: var(--radius-sm); background: #09090b; border: 1px solid var(--line); }
.xterm-box .xterm { height: 100%; }
.xterm .xterm-viewport { background: transparent !important; }
.chart { width: 100%; height: 170px; }
.prof-list { display: grid; gap: 8px; }
.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.type-pick label { cursor: pointer; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); display: grid; gap: 4px; transition: border-color .15s; }
.type-pick label:hover { border-color: #3a3a42; }
.type-pick input { display: none; }
.type-pick label:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.type-pick svg { width: 22px; height: 22px; color: var(--muted); }
.type-pick b { font-size: 14.5px; font-weight: 600; }
.type-pick small { color: var(--muted); font-size: 12.5px; }
details.more { border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); margin-bottom: 14px; }
details.more > summary { cursor: pointer; padding: 11px 13px; font-size: 14px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary svg { width: 15px; height: 15px; transition: transform .15s; }
details.more[open] > summary svg { transform: rotate(90deg); }
details.more > div { padding: 0 13px 13px; }
.chat { display: grid; gap: 14px; margin-bottom: 18px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg .bubble { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); max-width: 640px; white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.msg.staff .bubble { background: rgba(var(--accent-rgb), .07); border-color: rgba(var(--accent-rgb), .25); }
.msg .who { font-size: 12.5px; color: var(--dim); margin-bottom: 4px; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.plan-pick label { cursor: pointer; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); display: grid; gap: 3px; transition: border-color .15s; }
.plan-pick input { display: none; }
.plan-pick label:hover { border-color: #3a3a42; }
.plan-pick label:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.plan-pick b { font-size: 15px; font-weight: 600; }
.plan-pick .pp { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 2px; }
.plan-pick small { color: var(--muted); font-size: 12.5px; }
.summary { position: sticky; top: 20px; }
.summary .total { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.qr { width: 180px; height: 180px; padding: 10px; background: #fff; border-radius: 12px; margin: 0 auto; }
.qr svg { width: 100%; height: 100%; }
.avatar-edit { position: relative; width: 88px; height: 88px; border-radius: 22px; overflow: hidden; background: var(--surface-3); flex: none; }
.avatar-edit .avatar { width: 100%; height: 100%; border-radius: 0; }
.avatar-edit label { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .15s; cursor: pointer; color: #fff; }
.avatar-edit:hover label { opacity: 1; }
.avatar-edit label svg { width: 22px; height: 22px; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); padding: 18px; text-align: center; color: var(--muted); font-size: 13.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .04); }

/* ---------- Minecraft ---------- */
.mc-console { height: 460px; max-height: none; }
.mc-cmd { display: flex; gap: 8px; margin-top: 10px; }
.mc-cmd .input { font-family: var(--mono); font-size: 13px; }
.mc-cmd .prompt { display: grid; place-items: center; width: 40px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line-2); color: var(--green); font-family: var(--mono); }
.player { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.player:last-child { border-bottom: 0; }
.player img { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; background: var(--surface-3); }
.player b { font-weight: 500; flex: 1; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.file-row:hover { background: rgba(255, 255, 255, .02); }
.file-row:last-child { border-bottom: 0; }
.file-row svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.file-row .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fs { color: var(--dim); font-size: 12.5px; width: 90px; text-align: right; }
.file-row .fa { display: flex; gap: 4px; opacity: 0; }
.file-row:hover .fa { opacity: 1; }
.addon { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.addon:last-child { border-bottom: 0; }
.addon img, .addon .ph { width: 40px; height: 40px; border-radius: 9px; background: var(--surface-3); flex: none; object-fit: cover; }
.addon .ai { flex: 1; min-width: 0; }
.addon .ai b { font-weight: 500; display: block; }
.addon .ai small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; height: 100vh; transform: translateX(-105%); transition: transform .2s ease; }
  .app.drawer .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
  .app.mini .side { width: 252px; }
  .app.mini .side-head { flex-direction: row; padding: 16px 14px 14px 18px; }
  .app.mini .side-head .brand span, .app.mini .nav-item .lbl, .app.mini .nav-item .count, .app.mini .grp-h { display: initial; }
  .app.mini .grp[data-grp="Ссылки"] { display: block; }
  .app.mini .nav-item { width: auto; padding: 0 10px; justify-content: flex-start; }
  .collapse-btn { display: none !important; }
  .burger { display: inline-flex; }
  .topbar { padding: 0 14px; gap: 8px; }
  .gsearch { flex: 1; width: auto; }
  .gsearch kbd, .top-links, .user-btn b, .user-btn > svg, .balance-chip span { display: none; }
  .balance-chip { padding: 0 10px; }
  .crumbbar { padding: 0 16px; }
  .page { padding: 0 16px 40px; }
  .page-head { min-height: 64px; margin-bottom: 16px; }
  .app-foot { padding: 16px; }
  .srv-hero .actions { margin-left: 0; width: 100%; }
  .xterm-box { height: 420px; }
  .file-row .fa { opacity: 1; }
}
