/* ============ Server-Manager dark theme ============ */
:root {
  --bg: #0b0d12;
  --bg-1: #11141b;
  --bg-2: #161a23;
  --bg-3: #1d222d;
  --surface: #161a23;
  --surface-hover: #1f2531;
  --border: #262c3a;
  --border-soft: #1e232f;
  --text: #e7eaf1;
  --text-dim: #9aa3b5;
  --text-faint: #687085;
  --accent: #6366f1;
  --accent-hover: #7c7ef5;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.15);
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --gray: #6b7280;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.25);
  --sidebar-w: 248px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --accent-glow: rgba(99, 102, 241, 0.08);
  --teal-glow: rgba(45, 212, 191, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--accent-glow), transparent),
    radial-gradient(900px 500px at -10% 110%, var(--teal-glow), transparent),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b3242; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #3a4356; background-clip: content-box; }

/* ============ Layout ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-1), var(--bg));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.sidebar-brand .logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  color: #fff;
}
.sidebar-brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-faint); letter-spacing: 0; }

.nav { padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); padding: 16px 12px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-hover); }
.nav-item.active svg { color: var(--accent-hover); }

.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.user-chip .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: grid; place-items: center; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-chip .meta { flex: 1; min-width: 0; }
.user-chip .meta b { display: block; font-size: 13px; }
.user-chip .meta span { font-size: 11px; color: var(--text-faint); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(11, 13, 18, 0.7);
}
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.topbar .sub { font-size: 13px; color: var(--text-faint); font-weight: 400; }
.content { padding: 28px; flex: 1; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text);
  font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: #36405a; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #04231f; }
.btn-teal:hover { filter: brightness(1.1); }
.btn-danger { background: transparent; border-color: rgba(239, 68, 68, 0.4); color: #f87171; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.12); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-icon { padding: 8px; }
.btn-icon svg { width: 17px; height: 17px; }

.btn-group { display: inline-flex; gap: 8px; }

/* ============ Cards ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--text-faint); }

.grid { display: grid; gap: 18px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Stat card */
.stat {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.stat .label { font-size: 12px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -0.03em; }
.stat .ico {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-hover);
}
.stat.teal .ico { background: var(--teal-soft); color: var(--teal); }
.stat .foot { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* ============ Badges ============ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
  text-transform: capitalize;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-running { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.badge-running .dot { box-shadow: 0 0 8px #22c55e; animation: pulse 1.6s infinite; }
.badge-stopped { background: rgba(107, 114, 128, 0.18); color: #9aa3b5; }
.badge-starting, .badge-stopping { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }
.badge-starting .dot { animation: pulse 1s infinite; }
.badge-crashed, .badge-error { background: rgba(239, 68, 68, 0.14); color: #f87171; }
.badge-unknown, .badge-offline { background: rgba(107, 114, 128, 0.18); color: #9aa3b5; }
.badge-online { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ============ Server cards ============ */
.server-card { display: flex; flex-direction: column; cursor: pointer; transition: all 0.15s; overflow: hidden; }
.server-card:hover { border-color: #36405a; transform: translateY(-2px); box-shadow: var(--shadow); }
.server-card .sc-top { display: flex; align-items: center; gap: 14px; padding: 18px 18px 14px; }
.server-card .sc-icon {
  width: 46px; height: 46px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 24px;
  background: var(--bg-3); border: 1px solid var(--border);
}
.server-card .sc-name { font-weight: 700; font-size: 15px; }
.server-card .sc-meta { font-size: 12px; color: var(--text-faint); }
.server-card .sc-body { padding: 0 18px 14px; display: flex; gap: 18px; }
.server-card .sc-stat { font-size: 12px; }
.server-card .sc-stat b { display: block; font-size: 14px; color: var(--text); }
.server-card .sc-stat span { color: var(--text-faint); }
.server-card .sc-actions { display: flex; gap: 6px; padding: 12px 18px; border-top: 1px solid var(--border-soft); background: var(--bg-1); }
.server-card .sc-actions .btn { flex: 1; }

/* ============ Tables ============ */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table .mono { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

/* ============ Forms ============ */
.field { margin-bottom: 16px; }
.field label:not(.toggle) { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.input, .select, textarea.input {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-faint); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239aa3b5' stroke-width='2'%3E%3Cpath d='M3 5l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.field-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; }
.field-row { display: flex; gap: 14px; }
.field-row > .field { flex: 1; }

/* toggle */
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.field > .toggle { margin-top: 20px; }

/* installer wizard — category choice cards */
.choice-grid { display: flex; flex-direction: column; gap: 10px; }
.choice-card { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); cursor: pointer; transition: border 0.15s, background 0.15s, transform 0.1s; }
.choice-card:hover { border-color: var(--accent); background: var(--surface-hover); transform: translateY(-1px); }
.choice-emoji { font-size: 28px; flex-shrink: 0; width: 40px; text-align: center; }
.choice-title { font-size: 15px; font-weight: 700; }
.choice-desc { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }

/* server.properties editor rows */
.prop-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.prop-row:last-child { border-bottom: none; }
.prop-key { flex: 0 0 240px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); font-family: var(--mono); word-break: break-all; }
.prop-control { flex: 1; min-width: 0; }
.prop-control .input { width: 100%; }
@media (max-width: 640px) {
  .prop-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .prop-key { flex-basis: auto; }
}
.toggle input { display: none; }
.toggle .track { width: 40px; height: 22px; border-radius: 99px; background: var(--bg-3); border: 1px solid var(--border); position: relative; transition: 0.15s; flex-shrink: 0; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-dim); transition: 0.15s; }
.toggle input:checked + .track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(18px); background: #fff; }
.toggle .label { font-size: 13px; font-weight: 500; }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fade 0.15s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%; max-width: 520px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal.wide { max-width: 720px; }
/* VNC display modal: near-full-width so the guest screen has room to breathe. */
.modal.modal-vnc { max-width: min(1200px, 96vw); width: 96vw; }
.modal.modal-vnc .modal-body { padding: 14px; }
/* The screen element itself is drag-resizable; when fullscreened it fills the
   whole display (the UA gives :fullscreen 100%/100%, we just drop the radius). */
.vnc-screen:fullscreen { width: 100vw; height: 100vh; border-radius: 0; resize: none; }
.vnc-screen:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; resize: none; }
@keyframes pop { from { transform: scale(0.95) translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border-soft); }
.modal-close { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--surface-hover); color: var(--text); }

/* ============ Toast ============ */
#toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  min-width: 260px; max-width: 380px;
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 11px;
  animation: slidein 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.toast.out { animation: slideout 0.2s forwards; }
@keyframes slidein { from { transform: translateX(120%); opacity: 0; } }
@keyframes slideout { to { transform: translateX(120%); opacity: 0; } }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.info { border-left-color: var(--accent); }
.toast .t-ico { flex-shrink: 0; margin-top: 1px; }
.toast.success .t-ico { color: var(--green); }
.toast.error .t-ico { color: var(--red); }
.toast .t-body { font-size: 13px; }
.toast .t-title { font-weight: 600; }
.toast .t-msg { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }

/* ============ Tabs ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab {
  padding: 11px 16px;
  font-weight: 600; font-size: 13.5px;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-hover); border-bottom-color: var(--accent); }

/* ============ Terminal / Console ============ */
.terminal {
  background: #07090d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  height: 540px;
  overflow: hidden;
}
.term-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-line { color: #c8d0de; }
.term-line.sys { color: var(--accent-hover); }
.term-line.err { color: #f87171; }
.term-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg-1); }
.term-input-row .prompt { color: var(--teal); font-family: var(--mono); align-self: center; font-weight: 600; }
.term-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--mono); font-size: 13px; padding: 9px 12px;
}
.term-input:focus { outline: none; border-color: var(--accent); }

/* player list */
.player-list { display: flex; flex-direction: column; }
.player-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border-soft); }
.player-row:last-child { border-bottom: none; }
.player-row .pl-av { width: 32px; height: 32px; border-radius: 7px; flex-shrink: 0; background: var(--bg-3); image-rendering: pixelated; }
.player-row .pl-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .player-row .btn span, .player-row .btn { font-size: 11px; } .player-row .btn { padding: 5px 8px; } }

