:root {
  --bg: #080b11;
  --bg-2: #0b1019;
  --panel: #111827;
  --panel-2: #162032;
  --panel-3: #1c2740;
  --line: #24314a;
  --line-soft: #1b2537;
  --fg: #e8eef7;
  --muted: #8b9bb4;
  --accent: #37d7c4;
  --accent-2: #4f8cff;
  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --radius: 16px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(55, 215, 196, .10), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(79, 140, 255, .10), transparent 55%),
    var(--bg);
  color: var(--fg);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.ic.big { width: 40px; height: 40px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #26334c; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--accent); }

/* ───────────── brand / dots ───────────── */
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121a; font-weight: 800; letter-spacing: -.5px; font-size: 16px;
  box-shadow: 0 10px 30px -10px rgba(55, 215, 196, .6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: .2px; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.brand.small .logo { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; }
.brand.small .brand-text strong { font-size: 14px; }
.brand.small .brand-text small { font-size: 10px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 12px rgba(52, 211, 153, .7); }
.dot.err { background: var(--bad); box-shadow: 0 0 12px rgba(248, 113, 113, .7); }
.dot.load { background: var(--warn); animation: pulse 1s infinite; }

@keyframes pulse { 50% { opacity: .35; } }

/* ───────────── login ───────────── */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}
.login-glow {
  position: absolute; inset: -20% -10%;
  background:
    radial-gradient(600px 300px at 50% 20%, rgba(55, 215, 196, .16), transparent 70%),
    radial-gradient(500px 260px at 70% 80%, rgba(79, 140, 255, .12), transparent 70%);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, rgba(22, 32, 50, .92), rgba(13, 19, 30, .96));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 28px 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 23px; padding: 1px;
  background: linear-gradient(140deg, rgba(55, 215, 196, .55), transparent 35%, transparent 65%, rgba(79, 140, 255, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.login-card h1 { font-size: 24px; margin: 26px 0 6px; letter-spacing: -.02em; }
.login-card > .muted { margin: 0 0 22px; }

label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }

input[type=text], input[type=password], input[type=number], select {
  width: 100%;
  padding: 11px 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--fg);
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type=number] { font-family: var(--mono); }
input::placeholder { color: #5e6d84; }
input:focus, select:focus {
  border-color: rgba(55, 215, 196, .7);
  box-shadow: 0 0 0 3px rgba(55, 215, 196, .12);
  background: var(--panel-3);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b9bb4' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
option { background: #111827; }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 46px; letter-spacing: .22em; font-family: var(--mono); font-size: 15px; }
.input-wrap .icon-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--fg); background: var(--panel-3); border-color: var(--line); }
.icon-btn.tiny { width: 24px; height: 24px; }

.server-box { margin: 16px 0 0; border-top: 1px dashed var(--line-soft); padding-top: 12px; }
.server-box summary {
  cursor: pointer; font-size: 12px; color: var(--muted); list-style: none;
  display: flex; align-items: center; gap: 8px; user-select: none;
}
.server-box summary::-webkit-details-marker { display: none; }
.server-box summary::before { content: "▸"; font-size: 10px; transition: transform .15s; }
.server-box[open] summary::before { transform: rotate(90deg); }
.server-box summary .mono { margin-left: auto; color: var(--accent); }
.server-box input { margin-top: 10px; font-family: var(--mono); font-size: 12px; }
.hint { margin: 8px 0 0; font-size: 11px; color: var(--muted); }

.alert {
  margin-top: 14px; padding: 11px 13px; border-radius: 11px;
  background: rgba(248, 113, 113, .10);
  border: 1px solid rgba(248, 113, 113, .35);
  color: #ffb9b9; font-size: 13px;
}
.alert.ok { background: rgba(52, 211, 153, .10); border-color: rgba(52, 211, 153, .35); color: #a7f3d0; }

.login-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 11px; letter-spacing: .02em;
}

/* ───────────── buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--fg);
  font: inherit; font-weight: 500;
  cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(55, 215, 196, .55); background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, #3ee0cc, #24b6a6);
  border-color: transparent; color: #04211d; font-weight: 700;
  box-shadow: 0 10px 26px -12px rgba(55, 215, 196, .8);
}
.btn.primary:hover { filter: brightness(1.08); background: linear-gradient(180deg, #4ae7d3, #28c3b2); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { color: #ffb0b0; border-color: rgba(248, 113, 113, .35); }
.btn.danger:hover { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .6); }
.btn.danger-solid { background: linear-gradient(180deg, #f87171, #dc2626); border-color: transparent; color: #fff; font-weight: 700; }
.btn.danger-solid:hover { filter: brightness(1.08); }
.btn.block { width: 100%; padding: 12px 16px; margin-top: 18px; }

.btn .spin { display: none; }
.btn.loading .spin { display: inline-block; }
.btn.loading .btn-label { opacity: .6; }
.spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, .25); border-top-color: #04211d;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── app shell ───────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 24px;
  background: rgba(8, 11, 17, .82);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}
.status {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12px; color: var(--muted);
}
.status.ok { border-color: rgba(52, 211, 153, .3); color: #b7f0d6; }
.status.err { border-color: rgba(248, 113, 113, .35); color: #ffc1c1; }
.status.load { border-color: rgba(251, 191, 36, .3); color: #ffe0a3; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.topbar-actions .btn { padding: 9px 12px; font-size: 13px; background: transparent; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr);
  gap: 18px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 24px 80px;
  align-items: start;
}
.col { min-width: 0; }
.main-col { display: flex; flex-direction: column; gap: 18px; }
.side-col { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 86px; }

.card {
  background: linear-gradient(180deg, rgba(22, 32, 50, .62), rgba(15, 22, 35, .78));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 18px 40px -34px #000;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.count {
  min-width: 24px; text-align: center;
  padding: 2px 8px; border-radius: 999px;
  background: var(--panel-3); border: 1px solid var(--line);
  font-size: 11px; font-weight: 700; color: var(--accent);
}
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2 .card { margin-bottom: 0; }

/* search */
.search-card { padding: 14px; position: relative; }
.search-row { display: flex; gap: 10px; }
.search-field { position: relative; flex: 1; display: flex; align-items: center; }
.search-field .ic { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 38px; padding-right: 38px; }
.kbd {
  position: absolute; right: 11px;
  padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel-3);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.suggest {
  position: absolute; left: 14px; right: 14px; top: calc(100% - 4px); z-index: 30;
  background: #101827;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 70px -20px #000;
  overflow: hidden;
  max-height: 320px; overflow-y: auto;
}
.suggest-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item.active { background: rgba(55, 215, 196, .08); }
.suggest-item .mini-avatar {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.suggest-item .s-name { font-weight: 600; }
.suggest-item .s-meta { margin-left: auto; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state .ic { color: #33445f; }
.empty-state h2 { margin: 14px 0 6px; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--fg); }

/* player */
.player-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar {
  width: 58px; height: 58px; border-radius: 18px; flex: none;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #2b6cb0, #1a365d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 14px 30px -16px #000;
  text-transform: uppercase;
}
.player-meta { min-width: 0; }
.player-name { font-size: 22px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.player-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 4px; }
.player-sub .mono { font-size: 11px; }
.player-badges { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.pill.ok { color: #a7f3d0; border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.pill.off { color: var(--muted); }
.pill.bad { color: #fecaca; border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .08); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; min-height: 30px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 6px 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-size: 12px;
}
.chip b { font-weight: 650; }
.chip .x {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1;
}
.chip .x:hover { background: rgba(248, 113, 113, .15); color: #ffb0b0; }
.chip.click { cursor: pointer; padding: 5px 11px; transition: border-color .15s, background .15s; }
.chip.click:hover { border-color: rgba(55, 215, 196, .5); background: var(--panel-3); }
.chip .cdot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, .8); }
.chip .prio { color: var(--muted); font-size: 11px; font-family: var(--mono); }

/* forms */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn-row.right { justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .w-prio { max-width: 150px; }
.form-grid .w-value { max-width: 210px; }
.preview {
  margin-top: 12px; padding: 9px 12px; border-radius: 10px;
  background: var(--panel); border: 1px dashed var(--line);
  font-size: 12px; color: var(--muted);
}
.preview .mc { font-size: 14px; }
.filter { max-width: 200px; padding: 7px 11px; font-size: 12px; }

/* perms */
.perm-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; margin: 0 -6px; }
.perm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 9px;
}
.perm-row:hover { background: var(--panel-2); }
.perm-row code { font-family: var(--mono); font-size: 12px; color: #cfe0f5; word-break: break-all; }
.perm-row .pill { margin-left: auto; flex: none; }
.perm-row .icon-btn { flex: none; }
.perm-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; }

/* side */
.rank-list { display: flex; flex-direction: column; gap: 8px; max-height: none; }
.rank-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); overflow: hidden; }
.rank-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; background: transparent; border: 0; color: var(--fg);
  font: inherit; cursor: pointer; text-align: left;
}
.rank-head:hover { background: var(--panel-3); }
.rank-name { font-weight: 700; }
.rank-weight {
  font-size: 10px; font-family: var(--mono); color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
}
.rank-count { margin-left: auto; font-size: 11px; color: var(--muted); }
.rank-head .ic { transition: transform .18s; color: var(--muted); }
.rank-card.open .rank-head .ic { transform: rotate(180deg); }
.rank-body { display: none; padding: 0 12px 12px; }
.rank-card.open .rank-body { display: block; }
.rank-prefix { margin-bottom: 8px; font-weight: 600; }
.rank-perms { display: flex; flex-wrap: wrap; gap: 4px; }
.rank-perms code {
  font-family: var(--mono); font-size: 10.5px; color: #a9bdd8;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 5px; padding: 2px 6px; word-break: break-all;
}
.rank-none { font-size: 12px; color: var(--muted); }

/* mc colors */
.mc-obf { opacity: .75; }
.mc-0 { color: #000; } .mc-1 { color: #0000aa; } .mc-2 { color: #00aa00; } .mc-3 { color: #00aaaa; }
.mc-4 { color: #aa0000; } .mc-5 { color: #aa00aa; } .mc-6 { color: #ffaa00; } .mc-7 { color: #aaaaaa; }
.mc-8 { color: #555555; } .mc-9 { color: #5555ff; } .mc-a { color: #55ff55; } .mc-b { color: #55ffff; }
.mc-c { color: #ff5555; } .mc-d { color: #ff55ff; } .mc-e { color: #ffff55; } .mc-f { color: #ffffff; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 20px);
  max-width: min(92vw, 560px);
  padding: 12px 18px; border-radius: 13px;
  background: #101827; border: 1px solid var(--line);
  box-shadow: 0 26px 60px -20px #000;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  font-size: 13px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(52, 211, 153, .5); }
.toast.err { border-color: rgba(248, 113, 113, .55); color: #ffc4c4; }

/* modal */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(4, 7, 12, .72);
  backdrop-filter: blur(6px);
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, #172134, #0f1623);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: rise .18s ease;
}
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.modal-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .3);
  color: #ff9d9d; margin-bottom: 14px;
}
.modal-card h3 { margin: 0 0 8px; font-size: 17px; }
.modal-card p { margin: 0; font-size: 13px; }

/* responsive */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .side-col { position: static; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 14px; gap: 10px; }
  .topbar .status { order: 3; width: 100%; justify-content: center; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions .btn span { display: none; }
  .layout { padding: 14px 12px 70px; gap: 14px; }
  .card { padding: 15px; border-radius: 14px; }
  .player-name { font-size: 19px; }
  .player-badges { width: 100%; justify-content: flex-start; margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .w-prio, .form-grid .w-value { max-width: none; }
  .search-row { flex-wrap: wrap; }
  .search-row .btn { width: 100%; }
  .filter { max-width: 150px; }
  .login-card { padding: 24px 20px 18px; }
}

/* ───────────── dashboard tabs / views ───────────── */
.tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 4px; border-radius: 12px;
  background: rgba(13, 19, 30, .7); border: 1px solid var(--line-soft);
}
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}
.tab .ic { width: 15px; height: 15px; opacity: .8; }
.tab:hover { color: var(--fg); background: var(--panel-2); }
.tab.active {
  color: #d7fff9; background: rgba(55, 215, 196, .12);
  border-color: rgba(55, 215, 196, .28);
}
.tab.active .ic { opacity: 1; color: var(--accent); }

.app-main { max-width: 1360px; margin: 0 auto; }
.view { padding: 22px 24px 80px; display: flex; flex-direction: column; gap: 18px; }
#viewPerms .layout { padding: 0; margin: 0; max-width: none; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px; }
.stat-icon {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--accent);
}
.stat-icon .ic { width: 19px; height: 19px; }
.stat-body { min-width: 0; flex: 1; }
.stat-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 20px; font-weight: 750; letter-spacing: -.01em; margin-top: 2px; white-space: nowrap; }
.stat-dim { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot.big { width: 11px; height: 11px; }
.bad-text { color: var(--bad) !important; }

/* power */
.power-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.power { padding: 13px 10px; font-weight: 600; }
.btn.success {
  background: linear-gradient(180deg, #4ade80, #22c55e);
  border-color: transparent; color: #052e16; font-weight: 700;
  box-shadow: 0 10px 26px -14px rgba(34, 197, 94, .9);
}
.btn.success:hover { filter: brightness(1.07); background: linear-gradient(180deg, #6ee7a0, #2dd46b); }
.power-hint { margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.power-result {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  font-size: 12.5px; border: 1px solid var(--line); background: var(--panel);
  color: var(--fg); word-break: break-word;
}
.power-result.ok { border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .08); color: #b7f0d6; }
.power-result.err { border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); color: #ffc1c1; }

.badge-soft {
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-size: 10.5px; font-family: var(--mono); color: var(--muted);
  max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.sm { padding: 7px 10px; font-size: 12px; border-radius: 9px; }
.btn.sm .ic { width: 14px; height: 14px; }

/* kv */
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* console / terminal */
.console-card { display: flex; flex-direction: column; }
.terminal {
  margin: 0; padding: 13px 14px; border-radius: 12px;
  background: #05080e; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  color: #cfe0f5; overflow: auto; min-height: 180px; max-height: 52vh;
  white-space: pre-wrap; word-break: break-word;
}
.quick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.quick {
  padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--muted); font-family: var(--mono); font-size: 11.5px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.quick:hover { color: var(--accent); border-color: rgba(55, 215, 196, .5); background: var(--panel-3); }
.console-form { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.console-form .prompt { color: var(--accent); font-family: var(--mono); font-size: 17px; font-weight: 700; }
.console-form input { flex: 1; font-family: var(--mono); }
.console-form .btn { flex: none; }
.console-hint { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.t-line { min-height: 1.55em; }
.t-line.cmd { color: var(--accent); font-weight: 600; }
.t-line.err { color: #ffb0b0; }
.t-line.sys { color: var(--muted); }

/* logs */
.logs-head { flex-wrap: wrap; align-items: flex-start; }
.logs-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini-select { width: auto; padding: 7px 30px 7px 10px; font-size: 12px; border-radius: 9px; }
.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); }
.logs-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; font-family: var(--mono); }
.terminal.logs { max-height: 62vh; min-height: 320px; }
.log-line { display: flex; gap: 12px; }
.log-n {
  flex: none; width: 42px; text-align: right;
  color: #44546e; user-select: none; font-size: 11px;
}
.log-t { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.terminal.config { max-height: 64vh; min-height: 260px; white-space: pre; }

/* responsive additions */
@media (max-width: 1180px) {
  .tabs { order: 5; width: 100%; overflow-x: auto; justify-content: flex-start; }
  .topbar { gap: 12px; }
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .view { padding: 14px 12px 70px; gap: 14px; }
  .stat-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 14px; }
  .power-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 3px; }
  .kv dt { margin-top: 8px; }
  .console-form { flex-wrap: wrap; }
  .console-form input { flex-basis: 100%; order: 2; }
  .console-form .prompt { order: 1; }
  .console-form .btn { order: 3; width: 100%; }
  .logs-tools { width: 100%; }
  .logs-tools .filter { max-width: none; flex: 1; }
  .terminal { font-size: 11.5px; }
}
