/* Acme RMM console.
 *
 * One design system, dark by default: layered near-black surfaces, a single
 * accent (cyan), and a monospace face for anything numeric. The screen canvas is
 * the focal point, so everything around it stays quiet and low-contrast.
 */

:root {
  --bg: #08090c;
  --bg-2: #0b0d12;
  --panel: #10131a;
  --panel-2: #141821;
  --line: #1d222d;
  --line-2: #262d3b;

  --ink: #e8ecf4;
  --ink-2: #a3adbe;
  --ink-3: #6f7a8d;

  --accent: #4cc2ff;
  --accent-2: #2b8cff;
  --accent-dim: rgba(76, 194, 255, 0.12);
  --ok: #37d67a;
  --warn: #ffb02e;
  --bad: #ff5d5d;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(43, 140, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(76, 194, 255, 0.07), transparent 55%),
    var(--bg);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 10px; line-height: 1.55; }
strong { font-weight: 600; }

.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Brand ---------- */

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #04121d;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 6px 20px rgba(43, 140, 255, 0.35);
}

.brand h1 { font-size: 19px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em; }

/* ---------- Login ---------- */

.login-screen {
  position: relative;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.login-glow {
  position: absolute;
  inset: -30% 20% auto -10%;
  height: 70vh;
  background: radial-gradient(closest-side, rgba(76, 194, 255, 0.16), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: min(420px, 100%);
  padding: 30px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(22, 26, 35, 0.92), rgba(14, 17, 23, 0.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-card .brand { margin-bottom: 18px; }
.login-card label { font-size: 12px; color: var(--ink-2); margin-top: 8px; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: #0c0f15;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus, select:focus {
  border-color: rgba(76, 194, 255, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder { color: var(--ink-3); }

.select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.select.compact { padding: 6px 26px 6px 10px; font-size: 12px; border-radius: 999px; background-color: rgba(255,255,255,0.03); }

/* ---------- Buttons ---------- */

.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  background: linear-gradient(180deg, #1b2029, #141821);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:hover { border-color: #34405a; background: linear-gradient(180deg, #202633, #171c26); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); border-color: var(--line); }

.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #04121d;
  font-weight: 650;
}
.btn.primary:hover { filter: brightness(1.06); }

.btn.danger { background: rgba(255, 93, 93, 0.10); border-color: rgba(255, 93, 93, 0.28); color: #ffb4b4; }
.btn.danger:hover { background: rgba(255, 93, 93, 0.18); border-color: rgba(255, 93, 93, 0.45); }

.btn.wide { width: 100%; justify-content: center; margin-top: 14px; padding: 11px; }
.btn.small-btn { font-size: 12px; padding: 6px 10px; }
.btn.icon-btn.active { color: var(--accent); background: var(--accent-dim); border-color: rgba(76, 194, 255, 0.3); }

.danger-text { color: #ff9d9d !important; }

/* ---------- Shell ---------- */

.app { height: 100%; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 17, 0.72);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 20;
}

.topbar-center { flex: 1; display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.pill.online { color: #b7f5d0; border-color: rgba(55, 214, 122, 0.28); background: rgba(55, 214, 122, 0.10); }
.pill.offline { color: var(--ink-3); }

.led {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.pill.online .led { background: var(--ok); box-shadow: 0 0 0 3px rgba(55, 214, 122, 0.16); animation: pulse 2.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(55, 214, 122, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(55, 214, 122, 0.05); }
}

.layout { flex: 1; display: flex; min-height: 0; }

/* ---------- Sidebar ---------- */

.sidebar {
  width: 320px;
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 19, 26, 0.7), rgba(10, 12, 17, 0.5));
}

.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
.sidebar-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); }

.badge {
  min-width: 24px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(76, 194, 255, 0.2);
}

.chips { display: flex; gap: 6px; padding: 0 18px 10px; }

.chip {
  font: inherit;
  font-size: 12px;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip span { opacity: 0.7; margin-left: 3px; }
.chip:hover { color: var(--ink-2); border-color: var(--line-2); }
.chip.active { color: var(--ink); border-color: rgba(76, 194, 255, 0.35); background: var(--accent-dim); }

.filter-wrap { padding: 0 18px 12px; }
.filter { width: 100%; font-size: 13px; padding: 9px 12px; }

.device-list {
  list-style: none;
  margin: 0;
  padding: 0 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.device-list li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.device-list li:hover { background: rgba(255, 255, 255, 0.035); }
.device-list li.active { background: rgba(76, 194, 255, 0.09); border-color: rgba(76, 194, 255, 0.22); }
.device-list li.offline { opacity: 0.55; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: 0 0 8px; }
.dot.online { background: var(--ok); box-shadow: 0 0 8px rgba(55, 214, 122, 0.6); }

.dev-main { min-width: 0; flex: 1; }
.dev-name { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.dev-when { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }

.sidebar-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }

/* ---------- Stage ---------- */

.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 40px;
}

.empty-art { position: relative; width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 8px; }
.empty-ring {
  position: absolute; inset: 0;
  border-radius: 28px;
  border: 1px solid var(--line-2);
  background: radial-gradient(circle at 30% 20%, rgba(76, 194, 255, 0.14), transparent 65%);
  transform: rotate(8deg);
}
.empty-icon { font-size: 34px; color: var(--accent); opacity: 0.85; }
.empty h2 { font-size: 18px; }
.empty-hints { display: flex; gap: 16px; margin-top: 12px; color: var(--ink-3); font-size: 12px; }

kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-2);
  margin-right: 4px;
}

/* ---------- Viewer ---------- */

.viewer { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 14px; gap: 12px; overflow: hidden; }

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(16, 19, 26, 0.75);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}

.viewer-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.viewer-meta strong { display: block; font-size: 14px; }
.viewer-meta .tiny { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 10px rgba(255, 93, 93, 0.7); animation: pulse-bad 2s infinite; }
@keyframes pulse-bad { 50% { opacity: 0.35; } }

.viewer-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.stream-settings { display: flex; gap: 6px; margin-right: 4px; }

.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #12151d;
  box-shadow: var(--shadow);
  z-index: 30;
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 13px;
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.menu button:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }

/* ---------- Session controls ---------- */

.session-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(16, 19, 26, 0.55);
}

.ctrl-cluster { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctrl-caption {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 2px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.toggle-dot {
  width: 26px;
  height: 15px;
  border-radius: 999px;
  background: #2a3140;
  position: relative;
  transition: background 0.18s ease;
  flex: 0 0 26px;
}
.toggle-dot::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #8b95a7;
  transition: transform 0.18s ease, background 0.18s ease;
}
.toggle.on { color: var(--ink); border-color: rgba(55, 214, 122, 0.32); background: rgba(55, 214, 122, 0.08); }
.toggle.on .toggle-dot { background: rgba(55, 214, 122, 0.85); }
.toggle.on .toggle-dot::after { transform: translateX(11px); background: #05210f; }
.toggle:active { transform: translateY(1px); }

.maint-cluster { gap: 6px; }

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
}
.check-inline input { accent-color: var(--warn); width: 14px; height: 14px; margin: 0; }

.maint-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 176, 46, 0.3);
  background: linear-gradient(90deg, rgba(255, 176, 46, 0.12), rgba(255, 176, 46, 0.04));
}
.maint-banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.maint-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 3px 7px;
  border-radius: 4px;
  color: #1a1100;
  background: var(--warn);
}