/* per-server live CPU/RAM strip */
.srv-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.srv-stat {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.srv-stat .ss-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent-hover); }
.srv-stat .ss-ico.teal { background: var(--teal-soft); color: var(--teal); }
.srv-stat .ss-body { min-width: 64px; }
.srv-stat .ss-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 600; }
.srv-stat .ss-body b { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.tps-row { display: flex; align-items: baseline; gap: 5px; }
.tps-mspt { font-size: 11px; color: var(--text-faint); }
.spark-host { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
.spark, .spark svg { display: block; width: 100%; max-width: 180px; height: 36px; }

/* console toolbar + quick-command chips */
.term-toolbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.term-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 11px; flex: 1; min-width: 180px; max-width: 340px; color: var(--text-faint);
  transition: border 0.15s, box-shadow 0.15s;
}
.term-search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--accent-hover); }
.term-search-wrap svg { flex: 0 0 auto; }
.term-search { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 13px; padding: 8px 0; font-family: inherit; }
.term-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.cmd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cmd-chip {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text-dim);
  font-size: 12px; font-weight: 600; padding: 5px 13px; border-radius: 99px;
  cursor: pointer; transition: 0.13s; font-family: inherit;
}
.cmd-chip:hover { border-color: var(--accent); color: var(--text); background: var(--surface-hover); transform: translateY(-1px); }

