/* =====================================================================
   PELLE CORE — theme
   Every layout / colour value is a named variable below.
   Change a number here, refresh, done.
   ===================================================================== */
:root {
  /* ---- palette ---- */
  --bg: #02030a;
  --neon: #00d4ff;
  --neon-2: #2f6bff;
  --neon-3: #8a5cff;
  --ok: #19f0a5;
  --warn: #ffb020;
  --danger: #ff3d6e;
  --text: #d7ecff;
  --text-strong: #f2fbff;
  --muted: #7f98b8;
  --line: rgba(0, 200, 255, .14);

  /* ---- glass ---- */
  --card-bg: rgba(5, 12, 30, .58);
  --card-blur: 14px;
  --card-border: rgba(0, 200, 255, .22);
  --glow: 0 0 28px rgba(0, 160, 255, .16);
  --radius: 16px;
  --radius-sm: 10px;

  /* ---- layout ---- */
  --sidebar-width: 244px;
  --sidebar-width-collapsed: 72px;
  --topbar-height: 64px;
  --page-padding: 22px;
  --gap: 18px;
  --card-padding: 18px;
  --toolbar-height: 56px;

  /* ---- widgets ---- */
  --gauge-size: 138px;
  --gauge-stroke: 7;
  --chart-height: 210px;
  --file-tile-width: 148px;
  --file-row-height: 44px;
  --modal-width: min(1040px, 94vw);
  --modal-height: 82vh;
  --toast-width: 340px;

  /* ---- effects ---- */
  --scanline-opacity: .55;
  --tilt-perspective: 900px;
  --border-spin-seconds: 7s;

  --font: "Segoe UI", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px;
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
svg { display: block; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.r { text-align: right; }

/* ---------- background layers ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 125%, rgba(0, 110, 255, .22), transparent 55%),
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .78) 100%);
}
.scanlines {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: var(--scanline-opacity);
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 3px);
}

/* ---------- glass + animated neon border ---------- */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --ang: 360deg; } }
.glass {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(150%);
  backdrop-filter: blur(var(--card-blur)) saturate(150%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--glow), inset 0 0 0 1px rgba(255, 255, 255, .02);
  position: relative;
}
.card { padding: var(--card-padding); position: relative; }
.card::after, .login-card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: .75;
  background: conic-gradient(from var(--ang), transparent 0 68%, var(--neon) 84%, var(--neon-3) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin var(--border-spin-seconds) linear infinite;
}
.tilt { transition: transform .18s ease-out, box-shadow .2s; transform-style: preserve-3d; will-change: transform; }
.tilt:hover { box-shadow: 0 0 40px rgba(0, 190, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .03); }
.tilt::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 212, 255, .14), transparent 70%);
}
.tilt:hover::before { opacity: 1; }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--card-border); background: rgba(0, 190, 255, .06); color: var(--text-strong);
  font-weight: 600; letter-spacing: .02em; transition: .18s; white-space: nowrap;
}
.btn:hover { border-color: var(--neon); box-shadow: 0 0 18px rgba(0, 212, 255, .35); background: rgba(0, 190, 255, .12); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: linear-gradient(135deg, rgba(0, 212, 255, .85), rgba(47, 107, 255, .9)); border-color: transparent; color: #021018; }
.btn.primary:hover { box-shadow: 0 0 28px rgba(0, 212, 255, .65); filter: brightness(1.1); }
.btn.danger { border-color: rgba(255, 61, 110, .4); color: #ff8aa6; background: rgba(255, 61, 110, .08); }
.btn.danger:hover { border-color: var(--danger); box-shadow: 0 0 18px rgba(255, 61, 110, .45); background: rgba(255, 61, 110, .16); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.big { padding: 13px 20px; width: 100%; justify-content: center; font-size: 15px; }
.btn svg, .icon-btn svg { width: 17px; height: 17px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-sm);
  border: 1px solid transparent; color: var(--muted); transition: .15s; flex: none;
}
.icon-btn:hover { color: var(--neon); border-color: var(--card-border); background: rgba(0, 190, 255, .08); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.icon-btn.on { color: var(--neon); }
input, textarea, select {
  background: rgba(0, 10, 28, .7); border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%; outline: none; transition: .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(0, 212, 255, .15), 0 0 18px rgba(0, 212, 255, .2); }
select option { background: #05101f; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 14px; }
.field input { text-transform: none; letter-spacing: 0; font-size: 14.5px; color: var(--text-strong); }
.err { color: #ff8aa6; min-height: 20px; font-size: 13px; margin-bottom: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; box-shadow: 0 0 0 0 transparent; }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.bad { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.dot.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--card-border); color: var(--muted); font-size: 12.5px; background: rgba(0, 190, 255, .05); }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--card-border); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.pill.on { color: var(--ok); border-color: rgba(25, 240, 165, .4); }
.pill.on .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 1.6s infinite; }
.pill.off { color: var(--danger); border-color: rgba(255, 61, 110, .4); }
.pill.off .dot { background: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(25, 240, 165, 0); opacity: .6; } }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; border: 1px solid var(--card-border); color: var(--muted); }
.tag.ok { color: var(--ok); border-color: rgba(25, 240, 165, .4); }
.tag.bad { color: var(--danger); border-color: rgba(255, 61, 110, .45); }
.tag.warn { color: var(--warn); border-color: rgba(255, 176, 32, .45); }
.tag.blue { color: var(--neon); border-color: rgba(0, 212, 255, .4); }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 3; display: grid; place-items: center; padding: 20px; perspective: 1200px; }
.login-card { width: min(420px, 100%); padding: 34px 32px 30px; text-align: center; }
.login-card form { text-align: left; margin-top: 10px; }
.logo-wrap { display: grid; place-items: center; margin-bottom: 8px; }
.logo { width: 92px; height: 92px; filter: drop-shadow(0 0 16px rgba(0, 212, 255, .8)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(2deg); } }
.title { font-size: 30px; letter-spacing: .32em; font-weight: 300; color: var(--text-strong); text-shadow: 0 0 22px rgba(0, 212, 255, .7); }
.title span { color: var(--neon); font-weight: 800; }
.sub { color: var(--muted); font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; margin: 6px 0 14px; }
.boot { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; text-align: left; color: #54e0ff; min-height: 84px; margin: 0 0 16px; opacity: .85; white-space: pre-wrap; }

/* ---------- app shell ---------- */
.app {
  position: relative; z-index: 2; height: 100vh; padding: var(--page-padding); gap: var(--gap);
  display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}
.sidebar { display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); }
.brand-logo { width: 38px; height: 38px; filter: drop-shadow(0 0 8px rgba(0, 212, 255, .8)); flex: none; }
.brand-text b { display: block; letter-spacing: .22em; font-size: 14px; color: var(--text-strong); }
.brand-text small { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: 10px; }
.nav { display: grid; gap: 6px; }
.nav button {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--muted);
  font-weight: 600; letter-spacing: .03em; text-align: left; border: 1px solid transparent; transition: .18s; position: relative;
}
.nav button svg { width: 19px; height: 19px; flex: none; }
.nav button:hover { color: var(--text-strong); background: rgba(0, 190, 255, .07); }
.nav button.active {
  color: var(--neon); border-color: var(--card-border);
  background: linear-gradient(90deg, rgba(0, 212, 255, .16), rgba(0, 212, 255, .02));
  box-shadow: inset 3px 0 0 var(--neon), 0 0 22px rgba(0, 212, 255, .12);
}
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--text); font-weight: 600; }
.ver { color: var(--muted); padding: 0 8px; font-size: 11px; letter-spacing: .08em; }
.main { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; min-height: 0; }
.topbar { height: var(--topbar-height); flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.top-title h2 { font-size: 18px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--text-strong); text-shadow: 0 0 16px rgba(0, 212, 255, .45); }
.top-title small { color: var(--muted); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; }
.top-right { display: flex; gap: 10px; align-items: center; }
.views { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 6px 20px 2px; scrollbar-width: thin; scrollbar-color: rgba(0, 212, 255, .35) transparent; }
.views::-webkit-scrollbar { width: 8px; }
.views::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, .3); border-radius: 8px; }
.view { animation: viewIn .35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- dashboard ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.card-head h3 { font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-strong); font-weight: 700; }
.card-head h3 small { color: var(--muted); letter-spacing: .1em; font-weight: 500; margin-left: 6px; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.lg.cpu { --c: var(--neon); } .lg.mem { --c: var(--neon-3); } .lg.rx { --c: var(--ok); } .lg.tx { --c: var(--warn); }
.chart { width: 100%; height: var(--chart-height); display: block; }

.gauge-card { display: flex; align-items: center; gap: 16px; --gc: var(--neon); }
.gauge-card.warn { --gc: var(--warn); } .gauge-card.hot { --gc: var(--danger); }
.gauge-svg { width: var(--gauge-size); height: var(--gauge-size); flex: none; overflow: visible; }
.gauge-svg .g-track { fill: none; stroke: rgba(0, 200, 255, .1); stroke-width: var(--gauge-stroke); }
.gauge-svg .g-val { fill: none; stroke: var(--gc); stroke-width: var(--gauge-stroke); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1), stroke .4s; filter: drop-shadow(0 0 7px var(--gc)); }
.gauge-svg .g-ticks { fill: none; stroke: var(--gc); stroke-opacity: .35; stroke-width: 2; stroke-dasharray: 1.5 5.2; transform-origin: 60px 60px; animation: rot 24s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.gauge-num { font-family: var(--mono); font-size: 25px; font-weight: 700; fill: var(--text-strong); text-anchor: middle; dominant-baseline: central; }
.gauge-meta { min-width: 0; }
.gauge-meta .lbl { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gc); font-weight: 800; text-shadow: 0 0 12px var(--gc); }
.gauge-meta .big { font-family: var(--mono); font-size: 18px; color: var(--text-strong); margin: 5px 0 3px; }
.gauge-meta .small { color: var(--muted); font-size: 12px; line-height: 1.5; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; padding-top: 2px; }
.kv dd { color: var(--text-strong); font-family: var(--mono); font-size: 12.5px; word-break: break-word; }