.clip-text {
  flex: 1;
  resize: none;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  min-height: 90px;
}

.notice {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: #ffe1ad;
  background: rgba(255, 176, 46, 0.09);
  border: 1px solid rgba(255, 176, 46, 0.25);
}

/* ---------- Canvas ---------- */

.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 120px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, #0a0c11, #07080b),
    repeating-conic-gradient(#0c0e14 0% 25%, #0a0c11 0% 50%) 0 0 / 18px 18px;
  overflow: hidden;
  outline: none;
}

.canvas-wrap:focus { border-color: rgba(76, 194, 255, 0.4); }

#screen {
  display: block;
  max-width: 100%;
  max-height: 100%;
  background: #000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  cursor: default;
}

.canvas-wrap.no-cursor #screen { cursor: none; }

.control-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink);
  background: rgba(12, 15, 21, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  pointer-events: none;
  opacity: 0.9;
}

.hud-item { display: inline-flex; align-items: baseline; gap: 5px; }
.hud-item i { font-style: normal; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-size: 9.5px; }
.hud-item b { color: var(--ink); font-weight: 600; font-size: 12px; }
.hud-item em { font-style: normal; color: var(--ink-3); font-size: 9.5px; }
.hud-sep { width: 1px; height: 12px; background: rgba(255, 255, 255, 0.1); }

.latency-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  background: rgba(8, 10, 14, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

/* ---------- Toolbox ---------- */

.toolbox {
  flex: 0 0 clamp(170px, 30vh, 260px);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(16, 19, 26, 0.6);
  overflow: hidden;
}

.tabs { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); }

.tab {
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-3);
  background: none;
  border: 0;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.tab:hover { color: var(--ink-2); background: rgba(255, 255, 255, 0.04); }
.tab.active { color: var(--ink); background: rgba(255, 255, 255, 0.07); }