/* list toolbar (servers search + status filter) */
.list-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 12px; flex: 1; min-width: 200px; max-width: 360px; color: var(--text-faint);
  transition: border 0.15s, box-shadow 0.15s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--accent-hover); }
.search-box .input { border: none; background: none; padding: 9px 0; }
.search-box .input:focus { box-shadow: none; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 12.5px; font-weight: 600; padding: 6px 14px; border-radius: 6px;
  cursor: pointer; transition: 0.13s; font-family: inherit;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent); color: #fff; }

/* ============ Gauge ============ */
.gauge-wrap { display: flex; align-items: center; gap: 16px; }
.gauge { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.gauge .gv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
.gauge .gv b { font-size: 22px; font-weight: 800; line-height: 1; }
.gauge .gv span { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; line-height: 1; }

/* ============ File browser ============ */
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; margin-bottom: 14px; }
.breadcrumb .crumb { color: var(--accent-hover); cursor: pointer; padding: 3px 6px; border-radius: 5px; }
.breadcrumb .crumb:hover { background: var(--surface-hover); }
.breadcrumb .sep { color: var(--text-faint); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); cursor: pointer; transition: 0.12s; }
.file-row:hover { background: var(--surface-hover); }
.file-row .f-ico { color: var(--text-dim); display: grid; place-items: center; }
.file-row .f-ico.dir { color: var(--teal); }
.file-row .f-name { flex: 1; font-size: 13.5px; }
.file-row .f-meta { font-size: 12px; color: var(--text-faint); }
.file-row .f-del { opacity: 0; }
.file-row:hover .f-del { opacity: 1; }

/* ============ Misc ============ */
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.copy-box { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.copy-box code { flex: 1; color: var(--teal); }

/* empty / loading */
.empty { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty .e-ico { font-size: 44px; opacity: 0.6; margin-bottom: 12px; }
.empty h3 { color: var(--text-dim); font-size: 16px; margin-bottom: 6px; font-weight: 600; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner.big { width: 38px; height: 38px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: grid; place-items: center; padding: 60px; }
/* ── initial boot screen (replaced by login or dashboard once JS loads) ── */
.boot-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 24px; opacity: 1; animation: fade 0.3s ease both;
}
.boot-logo {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 24px rgba(99,102,241,0.35);
}
.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ Login ============ */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-logo .logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), var(--teal)); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45); color: #fff; }
.login-logo h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.login-logo p { color: var(--text-faint); font-size: 13px; }
.login-err { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #f87171; padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }

/* dashboard: node gauges + server overview */
.gauges-row { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; align-items: center; }
.node-foot { text-align: center; color: var(--text-faint); font-size: 12.5px; margin-top: 16px; }
.node-net { text-align: center; color: var(--text-dim); font-size: 12.5px; margin-top: 5px; font-family: var(--mono); }
.dash-srv-list { display: flex; flex-direction: column; }
.dash-srv { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--border-soft); cursor: pointer; transition: background 0.12s; border-radius: 6px; }
.dash-srv:last-child { border-bottom: none; }
.dash-srv:hover { background: var(--surface-hover); }
.dash-srv .ds-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; background: var(--bg-3); border: 1px solid var(--border); flex-shrink: 0; }
.dash-srv .ds-main { flex: 1; min-width: 0; }
.dash-srv .ds-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-srv .ds-meta { font-size: 11.5px; color: var(--text-faint); }