.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px 12px; }
.core { font-size: 11px; color: var(--muted); }
.core .bar { height: 6px; margin-top: 4px; }
.bar { height: 8px; border-radius: 99px; background: rgba(0, 200, 255, .1); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; width: 0; background: linear-gradient(90deg, var(--neon-2), var(--neon)); box-shadow: 0 0 10px var(--neon); transition: width .6s; }
.bar.warn i { background: linear-gradient(90deg, #ff8a00, var(--warn)); box-shadow: 0 0 10px var(--warn); }
.bar.hot i { background: linear-gradient(90deg, #ff0050, var(--danger)); box-shadow: 0 0 10px var(--danger); }

.disks { display: grid; gap: 14px; }
.disk .row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12.5px; gap: 10px; }
.disk .row b { color: var(--text-strong); font-family: var(--mono); }
.disk .row span { color: var(--muted); font-family: var(--mono); font-size: 12px; }

.feed { display: grid; gap: 4px; }
.feed-row { display: grid; grid-template-columns: 150px 150px 1fr; gap: 12px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; align-items: center; }
.feed-row:nth-child(odd) { background: rgba(0, 190, 255, .035); }
.feed-row .t { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.feed-row .d { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; max-height: 60vh; scrollbar-width: thin; scrollbar-color: rgba(0, 212, 255, .3) transparent; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.tbl th { text-align: left; color: var(--muted); font-size: 10.8px; letter-spacing: .16em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(4, 10, 24, .95); z-index: 1; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid rgba(0, 200, 255, .06); font-family: var(--mono); font-size: 12.3px; }
.tbl tr:hover td { background: rgba(0, 200, 255, .05); }
.tbl tr.click { cursor: pointer; }
.tbl .r { text-align: right; }

/* ---------- toolbar / tabs ---------- */
.toolbar { min-height: var(--toolbar-height); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 14px; margin-bottom: var(--gap); flex-wrap: wrap; }
.tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; font-family: var(--mono); font-size: 13px; }
.crumbs button { padding: 5px 9px; border-radius: 7px; color: var(--text); }
.crumbs button:hover { background: rgba(0, 200, 255, .1); color: var(--neon); }
.crumbs .sep { color: var(--muted); }
.search { position: relative; width: 250px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input { padding-left: 34px; height: 38px; }
.tabs { display: flex; gap: 4px; }
.tabs button { padding: 8px 16px; border-radius: 9px; color: var(--muted); font-weight: 700; letter-spacing: .06em; border: 1px solid transparent; }
.tabs button:hover { color: var(--text-strong); }
.tabs button.active { color: var(--neon); border-color: var(--card-border); background: rgba(0, 212, 255, .1); }

/* ---------- files ---------- */
.selbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; margin-bottom: var(--gap); flex-wrap: wrap; border-color: rgba(0, 212, 255, .45); }
.sel-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.filebox { padding: 14px; min-height: 340px; position: relative; }
.files.grid-mode { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--file-tile-width), 1fr)); gap: 12px; }
.files.list-mode { display: grid; gap: 2px; }
.item {
  position: relative; border: 1px solid transparent; border-radius: 12px; user-select: none; transition: .15s; cursor: default;
}
.grid-mode .item { padding: 16px 10px 12px; text-align: center; display: grid; justify-items: center; gap: 8px; background: rgba(0, 190, 255, .03); }
.grid-mode .item:hover { transform: translateY(-3px) perspective(600px) rotateX(4deg); border-color: var(--card-border); box-shadow: 0 10px 28px rgba(0, 150, 255, .18); }
.item.selected { border-color: var(--neon) !important; background: rgba(0, 212, 255, .12) !important; box-shadow: 0 0 22px rgba(0, 212, 255, .25); }
.item .ico { width: 46px; height: 46px; display: grid; place-items: center; color: var(--neon); filter: drop-shadow(0 0 7px rgba(0, 212, 255, .6)); }
.item .ico svg { width: 100%; height: 100%; }
.item.dir .ico { color: #5aa8ff; } .item.img .ico { color: var(--ok); } .item.code .ico { color: var(--neon-3); } .item.arch .ico { color: var(--warn); }
.item .nm { font-size: 12.8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.item .meta { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.item .chk { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; accent-color: var(--neon); opacity: 0; transition: .15s; cursor: pointer; }
.item:hover .chk, .item.selected .chk { opacity: 1; }
.list-mode .item { display: grid; grid-template-columns: 26px 34px minmax(0, 1fr) 100px 150px 70px; align-items: center; gap: 10px; height: var(--file-row-height); padding: 0 12px; }
.list-mode .item:hover { background: rgba(0, 200, 255, .07); }
.list-mode .item .ico { width: 24px; height: 24px; filter: none; }
.list-mode .item .chk { position: static; opacity: .7; }
.list-mode .item .nm { text-align: left; }
.list-mode .item .meta.perm { text-align: right; }
.list-mode .item .meta.size { text-align: right; }
.grid-mode .item .meta.perm, .grid-mode .item .meta.date { display: none; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 70px 10px; letter-spacing: .1em; }
.statusbar { color: var(--muted); font-size: 12px; padding: 10px 6px 0; }
.drop-overlay { position: absolute; inset: 0; border-radius: inherit; display: none; place-items: center; text-align: center; background: rgba(2, 8, 24, .82); border: 2px dashed var(--neon); z-index: 5; color: var(--neon); box-shadow: inset 0 0 60px rgba(0, 212, 255, .3); }
.drop-overlay svg { width: 56px; height: 56px; margin: 0 auto 10px; }
.drop-overlay b { display: block; letter-spacing: .2em; text-transform: uppercase; font-size: 15px; }
.drop-overlay small { color: var(--muted); }
.filebox.dragging .drop-overlay { display: grid; }
.upload-bar { position: fixed; z-index: 60; left: 50%; bottom: 26px; transform: translateX(-50%); width: min(480px, 90vw); padding: 12px 16px; }
.ub-text { font-size: 12.5px; margin-bottom: 8px; font-family: var(--mono); }
.ub-track { height: 7px; border-radius: 99px; background: rgba(0, 200, 255, .12); overflow: hidden; }
.ub-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--neon-2), var(--neon)); box-shadow: 0 0 12px var(--neon); transition: width .15s; }

/* ---------- backups ---------- */
.backup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); }
.bk { padding: 16px 18px; display: grid; gap: 12px; }
.bk h4 { font-family: var(--mono); font-size: 12.6px; color: var(--text-strong); word-break: break-all; font-weight: 600; }
.bk .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bk .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bk .stats div { background: rgba(0, 190, 255, .05); border-radius: 9px; padding: 8px 10px; }
.bk .stats small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.bk .stats b { font-family: var(--mono); font-size: 13px; color: var(--text-strong); }
.job { padding: 12px 16px; margin-bottom: var(--gap); display: flex; align-items: center; gap: 14px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(0, 212, 255, .2); border-top-color: var(--neon); animation: rot .8s linear infinite; flex: none; }