.panels { flex: 1; min-height: 0; position: relative; }
.panel { position: absolute; inset: 0; display: none; flex-direction: column; gap: 8px; padding: 10px; }
.panel.active { display: flex; }

.console {
  flex: 1;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #c9d3e3;
  background: #0a0c11;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.shell-input { display: flex; align-items: center; gap: 8px; }
.shell-input .prompt { color: var(--accent); font-family: var(--mono); }
.shell-input input { flex: 1; font-family: var(--mono); font-size: 12.5px; }

.file-nav { display: flex; gap: 8px; }
.file-nav input { flex: 1; font-family: var(--mono); font-size: 12.5px; }

.file-list { flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #0a0c11; }

.info-pre {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #0a0c11;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: #c9d3e3;
  white-space: pre-wrap;
}

.power-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 9, 0.7);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #12161e, #0c0f15);
  box-shadow: var(--shadow);
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head h2 { font-size: 17px; }
.modal-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin-bottom: 8px; }

.artifact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }

.artifact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.artifact.na { opacity: 0.45; }
.artifact .name { font-family: var(--mono); font-size: 12px; margin-bottom: 4px; }
.artifact .meta { font-size: 11px; color: var(--ink-3); margin-bottom: 8px; }
.artifact .actions { display: flex; gap: 6px; }

.art-kind {
  flex: 0 0 auto;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.06);
}
.art-kind.exe { color: #9fe0ff; background: rgba(76, 194, 255, 0.12); }
.art-kind.msi { color: #c9b6ff; background: rgba(160, 120, 255, 0.14); }
.art-main { flex: 1; min-width: 0; }
.art-name { font-family: var(--mono); font-size: 12px; }
.art-sub { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Toolbox rows (shared by the file browser and process list) */
.file-list .file-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
}
.file-list .file-row:hover { background: rgba(255, 255, 255, 0.03); }
.file-list .file-row.dir { cursor: pointer; color: #cfe6ff; }
.file-list .file-row .size { color: var(--ink-3); font-family: var(--mono); font-size: 11px; }

.console .cmd { color: var(--accent); }
.console .err { color: #ff9d9d; }

.script-row { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.script-select { min-width: 190px; }
.script-pre { max-height: 240px; }

/* ---------- Settings ---------- */

.settings-card { width: min(880px, 100%); }

.settings-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.settings-panel {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}
.settings-panel h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.settings-panel h4 { font-size: 13px; margin-bottom: 10px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 11.5px; color: var(--ink-3); }
.field input, .field select { width: 100%; }

.readonly {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
}

.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

.users-panel { margin-top: 16px; }

.user-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

.user-wrap { display: flex; flex-direction: column; }
.user-wrap .user-row { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.user-wrap .user-row:only-child { border-radius: var(--radius-sm); }

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.user-avatar {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 650;
  font-size: 13px;
  color: #04121d;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
}

.user-main { flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 550; display: flex; align-items: center; gap: 8px; }
.user-email { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.role-tag {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.07);
}
.role-tag.admin { color: #ffd9a0; background: rgba(255, 176, 46, 0.14); }
.role-tag.tech { color: #a9e3ff; background: rgba(76, 194, 255, 0.13); }
.role-tag.viewer { color: #cfd6e4; }

.user-reset {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px 12px;
  margin-top: -4px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: rgba(255, 255, 255, 0.012);
}
.user-reset input { flex: 1; }

.create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
}
.create-grid .field { margin-bottom: 0; }

/* Username / email / role on the first row, password plus the action on the
   second, so no field is squeezed into an unusable width. */
.create-grid .field:nth-child(4) { grid-column: span 2; }
.create-grid #nu-add { grid-column: span 1; justify-self: stretch; }

@media (max-width: 760px) {
  .settings-cols { grid-template-columns: 1fr; }
  .create-grid { grid-template-columns: 1fr 1fr; }
  .create-grid .field:nth-child(4) { grid-column: 1 / -1; }
  .create-grid #nu-add { grid-column: 1 / -1; }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink);
  background: #171c26;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 80;
  max-width: 70vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 93, 93, 0.4); color: #ffb4b4; }

.error { color: #ff9d9d; font-size: 12.5px; min-height: 18px; margin: 6px 0 0; }

/* ---------- Scrollbars ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232936; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2e3648; background-clip: padding-box; border: 2px solid transparent; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .sidebar { width: 260px; flex-basis: 260px; }
  .toolbox { height: 210px; flex-basis: 210px; }
}

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; flex: 0 0 45%; border-right: 0; border-bottom: 1px solid var(--line); }
  .viewer-actions { justify-content: flex-start; }
}