.audit-feed { display: flex; flex-direction: column; }
.audit-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.audit-item:last-child { border-bottom: none; }
.audit-item .a-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.audit-item .a-act { font-weight: 600; font-size: 13px; }
.audit-item .a-meta { font-size: 12px; color: var(--text-faint); }

/* mobile */
.menu-btn { display: none; }
@media (max-width: 880px) {
  .sidebar { position: fixed; z-index: 60; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .content { padding: 18px; }
  .topbar { padding: 14px 18px; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 55; }
}

/* ---------- Updates view ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.kv-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row .kv-k { color: var(--text-dim); min-width: 90px; flex: 0 0 90px; }
.kv-row .kv-v { color: var(--text); word-break: break-word; }
.kv-row .kv-v code, code { font-family: var(--mono); background: var(--bg); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

.banner { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; border: 1px solid var(--border); }
.banner svg { flex: 0 0 auto; }
.banner.ok { background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.35); color: var(--green); }
.banner.warn { background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.35); color: var(--amber); }
.banner.err { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.35); color: var(--red); align-items: flex-start; }
.banner.err b { display: block; margin-bottom: 2px; }

.commit-list { display: flex; flex-direction: column; gap: 1px; margin-top: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.commit-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px;
  background: var(--surface); border-bottom: 1px solid var(--border-soft); }
.commit-row:last-child { border-bottom: 0; }
.commit-hash { font-family: var(--mono); color: var(--accent); font-size: 12px; padding-top: 2px; flex: 0 0 auto; }
.commit-body { min-width: 0; }
.commit-subject { font-size: 14px; color: var(--text); font-weight: 500; }
.commit-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
pre.mini { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); white-space: pre-wrap;
  word-break: break-word; margin: 6px 0 0; max-height: 160px; overflow: auto; }
.hr { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------- Mods browser ---------- */
.mod-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.mod-row:last-child { border-bottom: 0; }
.mod-icon { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: var(--bg); }
.mod-icon-ph { display: inline-flex; align-items: center; justify-content: center; color: var(--text-faint); border: 1px solid var(--border); }
.mod-main { flex: 1 1 auto; min-width: 0; }
.mod-title { font-weight: 600; color: var(--text); text-decoration: none; }
.mod-title:hover { color: var(--accent); }
.mod-desc { font-size: 13px; color: var(--text-dim); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mod-meta { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 2px 7px; border-radius: 999px; }

/* ============ Light theme ============ */
:root { --gauge-track: #1d222d; }
[data-theme="light"] {
  --bg: #eef1f7;
  --bg-1: #ffffff;
  --bg-2: #f3f5fa;
  --bg-3: #e8ecf4;
  --surface: #ffffff;
  --surface-hover: #eef1f7;
  --border: #d7dce7;
  --border-soft: #e7ebf2;
  --text: #161b26;
  --text-dim: #515b70;
  --text-faint: #828b9e;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --teal-soft: rgba(45, 212, 191, 0.16);
  --accent-glow: rgba(99, 102, 241, 0.06);
  --teal-glow: rgba(45, 212, 191, 0.05);
  --shadow: 0 10px 34px rgba(30, 41, 77, 0.14);
  --shadow-soft: 0 2px 12px rgba(30, 41, 77, 0.07);
  --gauge-track: #e4e8f1;
}
[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--accent-glow), transparent),
    radial-gradient(900px 500px at -10% 110%, var(--teal-glow), transparent),
    var(--bg);
}
[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.72); }
[data-theme="light"] .sidebar { background: linear-gradient(180deg, #ffffff, #f3f5fa); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c4ccdb; background-clip: content-box; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #aab4c8; background-clip: content-box; }
[data-theme="light"] .btn { background: #ffffff; }
[data-theme="light"] .btn:hover { background: #f1f4fa; border-color: #c4ccdb; }
/* consoles read better dark — keep the terminal dark in light mode */
[data-theme="light"] .term-input-row { background: #0b0d12; border-top-color: #1d222d; }
[data-theme="light"] .term-input { background: #07090d; border-color: #1d222d; color: #e7eaf1; }
/* badge text needs more contrast on light surfaces */
[data-theme="light"] .badge-running, [data-theme="light"] .badge-online { color: #15803d; }
[data-theme="light"] .badge-starting, [data-theme="light"] .badge-stopping { color: #b45309; }
[data-theme="light"] .badge-crashed, [data-theme="light"] .badge-error { color: #b91c1c; }
[data-theme="light"] .badge-stopped, [data-theme="light"] .badge-unknown, [data-theme="light"] .badge-offline { color: #475569; }

/* ============ Color picker panel ============ */
.color-panel {
  position: fixed;
  z-index: 300;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 12px;
  min-width: 210px;
}
.color-panel-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cp-label { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.color-swatch {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 2px;
  background: transparent;
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.1s;
}
.color-swatch:hover { border-color: var(--accent); transform: scale(1.1); }
.color-swatch::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
.color-swatch::-webkit-color-swatch { border: none; border-radius: 50%; }
.color-swatch::-moz-color-swatch { border: none; border-radius: 50%; }
.cp-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: flex-end;
}

/* ============ Command palette ============ */
.cmd-palette-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 20px 20px; animation: fade 0.12s;
}
.cmd-palette {
  width: 100%; max-width: 560px;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; max-height: 70vh;
  animation: pop 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.cmd-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); color: var(--text-faint); }
.cmd-input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 15px; font-family: inherit; }
.cmd-list { overflow-y: auto; padding: 6px; }
.cmd-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.cmd-row.sel { background: var(--accent-soft); }
.cmd-ico { color: var(--text-dim); display: grid; place-items: center; flex: 0 0 auto; }
.cmd-row.sel .cmd-ico { color: var(--accent-hover); }
.cmd-main { flex: 1; min-width: 0; }
.cmd-label { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-sub { font-size: 12px; color: var(--text-faint); }
.cmd-kind { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.cmd-empty { padding: 22px; text-align: center; color: var(--text-faint); }
.cmd-hint { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border-soft); font-size: 11.5px; color: var(--text-faint); }
kbd { font-family: var(--mono); background: var(--bg-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 11px; color: var(--text-dim); }

/* topbar search trigger */
.cmd-trigger { gap: 8px; color: var(--text-dim); font-weight: 500; padding: 7px 10px 7px 12px; }
.cmd-trigger:hover { color: var(--text); }
@media (max-width: 640px) { .cmd-trigger span, .cmd-trigger kbd { display: none; } }

/* ============ Virtualization (VMs & containers) ============ */
.vm-card .sc-icon {
  display: grid; place-items: center; border-radius: 10px;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--accent);
}
.vm-card .sc-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.vm-card:hover { border-color: #36405a; transform: translateY(-2px); box-shadow: var(--shadow); transition: 0.15s; }

/* engine availability chips (top of grid) */
.vm-engines { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2px; }
.vm-engine {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-faint);
}
.vm-engine .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.vm-engine.on { color: var(--text); border-color: rgba(45, 212, 191, 0.4); }
.vm-engine.on .dot { background: var(--teal); box-shadow: 0 0 8px var(--teal); }

/* no-backend banner */
.vm-banner {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface);
}
.vm-banner svg { flex-shrink: 0; margin-top: 2px; color: var(--amber); }
.vm-banner.warn { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.07); }
.vm-banner .faint { font-size: 12.5px; margin-top: 3px; }

/* spec chips inside a VM card */
.vm-specs { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 4px; }
.vm-spec { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.vm-spec svg { color: var(--text-faint); }
.vm-spec-ip { font-family: var(--mono); }
.vm-ip { color: var(--text); }
.vm-err {
  margin: 8px 0 2px; padding: 8px 10px; font-size: 12px; font-family: var(--mono);
  color: #fca5a5; background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 6px; word-break: break-word; max-height: 88px; overflow: auto;
}

/* create modal — multi-column form rows */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row:has(.field:nth-child(3)) { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* console / exec modal */
.vm-console {
  height: 340px; overflow-y: auto; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.vm-cline { color: var(--text); }
.vm-cline.cmd { color: var(--teal); }
.vm-cline.err { color: #fca5a5; }
.vm-cline.muted { color: var(--text-faint); }
.vm-console-bar { display: flex; gap: 8px; margin-top: 12px; }
.vm-console-bar .input { flex: 1; }

/* Android capability hint (which backend will actually boot on this host) */
.vm-android-note {
  grid-column: 1 / -1;
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); font-size: 13px;
}
.vm-android-note svg { flex-shrink: 0; margin-top: 1px; }
.vm-android-note .faint { font-size: 12px; margin-top: 2px; }
.vm-android-note.ok { border-color: rgba(45, 212, 191, 0.4); background: rgba(45, 212, 191, 0.07); }
.vm-android-note.ok svg { color: var(--teal); }
.vm-android-note.warn { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.07); }
.vm-android-note.warn svg { color: var(--amber); }

/* Backup progress bar */
.backup-progress { margin-bottom: .75rem; }
.backup-progress-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.backup-progress-fill {
  height: 100%; background: var(--accent); border-radius: 3px;
  width: 0; transition: width 0.35s ease;
}
.backup-progress-fill.indeterminate {
  width: 40% !important;
  animation: backup-slide 1.4s ease-in-out infinite;
}
@keyframes backup-slide {
  0%   { transform: translateX(-160%); }
  100% { transform: translateX(350%); }
}
.backup-progress-label { font-size: 0.72rem; color: var(--text-faint); margin-top: 4px; }
.backup-progress.failed .backup-progress-fill { background: var(--red); }
.backup-progress.failed .backup-progress-label { color: var(--red); }

/* SSH Terminal — tab layout */
.ssh-view {
  display: flex; flex-direction: column;
  height: calc(100vh - 120px); /* fill below page header */
  min-height: 420px;
}
.ssh-tab-bar {
  display: flex; align-items: stretch; gap: 2px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  padding: 8px 8px 0;
  flex-shrink: 0; overflow-x: auto;
}
.ssh-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 6px 6px 0 0;
  background: transparent;
  border: 1px solid transparent; border-bottom: none;
  cursor: pointer; font-size: 0.82rem; color: var(--text-dim);
  white-space: nowrap; position: relative; bottom: -1px;
  transition: background 0.12s, color 0.12s;
}
.ssh-tab:hover { background: var(--bg-3); color: var(--text); }
.ssh-tab.active {
  background: var(--bg); border-color: var(--border);
  border-bottom-color: var(--bg); color: var(--text);
}
.ssh-tab.closed { opacity: 0.55; }
.ssh-tab-ico { display: flex; align-items: center; opacity: 0.65; }
.ssh-tab-label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.ssh-tab-close {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 3px; margin-left: 2px;
  opacity: 0.45; cursor: pointer; flex-shrink: 0;
}
.ssh-tab-close:hover { opacity: 1; background: var(--bg-3); }
.ssh-tab-add {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; margin-left: auto; align-self: center; margin-bottom: 0;
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.8rem; color: var(--text-dim); cursor: pointer; white-space: nowrap;
}
.ssh-tab-add:hover { color: var(--text); background: var(--bg-3); }
.ssh-term-area { flex: 1; min-height: 0; position: relative; background: #0b0d12; }
.ssh-term-panel {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; padding: 4px;
}
.ssh-term-panel .xterm, .ssh-term-panel .xterm-viewport, .ssh-term-panel .xterm-screen { height: 100% !important; }
.ssh-locked {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 14px; color: var(--text-dim);
}
.ssh-locked svg { opacity: 0.3; }

/* TOTP input in login */
.totp-input {
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: 0.25em;
  text-align: center;
}

/* mb helper */
.mb { margin-bottom: 12px; }

/* ── Notification hooks ─────────────────────────────── */
.notif-hook-card { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--border); border-radius:8px; margin-bottom:8px; }
.notif-hook-info { flex:1; min-width:0; }
.notif-hook-name { font-weight:600; margin-bottom:2px; }
.notif-hook-meta { font-size:12px; color:var(--muted); }
.notif-event-chips { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.notif-chip { font-size:11px; padding:2px 7px; border-radius:99px; background:var(--surface2); color:var(--muted); border:1px solid var(--border); }
.notif-chip.active { background:rgba(99,102,241,0.15); color:var(--accent); border-color:rgba(99,102,241,0.3); }

/* ── Discord embed preview ──────────────────────────── */
.dc-preview { background:#313338; border-radius:8px; padding:16px; font-family:'gg sans','Noto Sans',Whitney,sans-serif; margin-top:12px; }
.dc-msg { display:flex; gap:16px; }
.dc-avatar { width:40px; height:40px; border-radius:50%; background:#6366f1; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; color:#fff; }
.dc-content { flex:1; min-width:0; }
.dc-meta { display:flex; align-items:baseline; gap:6px; margin-bottom:4px; }
.dc-bot-name { font-weight:600; color:#ffffff; font-size:15px; }
.dc-bot-tag { font-size:10px; padding:1px 5px; border-radius:3px; background:#5865f2; color:#fff; font-weight:600; text-transform:uppercase; }
.dc-ts { font-size:12px; color:#80848e; }
.dc-embed { border-left:4px solid #6366f1; background:#2b2d31; border-radius:0 4px 4px 0; padding:10px 14px; max-width:520px; }
.dc-embed-title { font-weight:600; color:#f2f3f5; font-size:15px; margin-bottom:4px; }
.dc-embed-desc { color:#dbdee1; font-size:14px; margin-bottom:8px; line-height:1.45; white-space:pre-wrap; }
.dc-embed-fields { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.dc-embed-field { min-width:120px; }
.dc-embed-field.inline { flex:1; }
.dc-field-name { font-size:12px; font-weight:700; color:#b5bac1; margin-bottom:2px; text-transform:uppercase; letter-spacing:.3px; }
.dc-field-value { font-size:14px; color:#dbdee1; }
.dc-embed-footer { font-size:12px; color:#80848e; margin-top:8px; padding-top:6px; border-top:1px solid #3f4147; }
.dc-mention { color:#989cf8; background:rgba(88,101,242,.2); border-radius:3px; padding:0 2px; }

/* ── User Management ─────────────────────────────────── */
.user-modal-body { display: flex; flex-direction: column; gap: 0; }
.user-form-top { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.perm-section { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.perm-section-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.perm-editor { display: flex; flex-direction: column; gap: 14px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.perm-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; }
.perm-list { display: flex; flex-direction: column; gap: 4px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); }
.perm-label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.perm-override-badge { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 99px; }
.perm-override-badge.granted { background: rgba(34,197,94,.15); color: #22c55e; }
.perm-override-badge.denied  { background: rgba(239,68,68,.12); color: var(--danger); }
.perm-default-badge { font-size: 10px; color: var(--muted); }
.perm-controls { display: flex; gap: 2px; }
.perm-btn { width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); transition: background .1s; }
.perm-btn:hover { background: var(--surface2); }
.perm-btn.active-grant { background: rgba(34,197,94,.2); border-color: #22c55e; color: #22c55e; }
.perm-btn.active-deny  { background: rgba(239,68,68,.2);  border-color: var(--danger); color: var(--danger); }
.perm-btn.active-default { background: var(--accent-muted); border-color: var(--accent); color: var(--accent); }

/* ── Linux login mode toggle ─────────────────────── */
.login-mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
}
.login-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.login-mode-btn.active {
  background: var(--accent);
  color: #fff;
}
.login-mode-btn:hover:not(.active) {
  background: var(--border);
  color: var(--text);
}

/* ── Settings view ─────────────────────────────────────────── */
.settings-view { max-width: 720px; }
.settings-card { padding: 22px; }
.settings-card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.settings-card-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
}
.settings-card-head h3 { margin: 0 0 2px; font-size: 16px; }
.settings-card-head p.muted { margin: 0; font-size: 13px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.settings-grid .field:nth-child(5) { grid-column: 1 / -1; }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.settings-divider { border: none; border-top: 1px solid var(--border); margin: 22px 0 18px; }
.settings-test > label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.settings-test-row { display: flex; gap: 10px; }
.settings-test-row .input { flex: 1; }
@media (max-width: 560px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-test-row { flex-direction: column; }
}