/* ---------- modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0, 2, 10, .72); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fade .18s; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(var(--modal-w, 520px), 100%); max-height: var(--modal-height); display: flex; flex-direction: column; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); background: rgba(4, 10, 26, .92); }
.modal.wide { --modal-w: var(--modal-width); height: var(--modal-height); }
@keyframes pop { from { transform: translateY(18px) scale(.96); opacity: 0; } }
.modal > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 12px; }
.modal > header h3 { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 18px; overflow: auto; flex: 1; min-height: 0; }
.modal > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.modal > footer:empty { display: none; }
.editor { width: 100%; height: 100%; min-height: 50vh; resize: none; font-family: var(--mono); font-size: 13px; line-height: 1.6; tab-size: 2; white-space: pre; overflow: auto; }
.preview-img { max-width: 100%; max-height: 68vh; display: block; margin: 0 auto; border-radius: 10px; box-shadow: 0 0 40px rgba(0, 150, 255, .3); }
.logbox { font-family: var(--mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; color: #aee9ff; background: rgba(0, 8, 20, .8); padding: 14px; border-radius: 10px; min-height: 40vh; }
.msg { color: var(--text); line-height: 1.6; }
.list-plain { display: grid; gap: 8px; }
.trash-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: rgba(0, 190, 255, .04); }
.trash-row b { color: var(--text-strong); font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.trash-row small { color: var(--muted); display: block; font-family: var(--mono); font-size: 11px; }
.toast-wrap, #toasts { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 10px; width: var(--toast-width); max-width: calc(100vw - 30px); }
.toast { padding: 12px 16px; border-radius: 12px; background: rgba(4, 12, 30, .94); border: 1px solid var(--card-border); box-shadow: 0 0 26px rgba(0, 160, 255, .25); animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { border-color: rgba(25, 240, 165, .5); } .toast.err { border-color: rgba(255, 61, 110, .6); color: #ffc2d1; }
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .span-3 { grid-column: span 6; } .span-4, .span-8, .span-6 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr); --page-padding: 12px; --gap: 12px; }
  .brand-text, .nav button span, .sidebar-foot .btn span, .who span:last-child, .ver { display: none; }
  .nav button { justify-content: center; padding: 12px 0; }
  .brand { justify-content: center; padding: 4px 0 12px; }
  .top-right .chip { display: none; }
  .gauge-card { flex-direction: column; text-align: center; }
  .list-mode .item { grid-template-columns: 26px 34px minmax(0, 1fr) 80px; } .list-mode .item .perm, .list-mode .item .date { display: none; }
  .search { width: 100%; } .feed-row { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 560px) {
  .span-3 { grid-column: span 12; }
  .gauge-card { flex-direction: row; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
/* Static mode (CONFIG.MOTION = false in core.js): no keyframes, no transitions, no spinning rings */
html.no-motion *, html.no-motion *::before, html.no-motion *::after { animation: none !important; transition: none !important; }
html.no-motion .logo { filter: drop-shadow(0 0 16px rgba(0, 212, 255, .6)); }
